├── .devcontainer
├── Dockerfile
└── devcontainer.json
├── .github
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── config.yml
│ └── feature_request.yml
├── PULL_REQUEST_TEMPLATE.md
├── issue_labeler.yml
├── pr_labeler.yml
└── workflows
│ ├── ci.yml
│ ├── deploy.yml
│ ├── issue_labeler.yml
│ └── pr_labeler.yml
├── .gitignore
├── .gitmodules
├── .nvmrc
├── .swcrc
├── .vscode
├── i18n-ally-custom-framework.yml
├── launch.json
├── settings.json
└── tasks.json
├── Cargo.toml
├── LICENSE
├── README.md
├── apps
├── api
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ ├── app.controller.ts
│ │ ├── app.module.ts
│ │ ├── auth
│ │ │ ├── auth.controller.ts
│ │ │ ├── auth.decorator.ts
│ │ │ ├── auth.guard.ts
│ │ │ ├── auth.module.ts
│ │ │ ├── auth.role.ts
│ │ │ ├── auth.service.ts
│ │ │ └── index.ts
│ │ ├── commands
│ │ │ ├── commands.controller.ts
│ │ │ ├── commands.module.ts
│ │ │ ├── commands.service.ts
│ │ │ └── index.ts
│ │ ├── dtos
│ │ │ ├── cache.dto.ts
│ │ │ ├── cached-player.dto.ts
│ │ │ ├── command.dto.ts
│ │ │ ├── guild-leaderboard.dto.ts
│ │ │ ├── guild-rankings.dto.ts
│ │ │ ├── guild.dto.ts
│ │ │ ├── head.dto.ts
│ │ │ ├── index.ts
│ │ │ ├── key.dto.ts
│ │ │ ├── player-group.dto.ts
│ │ │ ├── player-leaderboard.dto.ts
│ │ │ ├── player-rankings.dto.ts
│ │ │ ├── player-search.dto.ts
│ │ │ ├── player.dto.ts
│ │ │ ├── session.dto.ts
│ │ │ ├── update-player.dto.ts
│ │ │ ├── user.dto.ts
│ │ │ ├── uuid.dto.ts
│ │ │ └── verify-code.dto.ts
│ │ ├── guild
│ │ │ ├── guild.controller.ts
│ │ │ ├── guild.module.ts
│ │ │ ├── guild.service.ts
│ │ │ ├── index.ts
│ │ │ └── leaderboards
│ │ │ │ ├── guild-leaderboard.controller.ts
│ │ │ │ └── guild-leaderboard.service.ts
│ │ ├── hypixel-resources
│ │ │ ├── hypixel-resources.controller.ts
│ │ │ ├── hypixel-resources.module.ts
│ │ │ └── index.ts
│ │ ├── hypixel
│ │ │ ├── hypixel.module.ts
│ │ │ ├── hypixel.service.ts
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── leaderboards
│ │ │ ├── index.ts
│ │ │ └── leaderboard.service.ts
│ │ ├── player
│ │ │ ├── index.ts
│ │ │ ├── leaderboards
│ │ │ │ ├── player-leaderboard.controller.ts
│ │ │ │ └── player-leaderboard.service.ts
│ │ │ ├── player.controller.ts
│ │ │ ├── player.module.ts
│ │ │ ├── player.service.ts
│ │ │ └── search
│ │ │ │ ├── player-search.controller.ts
│ │ │ │ └── player-search.service.ts
│ │ ├── redis
│ │ │ ├── index.ts
│ │ │ ├── redis.constants.ts
│ │ │ ├── redis.core-module.ts
│ │ │ ├── redis.decorators.ts
│ │ │ ├── redis.interfaces.ts
│ │ │ ├── redis.module.ts
│ │ │ └── redis.utils.ts
│ │ ├── sentry
│ │ │ ├── index.ts
│ │ │ └── sentry.interceptor.ts
│ │ ├── session
│ │ │ ├── index.ts
│ │ │ ├── session.controller.ts
│ │ │ ├── session.model.ts
│ │ │ ├── session.module.ts
│ │ │ └── session.service.ts
│ │ ├── skin
│ │ │ ├── index.ts
│ │ │ ├── skin.controller.ts
│ │ │ ├── skin.module.ts
│ │ │ └── skin.service.ts
│ │ └── user
│ │ │ ├── index.ts
│ │ │ ├── user.controller.ts
│ │ │ ├── user.module.ts
│ │ │ └── user.service.ts
│ ├── tsconfig.json
│ └── views
│ │ └── redoc.handlebars
├── discord-bot
│ ├── .swcrc
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ ├── commands
│ │ │ ├── arcade
│ │ │ │ ├── arcade.command.tsx
│ │ │ │ ├── arcade.profile.tsx
│ │ │ │ └── modes
│ │ │ │ │ ├── blocking-dead.tsx
│ │ │ │ │ ├── bounty-hunters.tsx
│ │ │ │ │ ├── creeper-attack.tsx
│ │ │ │ │ ├── dragon-wars.tsx
│ │ │ │ │ ├── dropper.tsx
│ │ │ │ │ ├── ender-spleef.tsx
│ │ │ │ │ ├── farm-hunt.tsx
│ │ │ │ │ ├── football.tsx
│ │ │ │ │ ├── galaxy-wars.tsx
│ │ │ │ │ ├── hide-and-seek.tsx
│ │ │ │ │ ├── hole-in-the-wall.tsx
│ │ │ │ │ ├── hypixel-says.tsx
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ ├── mini-walls.tsx
│ │ │ │ │ ├── overall-arcade.tsx
│ │ │ │ │ ├── party-games.tsx
│ │ │ │ │ ├── pixel-painters.tsx
│ │ │ │ │ ├── pixel-party.tsx
│ │ │ │ │ ├── seasonal.tsx
│ │ │ │ │ ├── throw-out.tsx
│ │ │ │ │ └── zombies.tsx
│ │ │ ├── arenabrawl
│ │ │ │ ├── arenabrawl.command.tsx
│ │ │ │ └── arenabrawl.profile.tsx
│ │ │ ├── base.hypixel-command.ts
│ │ │ ├── bedwars
│ │ │ │ ├── bedwars-challenges.command.tsx
│ │ │ │ ├── bedwars-challenges.profile.tsx
│ │ │ │ ├── bedwars.command.tsx
│ │ │ │ └── bedwars.profile.tsx
│ │ │ ├── blitzsg
│ │ │ │ ├── blitzsg.command.tsx
│ │ │ │ └── blitzsg.profile.tsx
│ │ │ ├── buildbattle
│ │ │ │ ├── buildbattle.command.tsx
│ │ │ │ └── buildbattle.profile.tsx
│ │ │ ├── challenges
│ │ │ │ ├── challenges.command.tsx
│ │ │ │ └── challenges.profile.tsx
│ │ │ ├── config
│ │ │ │ ├── badge.command.tsx
│ │ │ │ ├── demo.profile.tsx
│ │ │ │ ├── language.command.tsx
│ │ │ │ └── theme.command.tsx
│ │ │ ├── copsandcrims
│ │ │ │ ├── copsandcrims.command.tsx
│ │ │ │ └── copsandcrims.profile.tsx
│ │ │ ├── deprecated
│ │ │ │ ├── bridge.command.tsx
│ │ │ │ ├── daily.command.tsx
│ │ │ │ ├── dropper.command.tsx
│ │ │ │ ├── historical.base.tsx
│ │ │ │ ├── lastDay.command.tsx
│ │ │ │ ├── lastMonth.command.tsx
│ │ │ │ ├── lastWeek.command.tsx
│ │ │ │ ├── monthly.command.tsx
│ │ │ │ ├── recentgames.command.tsx
│ │ │ │ ├── weekly.command.tsx
│ │ │ │ └── yesterday.command.tsx
│ │ │ ├── duels
│ │ │ │ ├── duels.command.tsx
│ │ │ │ ├── duels.profile.tsx
│ │ │ │ └── tables
│ │ │ │ │ ├── bridge-duels.table.tsx
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── multi-duels-game-mode.table.tsx
│ │ │ │ │ ├── single-duels-game-mode.table.tsx
│ │ │ │ │ ├── titles.table.tsx
│ │ │ │ │ └── uhc-duels.table.tsx
│ │ │ ├── events
│ │ │ │ ├── event-colors.ts
│ │ │ │ ├── events.command.tsx
│ │ │ │ └── events.profile.tsx
│ │ │ ├── gamecounts.command.ts
│ │ │ ├── general
│ │ │ │ ├── general.command.tsx
│ │ │ │ ├── general.profile.tsx
│ │ │ │ ├── historical-general.profile.tsx
│ │ │ │ └── hypixel.command.tsx
│ │ │ ├── gtbhelper
│ │ │ │ ├── find-solutions.ts
│ │ │ │ ├── gtbhelpber.command.tsx
│ │ │ │ └── gtbhelper.argument.ts
│ │ │ ├── guild
│ │ │ │ ├── gexp.table.tsx
│ │ │ │ ├── guild-list.profile.tsx
│ │ │ │ ├── guild-member.profile.tsx
│ │ │ │ ├── guild-top.profile.tsx
│ │ │ │ ├── guild-top.subcommand.tsx
│ │ │ │ ├── guild.command.tsx
│ │ │ │ └── guild.profile.tsx
│ │ │ ├── historical
│ │ │ │ └── session.command.tsx
│ │ │ ├── info
│ │ │ │ ├── help.command.ts
│ │ │ │ ├── invite.command.ts
│ │ │ │ └── ping.command.ts
│ │ │ ├── leaderboards
│ │ │ │ ├── base.leaderboard-command.tsx
│ │ │ │ ├── guild-leaderboard.argument.ts
│ │ │ │ ├── guild-leaderboard.subcommand.ts
│ │ │ │ ├── leaderboard.profile.tsx
│ │ │ │ ├── player-leaderboard.argument.ts
│ │ │ │ └── player-leaderboard.command.ts
│ │ │ ├── megawalls
│ │ │ │ ├── megawalls.command.tsx
│ │ │ │ └── megawalls.profile.tsx
│ │ │ ├── minecraft
│ │ │ │ ├── available.command.ts
│ │ │ │ ├── cape.command.ts
│ │ │ │ ├── colors.command.ts
│ │ │ │ ├── server
│ │ │ │ │ ├── server.argument.ts
│ │ │ │ │ ├── server.command.tsx
│ │ │ │ │ ├── server.profile.tsx
│ │ │ │ │ └── server.util.ts
│ │ │ │ ├── skin.command.tsx
│ │ │ │ ├── text.command.tsx
│ │ │ │ └── uuid.command.ts
│ │ │ ├── murdermystery
│ │ │ │ ├── murdermystery.command.tsx
│ │ │ │ └── murdermystery.profile.tsx
│ │ │ ├── paintball
│ │ │ │ ├── paintball.command.tsx
│ │ │ │ └── paintball.profile.tsx
│ │ │ ├── parkour
│ │ │ │ ├── parkour.command.tsx
│ │ │ │ └── parkour.profile.tsx
│ │ │ ├── pit
│ │ │ │ ├── pit.command.tsx
│ │ │ │ └── pit.profile.tsx
│ │ │ ├── quake
│ │ │ │ ├── quake.command.tsx
│ │ │ │ └── quake.profile.tsx
│ │ │ ├── quests
│ │ │ │ ├── quests.command.tsx
│ │ │ │ └── quests.profile.tsx
│ │ │ ├── rankings
│ │ │ │ ├── games.ts
│ │ │ │ ├── positions.command.tsx
│ │ │ │ ├── rankings.command.tsx
│ │ │ │ └── rankings.profile.tsx
│ │ │ ├── ratios
│ │ │ │ ├── ratios.command.tsx
│ │ │ │ └── ratios.profile.tsx
│ │ │ ├── reset.command.ts
│ │ │ ├── skywars
│ │ │ │ ├── skywars-challenges.command.tsx
│ │ │ │ ├── skywars-challenges.profile.tsx
│ │ │ │ ├── skywars.command.tsx
│ │ │ │ └── skywars.profile.tsx
│ │ │ ├── smashheroes
│ │ │ │ ├── smashheroes.command.tsx
│ │ │ │ └── smashheroes.profile.tsx
│ │ │ ├── socials
│ │ │ │ └── socials.command.ts
│ │ │ ├── speeduhc
│ │ │ │ ├── speeduhc.command.tsx
│ │ │ │ └── speeduhc.profile.tsx
│ │ │ ├── status
│ │ │ │ ├── status.command.tsx
│ │ │ │ └── status.profile.tsx
│ │ │ ├── tntgames
│ │ │ │ ├── tntgames.command.tsx
│ │ │ │ └── tntgames.profile.tsx
│ │ │ ├── turbokartracers
│ │ │ │ ├── turbokartracers.command.tsx
│ │ │ │ └── turbokartracers.profile.tsx
│ │ │ ├── uhc
│ │ │ │ ├── uhc.command.tsx
│ │ │ │ └── uhc.profile.tsx
│ │ │ ├── unverify.command.ts
│ │ │ ├── vampirez
│ │ │ │ ├── vampirez.command.tsx
│ │ │ │ └── vampirez.profile.tsx
│ │ │ ├── verify.command.ts
│ │ │ ├── walls
│ │ │ │ ├── walls.command.tsx
│ │ │ │ └── walls.profile.tsx
│ │ │ ├── warlords
│ │ │ │ ├── tables
│ │ │ │ │ ├── capture-the-flag.table.tsx
│ │ │ │ │ ├── classes.table.tsx
│ │ │ │ │ ├── deathmatch.table.tsx
│ │ │ │ │ ├── domination.table.tsx
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── overall.table.tsx
│ │ │ │ ├── warlords.command.tsx
│ │ │ │ └── warlords.profile.tsx
│ │ │ ├── watchdog.command.ts
│ │ │ └── woolgames
│ │ │ │ ├── capture-the-wool.table.tsx
│ │ │ │ ├── sheepwars.table.tsx
│ │ │ │ ├── woolgames.command.tsx
│ │ │ │ ├── woolgames.profile.tsx
│ │ │ │ └── woolwars.table.tsx
│ │ ├── components
│ │ │ ├── Background.tsx
│ │ │ ├── Container.tsx
│ │ │ ├── Footer.tsx
│ │ │ ├── GameList.tsx
│ │ │ ├── Header
│ │ │ │ ├── Header.tsx
│ │ │ │ ├── HeaderBody.tsx
│ │ │ │ ├── HeaderNametag.tsx
│ │ │ │ ├── index.tsx
│ │ │ │ └── progression.ts
│ │ │ ├── Historical
│ │ │ │ ├── Exclude.tsx
│ │ │ │ ├── Header.tsx
│ │ │ │ ├── Include.tsx
│ │ │ │ ├── Progression.tsx
│ │ │ │ └── index.ts
│ │ │ ├── If.tsx
│ │ │ ├── List.tsx
│ │ │ ├── Multiline.tsx
│ │ │ ├── ProgressBar.tsx
│ │ │ ├── Sidebar.tsx
│ │ │ ├── Skin.tsx
│ │ │ ├── Table
│ │ │ │ ├── Table.tsx
│ │ │ │ ├── TableData.tsx
│ │ │ │ ├── TableRow.tsx
│ │ │ │ ├── TableSeparator.tsx
│ │ │ │ └── index.ts
│ │ │ └── index.ts
│ │ ├── constants.ts
│ │ ├── index.ts
│ │ ├── lib
│ │ │ ├── command.listener.ts
│ │ │ ├── convert-color-codes.ts
│ │ │ ├── format-position.ts
│ │ │ └── minecraft-head.ts
│ │ ├── services
│ │ │ ├── font-loader.service.ts
│ │ │ └── index.ts
│ │ ├── themes
│ │ │ ├── boxes
│ │ │ │ ├── hd.box.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── uhd.box.ts
│ │ │ ├── index.ts
│ │ │ ├── palette.ts
│ │ │ └── renderer.ts
│ │ └── tips.ts
│ ├── tsconfig.json
│ └── words.json
├── scripts
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ ├── api-key.js
│ │ ├── delete-sessions.js
│ │ ├── limit-redis.js
│ │ ├── purge.js
│ │ ├── rank-emojis.js
│ │ ├── timestamp.js
│ │ ├── utils.js
│ │ └── validate-commands.js
│ └── tsconfig.json
├── site
│ ├── components
│ │ ├── About
│ │ │ ├── about.module.scss
│ │ │ └── index.tsx
│ │ ├── Button
│ │ │ ├── button.module.scss
│ │ │ └── index.tsx
│ │ ├── Code
│ │ │ ├── code.module.scss
│ │ │ └── index.tsx
│ │ ├── Container
│ │ │ ├── container.module.scss
│ │ │ └── index.tsx
│ │ ├── Divider
│ │ │ ├── divider.module.scss
│ │ │ └── index.tsx
│ │ ├── Feature
│ │ │ ├── feature.module.scss
│ │ │ └── index.tsx
│ │ ├── Footer
│ │ │ ├── footer.module.scss
│ │ │ └── index.tsx
│ │ ├── Hero
│ │ │ ├── Navbar.tsx
│ │ │ ├── hero.module.scss
│ │ │ ├── index.tsx
│ │ │ └── navbar.module.scss
│ │ ├── Invite
│ │ │ ├── index.tsx
│ │ │ └── invite.module.scss
│ │ ├── Layout.tsx
│ │ └── StatCircle
│ │ │ ├── StatCircleContainer.tsx
│ │ │ ├── index.tsx
│ │ │ ├── stat-circle-container.module.scss
│ │ │ └── stat-circle.module.scss
│ ├── globals.scss
│ ├── next-env.d.ts
│ ├── next.config.js
│ ├── package.json
│ ├── pages
│ │ ├── 404.tsx
│ │ ├── _app.tsx
│ │ ├── _document.tsx
│ │ └── index.tsx
│ ├── public
│ │ ├── banner.svg
│ │ ├── commands.svg
│ │ ├── discord.svg
│ │ ├── embed-banner.png
│ │ ├── examples
│ │ │ ├── arcade.png
│ │ │ ├── bedwars-leaderboard.png
│ │ │ ├── bedwars.png
│ │ │ ├── blitzsg-leaderboard.png
│ │ │ ├── buildbattle-leaderboard.png
│ │ │ ├── duels.png
│ │ │ ├── guild-member.png
│ │ │ ├── guild-overall-gexp.png
│ │ │ ├── guild-overall.png
│ │ │ ├── guild-top.png
│ │ │ ├── recentgames.png
│ │ │ ├── session-murdermystery.png
│ │ │ ├── session-tntgames.png
│ │ │ ├── skin.png
│ │ │ ├── skywars.png
│ │ │ └── woolwars-leaderboard.png
│ │ ├── fonts
│ │ │ └── LexendDeca.ttf
│ │ ├── hero.png
│ │ ├── images
│ │ │ ├── apple-touch-icon.png
│ │ │ ├── favicon-16x16.png
│ │ │ ├── favicon-32x32.png
│ │ │ └── favicon.ico
│ │ ├── invite.svg
│ │ ├── logo.svg
│ │ ├── robots.txt
│ │ ├── servers.svg
│ │ └── socials
│ │ │ ├── discord.svg
│ │ │ ├── github.svg
│ │ │ ├── patreon.svg
│ │ │ └── twitter.svg
│ └── tsconfig.json
├── support-bot
│ ├── .swcrc
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ ├── commands
│ │ │ ├── close.command.ts
│ │ │ ├── commands.command.ts
│ │ │ ├── delete-player.command.ts
│ │ │ ├── force-unverify.command.ts
│ │ │ ├── force-verify.command.ts
│ │ │ ├── tags.command.ts
│ │ │ ├── ticket-menu.command.ts
│ │ │ └── user.command.ts
│ │ ├── events
│ │ │ ├── guild-member-add.event.tsx
│ │ │ ├── guild-member-remove.event.ts
│ │ │ ├── guild-member-update.event.ts
│ │ │ └── message-create.event.ts
│ │ ├── index.ts
│ │ ├── lib
│ │ │ ├── command.listener.ts
│ │ │ ├── index.ts
│ │ │ └── welcomer.profile.tsx
│ │ └── services
│ │ │ ├── font-loader.service.ts
│ │ │ ├── index.ts
│ │ │ ├── mongo-loader.service.ts
│ │ │ ├── tag.service.ts
│ │ │ ├── ticket.service.ts
│ │ │ └── user.service.ts
│ └── tsconfig.json
└── verify-server
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ ├── generate-code.ts
│ └── index.ts
│ └── tsconfig.json
├── config.schema.js
├── crowdin.yml
├── eslint.config.js
├── locales
├── bg
│ └── default.json
├── cs
│ └── default.json
├── da
│ └── default.json
├── de
│ └── default.json
├── el
│ └── default.json
├── en-US
│ ├── default.json
│ └── emojis.json
├── es-ES
│ └── default.json
├── fi
│ └── default.json
├── fr
│ └── default.json
├── hi
│ └── default.json
├── hr
│ └── default.json
├── hu
│ └── default.json
├── it
│ └── default.json
├── ja
│ └── default.json
├── ko
│ └── default.json
├── lt
│ └── default.json
├── nl
│ └── default.json
├── no
│ └── default.json
├── pl
│ └── default.json
├── pt-BR
│ └── default.json
├── ro
│ └── default.json
├── ru
│ └── default.json
├── sv-SE
│ └── default.json
├── th
│ └── default.json
├── tr
│ └── default.json
├── uk
│ └── default.json
├── vi
│ └── default.json
├── zh-CN
│ └── default.json
└── zh-TW
│ └── default.json
├── package.json
├── packages
├── api-client
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ ├── api.service.ts
│ │ ├── constants.ts
│ │ ├── exceptions
│ │ │ ├── base.404.ts
│ │ │ ├── guild.404.ts
│ │ │ ├── index.ts
│ │ │ ├── player.404.ts
│ │ │ ├── session.404.ts
│ │ │ ├── skin.404.ts
│ │ │ └── status.404.ts
│ │ ├── index.ts
│ │ └── responses
│ │ │ ├── delete.player.response.ts
│ │ │ ├── error.response.ts
│ │ │ ├── get.command-usage.response.ts
│ │ │ ├── get.gamecounts.response.ts
│ │ │ ├── get.guild.response.ts
│ │ │ ├── get.key.response.ts
│ │ │ ├── get.player-search.response.ts
│ │ │ ├── get.player.response.ts
│ │ │ ├── get.session.response.ts
│ │ │ ├── get.skin-textures.response.ts
│ │ │ ├── get.status.response.ts
│ │ │ ├── get.user.response.ts
│ │ │ ├── get.watchdog.response.ts
│ │ │ ├── index.ts
│ │ │ ├── post.leaderboard.response.ts
│ │ │ ├── post.rankings.response.ts
│ │ │ ├── put.user-badge.response.ts
│ │ │ └── success.response.ts
│ └── tsconfig.json
├── assets
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── discord
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ ├── arguments
│ │ │ ├── abstract.argument.ts
│ │ │ ├── choice.argument.ts
│ │ │ ├── file.argument.ts
│ │ │ ├── guild.argument.ts
│ │ │ ├── index.ts
│ │ │ ├── mojang-player.argument.ts
│ │ │ ├── number.argument.ts
│ │ │ ├── player.argument.ts
│ │ │ ├── text.argument.ts
│ │ │ └── user.argument.ts
│ │ ├── command
│ │ │ ├── abstract-command.listener.ts
│ │ │ ├── command.builder.ts
│ │ │ ├── command.context.ts
│ │ │ ├── command.decorator.ts
│ │ │ ├── command.interface.ts
│ │ │ ├── command.loader.ts
│ │ │ ├── command.poster.ts
│ │ │ ├── command.resolvable.ts
│ │ │ ├── index.ts
│ │ │ └── subcommand.decorator.ts
│ │ ├── event
│ │ │ ├── abstract-event.listener.ts
│ │ │ ├── event.loader.ts
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── interaction
│ │ │ ├── index.ts
│ │ │ ├── interaction.content.ts
│ │ │ └── interaction.ts
│ │ ├── messages
│ │ │ ├── base.message.ts
│ │ │ ├── components
│ │ │ │ ├── action-row.builder.ts
│ │ │ │ ├── button.builder.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── modal.builder.ts
│ │ │ │ ├── parse-emoji.ts
│ │ │ │ ├── select-menu.builder.ts
│ │ │ │ └── text-input.builder.ts
│ │ │ ├── embed.ts
│ │ │ ├── index.ts
│ │ │ └── localize.ts
│ │ ├── services
│ │ │ ├── api.service.ts
│ │ │ ├── channel.service.ts
│ │ │ ├── guild.service.ts
│ │ │ ├── i18n-loader.service.ts
│ │ │ ├── index.ts
│ │ │ ├── member.service.ts
│ │ │ ├── message.service.ts
│ │ │ └── paginate.service.ts
│ │ └── util
│ │ │ ├── error.message.ts
│ │ │ └── parse-discord-error.ts
│ ├── tsconfig.json
│ └── vitest.config.ts
├── logger
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── vitest.config.ts
├── math
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── vitest.config.ts
├── rendering
│ ├── .swcrc
│ ├── eslint.config.js
│ ├── package.json
│ ├── positions.json
│ ├── sizes.json
│ ├── src
│ │ ├── colors
│ │ │ └── index.ts
│ │ ├── font
│ │ │ ├── font-renderer.ts
│ │ │ ├── index.ts
│ │ │ └── tokens.ts
│ │ ├── hooks
│ │ │ ├── index.ts
│ │ │ ├── loadImage.ts
│ │ │ ├── useChildren.ts
│ │ │ ├── useComponentSize.ts
│ │ │ └── useGradient.ts
│ │ ├── index.ts
│ │ ├── intrinsics
│ │ │ ├── Box.ts
│ │ │ ├── Div.ts
│ │ │ ├── Image.ts
│ │ │ ├── Text.ts
│ │ │ └── index.ts
│ │ ├── jsx-runtime
│ │ │ ├── convert.ts
│ │ │ └── index.ts
│ │ └── jsx
│ │ │ ├── create-instructions.ts
│ │ │ ├── index.ts
│ │ │ ├── instrinsics.ts
│ │ │ ├── render.ts
│ │ │ ├── types.ts
│ │ │ └── util.ts
│ ├── tests
│ │ └── index.spec.tsx
│ ├── tsconfig.json
│ └── vitest.config.ts
├── schemas
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ │ ├── color.ts
│ │ ├── commands
│ │ │ └── index.ts
│ │ ├── game
│ │ │ ├── game-modes.ts
│ │ │ ├── game.ts
│ │ │ └── index.ts
│ │ ├── gamecounts
│ │ │ └── index.ts
│ │ ├── guild
│ │ │ ├── achievements.ts
│ │ │ ├── exp-by-game.ts
│ │ │ ├── index.ts
│ │ │ ├── member.ts
│ │ │ ├── rank.ts
│ │ │ └── util.ts
│ │ ├── index.ts
│ │ ├── key
│ │ │ └── index.ts
│ │ ├── metadata
│ │ │ ├── constants.ts
│ │ │ ├── deserialize.ts
│ │ │ ├── field.options.ts
│ │ │ ├── field
│ │ │ │ ├── get-leaderboard-metadata.ts
│ │ │ │ ├── get-store-metadata.ts
│ │ │ │ ├── get-type-metadata.ts
│ │ │ │ └── index.ts
│ │ │ ├── index.ts
│ │ │ ├── metadata-scanner.ts
│ │ │ ├── metadata.interface.ts
│ │ │ └── serialize.ts
│ │ ├── player
│ │ │ ├── gamemodes
│ │ │ │ ├── arcade
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── mode.ts
│ │ │ │ │ └── seasonal-mode.ts
│ │ │ │ ├── arenabrawl
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── mode.ts
│ │ │ │ ├── bedwars
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── mode.ts
│ │ │ │ │ ├── slumber.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── blitzsg
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── kit.ts
│ │ │ │ │ └── mode.ts
│ │ │ │ ├── buildbattle
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── mode.ts
│ │ │ │ ├── challenges
│ │ │ │ │ ├── game-challenges.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── modes
│ │ │ │ │ │ ├── arcade.ts
│ │ │ │ │ │ ├── arenabrawl.ts
│ │ │ │ │ │ ├── bedwars.ts
│ │ │ │ │ │ ├── blitzsg.ts
│ │ │ │ │ │ ├── buildbattle.ts
│ │ │ │ │ │ ├── cops-and-crims.ts
│ │ │ │ │ │ ├── duels.ts
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ ├── megawalls.ts
│ │ │ │ │ │ ├── murdermystery.ts
│ │ │ │ │ │ ├── paintball.ts
│ │ │ │ │ │ ├── quake.ts
│ │ │ │ │ │ ├── skywars.ts
│ │ │ │ │ │ ├── smashheroes.ts
│ │ │ │ │ │ ├── speeduhc.ts
│ │ │ │ │ │ ├── tntgames.ts
│ │ │ │ │ │ ├── turbokartracers.ts
│ │ │ │ │ │ ├── uhc.ts
│ │ │ │ │ │ ├── vampirez.ts
│ │ │ │ │ │ ├── walls.ts
│ │ │ │ │ │ ├── warlords.ts
│ │ │ │ │ │ └── woolgames.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── copsandcrims
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── mode.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── duels
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── mode.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── general
│ │ │ │ │ ├── bingo.ts
│ │ │ │ │ ├── events.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── megawalls
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── kit.ts
│ │ │ │ ├── murdermystery
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── mode.ts
│ │ │ │ ├── paintball
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── perks.ts
│ │ │ │ ├── parkour
│ │ │ │ │ └── index.ts
│ │ │ │ ├── pit
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── renown-upgrades.json
│ │ │ │ │ └── util.ts
│ │ │ │ ├── prefixes.ts
│ │ │ │ ├── quake
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── mode.ts
│ │ │ │ ├── quests
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── modes
│ │ │ │ │ │ ├── arcade.ts
│ │ │ │ │ │ ├── arenabrawl.ts
│ │ │ │ │ │ ├── bedwars.ts
│ │ │ │ │ │ ├── blitzsg.ts
│ │ │ │ │ │ ├── buildbattle.ts
│ │ │ │ │ │ ├── cops-and-crims.ts
│ │ │ │ │ │ ├── duels.ts
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ ├── megawalls.ts
│ │ │ │ │ │ ├── murdermystery.ts
│ │ │ │ │ │ ├── paintball.ts
│ │ │ │ │ │ ├── pit.ts
│ │ │ │ │ │ ├── quake.ts
│ │ │ │ │ │ ├── skywars.ts
│ │ │ │ │ │ ├── smashheroes.ts
│ │ │ │ │ │ ├── speeduhc.ts
│ │ │ │ │ │ ├── tntgames.ts
│ │ │ │ │ │ ├── turbokartracers.ts
│ │ │ │ │ │ ├── uhc.ts
│ │ │ │ │ │ ├── vampirez.ts
│ │ │ │ │ │ ├── walls.ts
│ │ │ │ │ │ ├── warlords.ts
│ │ │ │ │ │ └── woolgames.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── skywars
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── mode.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── smashheroes
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── mode.ts
│ │ │ │ ├── speeduhc
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── mastery.ts
│ │ │ │ │ ├── mode.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── tntgames
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── mode.ts
│ │ │ │ ├── turbokartracers
│ │ │ │ │ └── index.ts
│ │ │ │ ├── uhc
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── mode.ts
│ │ │ │ │ └── util.ts
│ │ │ │ ├── vampirez
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── life.ts
│ │ │ │ │ └── prefixes.ts
│ │ │ │ ├── walls
│ │ │ │ │ └── index.ts
│ │ │ │ ├── warlords
│ │ │ │ │ ├── class.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── mode.ts
│ │ │ │ └── woolgames
│ │ │ │ │ ├── capture-the-wool.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── sheepwars.ts
│ │ │ │ │ ├── util.ts
│ │ │ │ │ └── woolwars.ts
│ │ │ ├── index.ts
│ │ │ ├── socials.ts
│ │ │ ├── stats.ts
│ │ │ ├── status.ts
│ │ │ └── util.ts
│ │ ├── progression.ts
│ │ ├── ratios.ts
│ │ ├── skin
│ │ │ └── index.ts
│ │ ├── status
│ │ │ ├── index.ts
│ │ │ └── recent-game.ts
│ │ ├── tags
│ │ │ └── index.ts
│ │ ├── ticket
│ │ │ └── index.ts
│ │ ├── user
│ │ │ ├── footer.ts
│ │ │ ├── index.ts
│ │ │ └── theme.ts
│ │ ├── util
│ │ │ ├── create-historical-player.ts
│ │ │ ├── historical-scanner.ts
│ │ │ ├── index.ts
│ │ │ ├── leaderboard-scanner.ts
│ │ │ └── parse-fields.ts
│ │ ├── verify-codes
│ │ │ └── index.ts
│ │ └── watchdog
│ │ │ ├── index.ts
│ │ │ └── mode.ts
│ ├── tsconfig.json
│ └── vitest.config.ts
├── skin-renderer
│ ├── Cargo.toml
│ ├── build.rs
│ ├── examples
│ │ ├── node.ts
│ │ └── wasm.ts
│ ├── index.cjs
│ ├── index.d.ts
│ ├── models
│ │ ├── alex.png
│ │ └── steve.png
│ ├── package.json
│ └── src
│ │ ├── buffer_dimensions.rs
│ │ ├── camera
│ │ ├── mod.rs
│ │ ├── orbital.rs
│ │ └── uniform.rs
│ │ ├── error.rs
│ │ ├── geometry
│ │ ├── box_geometry.rs
│ │ ├── coordinate.rs
│ │ ├── mod.rs
│ │ ├── orientation.rs
│ │ ├── outer_layer_geometry.rs
│ │ ├── prism.rs
│ │ └── vertex.rs
│ │ ├── instance.rs
│ │ ├── lib.rs
│ │ ├── light
│ │ └── mod.rs
│ │ ├── material
│ │ └── mod.rs
│ │ ├── mesh.rs
│ │ ├── model.rs
│ │ ├── native.rs
│ │ ├── renderer
│ │ ├── backend.rs
│ │ ├── mod.rs
│ │ ├── native.rs
│ │ ├── shader.wgsl
│ │ └── wasm.rs
│ │ ├── skin_loader.rs
│ │ ├── texture.rs
│ │ └── wasm.rs
└── util
│ ├── eslint.config.js
│ ├── package.json
│ ├── src
│ ├── config.ts
│ ├── flatten.ts
│ ├── index.ts
│ ├── minecraft-colors.ts
│ ├── types.ts
│ ├── unflatten.ts
│ └── util.ts
│ ├── tsconfig.json
│ └── vitest.config.ts
├── pm2.config.cjs
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── renovate.json
├── rustfmt.toml
├── tsconfig.base.json
├── turbo.json
├── vite.swc.ts
├── vitest.shared.ts
└── vitest.workspace.ts
/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:1-16
2 |
3 | # Install additional OS packages
4 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5 | && apt-get -y install --no-install-recommends fontconfig redis-server
6 |
7 | # Install NPM packages
8 | RUN su node -c "npm install -g pm2 git-cz pnpm"
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Statsify",
3 | "build": {
4 | "dockerfile": "Dockerfile"
5 | },
6 | "customizations": {
7 | "vscode": {
8 | "extensions": [
9 | "dbaeumer.vscode-eslint",
10 | "esbenp.prettier-vscode",
11 | "vivaxy.vscode-conventional-commits",
12 | "mikestead.dotenv",
13 | "ms-azuretools.vscode-docker",
14 | "lokalise.i18n-ally",
15 | "gruntfuggly.todo-tree"
16 | ]
17 | }
18 | },
19 | "runArgs": [
20 | "--privileged"
21 | ],
22 | "containerEnv": {
23 | "USE_POLLING": "true"
24 | },
25 | "remoteUser": "node",
26 | "postCreateCommand": "git submodule update --init && pnpm install && pnpm run build",
27 | "postStartCommand": "sudo /etc/init.d/redis-server start && git config core.autocrlf true && pnpm scripts api-key --nonInteractiveKeyCreation",
28 | "features": {
29 | "ghcr.io/devcontainers/features/git:1": {},
30 | "ghcr.io/devcontainers/features/github-cli:1": {}
31 | }
32 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Discord server
4 | url: https://statsify.net/discord
5 | about: Visit our discord server for general questions and support.
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Description:
2 | Related issues (if exists):
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy
2 | on:
3 | push:
4 | tags:
5 | - "v*"
6 | workflow_dispatch:
7 |
8 | permissions:
9 | checks: write
10 | contents: write
11 |
12 | jobs:
13 | deploy:
14 | name: Deploy
15 | runs-on: core
16 | environment: production
17 | steps:
18 | - name: Checkout repository
19 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
20 | with:
21 | token: ${{ secrets.REPO_PAT }}
22 | submodules: recursive
23 |
24 | - name: Install dependencies
25 | run: pnpm install --force
26 |
27 | - name: Build Code
28 | run: pnpm scripts purge --dist && pnpm build --force
29 |
30 | - name: Prepare Assets
31 | run: cd assets/private && pnpm blur && cd ../../
32 |
33 | - name: Move Config
34 | run: cp /home/config.js ./config.js
35 |
36 | - name: Restart PM2
37 | run: npx pm2 restart pm2.config.cjs
38 |
--------------------------------------------------------------------------------
/.github/workflows/issue_labeler.yml:
--------------------------------------------------------------------------------
1 | name: "Issue Labeler"
2 | on:
3 | issues:
4 | types: [opened]
5 |
6 | jobs:
7 | labeler:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: github/issue-labeler@98b5412841f6c4b0b3d9c29d53c13fad16bd7de2 # v3.2
11 | with:
12 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
13 | configuration-path: .github/issue_labeler.yml
14 | enable-versioned-regex: 0
15 |
--------------------------------------------------------------------------------
/.github/workflows/pr_labeler.yml:
--------------------------------------------------------------------------------
1 | name: "PR Labeler"
2 | on:
3 | - pull_request_target
4 |
5 | jobs:
6 | labeler:
7 | permissions:
8 | contents: read
9 | pull-requests: write
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5
13 | with:
14 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
15 | configuration-path: .github/pr_labeler.yml
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | config.js
2 | config.json
3 | dist
4 | node_modules
5 | .turbo
6 | package-lock.json
7 | out
8 | .yarn/install-state.gz
9 | .yarn/build-state.yml
10 | *.tsbuildinfo
11 | *.zip
12 | *.tar
13 | *.tar.xz
14 | *.tar.gz
15 | *.7z
16 | *.rar
17 | .swc
18 | .next
19 | .
20 | coverage
21 | apps/discord-bot/commands.json
22 | apps/support-bot/commands.json
23 | .pnpm-store/
24 | Cargo.lock
25 | /target
26 | *.node
27 | .env
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "assets/public"]
2 | path = assets/public
3 | url = https://github.com/Statsify/public-assets
4 | [submodule "assets/private"]
5 | path = assets/private
6 | url = https://github.com/Statsify/assets
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | 22.6.0
2 |
--------------------------------------------------------------------------------
/.swcrc:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://swc.rs/schema.json",
3 | "jsc": {
4 | "parser": {
5 | "syntax": "typescript",
6 | "decorators": true,
7 | "dynamicImport": true
8 | },
9 | "transform": {
10 | "legacyDecorator": true,
11 | "decoratorMetadata": true,
12 | "optimizer": {
13 | "simplify": true,
14 | "globals": {
15 | "vars": {
16 | "import.meta.vitest": "false"
17 | }
18 | },
19 | "jsonify": {
20 | "minCost": 2048
21 | }
22 | }
23 | },
24 | "target": "es2022",
25 | "keepClassNames": true,
26 | "loose": false,
27 | "externalHelpers": true,
28 | "preserveAllComments": false,
29 | "experimental": {
30 | "keepImportAttributes": true
31 | }
32 | },
33 | "module": {
34 | "type": "es6",
35 | "strict": true,
36 | "strictMode": true,
37 | "lazy": false,
38 | "noInterop": false
39 | },
40 | "sourceMaps": true
41 | }
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | members = ["packages/skin-renderer"]
3 | resolver = "2"
4 |
5 | [profile.release]
6 | lto = true
7 |
--------------------------------------------------------------------------------
/apps/api/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/apps/api/src/auth/auth.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { AuthController } from "./auth.controller.js";
10 | import { AuthGuard } from "./auth.guard.js";
11 | import { AuthService } from "./auth.service.js";
12 | import { Global, Module } from "@nestjs/common";
13 |
14 | @Global()
15 | @Module({
16 | providers: [AuthGuard, AuthService],
17 | controllers: [AuthController],
18 | exports: [AuthService],
19 | })
20 | export class AuthModule {}
21 |
--------------------------------------------------------------------------------
/apps/api/src/auth/auth.role.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export enum AuthRole {
10 | MEMBER = 0,
11 | WORKER = 300,
12 | ADMIN = 999
13 | }
14 |
--------------------------------------------------------------------------------
/apps/api/src/auth/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./auth.decorator.js";
10 | export * from "./auth.module.js";
11 | export * from "./auth.role.js";
12 |
--------------------------------------------------------------------------------
/apps/api/src/commands/commands.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Commands } from "@statsify/schemas";
10 | import { CommandsController } from "./commands.controller.js";
11 | import { CommandsService } from "./commands.service.js";
12 | import { Module } from "@nestjs/common";
13 | import { TypegooseModule } from "@m8a/nestjs-typegoose";
14 |
15 | @Module({
16 | imports: [TypegooseModule.forFeature([Commands])],
17 | controllers: [CommandsController],
18 | providers: [CommandsService],
19 | })
20 | export class CommandsModule {}
21 |
--------------------------------------------------------------------------------
/apps/api/src/commands/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./commands.module.js";
10 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/cache.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { CacheLevel } from "@statsify/api-client";
11 | import { IsEnum, IsOptional } from "class-validator";
12 |
13 | export class CacheDto {
14 | @ApiProperty({
15 | enum: CacheLevel,
16 | enumName: "CacheLevel",
17 | example: CacheLevel.CACHE,
18 | default: CacheLevel.CACHE,
19 | description: "Describes whether to return live data or cached data.",
20 | required: false,
21 | })
22 | @IsOptional()
23 | @IsEnum(CacheLevel)
24 | public cache: CacheLevel = CacheLevel.CACHE;
25 | }
26 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/cached-player.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { CacheDto } from "./cache.dto.js";
10 | import { IntersectionType } from "@nestjs/swagger";
11 | import { PlayerDto } from "./player.dto.js";
12 |
13 | export class CachedPlayerDto extends IntersectionType(PlayerDto, CacheDto) {}
14 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/command.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsString } from "class-validator";
11 |
12 | export class CommandDto {
13 | @IsString()
14 | @ApiProperty()
15 | public command: string;
16 | }
17 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/guild-rankings.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { Guild, LeaderboardScanner } from "@statsify/schemas";
11 | import { IsEnum, IsString, MaxLength, MinLength } from "class-validator";
12 |
13 | const fields = LeaderboardScanner.getLeaderboardFields(Guild).map(([key]) => key);
14 |
15 | export class GuildRankingDto {
16 | @ApiProperty({ enum: fields, type: [String] })
17 | @IsEnum(fields, { each: true })
18 | public fields: string[];
19 |
20 | @IsString()
21 | @MinLength(24)
22 | @MaxLength(24)
23 | @ApiProperty()
24 | public id: string;
25 | }
26 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/head.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsInt, IsOptional, Max, Min } from "class-validator";
11 | import { Transform } from "class-transformer";
12 | import { UuidDto } from "./uuid.dto.js";
13 |
14 | export class HeadDto extends UuidDto {
15 | @IsOptional()
16 | @Transform(({ value }) => +value)
17 | @IsInt()
18 | @Min(8)
19 | @Max(800)
20 | @ApiProperty({
21 | description: "The size of the head",
22 | default: 160,
23 | minimum: 8,
24 | maximum: 800,
25 | })
26 | public size = 160;
27 | }
28 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./cache.dto.js";
10 | export * from "./cached-player.dto.js";
11 | export * from "./guild-leaderboard.dto.js";
12 | export * from "./guild-rankings.dto.js";
13 | export * from "./guild.dto.js";
14 | export * from "./head.dto.js";
15 | export * from "./user.dto.js";
16 | export * from "./verify-code.dto.js";
17 | export * from "./command.dto.js";
18 | export * from "./update-player.dto.js";
19 | export * from "./player-group.dto.js";
20 | export * from "./player-search.dto.js";
21 | export * from "./player.dto.js";
22 | export * from "./key.dto.js";
23 | export * from "./uuid.dto.js";
24 | export * from "./player-rankings.dto.js";
25 | export * from "./player-leaderboard.dto.js";
26 | export * from "./session.dto.js";
27 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/key.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsString } from "class-validator";
11 |
12 | export class AddKeyDto {
13 | @IsString()
14 | @ApiProperty()
15 | public name: string;
16 | }
17 |
18 | export class KeyParamDto {
19 | @IsString()
20 | @ApiProperty()
21 | public key: string;
22 | }
23 |
24 | export class KeyHeaderDto {
25 | @IsString()
26 | @ApiProperty()
27 | public "x-api-key": string;
28 | }
29 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/player-group.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsNumber, Min } from "class-validator";
11 | import { Transform } from "class-transformer";
12 |
13 | export class PlayerGroupDto {
14 | @Transform((params) => +params.value)
15 | @IsNumber()
16 | @Min(0)
17 | @ApiProperty()
18 | public start: number;
19 |
20 | @Transform((params) => +params.value)
21 | @IsNumber()
22 | @ApiProperty()
23 | public end: number;
24 | }
25 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/player-rankings.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsEnum } from "class-validator";
11 | import { LeaderboardScanner, Player } from "@statsify/schemas";
12 | import { UuidDto } from "./uuid.dto.js";
13 |
14 | const fields = LeaderboardScanner.getLeaderboardFields(Player).map(([key]) => key);
15 |
16 | export class PlayerRankingsDto extends UuidDto {
17 | @ApiProperty({ enum: fields, type: [String] })
18 | @IsEnum(fields, { each: true })
19 | public fields: string[];
20 | }
21 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/player-search.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsString, MaxLength } from "class-validator";
11 |
12 | export class PlayerSearchDto {
13 | @IsString()
14 | @MaxLength(16)
15 | @ApiProperty()
16 | public query: string;
17 | }
18 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/player.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsString, MaxLength, MinLength } from "class-validator";
11 |
12 | export class PlayerDto {
13 | @IsString()
14 | @MinLength(1)
15 | @MaxLength(36)
16 | @ApiProperty({
17 | example: "j4cobi",
18 | description: "The player's username or uuid",
19 | })
20 | public player: string;
21 | }
22 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/session.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { IsOptional, IsString } from "class-validator";
10 | import { PlayerDto } from "./player.dto.js";
11 |
12 | export class SessionDto extends PlayerDto {
13 | @IsOptional()
14 | @IsString()
15 | public userUuid?: string;
16 | }
17 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/update-player.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsString } from "class-validator";
11 |
12 | export class UpdatePlayerDto {
13 | @IsString()
14 | @ApiProperty()
15 | public uuid: string;
16 |
17 | @IsString()
18 | @ApiProperty()
19 | public playername: string;
20 |
21 | @IsString()
22 | @ApiProperty()
23 | public displayname: string;
24 | }
25 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/uuid.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { IsString, MaxLength, MinLength } from "class-validator";
11 |
12 | export class UuidDto {
13 | @IsString()
14 | @MaxLength(36)
15 | @MinLength(32)
16 | @ApiProperty()
17 | public uuid: string;
18 | }
19 |
--------------------------------------------------------------------------------
/apps/api/src/dtos/verify-code.dto.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty, PartialType } from "@nestjs/swagger";
10 | import { IsOptional, IsString, MaxLength, MinLength } from "class-validator";
11 | import { UuidDto } from "./uuid.dto.js";
12 |
13 | export class VerifyCodeDto extends PartialType(UuidDto) {
14 | @ApiProperty({ description: "Discord ID" })
15 | @IsString()
16 | @MinLength(17)
17 | public id: string;
18 |
19 | @ApiProperty({ description: "Verification Code" })
20 | @IsString()
21 | @IsOptional()
22 | @MinLength(4)
23 | @MaxLength(4)
24 | public code?: string;
25 | }
26 |
--------------------------------------------------------------------------------
/apps/api/src/guild/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./guild.controller.js";
10 | export * from "./guild.module.js";
11 | export * from "./guild.service.js";
12 |
--------------------------------------------------------------------------------
/apps/api/src/hypixel-resources/hypixel-resources.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { HypixelModule } from "#hypixel";
10 | import { HypixelResourcesController } from "./hypixel-resources.controller.js";
11 | import { Module } from "@nestjs/common";
12 |
13 | @Module({
14 | imports: [HypixelModule],
15 | controllers: [HypixelResourcesController],
16 | })
17 | export class HypixelResourcesModule {}
18 |
--------------------------------------------------------------------------------
/apps/api/src/hypixel-resources/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./hypixel-resources.controller.js";
10 | export * from "./hypixel-resources.module.js";
11 |
--------------------------------------------------------------------------------
/apps/api/src/hypixel/hypixel.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { HttpModule } from "@nestjs/axios";
10 | import { HypixelService } from "./hypixel.service.js";
11 | import { Module } from "@nestjs/common";
12 | import { config } from "@statsify/util";
13 |
14 | @Module({
15 | imports: [
16 | HttpModule.register({
17 | baseURL: "https://api.hypixel.net/",
18 | headers: {
19 | "API-Key": config("hypixelApi.key"),
20 | "accept-encoding": "*",
21 | },
22 | timeout: config("hypixelApi.timeout", { default: 5000 }),
23 | }),
24 | ],
25 | providers: [HypixelService],
26 | exports: [HypixelService],
27 | })
28 | export class HypixelModule {}
29 |
--------------------------------------------------------------------------------
/apps/api/src/hypixel/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./hypixel.module.js";
10 | export * from "./hypixel.service.js";
11 |
--------------------------------------------------------------------------------
/apps/api/src/leaderboards/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./leaderboard.service.js";
10 |
--------------------------------------------------------------------------------
/apps/api/src/player/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./player.controller.js";
10 | export * from "./player.module.js";
11 | export * from "./player.service.js";
12 |
--------------------------------------------------------------------------------
/apps/api/src/redis/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | /**
10 | * Adapted from: https://github.com/nest-modules/ioredis
11 | * because the module has not been updated for the latest version of NestJS and the repository is inactive
12 | */
13 |
14 | export * from "./redis.module.js";
15 | export * from "./redis.decorators.js";
16 | export * from "./redis.interfaces.js";
17 | export * from "./redis.utils.js";
18 |
--------------------------------------------------------------------------------
/apps/api/src/redis/redis.constants.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export const REDIS_MODULE_CONNECTION = "default";
10 | export const REDIS_MODULE_CONNECTION_TOKEN = "IORedisModuleConnectionToken";
11 | export const REDIS_MODULE_OPTIONS_TOKEN = "IORedisModuleOptionsToken";
12 |
--------------------------------------------------------------------------------
/apps/api/src/redis/redis.decorators.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Inject } from "@nestjs/common";
10 | import { getRedisConnectionToken } from "./redis.utils.js";
11 |
12 | export const InjectRedis = (connection?: string) =>
13 | Inject(getRedisConnectionToken(connection));
14 |
--------------------------------------------------------------------------------
/apps/api/src/redis/redis.interfaces.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type { RedisOptions } from "ioredis";
10 |
11 | export interface RedisModuleOptions {
12 | config: RedisOptions & { url?: string };
13 | }
14 |
--------------------------------------------------------------------------------
/apps/api/src/redis/redis.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { DynamicModule, Module } from "@nestjs/common";
10 | import { RedisCoreModule } from "./redis.core-module.js";
11 | import type { RedisModuleOptions } from "./redis.interfaces.js";
12 |
13 | @Module({})
14 | export class RedisModule {
15 | public static forRoot(options: RedisModuleOptions, connection?: string): DynamicModule {
16 | return {
17 | module: RedisModule,
18 | imports: [RedisCoreModule.forRoot(options, connection)],
19 | exports: [RedisCoreModule],
20 | };
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/apps/api/src/redis/redis.utils.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | REDIS_MODULE_CONNECTION,
11 | REDIS_MODULE_CONNECTION_TOKEN,
12 | REDIS_MODULE_OPTIONS_TOKEN,
13 | } from "./redis.constants.js";
14 | import { Redis } from "ioredis";
15 | import type { RedisModuleOptions } from "./redis.interfaces.js";
16 |
17 | export function getRedisOptionsToken(connection?: string): string {
18 | return `${connection || REDIS_MODULE_CONNECTION}_${REDIS_MODULE_OPTIONS_TOKEN}`;
19 | }
20 |
21 | export function getRedisConnectionToken(connection?: string): string {
22 | return `${connection || REDIS_MODULE_CONNECTION}_${REDIS_MODULE_CONNECTION_TOKEN}`;
23 | }
24 |
25 | export function createRedisConnection(options: RedisModuleOptions) {
26 | const { config } = options;
27 | return config.url ? new Redis(config.url, config) : new Redis(config);
28 | }
29 |
--------------------------------------------------------------------------------
/apps/api/src/sentry/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./sentry.interceptor.js";
10 |
--------------------------------------------------------------------------------
/apps/api/src/session/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./session.controller.js";
10 | export * from "./session.module.js";
11 | export * from "./session.service.js";
12 |
--------------------------------------------------------------------------------
/apps/api/src/session/session.model.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { modelOptions as ModelOptions } from "@typegoose/typegoose";
10 | import { Player } from "@statsify/schemas";
11 |
12 | @ModelOptions({ schemaOptions: { collection: "session" } })
13 | export class Session extends Player {}
14 |
--------------------------------------------------------------------------------
/apps/api/src/session/session.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Module, forwardRef } from "@nestjs/common";
10 | import { Player, User } from "@statsify/schemas";
11 | import { PlayerModule } from "#player";
12 | import { Session } from "./session.model.js";
13 | import { SessionController } from "./session.controller.js";
14 | import { SessionService } from "./session.service.js";
15 | import { TypegooseModule } from "@m8a/nestjs-typegoose";
16 |
17 | @Module({
18 | imports: [
19 | forwardRef(() => PlayerModule),
20 | TypegooseModule.forFeature([
21 | Session,
22 | Player,
23 | User,
24 | ]),
25 | ],
26 | controllers: [SessionController],
27 | providers: [SessionService],
28 | })
29 | export class SessionModule {}
30 |
--------------------------------------------------------------------------------
/apps/api/src/skin/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./skin.controller.js";
10 | export * from "./skin.module.js";
11 | export * from "./skin.service.js";
12 |
--------------------------------------------------------------------------------
/apps/api/src/skin/skin.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { HttpModule } from "@nestjs/axios";
10 | import { Module } from "@nestjs/common";
11 | import { Skin } from "@statsify/schemas";
12 | import { SkinController } from "./skin.controller.js";
13 | import { SkinService } from "./skin.service.js";
14 | import { TypegooseModule } from "@m8a/nestjs-typegoose";
15 |
16 | @Module({
17 | imports: [
18 | TypegooseModule.forFeature([Skin]),
19 | HttpModule.register({}),
20 | ],
21 | controllers: [SkinController],
22 | providers: [SkinService],
23 | })
24 | export class SkinModule {}
25 |
--------------------------------------------------------------------------------
/apps/api/src/user/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./user.module.js";
10 |
--------------------------------------------------------------------------------
/apps/api/src/user/user.module.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Module } from "@nestjs/common";
10 | import { TypegooseModule } from "@m8a/nestjs-typegoose";
11 | import { User, VerifyCode } from "@statsify/schemas";
12 | import { UserController } from "./user.controller.js";
13 | import { UserService } from "./user.service.js";
14 |
15 | @Module({
16 | imports: [TypegooseModule.forFeature([User, VerifyCode])],
17 | controllers: [UserController],
18 | providers: [UserService],
19 | })
20 | export class UserModule {}
21 |
--------------------------------------------------------------------------------
/apps/api/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js"
6 | ]
7 | }
--------------------------------------------------------------------------------
/apps/discord-bot/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/arcade/modes/blocking-dead.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { BlockingDead } from "@statsify/schemas";
10 | import { LocalizeFunction } from "@statsify/discord";
11 | import { Table } from "#components";
12 |
13 | interface BlockingDeadTableProps {
14 | stats: BlockingDead;
15 | t: LocalizeFunction;
16 | }
17 |
18 | export const BlockingDeadTable = ({ stats, t }: BlockingDeadTableProps) => (
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/arcade/modes/creeper-attack.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { CreeperAttack } from "@statsify/schemas";
10 | import { LocalizeFunction } from "@statsify/discord";
11 | import { Table } from "#components";
12 |
13 | interface CreeperAttackTableProps {
14 | stats: CreeperAttack;
15 | t: LocalizeFunction;
16 | }
17 |
18 | export const CreeperAttackTable = ({ stats, t }: CreeperAttackTableProps) => (
19 |
20 |
21 |
22 |
23 |
24 | );
25 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/arcade/modes/dragon-wars.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { DragonWars } from "@statsify/schemas";
10 | import { LocalizeFunction } from "@statsify/discord";
11 | import { Table } from "#components";
12 |
13 | interface DragonWarsTableProps {
14 | stats: DragonWars;
15 | t: LocalizeFunction;
16 | }
17 |
18 | export const DragonWarsTable = ({ stats, t }: DragonWarsTableProps) => (
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/arcade/modes/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./blocking-dead.js";
10 | export * from "./bounty-hunters.js";
11 | export * from "./creeper-attack.js";
12 | export * from "./dragon-wars.js";
13 | export * from "./dropper.js";
14 | export * from "./ender-spleef.js";
15 | export * from "./farm-hunt.js";
16 | export * from "./football.js";
17 | export * from "./galaxy-wars.js";
18 | export * from "./hide-and-seek.js";
19 | export * from "./hole-in-the-wall.js";
20 | export * from "./hypixel-says.js";
21 | export * from "./mini-walls.js";
22 | export * from "./overall-arcade.js";
23 | export * from "./party-games.js";
24 | export * from "./pixel-painters.js";
25 | export * from "./seasonal.js";
26 | export * from "./throw-out.js";
27 | export * from "./zombies.js";
28 | export * from "./pixel-party.js";
29 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/arcade/modes/pixel-painters.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { LocalizeFunction } from "@statsify/discord";
10 | import { PixelPainters } from "@statsify/schemas";
11 | import { Table } from "#components";
12 |
13 | interface PixelPaintersTableProps {
14 | stats: PixelPainters;
15 | t: LocalizeFunction;
16 | }
17 |
18 | export const PixelPaintersTable = ({ stats, t }: PixelPaintersTableProps) => (
19 |
20 |
21 |
22 |
23 |
24 | );
25 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/arcade/modes/throw-out.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { LocalizeFunction } from "@statsify/discord";
10 | import { Table } from "#components";
11 | import { ThrowOut } from "@statsify/schemas";
12 |
13 | interface ThrowOutTableProps {
14 | stats: ThrowOut;
15 | t: LocalizeFunction;
16 | }
17 |
18 | export const ThrowOutTable = ({ stats, t }: ThrowOutTableProps) => (
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | );
28 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/arenabrawl/arenabrawl.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ARENA_BRAWL_MODES, ArenaBrawlModes } from "@statsify/schemas";
10 | import { ArenaBrawlProfile } from "./arenabrawl.profile.js";
11 | import {
12 | BaseHypixelCommand,
13 | BaseProfileProps,
14 | ProfileData,
15 | } from "#commands/base.hypixel-command";
16 | import { Command } from "@statsify/discord";
17 |
18 | @Command({ description: (t) => t("commands.arenabrawl") })
19 | export class ArenaBrawlCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(ARENA_BRAWL_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/bedwars/bedwars.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { BEDWARS_MODES, BedWarsModes } from "@statsify/schemas";
10 | import {
11 | BaseHypixelCommand,
12 | BaseProfileProps,
13 | ProfileData,
14 | } from "#commands/base.hypixel-command";
15 | import { BedWarsProfile } from "./bedwars.profile.js";
16 | import { Command } from "@statsify/discord";
17 |
18 | @Command({ description: (t) => t("commands.bedwars") })
19 | export class BedWarsCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(BEDWARS_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/buildbattle/buildbattle.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { BUILD_BATTLE_MODES, BuildBattleModes } from "@statsify/schemas";
10 | import { BaseHypixelCommand, BaseProfileProps } from "#commands/base.hypixel-command";
11 | import { BuildBattleProfile } from "./buildbattle.profile.js";
12 | import { Command } from "@statsify/discord";
13 |
14 | @Command({ description: (t) => t("commands.buildbattle") })
15 | export class BuildBattleCommand extends BaseHypixelCommand {
16 | public constructor() {
17 | super(BUILD_BATTLE_MODES);
18 | }
19 |
20 | public getProfile(base: BaseProfileProps): JSX.Element {
21 | return ;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/bridge.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command, type IMessage } from "@statsify/discord";
10 |
11 | @Command({ description: (t) => t("deprecated.command-description", { newCommandName: "/duels" }) })
12 | export class BridgeCommand {
13 | public run(): IMessage {
14 | return {
15 | content: (t) => t("deprecated.merged-dropdown", {
16 | oldCommandName: "`/bridge`",
17 | newCommand: "",
18 | newCommandName: `${t("emojis:games.DUELS")} **Duels**`,
19 | mode: "**Bridge**",
20 | }),
21 | };
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/daily.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { HistoricalBase } from "./historical.base.js";
11 | import { HistoricalTimes } from "@statsify/api-client";
12 |
13 | @Command({ description: (t) => t("commands.daily") })
14 | export class DailyCommand extends HistoricalBase {
15 | public constructor() {
16 | super(HistoricalTimes.DAILY);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/dropper.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command, type IMessage } from "@statsify/discord";
10 |
11 | @Command({ description: (t) => t("deprecated.command-description", { newCommandName: "/arcade" }) })
12 | export class DropperCommand {
13 | public run(): IMessage {
14 | return {
15 | content: (t) => t("deprecated.merged-dropdown", {
16 | oldCommandName: "`/dropper`",
17 | newCommand: "",
18 | newCommandName: `${t("emojis:games.ARCADE")} **Arcade**`,
19 | mode: "**Dropper**",
20 | }),
21 | };
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/lastDay.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { HistoricalBase } from "./historical.base.js";
11 | import { HistoricalTimes } from "@statsify/api-client";
12 |
13 | @Command({ description: (t) => t("commands.last-day") })
14 | export class LastDayCommand extends HistoricalBase {
15 | public constructor() {
16 | super(HistoricalTimes.LAST_DAY);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/lastMonth.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { HistoricalBase } from "./historical.base.js";
11 | import { HistoricalTimes } from "@statsify/api-client";
12 |
13 | @Command({ description: (t) => t("commands.last-month") })
14 | export class LastMonthCommand extends HistoricalBase {
15 | public constructor() {
16 | super(HistoricalTimes.LAST_MONTH);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/lastWeek.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { HistoricalBase } from "./historical.base.js";
11 | import { HistoricalTimes } from "@statsify/api-client";
12 |
13 | @Command({ description: (t) => t("commands.last-week") })
14 | export class LastWeekCommand extends HistoricalBase {
15 | public constructor() {
16 | super(HistoricalTimes.LAST_WEEK);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/monthly.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { HistoricalBase } from "./historical.base.js";
11 | import { HistoricalTimes } from "@statsify/api-client";
12 |
13 | @Command({ description: (t) => t("commands.monthly") })
14 | export class MonthlyCommand extends HistoricalBase {
15 | public constructor() {
16 | super(HistoricalTimes.MONTHLY);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/recentgames.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command, type IMessage } from "@statsify/discord";
10 |
11 | @Command({ description: (t) => t("deprecated.command-description", { newCommandName: "/status" }) })
12 | export class RecentGamesCommand {
13 | public run(): IMessage {
14 | return {
15 | content: (t) => t("deprecated.merged-direct", {
16 | oldCommandName: "`/recentgames`",
17 | newCommandName: `${t("emojis:icons.status")} **Status**`,
18 | newCommand: "",
19 | }),
20 | };
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/weekly.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { HistoricalBase } from "./historical.base.js";
11 | import { HistoricalTimes } from "@statsify/api-client";
12 |
13 | @Command({ description: (t) => t("commands.weekly") })
14 | export class WeeklyCommand extends HistoricalBase {
15 | public constructor() {
16 | super(HistoricalTimes.WEEKLY);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/deprecated/yesterday.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { HistoricalBase } from "./historical.base.js";
11 | import { HistoricalTimes } from "@statsify/api-client";
12 |
13 | @Command({ description: (t) => t("commands.last-day") })
14 | export class YesterdayCommand extends HistoricalBase {
15 | public constructor() {
16 | super(HistoricalTimes.LAST_DAY);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/duels/tables/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./bridge-duels.table.js";
10 | export * from "./multi-duels-game-mode.table.js";
11 | export * from "./single-duels-game-mode.table.js";
12 | export * from "./uhc-duels.table.js";
13 | export * from "./titles.table.js";
14 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/events/event-colors.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type { EventPeriod } from "@statsify/schemas";
10 |
11 | export const EVENT_COLORS: Record = {
12 | summer: "§e",
13 | halloween: "§5",
14 | christmas: "§c",
15 | easter: "§b",
16 | };
17 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/general/hypixel.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { GeneralCommand } from "./general.command.js";
11 |
12 | @Command({ description: (t) => t("commands.general") })
13 | export class HypixelCommand extends GeneralCommand {}
14 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/paintball/paintball.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { BaseHypixelCommand, BaseProfileProps } from "#commands/base.hypixel-command";
10 | import { Command } from "@statsify/discord";
11 | import { PAINTBALL_MODES, PaintballModes } from "@statsify/schemas";
12 | import { PaintballProfile } from "./paintball.profile.js";
13 |
14 | @Command({ description: (t) => t("commands.paintball") })
15 | export class PaintballCommand extends BaseHypixelCommand {
16 | public constructor() {
17 | super(PAINTBALL_MODES);
18 | }
19 |
20 | public getProfile(base: BaseProfileProps): JSX.Element {
21 | return ;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/pit/pit.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { BaseHypixelCommand, BaseProfileProps } from "#commands/base.hypixel-command";
10 | import { Command, PlayerArgument } from "@statsify/discord";
11 | import { PIT_MODES, PitModes } from "@statsify/schemas";
12 | import { PitProfile } from "./pit.profile.js";
13 |
14 | @Command({ description: (t) => t("commands.pit"), args: [PlayerArgument] })
15 | export class PitCommand extends BaseHypixelCommand {
16 | public constructor() {
17 | super(PIT_MODES);
18 | }
19 |
20 | public getProfile(base: BaseProfileProps): JSX.Element {
21 | return ;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/quake/quake.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | BaseHypixelCommand,
11 | BaseProfileProps,
12 | ProfileData,
13 | } from "#commands/base.hypixel-command";
14 | import { Command } from "@statsify/discord";
15 | import { QUAKE_MODES, QuakeModes } from "@statsify/schemas";
16 | import { QuakeProfile } from "./quake.profile.js";
17 |
18 | @Command({ description: (t) => t("commands.quake") })
19 | export class QuakeCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(QUAKE_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/rankings/games.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ClassMetadata, METADATA_KEY, PlayerStats } from "@statsify/schemas";
10 | import { removeFormatting } from "@statsify/util";
11 |
12 | export const removeGameDash = (game: string) => game.replace(" -", "");
13 |
14 | export const games = Object.entries(
15 | Reflect.getMetadata(METADATA_KEY, PlayerStats.prototype) as ClassMetadata
16 | ).map(([key, value]) => {
17 | const name = value.leaderboard.fieldName ?? value.leaderboard.name;
18 |
19 | return {
20 | key: key as keyof PlayerStats,
21 | name: removeGameDash(removeFormatting(name)),
22 | formatted: name,
23 | };
24 | });
25 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/rankings/positions.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Command } from "@statsify/discord";
10 | import { RankingsCommand } from "./rankings.command.js";
11 |
12 | @Command({ description: (t) => t("commands.rankings") })
13 | export class PositionsCommand extends RankingsCommand {}
14 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/skywars/skywars.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | BaseHypixelCommand,
11 | BaseProfileProps,
12 | ProfileData,
13 | } from "#commands/base.hypixel-command";
14 | import { Command } from "@statsify/discord";
15 | import { SKYWARS_MODES, SkyWarsModes } from "@statsify/schemas";
16 | import { SkyWarsProfile } from "./skywars.profile.js";
17 |
18 | @Command({ description: (t) => t("commands.skywars") })
19 | export class SkyWarsCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(SKYWARS_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/smashheroes/smashheroes.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | BaseHypixelCommand,
11 | BaseProfileProps,
12 | ProfileData,
13 | } from "#commands/base.hypixel-command";
14 | import { Command } from "@statsify/discord";
15 | import { SMASH_HEROES_MODES, SmashHeroesModes } from "@statsify/schemas";
16 | import { SmashHeroesProfile } from "./smashheroes.profile.js";
17 |
18 | @Command({ description: (t) => t("commands.smashheroes") })
19 | export class SmashHeroesCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(SMASH_HEROES_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/speeduhc/speeduhc.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | BaseHypixelCommand,
11 | BaseProfileProps,
12 | ProfileData,
13 | } from "#commands/base.hypixel-command";
14 | import { Command } from "@statsify/discord";
15 | import { SPEED_UHC_MODES, SpeedUHCModes } from "@statsify/schemas";
16 | import { SpeedUHCProfile } from "./speeduhc.profile.js";
17 |
18 | @Command({ description: (t) => t("commands.speeduhc") })
19 | export class SpeedUHCCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(SPEED_UHC_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/tntgames/tntgames.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { BaseHypixelCommand, type BaseProfileProps, type ProfileData } from "#commands/base.hypixel-command";
10 | import { Command } from "@statsify/discord";
11 | import { type TNTGamesModes, TNT_GAMES_MODES } from "@statsify/schemas";
12 | import { TNTGamesProfile } from "./tntgames.profile.js";
13 |
14 | @Command({ description: (t) => t("commands.tntgames") })
15 | export class TNTGamesCommand extends BaseHypixelCommand {
16 | public constructor() {
17 | super(TNT_GAMES_MODES);
18 | }
19 |
20 | public getProfile(base: BaseProfileProps, { mode }: ProfileData): JSX.Element {
21 | return ;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/turbokartracers/turbokartracers.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { BaseHypixelCommand, BaseProfileProps } from "#commands/base.hypixel-command";
10 | import { Command } from "@statsify/discord";
11 | import { TURBO_KART_RACERS_MODES, TurboKartRacersModes } from "@statsify/schemas";
12 | import { TurboKartRacersProfile } from "./turbokartracers.profile.js";
13 |
14 | @Command({ description: (t) => t("commands.turbokartracers") })
15 | export class TurboKartRacersCommand extends BaseHypixelCommand {
16 | public constructor() {
17 | super(TURBO_KART_RACERS_MODES);
18 | }
19 |
20 | public getProfile(base: BaseProfileProps): JSX.Element {
21 | return ;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/uhc/uhc.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | BaseHypixelCommand,
11 | BaseProfileProps,
12 | ProfileData,
13 | } from "#commands/base.hypixel-command";
14 | import { Command } from "@statsify/discord";
15 | import { UHCModes, UHC_MODES } from "@statsify/schemas";
16 | import { UHCProfile } from "./uhc.profile.js";
17 |
18 | @Command({ description: (t) => t("commands.uhc") })
19 | export class UHCCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(UHC_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/vampirez/vampirez.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | BaseHypixelCommand,
11 | BaseProfileProps,
12 | ProfileData,
13 | } from "#commands/base.hypixel-command";
14 | import { Command } from "@statsify/discord";
15 | import { VAMPIREZ_MODES, VampireZModes } from "@statsify/schemas";
16 | import { VampireZProfile } from "./vampirez.profile.js";
17 |
18 | @Command({ description: (t) => t("commands.vampirez") })
19 | export class VampireZCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(VAMPIREZ_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/walls/walls.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { BaseHypixelCommand, BaseProfileProps } from "#commands/base.hypixel-command";
10 | import { Command } from "@statsify/discord";
11 | import { WALLS_MODES, WallsModes } from "@statsify/schemas";
12 | import { WallsProfile } from "./walls.profile.js";
13 |
14 | @Command({ description: (t) => t("commands.walls") })
15 | export class WallsCommand extends BaseHypixelCommand {
16 | public constructor() {
17 | super(WALLS_MODES);
18 | }
19 |
20 | public getProfile(base: BaseProfileProps): JSX.Element {
21 | return ;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/warlords/tables/deathmatch.table.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Table } from "#components";
10 | import type { LocalizeFunction } from "@statsify/discord";
11 | import type { Warlords } from "@statsify/schemas";
12 |
13 | export interface WarlordsDeathmatchTableProps {
14 | warlords: Warlords;
15 | t: LocalizeFunction;
16 | }
17 |
18 | export const WarlordsDeathmatchTable = ({ warlords, t }: WarlordsDeathmatchTableProps) => (
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/warlords/tables/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./classes.table.js";
10 | export * from "./capture-the-flag.table.js";
11 | export * from "./domination.table.js";
12 | export * from "./overall.table.js";
13 | export * from "./deathmatch.table.js";
14 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/warlords/warlords.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | BaseHypixelCommand,
11 | BaseProfileProps,
12 | ProfileData,
13 | } from "#commands/base.hypixel-command";
14 | import { Command } from "@statsify/discord";
15 | import { WARLORDS_MODES, WarlordsModes } from "@statsify/schemas";
16 | import { WarlordsProfile } from "./warlords.profile.js";
17 |
18 | @Command({ description: (t) => t("commands.warlords") })
19 | export class WarlordsCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(WARLORDS_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/commands/woolgames/woolgames.command.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import {
10 | BaseHypixelCommand,
11 | BaseProfileProps,
12 | ProfileData,
13 | } from "#commands/base.hypixel-command";
14 | import { Command } from "@statsify/discord";
15 | import { WOOLGAMES_MODES, WoolGamesModes } from "@statsify/schemas";
16 | import { WoolGamesProfile } from "./woolgames.profile.js";
17 |
18 | @Command({ description: (t) => t("commands.woolgames") })
19 | export class WoolGamesCommand extends BaseHypixelCommand {
20 | public constructor() {
21 | super(WOOLGAMES_MODES);
22 | }
23 |
24 | public getProfile(
25 | base: BaseProfileProps,
26 | { mode }: ProfileData
27 | ): JSX.Element {
28 | return ;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Background.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type { Canvas, Image } from "skia-canvas";
10 |
11 | export interface BackgroundProps {
12 | background: Canvas | Image;
13 | children: JSX.Children;
14 | }
15 |
16 | export const Background = ({ background, children }: BackgroundProps) => (
17 |
18 | {children}
19 |
20 | );
21 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Header/HeaderNametag.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { If } from "../If.js";
10 | import type { Canvas, Image } from "skia-canvas";
11 |
12 | export interface HeaderNametagProps {
13 | name: string;
14 | badge?: Image | Canvas;
15 | size?: number;
16 | }
17 |
18 | export const HeaderNametag = ({ name, badge, size = 4 }: HeaderNametagProps) => (
19 |
20 | {(badge) => }
21 |
22 | §^{size}^{name}
23 |
24 |
25 | );
26 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Header/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./Header.js";
10 | export * from "./HeaderNametag.js";
11 | export * from "./progression.js";
12 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Historical/Exclude.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { If } from "../If.js";
10 | import type { ProfileTime } from "#commands/base.hypixel-command";
11 |
12 | export interface HistoricalExcludeProps {
13 | time: ProfileTime;
14 | children: JSX.Children;
15 | }
16 |
17 | export const HistoricalExclude = ({ time, children }: HistoricalExcludeProps) => (
18 | {children}
19 | );
20 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Historical/Include.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { If } from "../If.js";
10 | import type { ProfileTime } from "#commands/base.hypixel-command";
11 |
12 | export interface HistoricalIncludeProps {
13 | time: ProfileTime;
14 | children: JSX.Children;
15 | }
16 |
17 | export const HistoricalInclude = ({ time, children }: HistoricalIncludeProps) => (
18 | {children}
19 | );
20 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Historical/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { HistoricalExclude } from "./Exclude.js";
10 | import { HistoricalHeader } from "./Header.js";
11 | import { HistoricalInclude } from "./Include.js";
12 | import { HistoricalProgression } from "./Progression.js";
13 |
14 | export const Historical = {
15 | header: HistoricalHeader,
16 | progression: HistoricalProgression,
17 | exclude: HistoricalExclude,
18 | include: HistoricalInclude,
19 | };
20 |
21 | export type { HistoricalTimeData } from "./Header.js";
22 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/If.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { noop } from "@statsify/util";
10 | import { useChildren } from "@statsify/rendering";
11 |
12 | export interface IfProps {
13 | condition: T | undefined | null | false;
14 | children: JSX.Children | JSX.Children<(data: T) => JSX.Children>;
15 | }
16 |
17 | export function If({
18 | children: _children,
19 | condition,
20 | }: IfProps): JSX.Element | null {
21 | const children = useChildren(_children);
22 |
23 | if (condition) {
24 | return <>{typeof children[0] === "function" ? children[0](condition) : children}>;
25 | }
26 |
27 | return noop();
28 | }
29 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Multiline.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Text, useChildren } from "@statsify/rendering";
10 |
11 | export const Multiline = (props: Text.TextProps) => {
12 | const children = useChildren(props.children);
13 |
14 | if (props.margin === undefined) props.margin = 1;
15 |
16 | const text = children
17 | .join(" ")
18 | .split("\n")
19 | .map((t) => {t} );
20 |
21 | return <>{text}>;
22 | };
23 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Skin.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Image } from "skia-canvas";
10 |
11 | export interface SkinProps {
12 | skin: Image;
13 | }
14 |
15 | /**
16 | *
17 | * @example
18 | * ```ts
19 | * const skin = new Image();
20 | *
21 | * ```
22 | */
23 | export const Skin = ({ skin }: SkinProps) => {
24 | const width = 125;
25 |
26 | return (
27 |
28 |
29 |
30 | );
31 | };
32 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Table/TableRow.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { useChildren } from "@statsify/rendering";
10 |
11 | export interface TableRow {
12 | children: JSX.Children;
13 | }
14 |
15 | /**
16 | * @example
17 | * ```ts
18 | *
19 | *
20 | *
21 | *
22 | *
23 | * ```
24 | */
25 | export const TableRow = ({ children: _children }: TableRow) => {
26 | const children = useChildren(_children);
27 | const length = children.length;
28 |
29 | return (
30 |
31 | {children.map((child) => (
32 |
{child}
33 | ))}
34 |
35 | );
36 | };
37 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/Table/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Table as TableComponent } from "./Table.js";
10 | import { TableData } from "./TableData.js";
11 | import { TableRow } from "./TableRow.js";
12 | import { TableSeparator } from "./TableSeparator.js";
13 |
14 | export const Table = {
15 | table: TableComponent,
16 | td: TableData,
17 | tr: TableRow,
18 | ts: TableSeparator,
19 | };
20 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/components/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./Background.js";
10 | export * from "./Container.js";
11 | export * from "./Footer.js";
12 | export * from "./Header/index.js";
13 | export * from "./Historical/index.js";
14 | export * from "./If.js";
15 | export * from "./List.js";
16 | export * from "./Multiline.js";
17 | export * from "./ProgressBar.js";
18 | export * from "./Sidebar.js";
19 | export * from "./Skin.js";
20 | export * from "./Table/index.js";
21 | export * from "./GameList.js";
22 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/lib/convert-color-codes.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export const convertColorCodes = (content: string) => content
10 | .replaceAll(String.raw`\&`, "")
11 | .replace(/&\S/g, (m) => m.replace("&", "§"))
12 | .replaceAll("", "&");
13 |
14 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/lib/format-position.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { LocalizeFunction } from "@statsify/discord";
10 |
11 | export const formatPosition = (t: LocalizeFunction, position: number): string => {
12 | let color = "§f";
13 |
14 | switch (position) {
15 | case 1:
16 | color = "§#ffd700";
17 | break;
18 |
19 | case 2:
20 | color = "§#c0c0c0";
21 | break;
22 |
23 | case 3:
24 | color = "§#cd7f32";
25 | break;
26 | }
27 |
28 | return `${color}#§l${t(position)}`;
29 | };
30 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/lib/minecraft-head.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { randomUUID } from "node:crypto";
10 |
11 | export function minecraftHeadUrl(uuid: string) {
12 | const dashlessUuid = uuid.replaceAll("-", "");
13 | return `https://crafatar.com/avatars/${dashlessUuid}?size=160&default=MHF_Steve&overlay&id=${randomUUID()}`;
14 | }
15 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/services/font-loader.service.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Container, Service } from "typedi";
10 | import { FontRenderer } from "@statsify/rendering";
11 | import { getMinecraftTexturePath } from "@statsify/assets";
12 |
13 | const renderer = new FontRenderer();
14 | const hdRenderer = new FontRenderer();
15 |
16 | Container.set(FontRenderer, renderer);
17 | Container.set("HDFontRenderer", hdRenderer);
18 |
19 | @Service()
20 | export class FontLoaderService {
21 | public async init() {
22 | await renderer.loadImages(getMinecraftTexturePath("textures/font"));
23 | await hdRenderer.loadImages(getMinecraftTexturePath("textures/font", "hd"));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/services/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./font-loader.service.js";
10 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/themes/boxes/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import * as HDBox from "./hd.box.js";
10 | import * as UHDBox from "./uhd.box.js";
11 | import { Box, Render } from "@statsify/rendering";
12 | import { UserBoxes } from "@statsify/schemas";
13 |
14 | export function getBoxRenderer(boxes: UserBoxes): Render {
15 | switch (boxes) {
16 | case UserBoxes.DEFAULT:
17 | return Box.render;
18 |
19 | case UserBoxes.HD:
20 | return HDBox.render;
21 |
22 | case UserBoxes.UHD:
23 | return UHDBox.render;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/apps/discord-bot/src/themes/renderer.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Container } from "typedi";
10 | import { FontRenderer } from "@statsify/rendering";
11 | import { UserFont } from "@statsify/schemas";
12 |
13 | export function getFontRenderer(font: UserFont): FontRenderer {
14 | switch (font) {
15 | case UserFont.HD:
16 | return Container.get("HDFontRenderer");
17 |
18 | default:
19 | return Container.get(FontRenderer);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/apps/discord-bot/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "preserve",
5 | "baseUrl": "./src",
6 | },
7 | "include": [
8 | "src",
9 | "eslint.config.js"
10 | ]
11 | }
--------------------------------------------------------------------------------
/apps/scripts/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import config from "../../eslint.config.js";
10 | import globals from "globals";
11 |
12 | export default [
13 | {
14 | languageOptions: { globals: globals.node },
15 | },
16 | ...config,
17 | ];
18 |
--------------------------------------------------------------------------------
/apps/scripts/src/delete-sessions.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { config } from "@statsify/util";
10 | import { connect } from "mongoose";
11 |
12 | const mongo = await connect(config("database.mongoUri"));
13 |
14 | const session = mongo.connection.db.collection("session");
15 |
16 | await session.deleteMany();
17 |
18 | console.log("Done!");
19 | process.exit(0);
20 |
--------------------------------------------------------------------------------
/apps/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js"
6 | ]
7 | }
--------------------------------------------------------------------------------
/apps/site/components/About/about.module.scss:
--------------------------------------------------------------------------------
1 | .container {
2 | display: flex;
3 | flex-direction: column;
4 | justify-content: center;
5 |
6 | color: #ffffff;
7 |
8 |
9 | padding-left: 30px;
10 | padding-right: 30px;
11 | margin-bottom: 10px;
12 |
13 | text-align: center;
14 |
15 | h1 {
16 | font-size: 2.3rem;
17 | margin-bottom: 10px;
18 | }
19 |
20 | p {
21 | font-size: 1rem;
22 | }
23 |
24 | @media (min-width: 640px) {
25 | width: 25%;
26 | text-align: left;
27 | justify-content: flex-start;
28 | padding-left: 70px;
29 | padding-right: 70px;
30 | }
31 | }
--------------------------------------------------------------------------------
/apps/site/components/About/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import styles from "./about.module.scss";
10 |
11 | export const About = () => (
12 |
13 |
About Us
14 |
15 | Statsify is an easy to use multipurpose Discord bot for viewing your Hypixel stats.
16 | Statsify can track statistics in several game modes on the Hypixel Network, such as
17 | Bed Wars, Sky Wars, Duels, and many other minigames. It is the #1 stat bot for
18 | tracking your progress and improvements while playing Minecraft.
19 |
20 |
21 | );
22 |
--------------------------------------------------------------------------------
/apps/site/components/Button/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import Link from "next/link";
10 | import styles from "./button.module.scss";
11 |
12 | export interface ButtonProps {
13 | children: React.ReactNode;
14 | link?: string;
15 | }
16 |
17 | export const Button = ({ link, children }: ButtonProps) => {
18 | if (link)
19 | return (
20 |
21 | {children}
22 |
23 | );
24 |
25 | return {children} ;
26 | };
27 |
--------------------------------------------------------------------------------
/apps/site/components/Code/code.module.scss:
--------------------------------------------------------------------------------
1 | .code {
2 | color: #ffffff;
3 | background-color: #0a0a0a;
4 | padding: 0.2em 0.4em;
5 | border-radius: 0.3em;
6 |
7 | font-family: "DejaVu Sans Mono", "Menlo", "Monaco", "Consolas", "Courier New", monospace;
8 | }
--------------------------------------------------------------------------------
/apps/site/components/Code/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import styles from "./code.module.scss";
10 | import { ReactNode } from "react";
11 |
12 | export interface CodeProps {
13 | children: ReactNode;
14 | }
15 |
16 | export const Code = ({ children }: CodeProps) => (
17 | {children}
18 | );
19 |
--------------------------------------------------------------------------------
/apps/site/components/Container/container.module.scss:
--------------------------------------------------------------------------------
1 | .container {
2 | width: 100%;
3 |
4 | display: flex;
5 | flex-direction: column;
6 | justify-content: center;
7 | align-items: center;
8 | }
--------------------------------------------------------------------------------
/apps/site/components/Container/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import styles from "./container.module.scss";
10 | import { ReactNode } from "react";
11 |
12 | export interface ContainerProps {
13 | children: ReactNode;
14 | }
15 |
16 | export const Container = ({ children }: ContainerProps) => (
17 | {children}
18 | );
19 |
--------------------------------------------------------------------------------
/apps/site/components/Divider/divider.module.scss:
--------------------------------------------------------------------------------
1 | .divider {
2 | width: 40%;
3 | margin: 24px;
4 | height: 1px;
5 | background-color: rgba(255, 255, 255, 0.4);
6 |
7 | @media (max-width: 640px) {
8 | width: 90%;
9 | }
10 | }
--------------------------------------------------------------------------------
/apps/site/components/Divider/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import styles from "./divider.module.scss";
10 |
11 | export const Divider = () =>
;
12 |
--------------------------------------------------------------------------------
/apps/site/components/Footer/footer.module.scss:
--------------------------------------------------------------------------------
1 | .footer {
2 | width: 100%;
3 | background-color: #111111;
4 | color: #ffffff;
5 | font-family: "Lexend Deca";
6 | display: flex;
7 | flex-direction: column;
8 | align-items: center;
9 | gap: 16px;
10 | padding-top: 16px;
11 | padding-bottom: 16px;
12 | }
13 |
14 | .socials,
15 | .links {
16 | display: flex;
17 | flex-direction: row;
18 | justify-content: center;
19 | gap: 8px;
20 | }
21 |
22 | .links {
23 | padding-top: 4px;
24 | padding-bottom: 4px;
25 |
26 | @media (max-width: 640px) {
27 | flex-direction: column;
28 | }
29 | }
30 |
31 | .link {
32 | text-align: center;
33 |
34 | &:hover {
35 | cursor: pointer;
36 | text-decoration: underline;
37 | }
38 | }
39 |
40 | .copyright {
41 | padding-top: 4px;
42 | padding-bottom: 4px;
43 | }
44 |
--------------------------------------------------------------------------------
/apps/site/components/Hero/Navbar.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import Image from "next/image";
10 | import Logo from "../../public/banner.svg";
11 | import styles from "./navbar.module.scss";
12 |
13 | export const Navbar = () => (
14 |
15 |
16 |
17 |
18 |
19 | );
20 |
--------------------------------------------------------------------------------
/apps/site/components/Hero/navbar.module.scss:
--------------------------------------------------------------------------------
1 | .nav {
2 | display: flex;
3 | flex-direction: row;
4 | justify-content: center;
5 |
6 | width: 100%;
7 |
8 | margin-top: 16px;
9 | }
10 |
11 | .branding {
12 | filter: drop-shadow(0px 0px 15px rgba(0, 0, 0, 0.8));
13 | position: relative;
14 |
15 | width: 100%;
16 | min-height: 100px;
17 |
18 | @media (max-width: 640px) {
19 | width: 90%;
20 | }
21 | }
--------------------------------------------------------------------------------
/apps/site/components/Invite/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import styles from "./invite.module.scss";
10 | import { Button } from "../Button";
11 |
12 | export const Invite = () => (
13 |
14 |
What are you waiting for?
15 |
Invite Statsify today to enhance your Hypixel experience!
16 |
Invite Now
17 |
18 | );
19 |
--------------------------------------------------------------------------------
/apps/site/components/Invite/invite.module.scss:
--------------------------------------------------------------------------------
1 | .invite {
2 | display: flex;
3 | flex-direction: column;
4 | align-items: center;
5 | justify-content: center;
6 |
7 | color: #ffffff;
8 | text-align: center;
9 |
10 | h1,
11 | h2,
12 | p {
13 | margin-bottom: 32px;
14 | }
15 |
16 | h1 {
17 | font-size: 3rem;
18 |
19 | @media (max-width: 640px) {
20 | font-size: 2.5rem;
21 | }
22 | }
23 |
24 | p {
25 | font-size: 1.2rem;
26 | }
27 |
28 | button {
29 | font-size: 1.5rem;
30 | }
31 |
32 | margin: 64px;
33 | }
34 |
--------------------------------------------------------------------------------
/apps/site/components/Layout.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Container } from "./Container";
10 | import { Footer } from "./Footer";
11 | import { Hero } from "./Hero";
12 | import { ReactNode } from "react";
13 |
14 | export interface LayoutProps {
15 | children: ReactNode;
16 | }
17 |
18 | export const Layout = ({ children }: LayoutProps) => (
19 | <>
20 |
21 |
22 | {children}
23 |
24 |
25 | >
26 | );
27 |
--------------------------------------------------------------------------------
/apps/site/components/StatCircle/StatCircleContainer.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import styles from "./stat-circle-container.module.scss";
10 | import { About } from "../About";
11 |
12 | export interface StatCircleContainerProps {
13 | children: React.ReactNode;
14 | }
15 |
16 | export const StatCircleContainer = ({ children }: StatCircleContainerProps) => (
17 |
18 |
{children}
19 |
20 |
21 | );
22 |
--------------------------------------------------------------------------------
/apps/site/components/StatCircle/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import CountUp from "react-countup";
10 | import styles from "./stat-circle.module.scss";
11 | import { ReactNode } from "react";
12 |
13 | export interface StatCircleProps {
14 | value: number;
15 | title: string;
16 | image: ReactNode;
17 | }
18 |
19 | export const StatCircle = ({ title, value, image }: StatCircleProps) => (
20 |
21 |
{image}
22 |
23 |
{title}
24 |
25 | );
26 |
27 | export * from "./StatCircleContainer";
28 |
--------------------------------------------------------------------------------
/apps/site/components/StatCircle/stat-circle-container.module.scss:
--------------------------------------------------------------------------------
1 | .container {
2 | display: flex;
3 | flex-direction: row;
4 | justify-content: center;
5 | align-items: center;
6 | background-color: #111111;
7 |
8 | width: 100%;
9 |
10 | padding-top: 60px;
11 | padding-bottom: 60px;
12 |
13 | @media (max-width: 640px) {
14 | flex-direction: column-reverse;
15 | }
16 | }
17 |
18 |
19 | .circleContainer {
20 | display: flex;
21 | flex-direction: row;
22 | justify-content: center;
23 | align-items: center;
24 |
25 | color: #ffffff;
26 | font-size: 2rem;
27 | font-weight: 800;
28 |
29 |
30 | @media (max-width: 640px) {
31 | margin-left: 0px;
32 | margin-right: 0px;
33 | margin-top: 15px;
34 | margin-bottom: 15px;
35 | flex-direction: column;
36 | }
37 | }
--------------------------------------------------------------------------------
/apps/site/globals.scss:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "Lexend Deca";
3 | src: url(/fonts/LexendDeca.ttf) format("truetype");
4 | }
5 |
6 | * {
7 | margin: 0;
8 | padding: 0;
9 | }
10 |
11 | html, body, #__next {
12 | width: 100%;
13 | height: 100%;
14 | background-color: #1d1d1d;
15 | font-family: "Lexend Deca", Arial, Helvetica, sans-serif;
16 | scroll-behavior: smooth;
17 | }
18 |
19 | #__next {
20 | display: flex;
21 | flex-direction: column;
22 | }
23 |
24 | main {
25 | flex: 1;
26 | }
27 |
28 | img {
29 | user-select: none;
30 | }
31 |
32 | .slider {
33 | position: relative;
34 | }
35 |
36 | .slider::before {
37 | content: '';
38 | position: absolute;
39 | top: 0;
40 | left: 100%;
41 | width: 10000%;
42 | height: 100%;
43 | }
--------------------------------------------------------------------------------
/apps/site/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
6 |
--------------------------------------------------------------------------------
/apps/site/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "site",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next -p 8080",
7 | "build": "next build",
8 | "start": "next start -p 8080",
9 | "test:types": "tsc --noEmit"
10 | },
11 | "dependencies": {
12 | "@swc/helpers": "^0.5.12",
13 | "@vercel/analytics": "^1.3.1",
14 | "next": "^12.3.4",
15 | "react": "^18.3.1",
16 | "react-countup": "^6.5.3",
17 | "react-dom": "^18.3.1",
18 | "react-responsive-carousel": "^3.2.23",
19 | "react-typed": "^2.0.12",
20 | "sharp": "^0.33.5"
21 | },
22 | "devDependencies": {
23 | "@next/eslint-plugin-next": "^14.2.7",
24 | "@types/node": "^22.5.2",
25 | "@types/react": "^18.3.5",
26 | "@types/react-dom": "^18.3.0",
27 | "@types/sharp": "^0.31.1",
28 | "sass": "^1.77.8",
29 | "typescript": "5.5.4"
30 | }
31 | }
--------------------------------------------------------------------------------
/apps/site/pages/404.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "./index";
10 |
--------------------------------------------------------------------------------
/apps/site/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Head, Html, Main, NextScript } from "next/document";
10 |
11 | export default function Document() {
12 | return (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/apps/site/public/commands.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
8 |
10 |
--------------------------------------------------------------------------------
/apps/site/public/embed-banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/embed-banner.png
--------------------------------------------------------------------------------
/apps/site/public/examples/arcade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/arcade.png
--------------------------------------------------------------------------------
/apps/site/public/examples/bedwars-leaderboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/bedwars-leaderboard.png
--------------------------------------------------------------------------------
/apps/site/public/examples/bedwars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/bedwars.png
--------------------------------------------------------------------------------
/apps/site/public/examples/blitzsg-leaderboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/blitzsg-leaderboard.png
--------------------------------------------------------------------------------
/apps/site/public/examples/buildbattle-leaderboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/buildbattle-leaderboard.png
--------------------------------------------------------------------------------
/apps/site/public/examples/duels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/duels.png
--------------------------------------------------------------------------------
/apps/site/public/examples/guild-member.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/guild-member.png
--------------------------------------------------------------------------------
/apps/site/public/examples/guild-overall-gexp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/guild-overall-gexp.png
--------------------------------------------------------------------------------
/apps/site/public/examples/guild-overall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/guild-overall.png
--------------------------------------------------------------------------------
/apps/site/public/examples/guild-top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/guild-top.png
--------------------------------------------------------------------------------
/apps/site/public/examples/recentgames.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/recentgames.png
--------------------------------------------------------------------------------
/apps/site/public/examples/session-murdermystery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/session-murdermystery.png
--------------------------------------------------------------------------------
/apps/site/public/examples/session-tntgames.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/session-tntgames.png
--------------------------------------------------------------------------------
/apps/site/public/examples/skin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/skin.png
--------------------------------------------------------------------------------
/apps/site/public/examples/skywars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/skywars.png
--------------------------------------------------------------------------------
/apps/site/public/examples/woolwars-leaderboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/examples/woolwars-leaderboard.png
--------------------------------------------------------------------------------
/apps/site/public/fonts/LexendDeca.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/fonts/LexendDeca.ttf
--------------------------------------------------------------------------------
/apps/site/public/hero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/hero.png
--------------------------------------------------------------------------------
/apps/site/public/images/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/images/apple-touch-icon.png
--------------------------------------------------------------------------------
/apps/site/public/images/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/images/favicon-16x16.png
--------------------------------------------------------------------------------
/apps/site/public/images/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/images/favicon-32x32.png
--------------------------------------------------------------------------------
/apps/site/public/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/apps/site/public/images/favicon.ico
--------------------------------------------------------------------------------
/apps/site/public/invite.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
8 |
12 |
--------------------------------------------------------------------------------
/apps/site/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Allow: /*
3 |
4 | Disallow: /api/*
--------------------------------------------------------------------------------
/apps/site/public/servers.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/apps/site/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "preserve",
5 | "lib": [
6 | "dom",
7 | "dom.iterable",
8 | "esnext"
9 | ],
10 | "target": "es5",
11 | "module": "ESNext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "resolvePackageJsonExports": false,
15 | "resolvePackageJsonImports": false,
16 | "forceConsistentCasingInFileNames": true,
17 | "noEmit": true,
18 | "incremental": true,
19 | "isolatedModules": true
20 | },
21 | "include": [
22 | "next-env.d.ts",
23 | "**/*.ts",
24 | "**/*.tsx"
25 | ]
26 | }
--------------------------------------------------------------------------------
/apps/support-bot/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/apps/support-bot/src/lib/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./command.listener.js";
10 | export * from "./welcomer.profile.js";
11 |
--------------------------------------------------------------------------------
/apps/support-bot/src/services/font-loader.service.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Container, Service } from "typedi";
10 | import { FontRenderer } from "@statsify/rendering";
11 | import { getMinecraftTexturePath } from "@statsify/assets";
12 |
13 | const renderer = new FontRenderer();
14 |
15 | Container.set(FontRenderer, renderer);
16 |
17 | @Service()
18 | export class FontLoaderService {
19 | public async init() {
20 | await renderer.loadImages(getMinecraftTexturePath("textures/font"));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/apps/support-bot/src/services/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./ticket.service.js";
10 | export * from "./mongo-loader.service.js";
11 | export * from "./tag.service.js";
12 | export * from "./user.service.js";
13 | export * from "./font-loader.service.js";
14 |
--------------------------------------------------------------------------------
/apps/support-bot/src/services/mongo-loader.service.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Container, Service } from "typedi";
10 | import { Tag, Ticket, User } from "@statsify/schemas";
11 | import { config } from "@statsify/util";
12 | import { createConnection } from "mongoose";
13 | import { getModelForClass } from "@typegoose/typegoose";
14 |
15 | @Service()
16 | export class MongoLoaderService {
17 | public init() {
18 | const connection = createConnection(config("database.mongoUri"));
19 |
20 | const models = [Ticket, Tag, User];
21 |
22 | models.forEach((modelClass) => {
23 | const model = getModelForClass(modelClass, { existingConnection: connection });
24 | Container.set(modelClass, model);
25 | });
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/apps/support-bot/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "preserve",
5 | },
6 | "include": [
7 | "src",
8 | "eslint.config.js"
9 | ]
10 | }
--------------------------------------------------------------------------------
/apps/verify-server/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/apps/verify-server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "verify-server",
3 | "version": "0.0.0",
4 | "private": true,
5 | "main": "dist/index.js",
6 | "type": "module",
7 | "scripts": {
8 | "start": "node --enable-source-maps .",
9 | "build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths",
10 | "test:types": "tsc --noEmit",
11 | "lint": "eslint"
12 | },
13 | "dependencies": {
14 | "@sentry/node": "^7.118.0",
15 | "@statsify/assets": "workspace:^",
16 | "@statsify/logger": "workspace:^",
17 | "@statsify/schemas": "workspace:^",
18 | "@statsify/util": "workspace:^",
19 | "@swc/helpers": "^0.5.12",
20 | "@typegoose/typegoose": "^12.6.0",
21 | "minecraft-protocol": "https://github.com/jacobk999/node-minecraft-protocol#cd8f06e3ee74f67dfc6deeeeb6b33b869bf705a2",
22 | "mongoose": "^8.5.2"
23 | }
24 | }
--------------------------------------------------------------------------------
/apps/verify-server/src/generate-code.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type { ReturnModelType } from "@typegoose/typegoose";
10 | import type { VerifyCode } from "@statsify/schemas";
11 |
12 | const createCode = () => Math.floor(Math.random() * (9999 - 1000 + 1) + 1000).toString();
13 |
14 | export const generateCode = async (
15 | verifyCodesModel: ReturnModelType
16 | ) => {
17 | let code = createCode();
18 |
19 | // Make sure the code is unique
20 | while (await verifyCodesModel.exists({ code }).lean().exec()) {
21 | code = createCode();
22 | }
23 |
24 | return code;
25 | };
26 |
--------------------------------------------------------------------------------
/apps/verify-server/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js"
6 | ]
7 | }
--------------------------------------------------------------------------------
/crowdin.yml:
--------------------------------------------------------------------------------
1 | pull_request_title: 'chore(i18n): update crowdin translation'
2 | commit_message: 'chore(i18n): update translations for `%language%`'
3 | append_commit_message:
4 | files:
5 | - source: /locales/en-US/default.json
6 | translation: /locales/%locale%/%original_file_name%
7 |
--------------------------------------------------------------------------------
/packages/api-client/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/packages/api-client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@statsify/api-client",
3 | "version": "0.0.0",
4 | "main": "dist/index.js",
5 | "types": "src/index.ts",
6 | "type": "module",
7 | "scripts": {
8 | "build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths",
9 | "test:types": "tsc --noEmit",
10 | "lint": "eslint"
11 | },
12 | "dependencies": {
13 | "@nestjs/common": "^10.4.1",
14 | "@nestjs/swagger": "^7.4.0",
15 | "@sentry/node": "^7.118.0",
16 | "@statsify/rendering": "workspace:^",
17 | "@statsify/schemas": "workspace:^",
18 | "@statsify/util": "workspace:^",
19 | "@swc/helpers": "^0.5.12",
20 | "axios": "^1.7.7"
21 | },
22 | "imports": {
23 | "#exceptions": {
24 | "types": "./src/exceptions/index.ts",
25 | "default": "./dist/exceptions/index.js"
26 | },
27 | "#responses": {
28 | "types": "./src/responses/index.ts",
29 | "default": "./dist/responses/index.js"
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/packages/api-client/src/exceptions/base.404.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { NotFoundException as BaseNotFoundException } from "@nestjs/common";
11 |
12 | export class NotFoundException extends BaseNotFoundException {
13 | @ApiProperty()
14 | public statusCode: number;
15 |
16 | @ApiProperty()
17 | public message: string;
18 |
19 | @ApiProperty()
20 | public error: string;
21 |
22 | public constructor(objectOrError?: string | any) {
23 | let error: any = { statusCode: 404, error: "Not Found" };
24 |
25 | if (typeof objectOrError === "string") {
26 | error.message = objectOrError;
27 | } else if (typeof objectOrError === "object") {
28 | error = { ...error, ...objectOrError };
29 | }
30 |
31 | super(error);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/packages/api-client/src/exceptions/guild.404.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { NotFoundException } from "./base.404.js";
11 |
12 | export class GuildNotFoundException extends NotFoundException {
13 | @ApiProperty()
14 | public displayName?: string;
15 |
16 | public constructor(displayName?: string) {
17 | super({ message: "guild", displayName });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/api-client/src/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./guild.404.js";
10 | export * from "./player.404.js";
11 | export * from "./status.404.js";
12 | export * from "./session.404.js";
13 |
--------------------------------------------------------------------------------
/packages/api-client/src/exceptions/player.404.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { NotFoundException } from "./base.404.js";
10 |
11 | export class PlayerNotFoundException extends NotFoundException {
12 | public constructor() {
13 | super("player");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/api-client/src/exceptions/session.404.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { NotFoundException } from "./base.404.js";
11 |
12 | export class SessionNotFoundException extends NotFoundException {
13 | @ApiProperty()
14 | public uuid: string;
15 |
16 | @ApiProperty()
17 | public displayName: string;
18 |
19 | public constructor(uuid: string, displayName: string) {
20 | super({
21 | message: "session",
22 | uuid,
23 | displayName,
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/api-client/src/exceptions/skin.404.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { NotFoundException } from "./base.404.js";
10 |
11 | export class SkinNotFoundException extends NotFoundException {
12 | public constructor() {
13 | super("skin");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/api-client/src/exceptions/status.404.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { NotFoundException } from "./base.404.js";
11 | import { Player, PlayerStatus } from "@statsify/schemas";
12 |
13 | export class StatusNotFoundException extends NotFoundException {
14 | @ApiProperty()
15 | public uuid: string;
16 |
17 | @ApiProperty()
18 | public displayName: string;
19 |
20 | @ApiProperty()
21 | public prefixName: string;
22 |
23 | @ApiProperty()
24 | public actions: PlayerStatus;
25 |
26 | public constructor(player: Player) {
27 | super({
28 | message: "status",
29 | uuid: player.uuid,
30 | displayName: player.displayName,
31 | prefixName: player.prefixName,
32 | actions: player.status,
33 | });
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/packages/api-client/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./api.service.js";
10 | export * from "./constants.js";
11 | export * from "./exceptions/index.js";
12 | export * from "./responses/index.js";
13 |
14 | export const GUILD_ID_REGEX = /^(?=[\da-f]{24}$)(\d+[a-f]|[a-f]+\d)/i;
15 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/delete.player.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { SuccessResponse } from "./success.response.js";
10 |
11 | export class DeletePlayerResponse extends SuccessResponse {}
12 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/error.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 |
11 | export class ErrorResponse {
12 | @ApiProperty()
13 | public statusCode: number;
14 |
15 | @ApiProperty({ type: [String] })
16 | public message: string[];
17 |
18 | @ApiProperty()
19 | public error: string;
20 | }
21 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.command-usage.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { SuccessResponse } from "./success.response.js";
10 |
11 | export class GetCommandUsageResponse extends SuccessResponse {
12 | public usage: Record;
13 | }
14 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.gamecounts.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { GameCounts } from "@statsify/schemas";
11 | import { SuccessResponse } from "./success.response.js";
12 |
13 | export class GetGamecountsResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public gamecounts: GameCounts;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.guild.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { Guild } from "@statsify/schemas";
11 | import { SuccessResponse } from "./success.response.js";
12 |
13 | export class GetGuildResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public guild: Guild;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.key.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { Key } from "@statsify/schemas";
11 | import { SuccessResponse } from "./success.response.js";
12 |
13 | export class GetKeyResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public key: Key;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.player-search.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { SuccessResponse } from "./success.response.js";
11 |
12 | export class GetPlayerSearchResponse extends SuccessResponse {
13 | @ApiProperty({ type: [String] })
14 | public players: string[];
15 | }
16 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.player.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { Player } from "@statsify/schemas";
11 | import { SuccessResponse } from "./success.response.js";
12 |
13 | export class GetPlayerResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public player: Player;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.session.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { Player } from "@statsify/schemas";
11 | import { SuccessResponse } from "./success.response.js";
12 |
13 | export class GetSessionResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public player: Player;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.skin-textures.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { Skin } from "@statsify/schemas";
11 | import { SuccessResponse } from "./success.response.js";
12 |
13 | export class GetSkinTexturesResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public skin: Skin;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.status.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { Status } from "@statsify/schemas";
11 | import { SuccessResponse } from "./success.response.js";
12 |
13 | export class GetStatusResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public status: Status;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.user.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { SuccessResponse } from "./success.response.js";
11 | import { User } from "@statsify/schemas";
12 |
13 | export class GetUserResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public user: User;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/get.watchdog.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 | import { SuccessResponse } from "./success.response.js";
11 | import { Watchdog } from "@statsify/schemas";
12 |
13 | export class GetWatchdogResponse extends SuccessResponse {
14 | @ApiProperty()
15 | public watchdog: Watchdog;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/post.rankings.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 |
11 | export class PostLeaderboardRankingsResponse {
12 | @ApiProperty({ description: "The name of the requested ranking" })
13 | public field: string;
14 |
15 | @ApiProperty()
16 | public name: string;
17 |
18 | @ApiProperty()
19 | public value: number | string;
20 |
21 | @ApiProperty()
22 | public rank: number;
23 | }
24 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/put.user-badge.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { SuccessResponse } from "./success.response.js";
10 |
11 | export class PutUserBadgeResponse extends SuccessResponse {}
12 |
--------------------------------------------------------------------------------
/packages/api-client/src/responses/success.response.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 |
11 | export class SuccessResponse {
12 | @ApiProperty()
13 | public success: boolean;
14 | }
15 |
--------------------------------------------------------------------------------
/packages/api-client/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js"
6 | ]
7 | }
--------------------------------------------------------------------------------
/packages/assets/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/packages/assets/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@statsify/assets",
3 | "version": "0.0.0",
4 | "main": "dist/index.js",
5 | "types": "src/index.ts",
6 | "type": "module",
7 | "scripts": {
8 | "build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths",
9 | "test:types": "tsc --noEmit",
10 | "lint": "eslint"
11 | },
12 | "dependencies": {
13 | "@statsify/logger": "workspace:^",
14 | "@statsify/schemas": "workspace:^",
15 | "@swc/helpers": "^0.5.12",
16 | "axios": "1.7.3",
17 | "skia-canvas": "https://github.com/samizdatco/skia-canvas/releases/download/v0.9.30/skia-canvas-v0.9.30-linux-x64-glibc.tar.gz"
18 | }
19 | }
--------------------------------------------------------------------------------
/packages/assets/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js"
6 | ]
7 | }
--------------------------------------------------------------------------------
/packages/discord/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/packages/discord/src/arguments/file.argument.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { AbstractArgument } from "./abstract.argument.js";
10 | import { ApplicationCommandOptionType } from "discord-api-types/v10";
11 | import { LocalizationString } from "#messages";
12 |
13 | export class FileArgument extends AbstractArgument {
14 | public description: LocalizationString;
15 | public type = ApplicationCommandOptionType.Attachment;
16 |
17 | public constructor(public name = "file", public required = false) {
18 | super();
19 | this.description = (t) => t("arguments.file");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/discord/src/arguments/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./abstract.argument.js";
10 | export * from "./choice.argument.js";
11 | export * from "./file.argument.js";
12 | export * from "./guild.argument.js";
13 | export * from "./mojang-player.argument.js";
14 | export * from "./number.argument.js";
15 | export * from "./player.argument.js";
16 | export * from "./text.argument.js";
17 | export * from "./user.argument.js";
18 |
--------------------------------------------------------------------------------
/packages/discord/src/arguments/mojang-player.argument.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { AbstractArgument } from "./abstract.argument.js";
10 | import { ApplicationCommandOptionType } from "discord-api-types/v10";
11 | import { LocalizationString } from "#messages";
12 |
13 | export class MojangPlayerArgument extends AbstractArgument {
14 | public name = "player";
15 | public description: LocalizationString;
16 | public type = ApplicationCommandOptionType.String;
17 |
18 | public constructor(public required = false) {
19 | super();
20 | this.description = (t) => t("arguments.mojang-player");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/discord/src/arguments/number.argument.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { AbstractArgument } from "./abstract.argument.js";
10 | import { ApplicationCommandOptionType } from "discord-api-types/v10";
11 | import { LocalizationString } from "#messages";
12 |
13 | export class NumberArgument extends AbstractArgument {
14 | public description: LocalizationString;
15 | public type = ApplicationCommandOptionType.Integer;
16 | public required = false;
17 |
18 | public constructor(
19 | public name = "count",
20 | public min_value?: number,
21 | public max_value?: number
22 | ) {
23 | super();
24 | this.description = (t) => t("arguments.number");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/discord/src/arguments/text.argument.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { AbstractArgument } from "./abstract.argument.js";
10 | import { ApplicationCommandOptionType } from "discord-api-types/v10";
11 | import { LocalizationString } from "#messages";
12 |
13 | export class TextArgument extends AbstractArgument {
14 | public type = ApplicationCommandOptionType.String;
15 |
16 | public constructor(
17 | public name = "content",
18 | public description: LocalizationString = (t) => t("arguments.text"),
19 | public required = true
20 | ) {
21 | super();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/discord/src/arguments/user.argument.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { AbstractArgument } from "./abstract.argument.js";
10 | import { ApplicationCommandOptionType } from "discord-api-types/v10";
11 | import { LocalizationString } from "#messages";
12 |
13 | export class UserArgument extends AbstractArgument {
14 | public description: LocalizationString;
15 | public type = ApplicationCommandOptionType.User;
16 |
17 | public constructor(public name = "user", public required = true) {
18 | super();
19 | this.description = (t) => t("arguments.user");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/discord/src/command/command.decorator.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Service } from "typedi";
10 | import type { CommandMetadata, CommandOptions } from "./command.interface.js";
11 |
12 | export function Command(options: CommandOptions): ClassDecorator {
13 | return (target) => {
14 | const metadata: CommandMetadata = {
15 | ...Reflect.getMetadata("statsify:command", target),
16 | ...options,
17 | name: options.name ?? target.name.toLowerCase().replace(/command$/, ""),
18 | methodName: "run",
19 | };
20 |
21 | Service()(target);
22 |
23 | Reflect.defineMetadata("statsify:command", metadata, target);
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/packages/discord/src/command/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./abstract-command.listener.js";
10 | export * from "./command.builder.js";
11 | export * from "./command.decorator.js";
12 | export * from "./command.loader.js";
13 | export * from "./command.poster.js";
14 | export * from "./command.resolvable.js";
15 | export * from "./subcommand.decorator.js";
16 | export * from "./command.context.js";
17 | export * from "./command.interface.js";
18 |
--------------------------------------------------------------------------------
/packages/discord/src/command/subcommand.decorator.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type { SubCommandMetadata, SubCommandOptions } from "./command.interface.js";
10 |
11 | export function SubCommand(options: SubCommandOptions): MethodDecorator {
12 | return (target, propertyKey) => {
13 | const oldMetadata = Reflect.getMetadata("statsify:subcommand", target);
14 |
15 | const metadata: SubCommandMetadata = {
16 | ...oldMetadata,
17 | [propertyKey]: {
18 | ...oldMetadata?.[propertyKey],
19 | ...options,
20 | name: options.name ?? (propertyKey as string).toLowerCase(),
21 | methodName: propertyKey as string,
22 | },
23 | };
24 |
25 | Reflect.defineMetadata("statsify:subcommand", metadata, target);
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/packages/discord/src/event/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./abstract-event.listener.js";
10 | export * from "./event.loader.js";
11 |
--------------------------------------------------------------------------------
/packages/discord/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import "reflect-metadata";
10 |
11 | export * from "./arguments/index.js";
12 | export * from "./command/index.js";
13 | export * from "./interaction/index.js";
14 | export * from "./messages/index.js";
15 | export * from "./services/index.js";
16 | export * from "./util/error.message.js";
17 | export * from "./event/index.js";
18 |
--------------------------------------------------------------------------------
/packages/discord/src/interaction/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./interaction.js";
10 | export * from "./interaction.content.js";
11 |
--------------------------------------------------------------------------------
/packages/discord/src/interaction/interaction.content.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type {
10 | APIAllowedMentions,
11 | APIAttachment,
12 | APIBaseComponent,
13 | APIEmbed,
14 | } from "discord-api-types/v10";
15 |
16 | export interface InteractionAttachment {
17 | name: string;
18 | data: Buffer;
19 | type?: string;
20 | }
21 |
22 | export interface InteractionContent {
23 | content?: string;
24 | tts?: boolean;
25 | ephemeral?: boolean;
26 | mentions?: APIAllowedMentions;
27 | embeds?: APIEmbed[];
28 | files?: InteractionAttachment[];
29 | attachments?: APIAttachment[];
30 | components?: APIBaseComponent[];
31 | }
32 |
--------------------------------------------------------------------------------
/packages/discord/src/messages/components/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./action-row.builder.js";
10 | export * from "./button.builder.js";
11 | export * from "./modal.builder.js";
12 | export * from "./select-menu.builder.js";
13 | export * from "./text-input.builder.js";
14 |
--------------------------------------------------------------------------------
/packages/discord/src/messages/components/parse-emoji.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { APIMessageComponentEmoji } from "discord-api-types/v10";
10 | import { LocalizationString, LocalizeFunction, translateField } from "../localize.js";
11 |
12 | export function parseEmoji(
13 | emote: LocalizationString,
14 | locale: LocalizeFunction
15 | ): APIMessageComponentEmoji {
16 | const emoji = translateField(locale, emote);
17 | const animated = emoji.startsWith("/g, "");
19 | const id = name.split(":")[1];
20 |
21 | return { name: name.replace(id, ""), animated, id };
22 | }
23 |
--------------------------------------------------------------------------------
/packages/discord/src/messages/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./base.message.js";
10 | export * from "./components/index.js";
11 | export * from "./embed.js";
12 | export * from "./localize.js";
13 |
--------------------------------------------------------------------------------
/packages/discord/src/services/guild.service.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { APIGuild } from "discord-api-types/v10";
10 | import { RestClient } from "tiny-discord";
11 | import { Service } from "typedi";
12 | import { parseDiscordResponse } from "#util/parse-discord-error";
13 |
14 | @Service()
15 | export class GuildService {
16 | public constructor(private readonly rest: RestClient) {}
17 |
18 | public async get(guildId: string): Promise {
19 | const response = await this.rest.get(`/guilds/${guildId}?with_counts=true`);
20 | return parseDiscordResponse(response);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/packages/discord/src/services/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./i18n-loader.service.js";
10 | export * from "./paginate.service.js";
11 | export * from "./api.service.js";
12 | export * from "./message.service.js";
13 | export * from "./channel.service.js";
14 | export * from "./member.service.js";
15 | export * from "./guild.service.js";
16 |
--------------------------------------------------------------------------------
/packages/discord/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js",
6 | "vitest.config.ts"
7 | ]
8 | }
--------------------------------------------------------------------------------
/packages/discord/vitest.config.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { config } from "../../vitest.shared.js";
10 |
11 | export default await config();
12 |
--------------------------------------------------------------------------------
/packages/logger/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/packages/logger/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@statsify/logger",
3 | "version": "0.0.0",
4 | "main": "dist/index.js",
5 | "types": "src/index.ts",
6 | "type": "module",
7 | "scripts": {
8 | "build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths",
9 | "test:types": "tsc --noEmit",
10 | "lint": "eslint"
11 | },
12 | "dependencies": {
13 | "@sentry/node": "^7.118.0",
14 | "@statsify/util": "workspace:^",
15 | "@swc/helpers": "^0.5.12",
16 | "chalk": "5.3.0",
17 | "luxon": "^3.5.0"
18 | },
19 | "devDependencies": {
20 | "@nestjs/common": "^10.4.1",
21 | "@types/luxon": "^3.4.2"
22 | }
23 | }
--------------------------------------------------------------------------------
/packages/logger/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js",
6 | "vitest.config.ts"
7 | ]
8 | }
--------------------------------------------------------------------------------
/packages/logger/vitest.config.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { config } from "../../vitest.shared.js";
10 |
11 | export default await config();
12 |
--------------------------------------------------------------------------------
/packages/math/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/packages/math/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@statsify/math",
3 | "version": "0.0.0",
4 | "main": "dist/index.js",
5 | "types": "src/index.ts",
6 | "type": "module",
7 | "scripts": {
8 | "build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths",
9 | "test:types": "tsc --noEmit",
10 | "lint": "eslint"
11 | },
12 | "dependencies": {
13 | "@statsify/util": "workspace:^",
14 | "@swc/helpers": "^0.5.12"
15 | }
16 | }
--------------------------------------------------------------------------------
/packages/math/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js",
6 | "vitest.config.ts"
7 | ]
8 | }
--------------------------------------------------------------------------------
/packages/math/vitest.config.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { config } from "../../vitest.shared.js";
10 |
11 | export default await config();
12 |
--------------------------------------------------------------------------------
/packages/rendering/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/packages/rendering/src/font/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./font-renderer.js";
10 | export * from "./tokens.js";
11 |
--------------------------------------------------------------------------------
/packages/rendering/src/hooks/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./loadImage.js";
10 | export * from "./useChildren.js";
11 | export * from "./useComponentSize.js";
12 | export * from "./useGradient.js";
13 |
--------------------------------------------------------------------------------
/packages/rendering/src/hooks/useChildren.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type { ElementNode } from "#jsx";
10 |
11 | type Child = [T] extends [ElementNode | ElementNode[]]
12 | ? ElementNode[]
13 | : T extends any[]
14 | ? T
15 | : [T];
16 |
17 | export const useChildren = (children: T): Child => children as any;
18 |
--------------------------------------------------------------------------------
/packages/rendering/src/intrinsics/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * as Box from "./Box.js";
10 | export * as Div from "./Div.js";
11 | export * as Image from "./Image.js";
12 | export * as Text from "./Text.js";
13 |
--------------------------------------------------------------------------------
/packages/rendering/src/jsx/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./create-instructions.js";
10 | export {
11 | type IntrinsicElement,
12 | type IntrinsicProps,
13 | type IntrinsicRenders,
14 | intrinsicElements,
15 | } from "./instrinsics.js";
16 | export * from "./render.js";
17 | export * from "./types.js";
18 | export * from "./util.js";
19 |
--------------------------------------------------------------------------------
/packages/rendering/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "preserve",
5 | },
6 | "include": [
7 | "src",
8 | "tests",
9 | "eslint.config.js",
10 | "vitest.config.ts"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/rendering/vitest.config.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { config } from "../../vitest.shared.js";
10 |
11 | export default await config("./.swcrc");
12 |
--------------------------------------------------------------------------------
/packages/schemas/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/packages/schemas/src/commands/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 |
11 | export class Commands {
12 | @Field({ mongo: { unique: true, index: true } })
13 | public name: string;
14 |
15 | @Field({ type: () => Object })
16 | public usage: Record;
17 | }
18 |
--------------------------------------------------------------------------------
/packages/schemas/src/game/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./game.js";
10 | export * from "./game-modes.js";
11 |
--------------------------------------------------------------------------------
/packages/schemas/src/guild/rank.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 | import type { APIData } from "@statsify/util";
11 |
12 | export class GuildRank {
13 | @Field()
14 | public name: string;
15 |
16 | @Field({ store: { required: false } })
17 | public tag?: string;
18 |
19 | @Field({ leaderboard: { enabled: false } })
20 | public priority: number;
21 |
22 | @Field({ store: { default: false } })
23 | public default: boolean;
24 |
25 | public constructor(data: APIData) {
26 | this.name = data.name;
27 | this.default = data.default;
28 | this.tag = data.tag;
29 | this.priority = data.priority;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/packages/schemas/src/key/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { ApiProperty } from "@nestjs/swagger";
10 |
11 | export class Key {
12 | @ApiProperty()
13 | public name: string;
14 |
15 | @ApiProperty()
16 | public lifetimeRequests: number;
17 |
18 | @ApiProperty()
19 | public recentRequests: number;
20 |
21 | @ApiProperty()
22 | public resetTime: number;
23 |
24 | @ApiProperty()
25 | public limit: number;
26 | }
27 |
--------------------------------------------------------------------------------
/packages/schemas/src/metadata/constants.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type { Constructor } from "@statsify/util";
10 |
11 | export const METADATA_KEY = "statsify";
12 |
13 | export const primitiveConstructors = [
14 | String,
15 | Number,
16 | Boolean,
17 | Date,
18 | BigInt,
19 | Symbol,
20 | ] as Constructor[];
21 |
--------------------------------------------------------------------------------
/packages/schemas/src/metadata/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./field/index.js";
10 | export * from "./metadata-scanner.js";
11 | export * from "./serialize.js";
12 | export * from "./deserialize.js";
13 | export * from "./field.options.js";
14 | export * from "./metadata.interface.js";
15 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/challenges/game-challenges.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export interface GameChallenges {
10 | total: number;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/challenges/modes/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./arcade.js";
10 | export * from "./arenabrawl.js";
11 | export * from "./bedwars.js";
12 | export * from "./buildbattle.js";
13 | export * from "./blitzsg.js";
14 | export * from "./cops-and-crims.js";
15 | export * from "./duels.js";
16 | export * from "./megawalls.js";
17 | export * from "./murdermystery.js";
18 | export * from "./paintball.js";
19 | export * from "./quake.js";
20 | export * from "./skywars.js";
21 | export * from "./smashheroes.js";
22 | export * from "./speeduhc.js";
23 | export * from "./tntgames.js";
24 | export * from "./turbokartracers.js";
25 | export * from "./uhc.js";
26 | export * from "./vampirez.js";
27 | export * from "./walls.js";
28 | export * from "./warlords.js";
29 | export * from "./woolgames.js";
30 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/challenges/util.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import type { FieldOptions } from "#metadata";
10 |
11 | export const challengeFieldData: FieldOptions = {
12 | leaderboard: {
13 | limit: 10_000,
14 | additionalFields: ["this.total"],
15 | },
16 | };
17 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/general/util.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { roundTo } from "@statsify/math";
10 |
11 | export const getNetworkExp = (networkLevel = 1) =>
12 | (Math.pow((networkLevel + 2.5) * 50, 2) - 30_625) / 2;
13 |
14 | export const getNetworkLevel = (networkExp = 0) =>
15 | networkExp ? roundTo(Math.sqrt(networkExp * 2 + 30_625) / 50 - 2.5) : 1;
16 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/arcade.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const ArcadeQuests = createGameModeQuests({
13 | game: FormattedGame.ARCADE,
14 | fieldPrefix: "arcade",
15 | daily: [
16 | { field: "gamer", propertyKey: "gamer" },
17 | { field: "winner", propertyKey: "winner" },
18 | ],
19 | weekly: [{ field: "specialist", propertyKey: "specialist" }],
20 | });
21 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/blitzsg.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const BlitzSGQuests = createGameModeQuests({
13 | game: FormattedGame.BLITZSG,
14 | fieldPrefix: "blitz",
15 | daily: [
16 | { field: "game_of_the_day", propertyKey: "gameOfTheDay" },
17 | { field: "win", propertyKey: "winNormal" },
18 | { field: "loot_chest_daily", propertyKey: "chestLooter" },
19 | { field: "kills", propertyKey: "kills" },
20 | ],
21 | weekly: [
22 | { field: "weekly_master", propertyKey: "master" },
23 | { field: "loot_chest_weekly", propertyKey: "expert" },
24 | ],
25 | });
26 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/buildbattle.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const BuildBattleQuests = createGameModeQuests({
13 | game: FormattedGame.BUILD_BATTLE,
14 | fieldPrefix: "build_battle",
15 | daily: [
16 | { field: "player", propertyKey: "player" },
17 | { field: "winner", propertyKey: "winner" },
18 | ],
19 | weekly: [{ field: "weekly", propertyKey: "masterArchitect" }],
20 | });
21 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/duels.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const DuelsQuests = createGameModeQuests({
13 | game: FormattedGame.DUELS,
14 | fieldPrefix: "duels",
15 | daily: [
16 | { field: "player", propertyKey: "player" },
17 | { field: "kills", propertyKey: "kills" },
18 | { field: "winner", propertyKey: "winner" },
19 | ],
20 | weekly: [
21 | { field: "weekly_kills", propertyKey: "weeklyKills" },
22 | { field: "weekly_wins", propertyKey: "weeklyWins" },
23 | ],
24 | });
25 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/megawalls.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const MegaWallsQuests = createGameModeQuests({
13 | game: FormattedGame.MEGAWALLS,
14 | fieldPrefix: "mega_walls",
15 | daily: [
16 | { field: "play", propertyKey: "gameOfTheDay" },
17 | { field: "win", propertyKey: "win" },
18 | { field: "kill", propertyKey: "kills" },
19 | { field: "faithful", propertyKey: "faithful" },
20 | ],
21 | weekly: [{ field: "weekly", propertyKey: "megaWaller" }],
22 | });
23 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/murdermystery.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const MurderMysteryQuests = createGameModeQuests({
13 | game: FormattedGame.MURDER_MYSTERY,
14 | fieldPrefix: "mm",
15 | daily: [
16 | { field: "daily_win", propertyKey: "winner" },
17 | { field: "daily_power_play", propertyKey: "powerPlay" },
18 | { field: "daily_target_kill", propertyKey: "hitman" },
19 | { field: "daily_infector", propertyKey: "infector" },
20 | ],
21 | weekly: [
22 | { field: "weekly_murderer_kills", propertyKey: "professional" },
23 | { field: "weekly_wins", propertyKey: "bigWinner" },
24 | ],
25 | });
26 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/paintball.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const PaintballQuests = createGameModeQuests({
13 | game: FormattedGame.PAINTBALL,
14 | daily: [
15 | { field: "paintballer", propertyKey: "paintballer" },
16 | { field: "paintball_killer", propertyKey: "killer" },
17 | ],
18 | weekly: [{ field: "paintball_expert", propertyKey: "expert" }],
19 | });
20 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/pit.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const PitQuests = createGameModeQuests({
13 | game: FormattedGame.PIT,
14 | fieldPrefix: "prototype_pit",
15 | daily: [
16 | { field: "daily_kills", propertyKey: "hunter" },
17 | { field: "daily_contract", propertyKey: "contracted" },
18 | ],
19 | weekly: [{ field: "weekly_gold", propertyKey: "doubleUp" }],
20 | });
21 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/quake.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const QuakeQuests = createGameModeQuests({
13 | game: FormattedGame.QUAKE,
14 | fieldPrefix: "quake",
15 | daily: [
16 | { field: "daily_play", propertyKey: "player" },
17 | { field: "daily_kill", propertyKey: "sniper" },
18 | { field: "daily_win", propertyKey: "winner" },
19 | ],
20 | weekly: [{ field: "weekly_play", propertyKey: "bazinga", name: "Bazinga!" }],
21 | });
22 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/smashheroes.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const SmashHeroesQuests = createGameModeQuests({
13 | game: FormattedGame.SMASH_HEROES,
14 | fieldPrefix: "supersmash",
15 | daily: [
16 | { field: "solo_win", propertyKey: "soloWin" },
17 | { field: "solo_kills", propertyKey: "soloKills" },
18 | { field: "team_win", propertyKey: "teamWin" },
19 | { field: "team_kills", propertyKey: "teamKills" },
20 | ],
21 | weekly: [{ field: "weekly_kills", propertyKey: "weeklyKills" }],
22 | });
23 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/speeduhc.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const SpeedUHCQuests = createGameModeQuests({
13 | game: FormattedGame.SPEED_UHC,
14 | daily: [
15 | { field: "solo_brawler", propertyKey: "soloSpeedBrawler" },
16 | { field: "team_brawler", propertyKey: "teamSpeedBrawler" },
17 | ],
18 | weekly: [{ field: "uhc_madness", propertyKey: "madness" }],
19 | });
20 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/turbokartracers.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const TurboKartRacersQuests = createGameModeQuests({
13 | game: FormattedGame.TURBO_KART_RACERS,
14 | fieldPrefix: "gingerbread",
15 | daily: [
16 | { field: "bling_bling", propertyKey: "blingBling" },
17 | { field: "maps", propertyKey: "internationalChampionship" },
18 | { field: "racer", propertyKey: "racer" },
19 | ],
20 | weekly: [{ field: "mastery", propertyKey: "turboKartRacers" }],
21 | });
22 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/uhc.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const UHCQuests = createGameModeQuests({
13 | game: FormattedGame.UHC,
14 | fieldPrefix: "uhc",
15 | daily: [
16 | { field: "team", propertyKey: "teamUHCChampions", fieldName: "Team UHC Champions" },
17 | { field: "solo", propertyKey: "soloUHCChampions", fieldName: "Solo UHC Champions" },
18 | { field: "dm", propertyKey: "uhcDeathmatch", fieldName: "UHC Deathmatch" },
19 | ],
20 | weekly: [{ field: "weekly", propertyKey: "uhcChampions", fieldName: "UHC Champions" }],
21 | });
22 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/vampirez.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const VampireZQuests = createGameModeQuests({
13 | game: FormattedGame.VAMPIREZ,
14 | fieldPrefix: "vampirez",
15 | daily: [
16 | { field: "daily_play", propertyKey: "vampirez", fieldName: "VampireZ" },
17 | { field: "daily_kill", propertyKey: "bloodDrinker" },
18 | { field: "daily_human_kill", propertyKey: "humanKiller" },
19 | { field: "daily_win", propertyKey: "dailyWin" },
20 | ],
21 | weekly: [
22 | { field: "weekly_win", propertyKey: "vampireWinner" },
23 | { field: "vampirez_weekly_kill", propertyKey: "vampireSlayer" },
24 | { field: "weekly_human_kill", propertyKey: "humanSlayer" },
25 | ],
26 | });
27 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/walls.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const WallsQuests = createGameModeQuests({
13 | game: FormattedGame.WALLS,
14 | fieldPrefix: "walls",
15 | daily: [
16 | { field: "daily_play", propertyKey: "waller" },
17 | { field: "daily_kill", propertyKey: "kills" },
18 | { field: "daily_win", propertyKey: "win" },
19 | ],
20 | weekly: [{ field: "weekly", propertyKey: "wallsWeekly" }],
21 | });
22 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/warlords.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const WarlordsQuests = createGameModeQuests({
13 | game: FormattedGame.WARLORDS,
14 | fieldPrefix: "warlords",
15 | daily: [
16 | { field: "ctf", propertyKey: "captureTheFlag" },
17 | { field: "tdm", propertyKey: "teamDeathmatch" },
18 | { field: "domination", propertyKey: "domination" },
19 | { field: "victorious", propertyKey: "victorious" },
20 | { field: "objectives", propertyKey: "carrySecured", name: "Carry, Secured!" },
21 | ],
22 | weekly: [
23 | { field: "dedication", propertyKey: "dedication" },
24 | { field: "all_star", propertyKey: "allStar" },
25 | ],
26 | });
27 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/quests/modes/woolgames.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { FormattedGame } from "#game";
10 | import { createGameModeQuests } from "../util.js";
11 |
12 | export const WoolGamesQuests = createGameModeQuests({
13 | game: FormattedGame.WOOLGAMES,
14 | daily: [
15 | { field: "wool_wars_daily_play", propertyKey: "firstPlayOfTheDay" },
16 | { field: "wool_wars_daily_wins", propertyKey: "winnerWinnerLambDinner" },
17 | { field: "wool_wars_daily_kills", propertyKey: "kills" },
18 | ],
19 | weekly: [
20 | { field: "wool_weekly_play", propertyKey: "kingOfTheHerd" },
21 | { field: "wool_wars_weekly_shears", propertyKey: "woolConnoisseur" },
22 | ],
23 | });
24 |
--------------------------------------------------------------------------------
/packages/schemas/src/player/gamemodes/speeduhc/util.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { findScoreIndex } from "@statsify/util";
10 |
11 | export const titleScores = [
12 | { req: 0, title: "Hiker" },
13 | { req: 50, title: "Jogger" },
14 | { req: 300, title: "Runner" },
15 | { req: 1050, title: "Sprinter" },
16 | { req: 2550, title: "Turbo" },
17 | { req: 5550, title: "Sanic" },
18 | { req: 15_550, title: "Hot Rod" },
19 | { req: 30_550, title: "Bolt" },
20 | { req: 55_550, title: "Zoom" },
21 | { req: 85_550, title: "God Speed" },
22 | ];
23 |
24 | export const getLevelIndex = (score: number): number =>
25 | findScoreIndex(titleScores, score);
26 |
--------------------------------------------------------------------------------
/packages/schemas/src/progression.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 | import { ratio } from "@statsify/math";
11 |
12 | export class Progression {
13 | @Field({ leaderboard: { enabled: false } })
14 | public current: number;
15 |
16 | @Field({ leaderboard: { enabled: false } })
17 | public max?: number;
18 |
19 | @Field({ leaderboard: { enabled: false } })
20 | public percent: number;
21 |
22 | public constructor(current: number, max: number) {
23 | this.current = current || 0;
24 |
25 | if (max) {
26 | this.max = max;
27 | this.percent = ratio(current, max);
28 | } else {
29 | this.percent = 1;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/packages/schemas/src/tags/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 |
11 | export class Tag {
12 | @Field({ mongo: { unique: true } })
13 | public name: string;
14 |
15 | @Field({ mongo: { unique: true } })
16 | public id: string;
17 |
18 | @Field()
19 | public content: string;
20 |
21 | @Field({ store: { required: false } })
22 | public attachment?: string;
23 | }
24 |
--------------------------------------------------------------------------------
/packages/schemas/src/ticket/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 |
11 | export class Ticket {
12 | @Field({ mongo: { unique: true } })
13 | public channel: string;
14 |
15 | @Field({ mongo: { unique: true, index: true } })
16 | public owner: string;
17 |
18 | @Field()
19 | public username: string;
20 | }
21 |
--------------------------------------------------------------------------------
/packages/schemas/src/user/footer.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 |
11 | export enum UserLogo {
12 | DEFAULT = 0,
13 | IRON = 100,
14 | GOLD = 200,
15 | DIAMOND = 300,
16 | EMERALD = 400,
17 | VENOM = 401,
18 | PINK = 402,
19 | AMETHYST = 420,
20 | SCULK = 421,
21 | NETHERITE = 422,
22 | RUBY = 423
23 | }
24 |
25 | export class UserFooter {
26 | @Field({ store: { required: false }, type: () => String })
27 | public message?: string | null;
28 |
29 | @Field({ store: { required: false }, type: () => Number })
30 | public icon?: UserLogo;
31 | }
32 |
--------------------------------------------------------------------------------
/packages/schemas/src/user/theme.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 |
11 | export enum UserFont {
12 | DEFAULT = "default",
13 | HD = "hd"
14 | }
15 |
16 | export enum UserPalette {
17 | DEFAULT = "default",
18 | LIGHT = "light",
19 | DARK = "dark",
20 | NO_BACKGROUNDS = "no-backgrounds"
21 | }
22 |
23 | export enum UserBoxes {
24 | DEFAULT = "default",
25 | HD = "hd",
26 | UHD = "uhd"
27 | }
28 |
29 | export class UserTheme {
30 | @Field({ store: { required: false }, type: () => String })
31 | public font?: UserFont;
32 |
33 | @Field({ store: { required: false }, type: () => String })
34 | public palette?: UserPalette;
35 |
36 | @Field({ store: { required: false }, type: () => String })
37 | public boxes?: UserBoxes;
38 | }
39 |
--------------------------------------------------------------------------------
/packages/schemas/src/util/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./leaderboard-scanner.js";
10 | export * from "./create-historical-player.js";
11 | export * from "./historical-scanner.js";
12 |
--------------------------------------------------------------------------------
/packages/schemas/src/util/parse-fields.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export function parseAdditionalFields(field: string, additionalKey: string) {
10 | if (!additionalKey.startsWith("this.")) return additionalKey;
11 |
12 | const fieldParts = field.split(".");
13 | fieldParts.pop();
14 |
15 | const additionalFieldParts = additionalKey.split(".").slice(1);
16 | const ending = additionalFieldParts.pop();
17 |
18 | if (!additionalFieldParts.length) return [...fieldParts, ending].join(".");
19 |
20 | const splitIndex = fieldParts.findIndex((part) => additionalFieldParts.includes(part));
21 |
22 | if (splitIndex === -1)
23 | return [...fieldParts, ...additionalFieldParts, ending].join(".");
24 |
25 | return [...fieldParts.slice(0, splitIndex), ...additionalFieldParts, ending].join(".");
26 | }
27 |
--------------------------------------------------------------------------------
/packages/schemas/src/verify-codes/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 |
11 | export class VerifyCode {
12 | @Field({ mongo: { unique: true } })
13 | public uuid: string;
14 |
15 | @Field({ mongo: { unique: true } })
16 | public code: string;
17 |
18 | @Field({ mongo: { expires: 300, default: Date.now } })
19 | public expireAt: Date;
20 |
21 | public constructor(uuid: string, code: string) {
22 | this.uuid = uuid;
23 | this.code = code;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/schemas/src/watchdog/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 | import { WatchdogMode } from "./mode.js";
11 | import { deepAdd } from "@statsify/math";
12 | import type { APIData } from "@statsify/util";
13 |
14 | export class Watchdog {
15 | @Field()
16 | public overall: WatchdogMode;
17 |
18 | @Field()
19 | public watchdog: WatchdogMode;
20 |
21 | @Field()
22 | public staff: WatchdogMode;
23 |
24 | public constructor(data: APIData) {
25 | this.watchdog = new WatchdogMode(data, "watchdog");
26 | this.staff = new WatchdogMode(data, "staff");
27 | this.overall = deepAdd(this.watchdog, this.staff);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/schemas/src/watchdog/mode.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { Field } from "#metadata";
10 | import type { APIData } from "@statsify/util";
11 |
12 | export class WatchdogMode {
13 | @Field()
14 | public bans: number;
15 |
16 | @Field()
17 | public lastMinute: number;
18 |
19 | @Field()
20 | public lastDay: number;
21 |
22 | public constructor(data: APIData, mode: string) {
23 | this.bans = data[`${mode}_total`];
24 | this.lastMinute = data[`${mode}_lastMinute`];
25 | this.lastDay = data[`${mode}_rollingDaily`];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/packages/schemas/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js",
6 | "vitest.config.ts"
7 | ]
8 | }
--------------------------------------------------------------------------------
/packages/schemas/vitest.config.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { config } from "../../vitest.shared.js";
10 |
11 | export default await config();
12 |
--------------------------------------------------------------------------------
/packages/skin-renderer/build.rs:
--------------------------------------------------------------------------------
1 | fn main() {
2 | napi_build::setup();
3 | }
4 |
--------------------------------------------------------------------------------
/packages/skin-renderer/examples/node.ts:
--------------------------------------------------------------------------------
1 | import { renderSkin } from "@statsify/skin-renderer";
2 | import { writeFile } from "node:fs/promises";
3 |
4 | const response = await fetch("URL_TO_SKIN");
5 | const skin = await response.arrayBuffer();
6 |
7 | const render = await renderSkin(new Uint8Array(skin), true, true);
8 | await writeFile("render.png", render);
--------------------------------------------------------------------------------
/packages/skin-renderer/examples/wasm.ts:
--------------------------------------------------------------------------------
1 | import init, { SkinRenderer, SkinMessenger } from "@statsify/skin-renderer/wasm"
2 |
3 | await init();
4 |
5 | const renderer = new SkinRenderer();
6 | renderer.run();
7 |
8 | const response = await fetch("URL_TO_SKIN");
9 | const skin = await response.arrayBuffer();
10 |
11 | SkinMessenger.registerCanvas("skin");
12 | SkinMessenger.renderSkin("skin", new Uint8Array(skin), true, true);
13 |
--------------------------------------------------------------------------------
/packages/skin-renderer/index.d.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 |
4 | /* auto-generated by NAPI-RS */
5 |
6 | export declare function renderSkin(skin: Uint8Array, slim: boolean, extruded: boolean): Promise
7 |
--------------------------------------------------------------------------------
/packages/skin-renderer/models/alex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/packages/skin-renderer/models/alex.png
--------------------------------------------------------------------------------
/packages/skin-renderer/models/steve.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Statsify/statsify/a0b6de7f7f231259abac9e203c415915e5008900/packages/skin-renderer/models/steve.png
--------------------------------------------------------------------------------
/packages/skin-renderer/src/buffer_dimensions.rs:
--------------------------------------------------------------------------------
1 | use std::mem::size_of;
2 |
3 | pub struct BufferDimensions {
4 | pub width: u32,
5 | pub height: u32,
6 | pub unpadded_bytes_per_row: u32,
7 | pub padded_bytes_per_row: u32,
8 | }
9 |
10 | impl BufferDimensions {
11 | pub fn new(width: u32, height: u32) -> Self {
12 | let bytes_per_pixel = size_of::() as u32;
13 | let unpadded_bytes_per_row = width * bytes_per_pixel;
14 |
15 | let align = wgpu::COPY_BYTES_PER_ROW_ALIGNMENT;
16 |
17 | let padded_bytes_per_row_padding = (align - unpadded_bytes_per_row % align) % align;
18 | let padded_bytes_per_row = unpadded_bytes_per_row + padded_bytes_per_row_padding;
19 |
20 | Self {
21 | width,
22 | height,
23 | unpadded_bytes_per_row,
24 | padded_bytes_per_row,
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/packages/skin-renderer/src/camera/uniform.rs:
--------------------------------------------------------------------------------
1 | use bytemuck::{Pod, Zeroable};
2 | use cgmath::Matrix4;
3 |
4 | use super::{Camera, CameraBehavior};
5 |
6 | #[rustfmt::skip]
7 | const OPENGL_TO_WGPU_MATRIX: Matrix4 = Matrix4::new(
8 | 1.0, 0.0, 0.0, 0.0,
9 | 0.0, 1.0, 0.0, 0.0,
10 | 0.0, 0.0, 0.5, 0.0,
11 | 0.0, 0.0, 0.5, 1.0,
12 | );
13 |
14 | #[repr(C)]
15 | #[derive(Copy, Clone, Pod, Zeroable)]
16 | pub struct CameraUniform {
17 | view_position: [f32; 4],
18 | view_proj: [[f32; 4]; 4],
19 | }
20 |
21 | impl CameraUniform {
22 | pub fn new(camera: &Camera) -> Self {
23 | let mut base = Self {
24 | view_position: [0.0; 4],
25 | view_proj: [[0.0; 4]; 4],
26 | };
27 |
28 | base.update_view_projection(camera);
29 |
30 | base
31 | }
32 |
33 | pub fn update_view_projection(&mut self, camera: &Camera) {
34 | self.view_position = camera.eye().to_homogeneous().into();
35 | self.view_proj = (OPENGL_TO_WGPU_MATRIX * camera.view_projection_matrix()).into();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/skin-renderer/src/geometry/box_geometry.rs:
--------------------------------------------------------------------------------
1 | use cgmath::Vector3;
2 | use strum::IntoEnumIterator;
3 |
4 | use super::orientation::Orientation;
5 | use super::prism::{Prism, TextureRegion};
6 | use super::{Geometry, Rotation};
7 |
8 | pub struct BoxGeometry {
9 | pub position: Vector3,
10 | pub dimensions: Vector3,
11 | pub texture_region: TextureRegion,
12 | pub rotation: Option,
13 | }
14 |
15 | impl BoxGeometry {
16 | pub fn create(self) -> Geometry {
17 | let mut geometry = Geometry::new(vec![], vec![]);
18 | let prism = Prism::new(self.dimensions, self.position);
19 |
20 | Orientation::iter()
21 | .for_each(|face| geometry.combine(prism.vertices(&face, &self.texture_region)));
22 |
23 | if let Some(rotation) = self.rotation {
24 | geometry.rotate_around(rotation);
25 | }
26 |
27 | geometry
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/skin-renderer/src/geometry/coordinate.rs:
--------------------------------------------------------------------------------
1 | pub type Coordinate = (T, T);
2 |
--------------------------------------------------------------------------------
/packages/skin-renderer/src/instance.rs:
--------------------------------------------------------------------------------
1 | use bytemuck::{Pod, Zeroable};
2 |
3 | use crate::geometry::vertex::VertexDescriptor;
4 |
5 | #[repr(C)]
6 | #[derive(Debug, Copy, Clone, Pod, Zeroable)]
7 | pub struct InstanceRaw {
8 | pub model: [[f32; 4]; 4],
9 | pub normal: [[f32; 3]; 3],
10 | }
11 |
12 | impl VertexDescriptor for InstanceRaw {
13 | // N by N matrix takes up N vectorN slots
14 | // Start at shader location 5 to avoid conflict with Vertex
15 | const ATTRIBUTES: &'static [wgpu::VertexAttribute] = &wgpu::vertex_attr_array![
16 | // Model Matrix
17 | 5 => Float32x4,
18 | 6 => Float32x4,
19 | 7 => Float32x4,
20 | 8 => Float32x4,
21 | // Normal Matrix
22 | 9 => Float32x3,
23 | 10 => Float32x3,
24 | 11 => Float32x3
25 | ];
26 | const STEP_MODE: wgpu::VertexStepMode = wgpu::VertexStepMode::Instance;
27 | }
28 |
--------------------------------------------------------------------------------
/packages/skin-renderer/src/lib.rs:
--------------------------------------------------------------------------------
1 | #[cfg(not(target_arch = "wasm32"))]
2 | mod buffer_dimensions;
3 | mod camera;
4 | mod error;
5 | mod geometry;
6 | mod instance;
7 | mod light;
8 | mod material;
9 | mod mesh;
10 | mod model;
11 | #[cfg(not(target_arch = "wasm32"))]
12 | mod native;
13 | mod renderer;
14 | mod skin_loader;
15 | mod texture;
16 | #[cfg(target_arch = "wasm32")]
17 | mod wasm;
18 | #[cfg(not(target_arch = "wasm32"))]
19 | pub use error::*;
20 | #[cfg(not(target_arch = "wasm32"))]
21 | pub use native::render_skin;
22 |
--------------------------------------------------------------------------------
/packages/skin-renderer/src/light/mod.rs:
--------------------------------------------------------------------------------
1 | use bytemuck::{Pod, Zeroable};
2 |
3 | use crate::camera::{Camera, CameraBehavior};
4 |
5 | // Uniforms require 16 byte spacing so we use padding fields
6 | #[repr(C)]
7 | #[derive(Debug, Copy, Clone, Pod, Zeroable)]
8 | pub struct LightUniform {
9 | pub position: [f32; 3],
10 | _padding: u32,
11 |
12 | pub color: [f32; 3],
13 | _padding2: u32,
14 | }
15 |
16 | impl LightUniform {
17 | pub fn new(position: [f32; 3], color: [f32; 3]) -> Self {
18 | Self {
19 | position,
20 | color,
21 | _padding: 0,
22 | _padding2: 0,
23 | }
24 | }
25 |
26 | pub fn update_position(&mut self, position: [f32; 3]) {
27 | self.position = position;
28 | }
29 | }
30 |
31 | impl From<&Camera> for LightUniform {
32 | fn from(camera: &Camera) -> Self {
33 | Self::new(camera.eye().into(), [1.0, 1.0, 1.0])
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/packages/skin-renderer/src/material/mod.rs:
--------------------------------------------------------------------------------
1 | use crate::texture::Texture;
2 |
3 | pub struct Material {
4 | pub bind_group: wgpu::BindGroup,
5 | }
6 |
7 | impl Material {
8 | pub fn new(
9 | device: &wgpu::Device,
10 | diffuse_texture: Texture,
11 | layout: &wgpu::BindGroupLayout,
12 | ) -> Self {
13 | let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
14 | layout,
15 | entries: &[
16 | wgpu::BindGroupEntry {
17 | binding: 0,
18 | resource: wgpu::BindingResource::TextureView(&diffuse_texture.view),
19 | },
20 | wgpu::BindGroupEntry {
21 | binding: 1,
22 | resource: wgpu::BindingResource::Sampler(&diffuse_texture.sampler),
23 | },
24 | ],
25 | label: None,
26 | });
27 |
28 | Self { bind_group }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/packages/util/eslint.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export { default } from "../../eslint.config.js";
10 |
--------------------------------------------------------------------------------
/packages/util/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@statsify/util",
3 | "version": "0.0.0",
4 | "main": "dist/index.js",
5 | "types": "src/index.ts",
6 | "type": "module",
7 | "scripts": {
8 | "build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths",
9 | "test:types": "tsc --noEmit",
10 | "lint": "eslint"
11 | },
12 | "dependencies": {
13 | "@swc/helpers": "^0.5.12"
14 | }
15 | }
--------------------------------------------------------------------------------
/packages/util/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export * from "./flatten.js";
10 | export * from "./unflatten.js";
11 | export * from "./minecraft-colors.js";
12 | export * from "./config.js";
13 | export * from "./util.js";
14 | export * from "./types.js";
15 |
--------------------------------------------------------------------------------
/packages/util/src/types.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | export type APIData = Record;
10 |
11 | export type RemoveMethods = Pick<
12 | T,
13 | // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
14 | { [Key in keyof T]: T[Key] extends Function ? never : Key }[keyof T]
15 | >;
16 |
17 | export type Constructor = new (...args: any[]) => T;
18 | export type UnwrapConstructor = T extends Constructor ? U : never;
19 | export type Circular = T;
20 |
--------------------------------------------------------------------------------
/packages/util/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "include": [
4 | "src",
5 | "eslint.config.js",
6 | "vitest.config.ts"
7 | ]
8 | }
--------------------------------------------------------------------------------
/packages/util/vitest.config.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { config } from "../../vitest.shared.js";
10 |
11 | export default await config();
12 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - "apps/**"
3 | - "packages/**"
4 | - "assets/**"
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": ["config:base", "helpers:pinGitHubActionDigests", "group:allNonMajor"],
4 | "labels": ["dependencies"],
5 | "schedule": ["before 12pm on Sunday"],
6 | "npm": {
7 | "rangeStrategy": "bump",
8 | "packageRules": [
9 | {
10 | "matchUpdateTypes": ["minor", "patch"],
11 | "matchCurrentVersion": "!/^0/",
12 | "automerge": true,
13 | "commitMessagePrefix": "chore(deps):"
14 | },
15 | {
16 | "matchPackagePatterns": ["chalk", "@swc/cli", "@swc/core", "@swc/jest"],
17 | "enabled": false
18 | },
19 | {
20 | "matchDepTypes": ["engines"],
21 | "enabled": false
22 | }
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/rustfmt.toml:
--------------------------------------------------------------------------------
1 | tab_spaces = 2
--------------------------------------------------------------------------------
/tsconfig.base.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowJs": true,
4 | "esModuleInterop": true,
5 | "experimentalDecorators": true,
6 | "verbatimModuleSyntax": false,
7 | "moduleResolution": "NodeNext",
8 | "module": "NodeNext",
9 | "resolvePackageJsonExports": true,
10 | "resolvePackageJsonImports": true,
11 | "skipDefaultLibCheck": true,
12 | "skipLibCheck": true,
13 | "resolveJsonModule": true,
14 | "downlevelIteration": true,
15 | "strictPropertyInitialization": false,
16 | "allowSyntheticDefaultImports": true,
17 | "target": "ES2022",
18 | "strict": true,
19 | "types": [
20 | "vitest/importMeta"
21 | ]
22 | },
23 | "exclude": [
24 | "node_modules"
25 | ]
26 | }
--------------------------------------------------------------------------------
/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turborepo.org/schema.json",
3 | "globalDependencies": ["pnpm.lock", "tsconfig.json", ".swcrc", "eslint.config.js"],
4 | "ui": "tui",
5 | "tasks": {
6 | "build": {
7 | "outputs": ["dist/**", ".next/**", "pkg/**"],
8 | "dependsOn": ["^build"]
9 | },
10 | "test:types": {
11 | "outputs": [],
12 | "dependsOn": ["^test:types"]
13 | },
14 | "test": {
15 | "outputs": [],
16 | "dependsOn": ["build", "^test"]
17 | },
18 | "test:coverage": {
19 | "outputs": ["coverage"],
20 | "dependsOn": ["build", "^test:coverage"]
21 | },
22 | "lint": {
23 | "outputs": [],
24 | "dependsOn": ["^lint"]
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/vitest.shared.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { defineConfig } from "vitest/config";
10 | import { readFile } from "node:fs/promises";
11 | import { swc } from "./vite.swc.js";
12 |
13 | async function getSwcrc(path?: string) {
14 | const config = await readFile(path ?? "./.swcrc", "utf8").then(JSON.parse);
15 | delete config["$schema"];
16 | return config;
17 | }
18 |
19 | export async function config(path?: string) {
20 | const swcrc = await getSwcrc(path);
21 |
22 | return defineConfig({
23 | optimizeDeps: {
24 | disabled: true,
25 | },
26 | envPrefix: "VITEST",
27 | test: {
28 | environment: "node",
29 | includeSource: ["./src/**/*.ts", "./src/**/*.tsx"],
30 | globals: false,
31 | passWithNoTests: true,
32 | },
33 | plugins: [swc.vite(swcrc)],
34 | });
35 | }
36 |
--------------------------------------------------------------------------------
/vitest.workspace.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Statsify
3 | *
4 | * This source code is licensed under the GNU GPL v3 license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | * https://github.com/Statsify/statsify/blob/main/LICENSE
7 | */
8 |
9 | import { defineWorkspace } from "vitest/config";
10 |
11 | export default defineWorkspace([
12 | "./apps/*/vitest.config.ts",
13 | "./packages/*/vitest.config.ts",
14 | ]);
15 |
--------------------------------------------------------------------------------