From 99ee7e9400f06e8718612d8b52d15215dc620774 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Mon, 26 Sep 2022 22:29:30 +1000 Subject: [PATCH] Prettier --- .github/ISSUE_TEMPLATE/config.yml | 18 +- .github/relase_body_template.md | 12 +- .prettierignore | 2 + .prettierrc.json | 11 + .vscode/launch.json | 12 +- package-lock.json | 22 + package.json | 12 +- scripts/benchmark/connections.js | 2 +- scripts/client.js | 50 +- scripts/rights.js | 4 +- scripts/schema.js | 14 +- scripts/stresstest/src/login/index.js | 4 +- scripts/stresstest/src/message/send.js | 19 +- scripts/stresstest/src/register/index.js | 10 +- src-slowcord/README.md | 2 +- src-slowcord/bot/.vscode/launch.json | 7 +- src-slowcord/bot/.vscode/tasks.json | 2 +- src-slowcord/bot/src/Bot.ts | 16 +- src-slowcord/bot/src/commands/index.ts | 13 +- src-slowcord/bot/src/commands/instance.ts | 50 +- src-slowcord/bot/src/index.ts | 4 +- src-slowcord/bot/tsconfig.json | 184 ++-- src-slowcord/login/public/css/index.css | 9 +- src-slowcord/login/public/js/handler.js | 13 +- src-slowcord/login/public/login.html | 194 ++-- src-slowcord/login/public/register.html | 142 +-- src-slowcord/login/src/index.ts | 76 +- src-slowcord/login/tsconfig.json | 40 +- src-slowcord/rules.md | 16 +- src-slowcord/status/src/gateway.ts | 51 +- src-slowcord/status/src/index.ts | 134 +-- src-slowcord/status/tsconfig.json | 38 +- src/api/Server.ts | 52 +- src/api/index.ts | 2 +- src/api/middlewares/Authentication.ts | 18 +- src/api/middlewares/BodyParser.ts | 3 +- src/api/middlewares/CORS.ts | 12 +- src/api/middlewares/ErrorHandler.ts | 25 +- src/api/middlewares/RateLimit.ts | 70 +- src/api/middlewares/Translation.ts | 14 +- src/api/routes/-/monitorz.ts | 24 +- src/api/routes/auth/location-metadata.ts | 14 +- src/api/routes/auth/login.ts | 169 ++-- src/api/routes/auth/logout.ts | 5 +- src/api/routes/auth/mfa/totp.ts | 73 +- src/api/routes/auth/register.ts | 301 ++++--- .../verify/view-backup-codes-challenge.ts | 34 +- src/api/routes/channels/#channel_id/index.ts | 121 ++- .../routes/channels/#channel_id/invites.ts | 65 +- .../#channel_id/messages/#message_id/ack.ts | 60 +- .../messages/#message_id/crosspost.ts | 52 +- .../#channel_id/messages/#message_id/index.ts | 168 ++-- .../messages/#message_id/reactions.ts | 307 ++++--- .../#channel_id/messages/bulk-delete.ts | 75 +- .../channels/#channel_id/messages/index.ts | 138 ++- .../channels/#channel_id/permissions.ts | 79 +- src/api/routes/channels/#channel_id/pins.ts | 149 +-- src/api/routes/channels/#channel_id/purge.ts | 111 ++- .../routes/channels/#channel_id/recipients.ts | 42 +- src/api/routes/channels/#channel_id/typing.ts | 54 +- .../routes/channels/#channel_id/webhooks.ts | 33 +- src/api/routes/discoverable-guilds.ts | 26 +- src/api/routes/discovery.ts | 4 +- src/api/routes/downloads.ts | 7 +- src/api/routes/experiments.ts | 2 +- src/api/routes/gateway/bot.ts | 10 +- src/api/routes/gateway/index.ts | 10 +- src/api/routes/gifs/search.ts | 19 +- src/api/routes/gifs/trending-gifs.ts | 19 +- src/api/routes/gifs/trending.ts | 46 +- src/api/routes/guild-recommendations.ts | 15 +- src/api/routes/guilds/#guild_id/audit-logs.ts | 2 +- src/api/routes/guilds/#guild_id/bans.ts | 268 +++--- src/api/routes/guilds/#guild_id/channels.ts | 101 ++- src/api/routes/guilds/#guild_id/delete.ts | 26 +- .../#guild_id/discovery-requirements.ts | 46 +- src/api/routes/guilds/#guild_id/emojis.ts | 173 ++-- src/api/routes/guilds/#guild_id/index.ts | 90 +- src/api/routes/guilds/#guild_id/invites.ts | 17 +- .../guilds/#guild_id/member-verification.ts | 4 +- .../#guild_id/members/#member_id/index.ts | 94 +- .../#guild_id/members/#member_id/nick.ts | 28 +- .../#member_id/roles/#role_id/index.ts | 28 +- .../routes/guilds/#guild_id/members/index.ts | 5 +- .../guilds/#guild_id/messages/search.ts | 100 ++- src/api/routes/guilds/#guild_id/prune.ts | 65 +- src/api/routes/guilds/#guild_id/regions.ts | 7 +- .../guilds/#guild_id/roles/#role_id/index.ts | 109 ++- .../routes/guilds/#guild_id/roles/index.ts | 129 +-- src/api/routes/guilds/#guild_id/stickers.ts | 56 +- src/api/routes/guilds/#guild_id/templates.ts | 110 ++- src/api/routes/guilds/#guild_id/vanity-url.ts | 100 ++- .../#guild_id/voice-states/#user_id/index.ts | 89 +- .../routes/guilds/#guild_id/welcome-screen.ts | 32 +- .../routes/guilds/#guild_id/widget.json.ts | 29 +- src/api/routes/guilds/#guild_id/widget.png.ts | 92 +- src/api/routes/guilds/#guild_id/widget.ts | 29 +- src/api/routes/guilds/index.ts | 51 +- src/api/routes/guilds/templates/index.ts | 141 ++- src/api/routes/invites/index.ts | 64 +- .../routes/partners/#guild_id/requirements.ts | 47 +- src/api/routes/policies/instance/domains.ts | 19 +- src/api/routes/policies/instance/index.ts | 3 +- src/api/routes/policies/instance/limits.ts | 2 +- .../scheduled-maintenances/upcoming_json.ts | 16 +- src/api/routes/stop.ts | 16 +- .../store/published-listings/applications.ts | 20 +- .../applications/#id/subscription-plans.ts | 4 +- .../routes/store/published-listings/skus.ts | 20 +- .../skus/#sku_id/subscription-plans.ts | 40 +- src/api/routes/updates.ts | 6 +- src/api/routes/users/#id/profile.ts | 150 ++-- src/api/routes/users/#id/relationships.ts | 63 +- src/api/routes/users/@me/channels.ts | 33 +- src/api/routes/users/@me/delete.ts | 10 +- src/api/routes/users/@me/disable.ts | 10 +- src/api/routes/users/@me/email-settings.ts | 4 +- src/api/routes/users/@me/guilds.ts | 39 +- .../users/@me/guilds/#guild_id/settings.ts | 42 +- src/api/routes/users/@me/index.ts | 177 ++-- .../users/@me/mfa/codes-verification.ts | 64 +- src/api/routes/users/@me/mfa/codes.ts | 81 +- src/api/routes/users/@me/mfa/totp/disable.ts | 75 +- src/api/routes/users/@me/mfa/totp/enable.ts | 74 +- src/api/routes/users/@me/notes.ts | 34 +- src/api/routes/users/@me/relationships.ts | 175 ++-- src/api/routes/users/@me/settings.ts | 26 +- src/api/start.ts | 2 +- src/api/util/handlers/Message.ts | 186 ++-- src/api/util/handlers/Voice.ts | 11 +- src/api/util/handlers/route.ts | 35 +- src/api/util/index.ts | 2 +- src/api/util/utility/Base64.ts | 3 +- src/api/util/utility/RandomInviteID.ts | 13 +- src/api/util/utility/String.ts | 14 +- src/api/util/utility/captcha.ts | 19 +- src/api/util/utility/ipAddress.ts | 44 +- src/api/util/utility/passwordStrength.ts | 20 +- src/bundle/Server.ts | 25 +- src/bundle/index.ts | 2 +- src/bundle/start.ts | 22 +- src/bundle/stats.ts | 11 +- src/cdn/Server.ts | 8 +- src/cdn/routes/attachments.ts | 8 +- src/cdn/routes/avatars.ts | 4 +- src/cdn/routes/external.ts | 11 +- src/cdn/routes/guilds.ts | 2 +- src/cdn/routes/role-icons.ts | 2 +- src/cdn/start.ts | 2 +- src/cdn/util/S3Storage.ts | 2 +- src/cdn/util/Storage.ts | 6 +- src/gateway/events/Connection.ts | 12 +- src/gateway/events/Message.ts | 8 +- src/gateway/listener/listener.ts | 14 +- src/gateway/opcodes/Identify.ts | 12 +- src/gateway/opcodes/LazyRequest.ts | 72 +- src/gateway/opcodes/PresenceUpdate.ts | 10 +- src/gateway/opcodes/VoiceStateUpdate.ts | 8 +- src/gateway/start.ts | 2 +- src/gateway/util/Send.ts | 4 +- src/util/dtos/DmChannelDTO.ts | 21 +- src/util/entities/Attachment.ts | 19 +- src/util/entities/AuditLog.ts | 16 +- src/util/entities/BackupCodes.ts | 4 +- src/util/entities/BaseClass.ts | 36 +- src/util/entities/Categories.ts | 24 +- src/util/entities/Channel.ts | 846 ++++++++++-------- src/util/entities/ClientRelease.ts | 2 +- src/util/entities/Config.ts | 31 +- src/util/entities/ConnectedAccount.ts | 3 +- src/util/entities/Emoji.ts | 2 +- src/util/entities/Encryption.ts | 20 +- src/util/entities/Guild.ts | 42 +- src/util/entities/Invite.ts | 12 +- src/util/entities/Member.ts | 68 +- src/util/entities/Message.ts | 27 +- src/util/entities/Migration.ts | 11 +- src/util/entities/Note.ts | 2 +- src/util/entities/ReadState.ts | 13 +- src/util/entities/Relationship.ts | 9 +- src/util/entities/StickerPack.ts | 10 +- src/util/entities/Team.ts | 10 +- src/util/entities/TeamMember.ts | 10 +- src/util/entities/User.ts | 122 ++- src/util/entities/index.ts | 2 +- src/util/imports/OrmUtils.ts | 22 +- src/util/imports/index.ts | 2 +- src/util/index.ts | 2 +- src/util/interfaces/Activity.ts | 3 +- src/util/interfaces/Event.ts | 2 +- .../migrations/1633864260873-EmojiRoles.ts | 8 +- .../migrations/1633864669243-EmojiUser.ts | 12 +- .../migrations/1633881705509-VanityInvite.ts | 14 +- src/util/migrations/1634308884591-Stickers.ts | 73 +- src/util/migrations/1634424361103-Presence.ts | 5 +- .../1634426540271-MigrationTimestamp.ts | 6 +- .../migrations/1660678870706-opencordFixes.ts | 37 +- .../migrations/1660689892073-mobileFixes2.ts | 25 +- src/util/schemas/ActivitySchema.ts | 5 +- .../schemas/BackupCodesChallengeSchema.ts | 2 +- src/util/schemas/BanCreateSchema.ts | 2 +- src/util/schemas/BanModeratorSchema.ts | 2 +- src/util/schemas/BanRegistrySchema.ts | 2 +- src/util/schemas/BulkDeleteSchema.ts | 2 +- src/util/schemas/ChannelModifySchema.ts | 2 +- src/util/schemas/CodesVerificationSchema.ts | 2 +- src/util/schemas/DmChannelCreateSchema.ts | 2 +- src/util/schemas/EmojiCreateSchema.ts | 2 +- src/util/schemas/EmojiModifySchema.ts | 2 +- src/util/schemas/GuildCreateSchema.ts | 2 +- src/util/schemas/GuildTemplateCreateSchema.ts | 2 +- .../schemas/GuildUpdateWelcomeScreenSchema.ts | 2 +- src/util/schemas/InviteCreateSchema.ts | 2 +- src/util/schemas/LoginSchema.ts | 2 +- src/util/schemas/MemberChangeSchema.ts | 2 +- src/util/schemas/MemberNickChangeSchema.ts | 2 +- src/util/schemas/MessageAcknowledgeSchema.ts | 2 +- src/util/schemas/MessageCreateSchema.ts | 2 +- src/util/schemas/MfaCodesSchema.ts | 2 +- src/util/schemas/ModifyGuildStickerSchema.ts | 2 +- src/util/schemas/PruneSchema.ts | 2 +- src/util/schemas/PurgeSchema.ts | 2 +- src/util/schemas/RegisterSchema.ts | 2 +- src/util/schemas/RelationshipPostSchema.ts | 2 +- src/util/schemas/RelationshipPutSchema.ts | 2 +- src/util/schemas/RoleModifySchema.ts | 2 +- src/util/schemas/SelectProtocolSchema.ts | 14 +- src/util/schemas/TemplateCreateSchema.ts | 2 +- src/util/schemas/TemplateModifySchema.ts | 2 +- src/util/schemas/TotpDisableSchema.ts | 2 +- src/util/schemas/TotpEnableSchema.ts | 2 +- src/util/schemas/TotpSchema.ts | 10 +- src/util/schemas/UserModifySchema.ts | 2 +- src/util/schemas/Validator.ts | 22 +- src/util/schemas/VanityUrlSchema.ts | 2 +- src/util/schemas/VoiceIdentifySchema.ts | 2 +- src/util/schemas/VoiceStateUpdateSchema.ts | 4 +- src/util/schemas/VoiceVideoSchema.ts | 4 +- src/util/schemas/WebhookCreateSchema.ts | 2 +- src/util/schemas/WidgetModifySchema.ts | 2 +- src/util/schemas/index.ts | 2 +- src/util/util/ApiError.ts | 19 +- src/util/util/AutoUpdate.ts | 17 +- src/util/util/BannedWords.ts | 10 +- src/util/util/BitField.ts | 23 +- src/util/util/Categories.ts | 2 +- src/util/util/Config.ts | 15 +- src/util/util/Constants.ts | 572 +++++++++--- src/util/util/Database.ts | 15 +- src/util/util/Email.ts | 2 +- src/util/util/Event.ts | 48 +- src/util/util/FieldError.ts | 12 +- src/util/util/Intents.ts | 7 +- src/util/util/InvisibleCharacters.ts | 112 +-- src/util/util/Permissions.ts | 72 +- src/util/util/RabbitMQ.ts | 6 +- src/util/util/Rights.ts | 40 +- src/util/util/Snowflake.ts | 13 +- src/util/util/Token.ts | 9 +- src/util/util/TraverseDirectory.ts | 7 +- src/util/util/cdn.ts | 48 +- src/util/util/index.ts | 2 +- src/webrtc/Server.ts | 12 +- src/webrtc/events/Close.ts | 2 +- src/webrtc/events/Connection.ts | 17 +- src/webrtc/events/Message.ts | 13 +- src/webrtc/index.ts | 2 +- src/webrtc/opcodes/BackendVersion.ts | 7 +- src/webrtc/opcodes/Heartbeat.ts | 10 +- src/webrtc/opcodes/Identify.ts | 35 +- src/webrtc/opcodes/SelectProtocol.ts | 27 +- src/webrtc/opcodes/Speaking.ts | 6 +- src/webrtc/opcodes/Video.ts | 39 +- src/webrtc/opcodes/index.ts | 4 +- src/webrtc/opcodes/sdp.json | 2 +- src/webrtc/start.ts | 4 +- src/webrtc/util/Constants.ts | 6 +- src/webrtc/util/MediaServer.ts | 14 +- src/webrtc/util/index.ts | 2 +- tsconfig.json | 207 ++--- 280 files changed, 6800 insertions(+), 3908 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.json diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index a4ca0bb9..8ab6ab5a 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,11 @@ blank_issues_enabled: true contact_links: - - name: Fosscord Documentation - url: https://docs.fosscord.com/ - about: Need documentation and examples for the Fosscord? Head over to Fosscord's official documentation. - - name: Discord's Developer Documentation - url: https://discord.com/developers/docs/intro - about: Need help with the Discord resources? Head here instead of asking on Fosscord! - - name: Fosscord' Official Discord server - url: https://discord.com/invite/Ms5Ev7S6bF - about: Need help with the server? Talk with us in our official server. + - name: Fosscord Documentation + url: https://docs.fosscord.com/ + about: Need documentation and examples for the Fosscord? Head over to Fosscord's official documentation. + - name: Discord's Developer Documentation + url: https://discord.com/developers/docs/intro + about: Need help with the Discord resources? Head here instead of asking on Fosscord! + - name: Fosscord' Official Discord server + url: https://discord.com/invite/Ms5Ev7S6bF + about: Need help with the server? Talk with us in our official server. diff --git a/.github/relase_body_template.md b/.github/relase_body_template.md index 994e83d3..c410b0c2 100644 --- a/.github/relase_body_template.md +++ b/.github/relase_body_template.md @@ -1,13 +1,17 @@ ## Notes ## Additions -- + +- ## Fixes + - + ## Download -- [Windows]() -- [MacOS]() -- [Linux]() + +- [Windows]() +- [MacOS]() +- [Linux]() After (extracting) and starting the server executable you can access your own Fosscord server on http://localhost:3001/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..49bc63ad --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +assets +dist \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..7f0d7f20 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,11 @@ +{ + "trailingComma": "all", + "tabWidth": 4, + "semi": true, + "arrowParens": "always", + "bracketSameLine": false, + "bracketSpacing": true, + "quoteProps": "as-needed", + "useTabs": true, + "singleQuote": false +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 86eb202e..09a69132 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,21 +8,17 @@ "name": "Launch current file", "program": "${relativeFile}", "request": "launch", - "skipFiles": [ - "/**" - ], + "skipFiles": ["/**"], "type": "node" }, { "type": "node", "request": "launch", "name": "Bundle", - "skipFiles": [ - "/**" - ], + "skipFiles": ["/**"], "program": "${workspaceFolder}/src/bundle/start.ts", - "outFiles": [ "${workspaceFolder}/dist/**/*.js" ], + "outFiles": ["${workspaceFolder}/dist/**/*.js"], "preLaunchTask": "tsc: build - tsconfig.json" } ] -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index fd43bef5..4b19a8bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,7 @@ "@types/sharp": "^0.31.0", "@types/ws": "^8.5.3", "express": "^4.18.1", + "prettier": "^2.7.1", "typescript": "^4.8.3" }, "optionalDependencies": { @@ -4715,6 +4716,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -9846,6 +9862,12 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==" }, + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", diff --git a/package.json b/package.json index 8a737424..9c86f918 100644 --- a/package.json +++ b/package.json @@ -40,11 +40,16 @@ "@types/sharp": "^0.31.0", "@types/ws": "^8.5.3", "express": "^4.18.1", + "prettier": "^2.7.1", "typescript": "^4.8.3" }, "dependencies": { + "@aws-sdk/client-s3": "^3.178.0", + "@sentry/node": "^7.13.0", + "@sentry/tracing": "^7.13.0", "ajv": "^8.6.2", "ajv-formats": "^2.1.1", + "amqplib": "^0.10.3", "bcrypt": "^5.0.1", "cheerio": "^1.0.0-rc.12", "cookie-parser": "^1.4.6", @@ -72,12 +77,7 @@ "sqlite3": "^5.1.1", "typeorm": "^0.3.10", "typescript-json-schema": "^0.50.1", - "ws": "^8.9.0", - - "@aws-sdk/client-s3": "^3.178.0", - "@sentry/node": "^7.13.0", - "@sentry/tracing": "^7.13.0", - "amqplib": "^0.10.3" + "ws": "^8.9.0" }, "optionalDependencies": { "@yukikaze-bot/erlpack": "^1.0.1" diff --git a/scripts/benchmark/connections.js b/scripts/benchmark/connections.js index 515f76e9..1a30d49f 100644 --- a/scripts/benchmark/connections.js +++ b/scripts/benchmark/connections.js @@ -48,7 +48,7 @@ function connect() { token, properties: {}, }, - }) + }), ); break; diff --git a/scripts/client.js b/scripts/client.js index e73bc7ee..ed1a94b9 100644 --- a/scripts/client.js +++ b/scripts/client.js @@ -8,21 +8,21 @@ const BASE_URL = "https://discord.com"; // Manual for now const INDEX_SCRIPTS = [ - "83ace7450e110d16319e", // 50 - "e02290aaa8dac5d195c2", // 1 - "4f3b3c576b879a5f75d1", // 0? - "699456246fdfe7589855", // ~4500. + "83ace7450e110d16319e", // 50 + "e02290aaa8dac5d195c2", // 1 + "4f3b3c576b879a5f75d1", // 0? + "699456246fdfe7589855", // ~4500. ]; const doPatch = (content) => { //remove nitro references content = content.replace(/Discord Nitro/g, "Fosscord Premium"); - content = content.replace(/"Nitro"/g, "\"Premium\""); + content = content.replace(/"Nitro"/g, '"Premium"'); content = content.replace(/Nitro /g, "Premium "); content = content.replace(/ Nitro/g, " Premium"); content = content.replace(/\[Nitro\]/g, "[Premium]"); content = content.replace(/\*Nitro\*/g, "*Premium*"); - content = content.replace(/\"Nitro \. /g, "\"Premium. "); + content = content.replace(/\"Nitro \. /g, '"Premium. '); //remove discord references content = content.replace(/ Discord /g, " Fosscord "); @@ -35,11 +35,11 @@ const doPatch = (content) => { content = content.replace(/\*Discord\*/g, "*Fosscord*"); //server -> guild - content = content.replace(/"Server"/g, "\"Guild\""); - content.replaceAll("server.\"", "guild.\""); + content = content.replace(/"Server"/g, '"Guild"'); + content.replaceAll('server."', 'guild."'); content.replaceAll(" server ", " guild "); content.replaceAll(" Server ", " Guild "); - content.replaceAll("\"Server", "\"Guild"); + content.replaceAll('"Server', '"Guild'); // //change some vars // content = content.replace('dsn: "https://fa97a90475514c03a42f80cd36d147c4@sentry.io/140984"', "dsn: (/true/.test(localStorage.sentryOptIn)?'https://6bad92b0175d41a18a037a73d0cff282@sentry.thearcanebrony.net/12':'')"); @@ -52,8 +52,14 @@ const doPatch = (content) => { // content = content.replace('width: n, height: o, viewBox: "0 0 28 20"', 'width: 48, height: 48, viewBox: "0 0 48 48"'); //save some time on load resolving asset urls... - content = content.replaceAll('e.exports = n.p + "', 'e.exports = "/assets/'); - content = content.replaceAll('e.exports = r.p + "', 'e.exports = "/assets/'); + content = content.replaceAll( + 'e.exports = n.p + "', + 'e.exports = "/assets/', + ); + content = content.replaceAll( + 'e.exports = r.p + "', + 'e.exports = "/assets/', + ); return content; }; @@ -66,7 +72,7 @@ const processFile = async (name) => { await fs.writeFile(path.join(CACHE_PATH, `${name}.js`), text); - return [...new Set(text.match((/[A-Fa-f0-9]{20}/g)))]; + return [...new Set(text.match(/[A-Fa-f0-9]{20}/g))]; }; (async () => { @@ -83,7 +89,9 @@ const processFile = async (name) => { process.stdout.clearLine(0); process.stdout.cursorTo(0); - process.stdout.write(`Scraping asset ${asset}. Remaining: ${INDEX_SCRIPTS.length}`); + process.stdout.write( + `Scraping asset ${asset}. Remaining: ${INDEX_SCRIPTS.length}`, + ); const newAssets = await processFile(asset); assets.push(...newAssets); @@ -103,15 +111,21 @@ const processFile = async (name) => { } while (rates.length > 20) rates.shift(); - const averageRate = rates.length ? rates.reduce((prev, curr) => prev + curr) / rates.length : 1; - const finishTime = (averageRate * (assets.length - i)); + const averageRate = rates.length + ? rates.reduce((prev, curr) => prev + curr) / rates.length + : 1; + const finishTime = averageRate * (assets.length - i); process.stdout.clearLine(0); process.stdout.cursorTo(0); process.stdout.write( `Caching asset ${asset}. ` + - `${i}/${assets.length - 1} = ${Math.floor((i / (assets.length - 1)) * 100)}% ` + - `Finish at: ${new Date(Date.now() + finishTime).toLocaleTimeString()}` + `${i}/${assets.length - 1} = ${Math.floor( + (i / (assets.length - 1)) * 100, + )}% ` + + `Finish at: ${new Date( + Date.now() + finishTime, + ).toLocaleTimeString()}`, ); await processFile(asset); @@ -122,4 +136,4 @@ const processFile = async (name) => { } console.log(`\nDone`); -})(); \ No newline at end of file +})(); diff --git a/scripts/rights.js b/scripts/rights.js index a4eb0b31..d0d1e163 100644 --- a/scripts/rights.js +++ b/scripts/rights.js @@ -1,4 +1,4 @@ -require('module-alias/register'); +require("module-alias/register"); const { Rights } = require(".."); const allRights = new Rights(1).bitfield; @@ -18,4 +18,4 @@ discordLike -= Rights.FLAGS.BYPASS_RATE_LIMITS; discordLike -= Rights.FLAGS.CREDITABLE; discordLike -= Rights.FLAGS.MANAGE_GUILD_DIRECTORY; discordLike -= Rights.FLAGS.SEND_BACKDATED_EVENTS; -console.log(`Discord.com-like rights:`, discordLike); \ No newline at end of file +console.log(`Discord.com-like rights:`, discordLike); diff --git a/scripts/schema.js b/scripts/schema.js index de062d63..90a346c9 100644 --- a/scripts/schema.js +++ b/scripts/schema.js @@ -11,10 +11,10 @@ const settings = { excludePrivate: true, defaultNumberType: "integer", noExtraProps: true, - defaultProps: false + defaultProps: false, }; const compilerOptions = { - strictNullChecks: true + strictNullChecks: true, }; const Excluded = [ "DefaultSchema", @@ -47,11 +47,17 @@ function modify(obj) { } function main() { - const program = TJS.programFromConfig("tsconfig.json") + const program = TJS.programFromConfig("tsconfig.json"); const generator = TJS.buildGenerator(program, settings); if (!generator || !program) return; - let schemas = generator.getUserSymbols().filter((x) => (x.endsWith("Schema") || x.endsWith("Response")) && !Excluded.includes(x)); + let schemas = generator + .getUserSymbols() + .filter( + (x) => + (x.endsWith("Schema") || x.endsWith("Response")) && + !Excluded.includes(x), + ); console.log(schemas); var definitions = {}; diff --git a/scripts/stresstest/src/login/index.js b/scripts/stresstest/src/login/index.js index 96603652..291e2b8b 100644 --- a/scripts/stresstest/src/login/index.js +++ b/scripts/stresstest/src/login/index.js @@ -6,12 +6,12 @@ async function login(account) { var body = { fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", login: account.email, - password: account.password + password: account.password, }; var x = await fetch(config.url + "/auth/login", { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify(body) + body: JSON.stringify(body), }); console.log(x); x = await x.json(); diff --git a/scripts/stresstest/src/message/send.js b/scripts/stresstest/src/message/send.js index d21560d7..1e5ea062 100644 --- a/scripts/stresstest/src/message/send.js +++ b/scripts/stresstest/src/message/send.js @@ -6,16 +6,19 @@ async function sendMessage(account) { var body = { fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", content: "Test", - tts: false + tts: false, }; - var x = await fetch(config.url + "/channels/" + config["text-channel"] + "/messages", { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: account.token + var x = await fetch( + config.url + "/channels/" + config["text-channel"] + "/messages", + { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: account.token, + }, + body: JSON.stringify(body), }, - body: JSON.stringify(body) - }); + ); console.log(x); x = await x.json(); console.log(x); diff --git a/scripts/stresstest/src/register/index.js b/scripts/stresstest/src/register/index.js index 86f908cd..38089dc7 100644 --- a/scripts/stresstest/src/register/index.js +++ b/scripts/stresstest/src/register/index.js @@ -4,7 +4,11 @@ var config = require("../../config.json"); module.exports = generate; async function generate() { var mail = (Math.random() + 10).toString(36).substring(2); - mail = mail + "." + (Math.random() + 10).toString(36).substring(2) + "@stresstest.com"; + mail = + mail + + "." + + (Math.random() + 10).toString(36).substring(2) + + "@stresstest.com"; var password = (Math.random() * 69).toString(36).substring(-7) + (Math.random() * 69).toString(36).substring(-7) + @@ -20,12 +24,12 @@ async function generate() { consent: true, date_of_birth: "2000-04-04", gift_code_sku_id: null, - captcha_key: null + captcha_key: null, }; var x = await fetch(config.url + "/auth/register", { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify(body) + body: JSON.stringify(body), }); console.log(x); x = await x.json(); diff --git a/src-slowcord/README.md b/src-slowcord/README.md index 892b5763..ac42117a 100644 --- a/src-slowcord/README.md +++ b/src-slowcord/README.md @@ -1 +1 @@ -Additional resources/services for [Slowcord](https://slowcord.maddy.k.vu/login) \ No newline at end of file +Additional resources/services for [Slowcord](https://slowcord.maddy.k.vu/login) diff --git a/src-slowcord/bot/.vscode/launch.json b/src-slowcord/bot/.vscode/launch.json index 92765e22..c1c765a8 100644 --- a/src-slowcord/bot/.vscode/launch.json +++ b/src-slowcord/bot/.vscode/launch.json @@ -4,12 +4,9 @@ "name": "Slowcord Bot", "program": "${workspaceFolder}/build/index.js", "request": "launch", - "skipFiles": [ - "/**" - ], + "skipFiles": ["/**"], "type": "node", "preLaunchTask": "npm: build" } - ] -} \ No newline at end of file +} diff --git a/src-slowcord/bot/.vscode/tasks.json b/src-slowcord/bot/.vscode/tasks.json index 356126d8..be345ecd 100644 --- a/src-slowcord/bot/.vscode/tasks.json +++ b/src-slowcord/bot/.vscode/tasks.json @@ -10,4 +10,4 @@ "detail": "tsc -b" } ] -} \ No newline at end of file +} diff --git a/src-slowcord/bot/src/Bot.ts b/src-slowcord/bot/src/Bot.ts index 45938846..cf3ff09f 100644 --- a/src-slowcord/bot/src/Bot.ts +++ b/src-slowcord/bot/src/Bot.ts @@ -1,11 +1,11 @@ import { Message } from "discord.js"; -import { Client } from "fosscord-gopnik/build/lib"; // huh? oh well. some bugs in my lib Ig +import { Client } from "fosscord-gopnik/build/lib"; // huh? oh well. some bugs in my lib Ig import { Command, getCommands } from "./commands/index.js"; export default class Bot { client: Client; - commands: { [key: string]: Command; } = {}; + commands: { [key: string]: Command } = {}; constructor(client: Client) { this.client = client; @@ -17,10 +17,12 @@ export default class Bot { console.log(`Logged in as ${this.client.user!.tag}`); this.client.user!.setPresence({ - activities: [{ - name: "EVERYTHING", - type: "WATCHING", - }] + activities: [ + { + name: "EVERYTHING", + type: "WATCHING", + }, + ], }); }; @@ -45,4 +47,4 @@ export default class Bot { args: args, }); }; -} \ No newline at end of file +} diff --git a/src-slowcord/bot/src/commands/index.ts b/src-slowcord/bot/src/commands/index.ts index d3b39e0f..0130b2bc 100644 --- a/src-slowcord/bot/src/commands/index.ts +++ b/src-slowcord/bot/src/commands/index.ts @@ -2,11 +2,11 @@ import { Message, GuildMember, Guild, User } from "discord.js"; import fs from "fs"; export type CommandContext = { - user: User, - guild: Guild | null, - member: GuildMember | null, - message: Message, - args: string[], + user: User; + guild: Guild | null; + member: GuildMember | null; + message: Message; + args: string[]; }; export type Command = { @@ -19,8 +19,7 @@ const walk = async (path: string) => { const out = []; for (var file of files) { if (fs.statSync(`${path}/${file}`).isDirectory()) continue; - if (file.indexOf("index") !== -1) - continue; + if (file.indexOf("index") !== -1) continue; if (file.indexOf(".js") !== file.length - 3) continue; var imported = (await import(`./${file}`)).default; out.push(imported); diff --git a/src-slowcord/bot/src/commands/instance.ts b/src-slowcord/bot/src/commands/instance.ts index ac0c9b2d..170d8f76 100644 --- a/src-slowcord/bot/src/commands/instance.ts +++ b/src-slowcord/bot/src/commands/instance.ts @@ -1,7 +1,7 @@ import { Command } from "./index.js"; import { User, Guild, Message } from "@fosscord/util"; -const cache: { [key: string]: number; } = { +const cache: { [key: string]: number } = { users: 0, guilds: 0, messages: 0, @@ -11,7 +11,10 @@ const cache: { [key: string]: number; } = { export default { name: "instance", exec: async ({ message }) => { - if (Date.now() > cache.lastChecked + parseInt(process.env.CACHE_TTL as string)) { + if ( + Date.now() > + cache.lastChecked + parseInt(process.env.CACHE_TTL as string) + ) { cache.users = await User.count(); cache.guilds = await Guild.count(); cache.messages = await Message.count(); @@ -19,18 +22,35 @@ export default { } return message.reply({ - embeds: [{ - title: "Instance Stats", - description: "For more indepth information, check out https://grafana.understars.dev", - footer: { - text: `Last checked: ${Math.floor((Date.now() - cache.lastChecked) / (1000 * 60))} minutes ago`, + embeds: [ + { + title: "Instance Stats", + description: + "For more indepth information, check out https://grafana.understars.dev", + footer: { + text: `Last checked: ${Math.floor( + (Date.now() - cache.lastChecked) / (1000 * 60), + )} minutes ago`, + }, + fields: [ + { + inline: true, + name: "Total Users", + value: cache.users.toString(), + }, + { + inline: true, + name: "Total Guilds", + value: cache.guilds.toString(), + }, + { + inline: true, + name: "Total Messages", + value: cache.messages.toString(), + }, + ], }, - fields: [ - { inline: true, name: "Total Users", value: cache.users.toString() }, - { inline: true, name: "Total Guilds", value: cache.guilds.toString() }, - { inline: true, name: "Total Messages", value: cache.messages.toString() }, - ] - }] + ], }); - } -} as Command; \ No newline at end of file + }, +} as Command; diff --git a/src-slowcord/bot/src/index.ts b/src-slowcord/bot/src/index.ts index 253f759c..fa97313f 100644 --- a/src-slowcord/bot/src/index.ts +++ b/src-slowcord/bot/src/index.ts @@ -1,6 +1,6 @@ import "dotenv/config"; import Fosscord from "fosscord-gopnik"; -import Bot from "./Bot.js"; // huh? +import Bot from "./Bot.js"; // huh? import { initDatabase } from "fosscord-server/src/util"; const client = new Fosscord.Client({ @@ -21,4 +21,4 @@ client.on("messageCreate", bot.onMessageCreate); (async () => { await initDatabase(); await client.login(process.env.TOKEN); -})(); \ No newline at end of file +})(); diff --git a/src-slowcord/bot/tsconfig.json b/src-slowcord/bot/tsconfig.json index 05bfc5c7..f055681a 100644 --- a/src-slowcord/bot/tsconfig.json +++ b/src-slowcord/bot/tsconfig.json @@ -1,101 +1,103 @@ { - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ - /* Projects */ - // "incremental": true, /* Enable incremental compilation */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + /* Projects */ + // "incremental": true, /* Enable incremental compilation */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "ES6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - "lib": ["ES2021"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ - // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + /* Language and Environment */ + "target": "ES6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "lib": [ + "ES2021" + ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, + // "jsx": "preserve", /* Specify what JSX code is generated. */ + "experimentalDecorators": true /* Enable experimental support for TC39 stage 2 draft decorators. */, + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ + // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - /* Modules */ - "module": "CommonJS", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "resolveJsonModule": true, /* Enable importing .json files */ - // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ + /* Modules */ + "module": "CommonJS" /* Specify what module code is generated. */, + // "rootDir": "./", /* Specify the root folder within your source files. */ + "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "resolveJsonModule": true, /* Enable importing .json files */ + // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./build", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "sourceMap": true /* Create source map files for emitted JavaScript files. */, + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./build" /* Specify an output folder for all emitted files. */, + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ - // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ - "strictPropertyInitialization": false, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ - // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ + // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ + "strictPropertyInitialization": false /* Check for class properties that are declared but not set in the constructor. */, + // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ + // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } } diff --git a/src-slowcord/login/public/css/index.css b/src-slowcord/login/public/css/index.css index d4f5a4b4..cf294ccb 100644 --- a/src-slowcord/login/public/css/index.css +++ b/src-slowcord/login/public/css/index.css @@ -4,13 +4,13 @@ html { --background-primary: rgb(22, 23, 25); --background-secondary: rgb(15, 16, 18); --foreground-primary: rgb(200, 200, 200); - --background-login-discord: #5865F2; + --background-login-discord: #5865f2; background: url("https://slowcord.maddy.k.vu/assets/background.png"); background-size: 100% 100%; background-repeat: no-repeat; - font-family: 'Montserrat', sans-serif; + font-family: "Montserrat", sans-serif; color: var(--foreground-primary); } @@ -55,7 +55,8 @@ html { text-align: center; } -.header-subtext a, .header-subtext p { +.header-subtext a, +.header-subtext p { display: inline-block; margin: 0 10px 0 10px; } @@ -109,4 +110,4 @@ label { display: flex; justify-content: center; margin-top: 10px; -} \ No newline at end of file +} diff --git a/src-slowcord/login/public/js/handler.js b/src-slowcord/login/public/js/handler.js index 68a656b4..2d7b164b 100644 --- a/src-slowcord/login/public/js/handler.js +++ b/src-slowcord/login/public/js/handler.js @@ -29,13 +29,12 @@ const handleSubmit = async (path, body) => { } // Very fun error message here lol - const error = - json.errors - ? Object.values(json.errors)[0]._errors[0].message - : ( - json.captcha_key ? "Captcha required" : json.message - ); + const error = json.errors + ? Object.values(json.errors)[0]._errors[0].message + : json.captcha_key + ? "Captcha required" + : json.message; failureMessage.innerHTML = error; failureMessage.style.display = "block"; -}; \ No newline at end of file +}; diff --git a/src-slowcord/login/public/login.html b/src-slowcord/login/public/login.html index 8cecd20b..fa367b70 100644 --- a/src-slowcord/login/public/login.html +++ b/src-slowcord/login/public/login.html @@ -1,103 +1,127 @@ + + + + + Slowcord - - - - - Slowcord + + + - - - + + + - - - + +
+