From fa2c7e81916f1f1e9989624bfd19359f0131ac27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aura=20Rom=C3=A1n?= Date: Sun, 22 Oct 2023 00:19:16 +0200 Subject: [PATCH] refactor: rewrite to djs v14 --- .github/workflows/continuous-integration.yml | 12 +- .github/workflows/update-tlds.yml | 4 +- ...d.js-utilities-npm-4.12.0-cff496cdca.patch | 22 - ...phire-framework-npm-2.5.1-e9e3e6d600.patch | 32 - .../discord.js-npm-13.16.0-03bbf983c5.patch | 93 - Dockerfile | 2 - babel.config.js | 23 - jest.config.mjs | 56 - package.json | 124 +- scripts/workerTsLoader.js | 9 - src/.env | 2 +- src/.env.development | 2 +- src/Skyra.ts | 2 +- src/arguments/boolean.ts | 21 +- src/arguments/case.ts | 4 +- src/arguments/channelName.ts | 4 +- src/arguments/cleanString.ts | 4 +- src/arguments/command.ts | 6 +- src/arguments/commandMatch.ts | 6 +- src/arguments/commandName.ts | 4 +- src/arguments/duration.ts | 4 +- src/arguments/emoji.ts | 6 +- src/arguments/invite.ts | 4 +- src/arguments/language.ts | 4 +- src/arguments/piece.ts | 4 +- src/arguments/range.ts | 4 +- src/arguments/reset.ts | 4 +- src/arguments/roleName.ts | 4 +- src/arguments/snowflake.ts | 4 +- src/arguments/store.ts | 7 +- src/arguments/textChannelName.ts | 4 +- src/arguments/textOrNewsChannelName.ts | 4 +- src/arguments/time.ts | 11 +- src/arguments/timespan.ts | 4 +- src/arguments/userName.ts | 4 +- src/commands/Admin/conf.ts | 29 +- src/commands/Admin/roleset.ts | 18 +- src/commands/Animal/bunny.ts | 10 +- src/commands/Animal/dog.ts | 10 +- src/commands/Animal/fox.ts | 10 +- src/commands/Animal/kitty.ts | 22 +- src/commands/Animal/shibe.ts | 10 +- src/commands/Fun/dice.ts | 2 +- src/commands/Fun/escaperope.ts | 6 +- src/commands/Fun/love.ts | 8 +- src/commands/Fun/pop.ts | 9 +- src/commands/Fun/rate.ts | 2 +- src/commands/Games/c4.ts | 4 +- src/commands/Games/hungergames.ts | 11 +- src/commands/Games/tictactoe.ts | 4 +- src/commands/Games/trivia.ts | 20 +- src/commands/General/help.ts | 49 +- src/commands/General/info.ts | 58 +- src/commands/General/invite.ts | 16 +- src/commands/General/ping.ts | 2 +- src/commands/General/v7-artiel.ts | 2 +- src/commands/General/v7-iriss.ts | 32 - src/commands/General/v7-nayre.ts | 74 - src/commands/General/v7-nekokai.ts | 57 - src/commands/General/v7-pokemon.ts | 35 - src/commands/General/v7-teryl.ts | 42 - src/commands/General/v7.ts | 122 - .../manage-command-auto-delete.ts | 16 +- .../Configuration/manage-command-channel.ts | 16 +- .../Configuration/manage-reaction-roles.ts | 24 +- .../Configuration/setIgnoreChannels.ts | 6 +- .../Management/Configuration/setPrefix.ts | 2 +- src/commands/Management/Helpers/guild-info.ts | 61 +- src/commands/Management/Helpers/role-info.ts | 12 +- .../Management/Members/stickyRoles.ts | 18 +- .../Message Filters/attachmentMode.ts | 15 +- .../Message Filters/capitalsMode.ts | 15 +- .../Management/Message Filters/filter.ts | 18 +- .../Management/Message Filters/filterMode.ts | 15 +- .../Management/Message Filters/inviteMode.ts | 15 +- .../Management/Message Filters/linkMode.ts | 15 +- .../Management/Message Filters/messageMode.ts | 15 +- .../Management/Message Filters/newlineMode.ts | 15 +- .../Reaction Filters/reactionMode.ts | 15 +- src/commands/Management/create-mute.ts | 20 +- src/commands/Management/permissionNodes.ts | 30 +- src/commands/Management/roles.ts | 28 +- src/commands/Misc/remindme.ts | 10 +- src/commands/Misc/snipe.ts | 8 +- src/commands/Moderation/Management/history.ts | 29 +- .../Moderation/Management/moderations.ts | 55 +- src/commands/Moderation/Management/mutes.ts | 28 +- .../Moderation/Management/warnings.ts | 24 +- .../Restriction/restrictAttachment.ts | 2 +- .../Moderation/Restriction/restrictEmbed.ts | 2 +- .../Moderation/Restriction/restrictEmoji.ts | 2 +- .../Restriction/restrictReaction.ts | 2 +- .../Moderation/Restriction/restrictVoice.ts | 2 +- .../Restriction/unrestrictAttachment.ts | 2 +- .../Moderation/Restriction/unrestrictEmbed.ts | 2 +- .../Moderation/Restriction/unrestrictEmoji.ts | 2 +- .../Restriction/unrestrictReaction.ts | 2 +- .../Moderation/Restriction/unrestrictVoice.ts | 2 +- src/commands/Moderation/Utilities/case.ts | 12 +- .../Moderation/Utilities/permissions.ts | 12 +- src/commands/Moderation/Utilities/reason.ts | 4 +- src/commands/Moderation/Utilities/slowmode.ts | 4 +- src/commands/Moderation/Utilities/time.ts | 11 +- src/commands/Moderation/addrole.ts | 6 +- src/commands/Moderation/ban.ts | 8 +- src/commands/Moderation/dehoist.ts | 10 +- src/commands/Moderation/kick.ts | 8 +- src/commands/Moderation/lockdown.ts | 38 +- src/commands/Moderation/mute.ts | 2 +- src/commands/Moderation/prune.ts | 23 +- src/commands/Moderation/removerole.ts | 6 +- src/commands/Moderation/setnickname.ts | 6 +- src/commands/Moderation/softban.ts | 8 +- src/commands/Moderation/togglemoderationdm.ts | 4 +- src/commands/Moderation/unban.ts | 14 +- src/commands/Moderation/unmute.ts | 2 +- src/commands/Moderation/unwarn.ts | 4 +- src/commands/Moderation/vmute.ts | 4 +- src/commands/Moderation/voicekick.ts | 4 +- src/commands/Moderation/vunmute.ts | 4 +- src/commands/System/Admin/eval.ts | 4 +- src/commands/System/Admin/reboot.ts | 2 +- src/commands/System/donate.ts | 8 +- src/commands/System/support.ts | 8 +- src/commands/Tools/avatar.ts | 18 +- src/commands/Tools/vote.ts | 6 +- src/commands/Tools/whois.ts | 44 +- src/commands/Twitch/twitchsubscription.ts | 18 +- src/config.ts | 67 +- src/languages/index.ts | 12 +- src/lib/SkyraClient.ts | 35 +- src/lib/api/ApiTransformers.ts | 58 +- src/lib/api/{types.d.ts => types.ts} | 2 +- src/lib/api/utils.ts | 35 +- src/lib/database/database.config.ts | 24 +- src/lib/database/entities/BannerEntity.ts | 19 - src/lib/database/entities/GuildEntity.ts | 14 +- .../entities/GuildSubscriptionEntity.ts | 4 +- src/lib/database/entities/ModerationEntity.ts | 14 +- src/lib/database/entities/ScheduleEntity.ts | 2 +- .../entities/TwitchSubscriptionEntity.ts | 2 +- src/lib/database/entities/index.ts | 15 +- src/lib/database/index.ts | 11 +- src/lib/database/keys/index.ts | 2 +- src/lib/database/keys/settings/All.ts | 12 +- src/lib/database/keys/settings/Channels.ts | 4 +- src/lib/database/keys/settings/Messages.ts | 2 +- src/lib/database/keys/settings/Selfmod/All.ts | 18 +- .../1594413973851-V01_MigrateClientStorage.ts | 2 +- ...1594582514749-V02_MigrateDashboardUsers.ts | 2 +- .../1594582905434-V04_MigrateGiveaways.ts | 2 +- .../1594583103788-V05_MigrateGuilds.ts | 2 +- .../1594583300041-V07_MigrateModeration.ts | 2 +- .../1594625931497-V08_MigrateUsers.ts | 2 +- ...629639526-V10_MigrateTwitchSubscription.ts | 2 +- .../1594649287397-V11_MigrateRpg.ts | 2 +- .../1594757329224-V13_MigrateAnalytics.ts | 2 +- ...1594843508131-V14_FixRpgGuildRankEntity.ts | 2 +- .../1594922379627-V15_ClearDashboardUsers.ts | 2 +- .../1595064247769-V16_CreateSpousesTable.ts | 2 +- .../1596289368633-V18_CreateIgnoreLogs.ts | 2 +- .../1596299849081-V19_MigrateReactionRoles.ts | 2 +- ...97088981807-V20_UpdateGuildEntityChecks.ts | 5 +- .../1597266996401-V21_AddMissingChecks.ts | 5 +- ...98010877863-V22_AddSelfStarCapabilities.ts | 2 +- .../migrations/1598083459734-V23_AddGIData.ts | 2 +- .../1606138444111-V29_AttachmentMode.ts | 2 +- .../1606411800922-V30_AttachmentModeChecks.ts | 5 +- ...88150-V32_SeparatedMemberNameUpdateLogs.ts | 2 +- ...806881-V34_IncreasedModerationDurations.ts | 2 +- .../1612574048431-V35_RemoveRaidColumns.ts | 2 +- .../1615269810077-V37_BirthdayIntegration.ts | 2 +- ...1616188199786-V40_AddSocialIgnoredRoles.ts | 2 +- ...41_AddMusicAllowedVoiceChannelsAndRoles.ts | 2 +- ...639503-V42_AddAllowedRolesIntoGiveaways.ts | 2 +- ...72351741-V44_AddAutoDeleteIgnoreOptions.ts | 2 +- ...617314282232-V46_AddStarboardMaximumAge.ts | 2 +- .../1617645345960-V47_AddNewLogsChannels.ts | 2 +- ...17890802896-V48_AddSeparateInitialRoles.ts | 2 +- .../1618951687674-V50_RemoveDatabaseChecks.ts | 2 +- ...427-V51_NewSocialFeaturesAndValueRename.ts | 2 +- ...27210-V52_JoinAndLeaveMessageAutoDelete.ts | 2 +- .../1620050724729-V53_AfkSettings.ts | 2 +- .../1626169505546-V54_EventsModernization.ts | 4 +- .../1627318321333-V55_MediaOnlyChannels.ts | 2 +- ...29315603851-V56_MigrateTwitchToEventSub.ts | 4 +- ...614-V57_MigrateReactionRolesAndTriggers.ts | 2 +- .../1633201003755-V58_GiveawayAuthor.ts | 2 +- .../1634379789387-V61_AddMusicAutoLeave.ts | 2 +- ...171-V62_VersionSevenRemoveGuildSettings.ts | 2 +- ...2907066-V63_VersionSevenRemoveStarboard.ts | 2 +- ...163533583-V64_VersionSevenRemoveSpouses.ts | 2 +- .../1648974657502-V67_RemoveAudioSettings.ts | 2 +- ...464-V68_PartialRemoveSuggestionSettings.ts | 2 +- .../1654346108374-V69_RemoveTriggers.ts | 2 +- ...215154740-V70_RemoveUserGameIntegration.ts | 2 +- .../migrations/1662215310736-V71_RemoveRpg.ts | 2 +- .../1662216686859-V72_RemoveSocial.ts | 2 +- .../1662291099795-V73_RemoveSuggestions.ts | 2 +- .../database/repositories/ClientRepository.ts | 10 - src/lib/database/settings/ConfigurableKey.ts | 6 +- src/lib/database/settings/SettingsManager.ts | 6 +- src/lib/database/settings/Utils.ts | 8 +- .../{ISchemaValue.d.ts => ISchemaValue.ts} | 0 .../settings/base/SettingsCollection.ts | 4 +- src/lib/database/settings/functions.ts | 4 +- src/lib/database/settings/index.ts | 32 +- .../database/settings/schema/SchemaGroup.ts | 6 +- src/lib/database/settings/schema/SchemaKey.ts | 22 +- .../settings/structures/AdderManager.ts | 2 +- .../structures/PermissionNodeManager.ts | 2 +- .../settings/structures/Serializer.ts | 36 +- .../settings/structures/SerializerStore.ts | 2 +- src/lib/database/settings/structures/Task.ts | 4 +- .../database/settings/structures/TaskStore.ts | 4 +- .../collections/AliasedCollection.ts | 2 +- .../collections/GuildSettingsCollection.ts | 4 +- src/lib/database/utils/DbSet.ts | 39 +- src/lib/database/utils/matchers/index.ts | 2 +- src/lib/discord/Api.ts | 1106 +-- src/lib/discord/SkyraEmbed.ts | 13 +- src/lib/discord/index.ts | 4 +- src/lib/games/base/BaseBotController.ts | 2 +- src/lib/games/base/BaseController.ts | 2 +- src/lib/games/base/BaseGame.ts | 2 +- src/lib/games/base/BaseReactionController.ts | 10 +- src/lib/games/base/BaseReactionGame.ts | 8 +- .../connect-four/ConnectFourBotController.ts | 4 +- src/lib/games/connect-four/ConnectFourGame.ts | 10 +- .../ConnectFourHumanController.ts | 4 +- .../tic-tac-toe/TicTacToeBotController.ts | 4 +- src/lib/games/tic-tac-toe/TicTacToeGame.ts | 8 +- .../tic-tac-toe/TicTacToeHumanController.ts | 4 +- src/lib/i18n/languageKeys/index.ts | 2 +- src/lib/i18n/languageKeys/keys/All.ts | 24 +- src/lib/i18n/languageKeys/keys/Commands.ts | 22 +- src/lib/i18n/languageKeys/keys/Serializers.ts | 2 +- src/lib/i18n/languageKeys/keys/Settings.ts | 4 +- src/lib/i18n/languageKeys/keys/events/All.ts | 14 +- .../languageKeys/keys/events/guilds/All.ts | 4 +- .../languageKeys/keys/events/guilds/Logs.ts | 10 +- .../keys/events/moderation/All.ts | 2 +- .../languageKeys/keys/settings/Channels.ts | 4 +- src/lib/i18n/structures/Handler.ts | 2 +- src/lib/i18n/translate.ts | 2 +- src/lib/moderation/index.ts | 4 +- .../moderation/managers/ModerationManager.ts | 4 +- src/lib/moderation/managers/index.ts | 4 +- .../structures/ModerationCommand.ts | 24 +- .../structures/ModerationListener.ts | 23 +- .../structures/ModerationMessageListener.ts | 40 +- .../moderation/structures/ModerationTask.ts | 2 +- .../structures/SelfModerationCommand.ts | 24 +- .../structures/SetUpModerationCommand.ts | 32 +- src/lib/moderation/structures/index.ts | 14 +- src/lib/moderation/workers/WorkerHandler.ts | 12 +- src/lib/moderation/workers/WorkerManager.ts | 14 +- .../workers/WorkerResponseHandler.ts | 6 +- src/lib/moderation/workers/errors/index.ts | 1 - src/lib/moderation/workers/index.ts | 10 +- src/lib/moderation/workers/worker.ts | 6 +- src/lib/setup/index.ts | 6 +- src/lib/structures/AnalyticsData.ts | 2 +- src/lib/structures/InviteStore.ts | 4 +- src/lib/structures/SettingsMenu.ts | 41 +- .../structures/SkyraLazyPaginatedMessage.ts | 2 +- src/lib/structures/SkyraPaginatedMessage.ts | 2 +- .../commands/ChannelConfigurationCommand.ts | 18 +- .../commands/PaginatedMessageCommand.ts | 32 - .../commands/{parsers => }/SkyraArgs.ts | 34 +- src/lib/structures/commands/SkyraCommand.ts | 105 +- .../structures/commands/SkyraSubcommand.ts | 63 + .../base/BaseSkyraCommandUtilities.ts | 80 + src/lib/structures/commands/index.ts | 8 +- src/lib/structures/commands/parsers/index.ts | 1 - src/lib/structures/index.ts | 18 +- .../structures/listeners/AnalyticsListener.ts | 10 +- src/lib/structures/listeners/index.ts | 4 +- .../structures/managers/LockdownManager.ts | 2 +- .../structures/managers/ScheduleManager.ts | 4 +- src/lib/structures/managers/index.ts | 4 +- .../preconditions/PermissionsPrecondition.ts | 20 +- src/lib/structures/preconditions/index.ts | 2 +- src/lib/types/Augments.d.ts | 35 +- src/lib/types/Discord.d.ts | 14 - src/lib/types/Discord.ts | 4 + src/lib/types/Enums.ts | 8 - src/lib/types/{definitions => }/Internals.ts | 0 src/lib/types/{definitions => }/Twitch.ts | 0 src/lib/types/Utils.ts | 1 - src/lib/types/definitions/index.ts | 2 - src/lib/types/index.ts | 8 +- src/lib/util/Links/UrlRegex.ts | 2 +- src/lib/util/LongLivingReactionCollector.ts | 2 +- src/lib/util/Notifications/Twitch.ts | 20 +- src/lib/util/Security/GuildSecurity.ts | 2 +- src/lib/util/Security/ModerationActions.ts | 271 +- src/lib/util/bits.ts | 48 +- src/lib/util/common/index.ts | 10 +- src/lib/util/common/promises.ts | 6 +- src/lib/util/deprecate.ts | 46 +- src/lib/util/formatters.ts | 36 +- src/lib/util/functions/index.ts | 10 +- src/lib/util/functions/messages.ts | 20 +- src/lib/util/functions/permissions.ts | 7 +- src/lib/util/moderation-utilities.ts | 2 +- src/lib/util/util.ts | 56 +- .../commands/commandSuccessAnalytics.ts | 12 - ...mmandDenied.ts => messageCommandDenied.ts} | 8 +- ...commandError.ts => messageCommandError.ts} | 40 +- ...unAttach.ts => messageCommandRunAttach.ts} | 6 +- .../messageCommandSuccessAnalytics.ts | 12 + ....ts => messageCommandSuccessAutoDelete.ts} | 9 +- ...gger.ts => messageCommandSuccessLogger.ts} | 10 +- src/listeners/errors/error.ts | 4 +- src/listeners/errors/listenerError.ts | 2 +- src/listeners/errors/listenerErrorSentry.ts | 2 +- src/listeners/guildMessageLog.ts | 14 +- .../guilds/channels/channelCreateNotify.ts | 40 +- .../guilds/channels/channelDeleteNotify.ts | 12 +- .../guilds/channels/channelUpdateNotify.ts | 50 +- .../guilds/emojis/emojiCreateNotify.ts | 10 +- .../guilds/emojis/emojiDeleteNotify.ts | 10 +- .../guilds/emojis/emojiUpdateNotify.ts | 10 +- src/listeners/guilds/guildUpdateNotify.ts | 53 +- .../guilds/members/guildMemberAdd.ts | 9 +- .../guildMemberUpdateNicknameNotify.ts | 8 +- .../members/guildMemberUpdateRolesNotify.ts | 8 +- .../members/notMutedMemberAddInitialRole.ts | 4 +- .../guilds/members/notMutedMemberAddNotify.ts | 8 +- .../guilds/members/rawGuildMemberRemove.ts | 6 +- .../guilds/members/rawGuildMemberUpdate.ts | 26 +- .../guilds/members/rawMemberRemoveNotify.ts | 10 +- .../messages/guildUserMessageImageNotify.ts | 12 +- .../guilds/rawGuildCreateMemberFetch.ts | 6 +- src/listeners/guilds/rawGuildDelete.ts | 6 +- .../guilds/rawGuildDeleteMemberFetch.ts | 6 +- .../guilds/roles/roleCreateNotify.ts | 10 +- .../guilds/roles/roleDeleteNotify.ts | 10 +- .../guilds/roles/roleUpdateNotify.ts | 10 +- src/listeners/mentionSpamExceeded.ts | 2 +- .../messages/guildMessageDeleteNotify.ts | 8 +- .../messages/guildMessageDeleteRichDisplay.ts | 4 +- .../messages/guildMessageDeleteSnipe.ts | 4 +- .../messages/guildUserMessageMediaOnly.ts | 4 +- .../messageDeleteBulkRemoveResponses.ts | 4 +- .../messages/messageDeleteRemoveResponses.ts | 4 +- src/listeners/messages/messageUpdateNotify.ts | 4 +- src/listeners/messages/rawMessageDelete.ts | 6 +- .../messages/rawMessageDeleteBulk.ts | 6 +- .../messages/userMessageGuildHandler.ts | 4 +- .../guildUserMessageAttachmentsHandler.ts | 4 +- .../guildUserMessageCapitalsHandler.ts | 4 +- .../guildUserMessageInvitesHandler.ts | 4 +- .../messages/guildUserMessageLinksHandler.ts | 4 +- .../guildUserMessageMentionsHandler.ts | 4 +- .../guildUserMessageMessagesHandler.ts | 4 +- .../guildUserMessageNewLinesHandler.ts | 4 +- .../moderation/moderationEntryAdd.ts | 2 +- .../moderation/moderationEntryEdit.ts | 21 +- .../reactions/rawMessageReactionAdd.ts | 6 +- .../reactions/rawMessageReactionRemove.ts | 6 +- .../reactions/rawReactionAddBlockList.ts | 38 +- .../reactions/rawReactionAddNotify.ts | 17 +- src/listeners/reactions/rawReactionAddRole.ts | 6 +- .../reactions/rawReactionRemoveRole.ts | 6 +- src/listeners/ready.ts | 8 +- src/listeners/twitch/twitchStreamOffline.ts | 10 +- src/listeners/twitch/twitchStreamOnline.ts | 16 +- src/listeners/userUpdate.ts | 4 +- src/preconditions/BotOwner.ts | 4 +- src/preconditions/Enabled.ts | 2 +- src/routes/banners.ts | 14 - src/routes/commands.ts | 9 +- src/routes/guilds/guild.ts | 6 +- src/routes/guilds/guild/channels.ts | 4 +- src/routes/guilds/guild/channels/channel.ts | 4 +- src/routes/guilds/guild/members/member.ts | 4 +- src/routes/guilds/guild/roles.ts | 4 +- src/routes/guilds/guild/roles/role.ts | 4 +- src/routes/guilds/guild/settings.ts | 18 +- src/routes/languages.ts | 4 +- src/routes/main.ts | 4 +- src/routes/oauth/oauthUser.ts | 8 +- src/routes/twitch/twitchEventSubVerify.ts | 6 +- src/routes/users/user.ts | 6 +- src/serializers/boolean.ts | 4 +- src/serializers/categoryortextchannel.ts | 17 +- src/serializers/channel.ts | 15 +- src/serializers/command.ts | 11 +- src/serializers/commandautodelete.ts | 12 +- src/serializers/commandmatch.ts | 9 +- src/serializers/disabledcommandchannel.ts | 14 +- src/serializers/emoji.ts | 14 +- src/serializers/guild.ts | 6 +- src/serializers/invite.ts | 11 +- src/serializers/number.ts | 6 +- src/serializers/permissionnode.ts | 8 +- src/serializers/reactionrole.ts | 10 +- src/serializers/role.ts | 13 +- src/serializers/snowflake.ts | 4 +- src/serializers/stickyrole.ts | 10 +- src/serializers/string.ts | 8 +- src/serializers/textchannel.ts | 11 +- src/serializers/timespan.ts | 8 +- src/serializers/uniqueroleset.ts | 14 +- src/serializers/url.ts | 10 +- src/serializers/user.ts | 11 +- src/serializers/voicechannel.ts | 11 +- src/serializers/word.ts | 8 +- src/tasks/moderation/moderationEndAddRole.ts | 7 +- src/tasks/moderation/moderationEndBan.ts | 7 +- src/tasks/moderation/moderationEndMute.ts | 2 +- .../moderation/moderationEndRemoveRole.ts | 7 +- .../moderationEndRestrictionAttachment.ts | 7 +- .../moderationEndRestrictionEmbed.ts | 7 +- .../moderationEndRestrictionReaction.ts | 7 +- .../moderationEndRestrictionVoice.ts | 7 +- .../moderation/moderationEndSetNickname.ts | 7 +- .../moderation/moderationEndVoiceMute.ts | 7 +- src/tasks/moderation/moderationEndWarning.ts | 7 +- src/tasks/poststats.ts | 6 +- src/tasks/reminder.ts | 4 +- src/tsconfig.json | 20 +- tests/lib/TriviaManager.test.ts | 42 - tests/lib/bits.test.ts | 138 +- .../structures/PermissionNodeManager.test.ts | 10 +- tests/lib/formatters.test.ts | 11 +- .../moderation/workers/WorkerHandler.test.ts | 32 +- .../moderation/workers/WorkerManager.test.ts | 20 +- .../workers/WorkerResponseHandler.test.ts | 24 +- tests/lib/util.test.ts | 37 +- tests/lib/util/common/comparators.test.ts | 28 +- tests/lib/util/constants.test.ts | 2 - tests/lib/util/formatters.test.ts | 4 +- .../functions/emojis/getEmojiObject.test.ts | 2 +- tests/mocks/MockInstances.ts | 43 +- tests/tsconfig.json | 13 +- tests/{jest.setup.ts => vitest.setup.ts} | 0 tsconfig.base.json | 2 +- tsconfig.eslint.json | 2 +- vitest.config.ts | 93 + yarn.lock | 7387 +++++++---------- 443 files changed, 5447 insertions(+), 8794 deletions(-) delete mode 100644 .yarn/patches/@sapphire-discord.js-utilities-npm-4.12.0-cff496cdca.patch delete mode 100644 .yarn/patches/@sapphire-framework-npm-2.5.1-e9e3e6d600.patch delete mode 100644 .yarn/patches/discord.js-npm-13.16.0-03bbf983c5.patch delete mode 100644 babel.config.js delete mode 100644 jest.config.mjs delete mode 100644 scripts/workerTsLoader.js delete mode 100644 src/commands/General/v7-iriss.ts delete mode 100644 src/commands/General/v7-nayre.ts delete mode 100644 src/commands/General/v7-nekokai.ts delete mode 100644 src/commands/General/v7-pokemon.ts delete mode 100644 src/commands/General/v7-teryl.ts delete mode 100644 src/commands/General/v7.ts rename src/lib/api/{types.d.ts => types.ts} (88%) delete mode 100644 src/lib/database/entities/BannerEntity.ts delete mode 100644 src/lib/database/repositories/ClientRepository.ts rename src/lib/database/settings/base/{ISchemaValue.d.ts => ISchemaValue.ts} (100%) delete mode 100644 src/lib/moderation/workers/errors/index.ts delete mode 100644 src/lib/structures/commands/PaginatedMessageCommand.ts rename src/lib/structures/commands/{parsers => }/SkyraArgs.ts (59%) create mode 100644 src/lib/structures/commands/SkyraSubcommand.ts create mode 100644 src/lib/structures/commands/base/BaseSkyraCommandUtilities.ts delete mode 100644 src/lib/structures/commands/parsers/index.ts delete mode 100644 src/lib/types/Discord.d.ts create mode 100644 src/lib/types/Discord.ts rename src/lib/types/{definitions => }/Internals.ts (100%) rename src/lib/types/{definitions => }/Twitch.ts (100%) delete mode 100644 src/lib/types/definitions/index.ts delete mode 100644 src/listeners/commands/commandSuccessAnalytics.ts rename src/listeners/commands/{commandDenied.ts => messageCommandDenied.ts} (61%) rename src/listeners/commands/{commandError.ts => messageCommandError.ts} (83%) rename src/listeners/commands/{commandRunAttach.ts => messageCommandRunAttach.ts} (58%) create mode 100644 src/listeners/commands/messageCommandSuccessAnalytics.ts rename src/listeners/commands/{commandSuccessAutoDelete.ts => messageCommandSuccessAutoDelete.ts} (63%) rename src/listeners/commands/{commandSuccessLogger.ts => messageCommandSuccessLogger.ts} (72%) delete mode 100644 src/routes/banners.ts delete mode 100644 tests/lib/TriviaManager.test.ts rename tests/{jest.setup.ts => vitest.setup.ts} (100%) create mode 100644 vitest.config.ts diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f042b4036a6..d8797169047 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -15,10 +15,10 @@ jobs: uses: actions/checkout@v3 - name: Add problem matchers run: echo "::add-matcher::.github/problemMatchers/eslint.json" - - name: Use Node.js v20 + - name: Use Node.js v18 uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 18 cache: yarn - name: Install Dependencies run: yarn --immutable @@ -35,10 +35,10 @@ jobs: submodules: true - name: Add problem matchers run: echo "::add-matcher::.github/problemMatchers/tsc.json" - - name: Use Node.js v20 + - name: Use Node.js v18 uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 18 cache: yarn - name: Install Dependencies run: yarn --immutable @@ -53,10 +53,10 @@ jobs: uses: actions/checkout@v3 with: submodules: true - - name: Use Node.js v20 + - name: Use Node.js v18 uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 18 cache: yarn - name: Install Dependencies run: yarn --immutable diff --git a/.github/workflows/update-tlds.yml b/.github/workflows/update-tlds.yml index 6a03acf7f3e..78b03fba2e4 100644 --- a/.github/workflows/update-tlds.yml +++ b/.github/workflows/update-tlds.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout Project uses: actions/checkout@v3 - - name: Use Node.js v20 + - name: Use Node.js v18 uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 18 cache: yarn - name: Install Dependencies run: yarn --immutable diff --git a/.yarn/patches/@sapphire-discord.js-utilities-npm-4.12.0-cff496cdca.patch b/.yarn/patches/@sapphire-discord.js-utilities-npm-4.12.0-cff496cdca.patch deleted file mode 100644 index d3bcc91732b..00000000000 --- a/.yarn/patches/@sapphire-discord.js-utilities-npm-4.12.0-cff496cdca.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/dist/index.js b/dist/index.js -index b9256ddb47c0bee60891aec094728daf7a806cec..02eb56e8ce49efc3ad84702e598a6e0be22290e3 100644 ---- a/dist/index.js -+++ b/dist/index.js -@@ -1323,7 +1323,16 @@ function canJoinVoiceChannel(channel) { - } - __name(canJoinVoiceChannel, "canJoinVoiceChannel"); - function canDoUtility(channel, permissionsToPass) { -- return isGuildBasedChannel(channel) ? channel.permissionsFor(channel.guild.me).has(permissionsToPass) : true; -+ if (!isGuildBasedChannel(channel)) { -+ return true; -+ } -+ const { me } = channel.guild; -+ if (!me) -+ return false; -+ const permissionsFor = channel.permissionsFor(me); -+ if (!permissionsFor) -+ return false; -+ return permissionsFor.has(permissionsToPass); - } - __name(canDoUtility, "canDoUtility"); - // Annotate the CommonJS export names for ESM import in node: diff --git a/.yarn/patches/@sapphire-framework-npm-2.5.1-e9e3e6d600.patch b/.yarn/patches/@sapphire-framework-npm-2.5.1-e9e3e6d600.patch deleted file mode 100644 index 7a28a1c35a6..00000000000 --- a/.yarn/patches/@sapphire-framework-npm-2.5.1-e9e3e6d600.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/dist/listeners/command-handler/CoreMessageParser.js b/dist/listeners/command-handler/CoreMessageParser.js -index 77085e6236e54886704803e8111278c4977780df..a76c155d757cc0e2890529ad6ad322246ce328ca 100644 ---- a/dist/listeners/command-handler/CoreMessageParser.js -+++ b/dist/listeners/command-handler/CoreMessageParser.js -@@ -43,13 +43,16 @@ class CoreListener extends Listener_1.Listener { - async canRunInChannel(message) { - if ((0, discord_js_utilities_1.isDMChannel)(message.channel)) - return true; -- const me = message.guild.me ?? (message.client.id ? await message.guild.members.fetch(message.client.id) : null); -+ const me = message.guild.members.me ?? (message.client.id ? await message.guild.members.fetch(message.client.id) : null); - if (!me) - return false; - if (me.isCommunicationDisabled()) - return false; - const channel = message.channel; -- return channel.permissionsFor(me).has(this.requiredPermissions, false); -+ const permissionsFor = channel.permissionsFor(me); -+ if (!permissionsFor) return false; -+ -+ return permissionsFor.has(this.requiredPermissions, false); - } - getMentionPrefix(message) { - if (this.container.client.disableMentionPrefix) -@@ -59,7 +62,7 @@ class CoreListener extends Listener_1.Listener { - return null; - // Calculate the offset and the ID that is being provided - const [offset, id] = message.content[2] === '&' -- ? [3, message.guild?.roles.botRoleFor(message.guild.me)?.id] -+ ? [3, message.guild?.roles.botRoleFor(message.guild.members.me)?.id] - : [message.content[2] === '!' ? 3 : 2, this.container.client.id]; - if (!id) - return null; diff --git a/.yarn/patches/discord.js-npm-13.16.0-03bbf983c5.patch b/.yarn/patches/discord.js-npm-13.16.0-03bbf983c5.patch deleted file mode 100644 index 11aacd24ce1..00000000000 --- a/.yarn/patches/discord.js-npm-13.16.0-03bbf983c5.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff --git a/src/client/actions/ChannelUpdate.js b/src/client/actions/ChannelUpdate.js -index 34d1a86a4c0d59317b7d7be69b42cff4fb71e1c7..59bdc5b4858bc036934b82f54f2a6c471e3acdd5 100644 ---- a/src/client/actions/ChannelUpdate.js -+++ b/src/client/actions/ChannelUpdate.js -@@ -14,7 +14,15 @@ class ChannelUpdateAction extends Action { - - if (ChannelTypes[channel.type] !== data.type) { - const newChannel = Channel.create(this.client, data, channel.guild); -- for (const [id, message] of channel.messages.cache) newChannel.messages.cache.set(id, message); -+ if (!newChannel) { -+ this.client.channels.cache.delete(channel.id); -+ return {}; -+ } -+ -+ if (channel.isText() && newChannel.isText()) { -+ for (const [id, message] of channel.messages.cache) newChannel.messages.cache.set(id, message); -+ } -+ - channel = newChannel; - this.client.channels.cache.set(channel.id, channel); - } -diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js -index 2fff24990d3702865e28ee88cadd6c7908c49217..7cbd748307f488521665de96724622f1a62ef091 100644 ---- a/src/structures/GuildMember.js -+++ b/src/structures/GuildMember.js -@@ -259,12 +259,12 @@ class GuildMember extends Base { - } - - /** -- * The nickname of this member, or their username if they don't have one -+ * The nickname of this member, or their user display name if they don't have one - * @type {?string} - * @readonly - */ - get displayName() { -- return this.nickname ?? this.user.username; -+ return this.nickname ?? this.user.displayName; - } - - /** -diff --git a/src/structures/User.js b/src/structures/User.js -index dd1880edec3d5051a3b710f9ec530206f80d6193..c7e5321a3071ff818d582fd54c7a72ac9b1e972d 100644 ---- a/src/structures/User.js -+++ b/src/structures/User.js -@@ -41,6 +41,16 @@ class User extends Base { - this.username ??= null; - } - -+ if ('global_name' in data) { -+ /** -+ * The global name of this user -+ * @type {?string} -+ */ -+ this.globalName = data.global_name; -+ } else { -+ this.globalName ??= null; -+ } -+ - if ('bot' in data) { - /** - * Whether or not the user is a bot -@@ -201,6 +211,15 @@ class User extends Base { - return typeof this.username === 'string' ? `${this.username}#${this.discriminator}` : null; - } - -+ /** -+ * The global name of this user, or their username if they don't have one -+ * @type {?string} -+ * @readonly -+ */ -+ get displayName() { -+ return this.globalName ?? this.username; -+ } -+ - /** - * The DM between the client's user and this user - * @type {?DMChannel} -diff --git a/typings/index.d.ts b/typings/index.d.ts -index 42630bb85c963ef8c14764a5e0fb8629e7c07d59..428fd58408f355380bb3d1c16886cb5092a8bb6c 100644 ---- a/typings/index.d.ts -+++ b/typings/index.d.ts -@@ -2700,9 +2700,11 @@ export class User extends PartialTextBasedChannel(Base) { - public readonly createdAt: Date; - public readonly createdTimestamp: number; - public discriminator: string; -+ public readonly displayName: string; - public readonly defaultAvatarURL: string; - public readonly dmChannel: DMChannel | null; - public flags: Readonly | null; -+ public globalName: string | null; - public readonly hexAccentColor: HexColorString | null | undefined; - public id: Snowflake; - public readonly partial: false; diff --git a/Dockerfile b/Dockerfile index fe734fb6e6f..18ba350b7fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,6 @@ FROM base as builder ENV NODE_ENV="development" COPY --chown=node:node tsconfig.base.json tsconfig.base.json -COPY --chown=node:node scripts/ scripts/ COPY --chown=node:node src/ src/ RUN yarn install --immutable @@ -44,7 +43,6 @@ ENV NODE_OPTIONS="--enable-source-maps --max_old_space_size=4096" COPY --chown=node:node --from=builder /usr/src/app/dist dist -COPY --chown=node:node scripts/workerTsLoader.js scripts/workerTsLoader.js COPY --chown=node:node src/.env src/.env RUN yarn workspaces focus --all --production diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 09ed3f6da2f..00000000000 --- a/babel.config.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = { - presets: [ - [ - '@babel/preset-env', - { - targets: { - node: true - } - } - ], - '@babel/preset-typescript' - ], - plugins: [ - [ - '@babel/plugin-proposal-decorators', - { - legacy: true - } - ], - '@babel/plugin-proposal-class-properties', - 'const-enum' - ] -}; diff --git a/jest.config.mjs b/jest.config.mjs deleted file mode 100644 index 5fcb212d1d9..00000000000 --- a/jest.config.mjs +++ /dev/null @@ -1,56 +0,0 @@ -/** @type {import('@jest/types').Config.InitialOptions} */ -const config = { - coverageProvider: 'v8', - displayName: 'unit test', - testMatch: ['/tests/**/*.test.ts'], - moduleNameMapper: { - '^#utils/(.*)$': '/src/lib/util/$1', - '^#lib/(.*)$': '/src/lib/$1', - '^#root/(.*)$': '/src/$1', - '^#mocks/(.*)$': '/tests/mocks/$1' - }, - setupFilesAfterEnv: ['/tests/jest.setup.ts'], - collectCoverageFrom: ['/src/lib/**/*.ts'], - coveragePathIgnorePatterns: [ - '/src/lib/api', - '/src/lib/database/entities', - '/src/lib/database/index.ts', - '/src/lib/database/migrations', - '/src/lib/database/repositories', - '/src/lib/database/settings', - '/src/lib/database/utils', - '/src/lib/discord', - '/src/lib/env', - '/src/lib/extensions', - '/src/lib/games/base', - '/src/lib/games/connect-four', - '/src/lib/games/HungerGamesUsage.ts', - '/src/lib/games/Slotmachine.ts', - '/src/lib/games/tic-tac-toe', - '/src/lib/games/WheelOfFortune.ts', - '/src/lib/i18n/structures/Augments.d.ts', - '/src/lib/moderation', - '/src/lib/setup/PaginatedMessage.ts', - '/src/lib/SkyraClient.ts', - '/src/lib/structures', - '/src/lib/types', - '/src/lib/util/APIs', - '/src/lib/util/Color.ts', - '/src/lib/util/decorators.ts', - '/src/lib/util/External', - '/src/lib/util/Leaderboard.ts', - '/src/lib/util/Links', - '/src/lib/util/LongLivingReactionCollector.ts', - '/src/lib/util/Models', - '/src/lib/util/Notifications', - '/src/lib/util/Parsers', - '/src/lib/util/PreciseTimeout.ts', - '/src/lib/util/PromptList.ts', - '/src/lib/util/Security/GuildSecurity.ts', - '/src/lib/util/Security/ModerationActions.ts', - '/src/lib/util/Timers.ts', - '/src/lib/weather' - ] -}; - -export default config; diff --git a/package.json b/package.json index 01b4d52ae32..e086b36570c 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "skyra", - "version": "6.2.0", + "version": "6.3.0", "description": "Multipurpose Discord Bot built on Sapphire Framework", "author": "Skyra Project", "license": "Apache-2.0", "main": "./dist/Skyra.js", + "type": "module", "imports": { - "#lib/*": "./dist/lib/*.js", "#lib/database": "./dist/lib/database/index.js", "#lib/database/entities": "./dist/lib/database/entities/index.js", "#lib/database/keys": "./dist/lib/database/keys/index.js", @@ -21,11 +21,12 @@ "#lib/setup": "./dist/lib/setup/index.js", "#lib/types": "./dist/lib/types/index.js", "#lib/i18n/languageKeys": "./dist/lib/i18n/languageKeys/index.js", + "#lib/*": "./dist/lib/*.js", "#root/*": "./dist/*.js", "#languages": "./dist/languages/index.js", - "#utils/*": "./dist/lib/util/*.js", "#utils/common": "./dist/lib/util/common/index.js", - "#utils/functions": "./dist/lib/util/functions/index.js" + "#utils/functions": "./dist/lib/util/functions/index.js", + "#utils/*": "./dist/lib/util/*.js" }, "scripts": { "build": "tsc -b src", @@ -35,7 +36,7 @@ "clean": "node scripts/build/clean.mjs", "start": "node --enable-source-maps dist/Skyra.js", "start:profiler:0x": "0x --collect-only dist/Skyra.js", - "test": "jest", + "test": "NODE_OPTIONS=\"--loader tsx/esm\" vitest", "lint": "eslint --fix --ext ts src tests", "format": "prettier --write --loglevel=warn \"{src,tests}/**/*.{js,ts,json}\"", "scripts:tlds": "node scripts/tlds.mjs", @@ -45,92 +46,81 @@ "update": "yarn upgrade-interactive" }, "dependencies": { - "@discordjs/builders": "^0.16.0", - "@discordjs/collection": "^1.5.1", + "@discordjs/builders": "^1.6.5", + "@discordjs/collection": "^1.5.3", + "@discordjs/core": "^1.0.1", "@influxdata/influxdb-client": "^1.33.2", "@influxdata/influxdb-client-apis": "^1.33.2", "@sapphire/async-queue": "^1.5.0", - "@sapphire/decorators": "^4.3.8", - "@sapphire/discord.js-utilities": "4.12.0", + "@sapphire/bitfield": "^1.2.0", + "@sapphire/decorators": "^6.0.2", + "@sapphire/discord.js-utilities": "7.0.2", "@sapphire/fetch": "^2.4.1", - "@sapphire/framework": "2.5.1", - "@sapphire/plugin-api": "^3.2.4", - "@sapphire/plugin-editable-commands": "^1.2.2", - "@sapphire/plugin-i18next": "^2.5.4", - "@sapphire/plugin-logger": "^2.2.3", - "@sapphire/plugin-subcommands": "^2.2.2", - "@sapphire/ratelimits": "^2.4.6", + "@sapphire/framework": "4.7.2", + "@sapphire/plugin-api": "^5.1.2", + "@sapphire/plugin-editable-commands": "^3.0.3", + "@sapphire/plugin-i18next": "^6.0.1", + "@sapphire/plugin-logger": "^3.0.6", + "@sapphire/plugin-subcommands": "^5.0.0", + "@sapphire/ratelimits": "^2.4.7", "@sapphire/snowflake": "^3.5.1", "@sapphire/stopwatch": "^1.5.0", - "@sapphire/time-utilities": "^1.7.9", - "@sapphire/utilities": "^3.12.0", - "@sentry/hub": "^7.58.1", - "@sentry/integrations": "^7.58.1", - "@sentry/node": "^7.58.1", + "@sapphire/time-utilities": "^1.7.10", + "@sapphire/utilities": "^3.13.0", + "@sentry/hub": "^7.79.0", + "@sentry/integrations": "^7.79.0", + "@sentry/node": "^7.79.0", "@skyra/ai": "^1.2.0", "@skyra/char": "^1.0.3", "@skyra/env-utilities": "^1.2.1", "@skyra/jaro-winkler": "^1.1.0", "async-rwlock": "^1.1.1", - "bufferutil": "^4.0.7", + "bufferutil": "^4.0.8", "colorette": "^2.0.20", "confusables": "^1.1.1", "diff": "^5.1.0", - "discord-api-types": "~0.33.5", - "discord.js": "^13.16.0", + "discord-api-types": "~0.37.62", + "discord.js": "^14.13.0", "he": "^1.2.0", - "pg": "^8.11.1", - "tslib": "1.14.1", - "typeorm": "0.2.28", - "typeorm-naming-strategies": "^2.0.0", - "zlib-sync": "^0.1.8" + "pg": "^8.11.3", + "typeorm": "0.3.17", + "typeorm-naming-strategies": "^4.1.0", + "zlib-sync": "^0.1.9" }, "devDependencies": { - "0x": "^5.5.0", - "@babel/core": "^7.22.9", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-decorators": "^7.22.7", - "@babel/preset-env": "^7.22.9", - "@babel/preset-typescript": "^7.21.4", - "@commitlint/cli": "^17.6.6", - "@commitlint/config-conventional": "^17.6.6", - "@sapphire/eslint-config": "^4.4.3", - "@sapphire/prettier-config": "^1.4.5", - "@sapphire/ts-config": "^3.3.4", - "@types/backoff": "^2.5.2", - "@types/diff": "^5.0.3", - "@types/he": "^1.2.0", - "@types/jest": "^29.5.3", - "@types/node": "^18.16.19", - "@types/pg": "^8.10.2", - "@types/ws": "^8.5.5", - "@typescript-eslint/eslint-plugin": "^5.58.0", - "@typescript-eslint/parser": "^5.58.0", - "babel-plugin-const-enum": "^1.2.0", + "0x": "^5.7.0", + "@commitlint/cli": "^18.2.0", + "@commitlint/config-conventional": "^18.1.0", + "@sapphire/eslint-config": "^5.0.2", + "@sapphire/prettier-config": "^2.0.0", + "@sapphire/ts-config": "^5.0.0", + "@types/backoff": "^2.5.5", + "@types/diff": "^5.0.8", + "@types/he": "^1.2.3", + "@types/node": "^20.9.0", + "@types/pg": "^8.10.9", + "@types/ws": "^8.5.9", + "@typescript-eslint/eslint-plugin": "^6.10.0", + "@typescript-eslint/parser": "^6.10.0", + "@vitest/coverage-v8": "^0.34.6", "cz-conventional-changelog": "^3.3.0", - "eslint": "^8.45.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-prettier": "^4.2.1", - "jest": "^29.6.1", - "jest-mock-random": "^1.1.1", - "lint-staged": "^13.2.3", - "nock": "^13.3.2", - "prettier": "^2.8.8", + "eslint": "^8.53.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-prettier": "^5.0.1", + "lint-staged": "^15.0.2", + "prettier": "^3.0.3", "ts-node": "^10.9.1", "tsc-watch": "^6.0.4", - "typescript": "~4.7.4" + "tsx": "^4.0.0", + "typescript": "^5.2.2", + "vitest": "^0.34.6" }, "resolutions": { "ansi-regex": "^5.0.1", - "minimist": "^1.2.8", - "typescript": "~4.7.4", - "@sapphire/discord.js-utilities@4.12.0": "patch:@sapphire/discord.js-utilities@npm%3A4.12.0#./.yarn/patches/@sapphire-discord.js-utilities-npm-4.12.0-cff496cdca.patch", - "@sapphire/discord.js-utilities@^4.11.2": "patch:@sapphire/discord.js-utilities@npm%3A4.12.0#./.yarn/patches/@sapphire-discord.js-utilities-npm-4.12.0-cff496cdca.patch", - "@sapphire/framework@2.5.1": "patch:@sapphire/framework@npm%3A2.5.1#./.yarn/patches/@sapphire-framework-npm-2.5.1-e9e3e6d600.patch", - "discord.js@^13.16.0": "patch:discord.js@npm%3A13.16.0#./.yarn/patches/discord.js-npm-13.16.0-03bbf983c5.patch" + "minimist": "^1.2.8" }, "engines": { - "node": "^16", + "node": "^18", "npm": "^7" }, "repository": { @@ -154,6 +144,6 @@ "prettier": "@sapphire/prettier-config", "packageManager": "yarn@3.6.1", "volta": { - "node": "16.20.1" + "node": "18.18.2" } } diff --git a/scripts/workerTsLoader.js b/scripts/workerTsLoader.js deleted file mode 100644 index 90437416c6b..00000000000 --- a/scripts/workerTsLoader.js +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const path = require('path'); -const { workerData } = require('worker_threads'); - -if (process.env.NODE_ENV === 'test') { - require('ts-node').register(); -} - -require(path.resolve(workerData.path)); diff --git a/src/.env b/src/.env index 72131dba876..00251796322 100644 --- a/src/.env +++ b/src/.env @@ -1,5 +1,5 @@ CLIENT_NAME='Skyra' -CLIENT_VERSION='6.2.0 [Sapphire Edition]' +CLIENT_VERSION='6.3.0 [Sapphire Edition]' CLIENT_PREFIX='s!' CLIENT_REGEX_PREFIX='^skyra[, ]' CLIENT_OWNERS='242043489611808769 268792781713965056' diff --git a/src/.env.development b/src/.env.development index 9006b5612ff..367832b41e7 100644 --- a/src/.env.development +++ b/src/.env.development @@ -1,5 +1,5 @@ CLIENT_NAME='Skyra' -CLIENT_VERSION='6.2.0-dev [Sapphire Edition]' +CLIENT_VERSION='6.3.0-dev [Sapphire Edition]' CLIENT_PREFIX='sd!' CLIENT_REGEX_PREFIX='' CLIENT_OWNERS='' diff --git a/src/Skyra.ts b/src/Skyra.ts index 5e8172f6efa..3bfd84ceb63 100644 --- a/src/Skyra.ts +++ b/src/Skyra.ts @@ -37,7 +37,7 @@ async function main() { await client.login(); } catch (error) { container.logger.error(error); - client.destroy(); + await client.destroy(); process.exit(1); } } diff --git a/src/arguments/boolean.ts b/src/arguments/boolean.ts index 89684c8e7d4..d5cfe4d4533 100644 --- a/src/arguments/boolean.ts +++ b/src/arguments/boolean.ts @@ -1,20 +1,25 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Argument, ArgumentContext, AsyncArgumentResult, Identifiers } from '@sapphire/framework'; +import { Argument, Identifiers } from '@sapphire/framework'; import type { PieceContext } from '@sapphire/pieces'; +import { cast } from '@sapphire/utilities'; +import { t } from 'i18next'; export class CoreArgument extends Argument { + private defaultTruthValues: string[] | null = null; + private defaultFalseValues: string[] | null = null; + public constructor(context: PieceContext) { super(context, { name: 'boolean' }); } - public async run(parameter: string, context: ArgumentContext): AsyncArgumentResult { + public run(parameter: string, context: Argument.Context): Argument.Result { const boolean = parameter.toLowerCase(); let truths = context.args.t(LanguageKeys.Arguments.BooleanTrueOptions).filter(Boolean); let falses = context.args.t(LanguageKeys.Arguments.BooleanFalseOptions).filter(Boolean); - if (!truths.length) truths = context.args.t(LanguageKeys.Arguments.BooleanTrueOptions, { lng: 'en-US' }).filter(Boolean); - if (!falses.length) falses = context.args.t(LanguageKeys.Arguments.BooleanFalseOptions, { lng: 'en-US' }).filter(Boolean); + if (!truths.length) truths = this.getDefaultTruthValues; + if (!falses.length) falses = this.getDefaultFalseValues; if (truths.includes(boolean)) return this.ok(true); if (falses.includes(boolean)) return this.ok(false); @@ -22,4 +27,12 @@ export class CoreArgument extends Argument { const possibles = truths.concat(falses); return this.error({ parameter, identifier: Identifiers.ArgumentBooleanError, context: { ...context, possibles, count: possibles.length } }); } + + private get getDefaultTruthValues() { + return (this.defaultTruthValues ??= cast(t(LanguageKeys.Arguments.BooleanTrueOptions, { lng: 'en-US' })).filter(Boolean)); + } + + private get getDefaultFalseValues() { + return (this.defaultFalseValues ??= cast(t(LanguageKeys.Arguments.BooleanFalseOptions, { lng: 'en-US' })).filter(Boolean)); + } } diff --git a/src/arguments/case.ts b/src/arguments/case.ts index 1377192c668..42c2fc599fe 100644 --- a/src/arguments/case.ts +++ b/src/arguments/case.ts @@ -1,12 +1,12 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { getModeration } from '#utils/functions'; -import { Argument, ArgumentContext, Identifiers } from '@sapphire/framework'; +import { Argument, Identifiers } from '@sapphire/framework'; const minimum = 0; const maximum = 2_147_483_647; // Maximum value for int32 export class UserArgument extends Argument { - public async run(parameter: string, context: ArgumentContext) { + public async run(parameter: string, context: Argument.Context) { const latest = context.args.t(LanguageKeys.Arguments.CaseLatestOptions); if (latest.includes(parameter)) return this.ok(await getModeration(context.message.guild!).getCurrentId()); diff --git a/src/arguments/channelName.ts b/src/arguments/channelName.ts index 175dc8659dc..dceb1c20a58 100644 --- a/src/arguments/channelName.ts +++ b/src/arguments/channelName.ts @@ -3,7 +3,7 @@ import { isGuildMessage } from '#utils/common'; import { FuzzySearch } from '#utils/Parsers/FuzzySearch'; import { validateChannelAccess } from '#utils/util'; import { ChannelMentionRegex, SnowflakeRegex } from '@sapphire/discord.js-utilities'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; import type { Guild, GuildChannel, ThreadChannel, User } from 'discord.js'; export class UserArgument extends Argument { @@ -33,6 +33,6 @@ export class UserArgument extends Argument { } } -interface ChannelArgumentContext extends ArgumentContext { +interface ChannelArgumentContext extends Argument.Context { filter?: (entry: GuildChannel | ThreadChannel) => boolean; } diff --git a/src/arguments/cleanString.ts b/src/arguments/cleanString.ts index fc4d8c13a13..59affbe6699 100644 --- a/src/arguments/cleanString.ts +++ b/src/arguments/cleanString.ts @@ -1,8 +1,8 @@ import { cleanMentions } from '#utils/util'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { - public async run(parameter: string, { message }: ArgumentContext) { + public run(parameter: string, { message }: Argument.Context) { const clean = message.guild ? cleanMentions(message.guild, parameter) : parameter; return this.ok(clean); } diff --git a/src/arguments/command.ts b/src/arguments/command.ts index 286fa3d5025..c5b11851a5e 100644 --- a/src/arguments/command.ts +++ b/src/arguments/command.ts @@ -2,10 +2,10 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { SkyraCommand } from '#lib/structures'; import { PermissionLevels } from '#lib/types/Enums'; import { OWNERS } from '#root/config'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { - public async run(parameter: string, context: CommandArgumentContext) { + public run(parameter: string, context: CommandArgumentContext) { const resolved = this.container.stores.get('commands').get(parameter.toLowerCase()) as SkyraCommand | undefined; if (resolved !== undefined && this.isAllowed(resolved, context)) return this.ok(resolved); return this.error({ parameter, identifier: LanguageKeys.Arguments.Command, context }); @@ -17,6 +17,6 @@ export class UserArgument extends Argument { } } -interface CommandArgumentContext extends ArgumentContext { +interface CommandArgumentContext extends Argument.Context { owners?: boolean; } diff --git a/src/arguments/commandMatch.ts b/src/arguments/commandMatch.ts index b131128b8f1..b10b30ff982 100644 --- a/src/arguments/commandMatch.ts +++ b/src/arguments/commandMatch.ts @@ -3,10 +3,10 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { SkyraCommand } from '#lib/structures'; import { PermissionLevels } from '#lib/types/Enums'; import { OWNERS } from '#root/config'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { - public async run(parameter: string, context: CommandArgumentContext) { + public run(parameter: string, context: CommandArgumentContext) { const resolved = CommandMatcher.resolve(parameter); if (resolved !== null && this.isAllowed(resolved, context)) return this.ok(resolved); return this.error({ parameter, identifier: LanguageKeys.Arguments.CommandMatch, context }); @@ -21,6 +21,6 @@ export class UserArgument extends Argument { } } -interface CommandArgumentContext extends ArgumentContext { +interface CommandArgumentContext extends Argument.Context { owners?: boolean; } diff --git a/src/arguments/commandName.ts b/src/arguments/commandName.ts index 238fac958cf..db4c1e55fb8 100644 --- a/src/arguments/commandName.ts +++ b/src/arguments/commandName.ts @@ -3,7 +3,7 @@ import type { SkyraCommand } from '#lib/structures'; import { PermissionLevels } from '#lib/types/Enums'; import { OWNERS } from '#root/config'; import { FuzzySearch } from '#utils/Parsers/FuzzySearch'; -import { Argument, ArgumentContext, Command } from '@sapphire/framework'; +import { Argument, Command } from '@sapphire/framework'; export class UserArgument extends Argument { public async run(parameter: string, context: CommandArgumentContext) { @@ -25,7 +25,7 @@ export class UserArgument extends Argument { } } -interface CommandArgumentContext extends ArgumentContext { +interface CommandArgumentContext extends Argument.Context { filter?: (entry: Command) => boolean; owners?: boolean; } diff --git a/src/arguments/duration.ts b/src/arguments/duration.ts index d536042969a..b8f87f2c657 100644 --- a/src/arguments/duration.ts +++ b/src/arguments/duration.ts @@ -1,9 +1,9 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; import { Duration } from '@sapphire/time-utilities'; export class UserArgument extends Argument { - public async run(parameter: string, context: ArgumentContext) { + public run(parameter: string, context: Argument.Context) { const date = new Duration(parameter).fromNow; if (!isNaN(date.getTime()) && date.getTime() > Date.now()) return this.ok(date); return this.error({ parameter, identifier: LanguageKeys.Arguments.Duration, context }); diff --git a/src/arguments/emoji.ts b/src/arguments/emoji.ts index 7f37748425c..543b8a8bb3f 100644 --- a/src/arguments/emoji.ts +++ b/src/arguments/emoji.ts @@ -1,9 +1,9 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { EmojiObject, getEmojiObject } from '#utils/functions'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { getEmojiObject, type EmojiObject } from '#utils/functions'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { - public run(parameter: string, context: ArgumentContext) { + public run(parameter: string, context: Argument.Context) { const resolved = getEmojiObject(parameter); if (resolved === null) return this.error({ parameter, identifier: LanguageKeys.Arguments.Emoji, context }); return this.ok(resolved); diff --git a/src/arguments/invite.ts b/src/arguments/invite.ts index 3ff0ee49b57..b947e40fb18 100644 --- a/src/arguments/invite.ts +++ b/src/arguments/invite.ts @@ -1,9 +1,9 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { DiscordInviteLinkRegex } from '@sapphire/discord-utilities'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { - public async run(parameter: string, context: ArgumentContext) { + public async run(parameter: string, context: Argument.Context) { const parsed = DiscordInviteLinkRegex.exec(parameter); if (parsed === null) { return this.error({ parameter, identifier: LanguageKeys.Arguments.Invite, context }); diff --git a/src/arguments/language.ts b/src/arguments/language.ts index 793d2479256..f1dd76dff72 100644 --- a/src/arguments/language.ts +++ b/src/arguments/language.ts @@ -1,8 +1,8 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { - public async run(parameter: string, context: ArgumentContext) { + public run(parameter: string, context: Argument.Context) { const { languages } = this.container.i18n; if (languages.has(parameter)) return this.ok(parameter); return this.error({ parameter, identifier: LanguageKeys.Arguments.Language, context: { ...context, possibles: [...languages.keys()] } }); diff --git a/src/arguments/piece.ts b/src/arguments/piece.ts index 176dfff4289..a86d1b3271e 100644 --- a/src/arguments/piece.ts +++ b/src/arguments/piece.ts @@ -1,8 +1,8 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Argument, ArgumentContext, Piece } from '@sapphire/framework'; +import { Argument, Piece } from '@sapphire/framework'; export class UserArgument extends Argument { - public async run(parameter: string, context: ArgumentContext) { + public run(parameter: string, context: Argument.Context) { for (const store of this.container.stores.values()) { const piece = store.get(parameter); if (piece) return this.ok(piece); diff --git a/src/arguments/range.ts b/src/arguments/range.ts index 1248eda71a4..36a86b5cc27 100644 --- a/src/arguments/range.ts +++ b/src/arguments/range.ts @@ -1,9 +1,9 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { parseRange } from '#utils/util'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { - public run(parameter: string, context: ArgumentContext) { + public run(parameter: string, context: Argument.Context) { const number = Number(parameter); if (Number.isSafeInteger(number)) return this.ok([number]); diff --git a/src/arguments/reset.ts b/src/arguments/reset.ts index 00e2cf5a5b2..5b6690395f1 100644 --- a/src/arguments/reset.ts +++ b/src/arguments/reset.ts @@ -1,8 +1,8 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { - public run(parameter: string, context: ArgumentContext) { + public run(parameter: string, context: Argument.Context) { const lowerCasedParameter = parameter.toLowerCase(); if (context.args.t(LanguageKeys.Arguments.ResetPossibles).includes(lowerCasedParameter)) return this.ok(true); return this.error({ parameter, context }); diff --git a/src/arguments/roleName.ts b/src/arguments/roleName.ts index fb6e97835e3..c1d96737500 100644 --- a/src/arguments/roleName.ts +++ b/src/arguments/roleName.ts @@ -2,7 +2,7 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { isGuildMessage } from '#utils/common'; import { FuzzySearch } from '#utils/Parsers/FuzzySearch'; import { RoleMentionRegex, SnowflakeRegex } from '@sapphire/discord.js-utilities'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; import type { Guild, Role } from 'discord.js'; export class UserArgument extends Argument { @@ -32,6 +32,6 @@ export class UserArgument extends Argument { } } -interface RoleArgumentContext extends ArgumentContext { +interface RoleArgumentContext extends Argument.Context { filter?: (entry: Role) => boolean; } diff --git a/src/arguments/snowflake.ts b/src/arguments/snowflake.ts index 9385d44ea46..8f84ebf6f96 100644 --- a/src/arguments/snowflake.ts +++ b/src/arguments/snowflake.ts @@ -1,5 +1,5 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; import { DiscordSnowflake } from '@sapphire/snowflake'; import type { Snowflake } from 'discord.js'; @@ -15,7 +15,7 @@ export class UserArgument extends Argument { */ private readonly kMinimum = new Date(2015, 1, 28).getTime(); - public run(parameter: string, context: ArgumentContext) { + public run(parameter: string, context: Argument.Context) { if (this.kRegExp.test(parameter)) { const snowflake = DiscordSnowflake.deconstruct(parameter); const timestamp = Number(snowflake.timestamp); diff --git a/src/arguments/store.ts b/src/arguments/store.ts index 43525ed9275..33ab8970fb2 100644 --- a/src/arguments/store.ts +++ b/src/arguments/store.ts @@ -1,16 +1,17 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Argument, ArgumentContext, Piece, Store } from '@sapphire/framework'; +import { Argument, Piece, Store } from '@sapphire/framework'; export class UserArgument extends Argument> { public possibles: readonly string[] = []; - public async run(parameter: string, context: ArgumentContext) { + + public run(parameter: string, context: Argument.Context) { for (const store of this.container.stores.values()) { if (store.name === parameter) return this.ok(store); } return this.error({ parameter, identifier: LanguageKeys.Arguments.Store, context: { ...context, possibles: this.possibles } }); } - public onLoad() { + public override onLoad() { this.possibles = this.container.stores.map((store) => `\`${store.name}\``); return super.onLoad(); } diff --git a/src/arguments/textChannelName.ts b/src/arguments/textChannelName.ts index bc14708ff8c..8aed4910b01 100644 --- a/src/arguments/textChannelName.ts +++ b/src/arguments/textChannelName.ts @@ -1,5 +1,5 @@ import { isTextChannel } from '@sapphire/discord.js-utilities'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; import type { TextChannel } from 'discord.js'; export class UserArgument extends Argument { @@ -7,7 +7,7 @@ export class UserArgument extends Argument { return this.store.get('channelName') as Argument; } - public run(argument: string, context: ArgumentContext) { + public run(argument: string, context: Argument.Context) { return this.channelName.run(argument, { ...context, filter: isTextChannel }); } } diff --git a/src/arguments/textOrNewsChannelName.ts b/src/arguments/textOrNewsChannelName.ts index 8def796c674..c60b600f10f 100644 --- a/src/arguments/textOrNewsChannelName.ts +++ b/src/arguments/textOrNewsChannelName.ts @@ -1,6 +1,6 @@ import { orMix } from '#utils/common'; import { isNewsChannel, isTextChannel } from '@sapphire/discord.js-utilities'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; import type { NewsChannel, TextChannel } from 'discord.js'; export class UserArgument extends Argument { @@ -10,7 +10,7 @@ export class UserArgument extends Argument { return this.store.get('channelName') as Argument; } - public run(argument: string, context: ArgumentContext) { + public run(argument: string, context: Argument.Context) { return this.channelName.run(argument, { ...context, filter: this.filter }); } } diff --git a/src/arguments/time.ts b/src/arguments/time.ts index 082ef50a8e8..e637383b785 100644 --- a/src/arguments/time.ts +++ b/src/arguments/time.ts @@ -1,5 +1,5 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; export class UserArgument extends Argument { private get date() { @@ -10,12 +10,11 @@ export class UserArgument extends Argument { return this.container.stores.get('arguments').get('duration') as Argument; } - public async run(parameter: string, context: ArgumentContext) { - const date = await Promise.resolve() - .then(() => this.date.run(parameter, context)) - .then((date) => (date.success ? date : this.duration.run(parameter, context))); + public async run(parameter: string, context: Argument.Context) { + let result = await this.date.run(parameter, context); + if (result.isErr()) result = await this.duration.run(parameter, context); - if (date.success && date.value.getTime() > Date.now()) return this.ok(date.value); + if (result.isOkAnd((date) => date.getTime() > Date.now())) return this.ok(result.unwrap()); return this.error({ parameter, identifier: LanguageKeys.Arguments.Time, context }); } } diff --git a/src/arguments/timespan.ts b/src/arguments/timespan.ts index bb4e315ed2a..1e74b2bcda0 100644 --- a/src/arguments/timespan.ts +++ b/src/arguments/timespan.ts @@ -1,10 +1,10 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { seconds } from '#utils/common'; -import { Argument, ArgumentContext } from '@sapphire/framework'; +import { Argument } from '@sapphire/framework'; import { Duration } from '@sapphire/time-utilities'; export class UserArgument extends Argument { - public run(parameter: string, context: ArgumentContext) { + public run(parameter: string, context: Argument.Context) { const duration = this.parseParameter(parameter); if (!Number.isSafeInteger(duration)) { diff --git a/src/arguments/userName.ts b/src/arguments/userName.ts index 4bb99f13dc7..ae5c45f85b5 100644 --- a/src/arguments/userName.ts +++ b/src/arguments/userName.ts @@ -2,7 +2,7 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { GuildMessage } from '#lib/types'; import { isGuildMessage } from '#utils/common'; import { SnowflakeRegex, UserOrMemberMentionRegex } from '@sapphire/discord.js-utilities'; -import { Argument, ArgumentContext, Identifiers } from '@sapphire/framework'; +import { Argument, Identifiers } from '@sapphire/framework'; import type { User } from 'discord.js'; export class UserArgument extends Argument { @@ -10,7 +10,7 @@ export class UserArgument extends Argument { return this.store.get('user') as Argument; } - public async run(parameter: string, context: ArgumentContext) { + public async run(parameter: string, context: Argument.Context) { const message = context.message as GuildMessage; if (!isGuildMessage(message)) return this.user.run(parameter, context); diff --git a/src/commands/Admin/conf.ts b/src/commands/Admin/conf.ts index 1fd0bd54012..9882e4b4628 100644 --- a/src/commands/Admin/conf.ts +++ b/src/commands/Admin/conf.ts @@ -1,6 +1,6 @@ import { configurableGroups, isSchemaGroup, isSchemaKey, readSettings, remove, reset, SchemaKey, set, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SettingsMenu, SkyraCommand } from '#lib/structures'; +import { SettingsMenu, SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { isValidCustomEmoji, isValidSerializedTwemoji, isValidTwemoji } from '#lib/util/functions/emojis'; @@ -10,24 +10,31 @@ import { ApplyOptions, RequiresClientPermissions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { toTitleCase } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; -@ApplyOptions({ +@ApplyOptions({ aliases: ['settings', 'config', 'configs', 'configuration'], description: LanguageKeys.Commands.Admin.ConfDescription, detailedDescription: LanguageKeys.Commands.Admin.ConfExtended, guarded: true, permissionLevel: PermissionLevels.Administrator, runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['set', { input: 'add', output: 'set' }, 'show', 'remove', 'reset', { input: 'menu', default: true }] + subcommands: [ + { name: 'set' }, + { name: 'add', messageRun: 'set' }, + { name: 'show' }, + { name: 'remove' }, + { name: 'reset' }, + { name: 'menu', default: true } + ] }) -export class UserCommand extends SkyraCommand { +export class UserCommand extends SkyraSubcommand { @RequiresClientPermissions(PermissionFlagsBits.EmbedLinks) - public menu(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.Context) { + public menu(message: GuildMessage, args: SkyraSubcommand.Args, context: SkyraSubcommand.RunContext) { return new SettingsMenu(message, args.t).init(context); } - public async show(message: GuildMessage, args: SkyraCommand.Args) { + public async show(message: GuildMessage, args: SkyraSubcommand.Args) { const key = args.finished ? '' : await args.pick('string'); const schemaValue = configurableGroups.getPathString(key.toLowerCase()); if (schemaValue === null) this.error(LanguageKeys.Commands.Admin.ConfGetNoExt, { key }); @@ -55,7 +62,7 @@ export class UserCommand extends SkyraCommand { }); } - public async set(message: GuildMessage, args: SkyraCommand.Args) { + public async set(message: GuildMessage, args: SkyraSubcommand.Args) { const [key, schemaKey] = await this.fetchKey(args); const response = await writeSettings(message.guild, async (settings) => { await set(settings, schemaKey, args); @@ -68,7 +75,7 @@ export class UserCommand extends SkyraCommand { }); } - public async remove(message: GuildMessage, args: SkyraCommand.Args) { + public async remove(message: GuildMessage, args: SkyraSubcommand.Args) { const [key, schemaKey] = await this.fetchKey(args); const response = await writeSettings(message.guild, async (settings) => { await remove(settings, schemaKey, args); @@ -81,7 +88,7 @@ export class UserCommand extends SkyraCommand { }); } - public async reset(message: GuildMessage, args: SkyraCommand.Args) { + public async reset(message: GuildMessage, args: SkyraSubcommand.Args) { const [key, schemaKey] = await this.fetchKey(args); const response = await writeSettings(message.guild, async (settings) => { reset(settings, schemaKey); @@ -98,7 +105,7 @@ export class UserCommand extends SkyraCommand { return isValidCustomEmoji(response) || isValidSerializedTwemoji(response) || isValidTwemoji(response) ? response : inlineCode(response); } - private async fetchKey(args: SkyraCommand.Args) { + private async fetchKey(args: SkyraSubcommand.Args) { const key = await args.pick('string'); const value = configurableGroups.getPathString(key.toLowerCase()); if (value === null) this.error(LanguageKeys.Commands.Admin.ConfGetNoExt, { key }); diff --git a/src/commands/Admin/roleset.ts b/src/commands/Admin/roleset.ts index e2c91b20309..16301aff4ca 100644 --- a/src/commands/Admin/roleset.ts +++ b/src/commands/Admin/roleset.ts @@ -1,28 +1,28 @@ -import { GuildEntity, GuildSettings, readSettings, UniqueRoleSet, writeSettings } from '#lib/database'; +import { GuildEntity, GuildSettings, readSettings, writeSettings, type UniqueRoleSet } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; +import { SkyraCommand, SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -@ApplyOptions({ +@ApplyOptions({ aliases: ['rs'], description: LanguageKeys.Commands.Admin.RoleSetDescription, detailedDescription: LanguageKeys.Commands.Admin.RoleSetExtended, permissionLevel: PermissionLevels.Administrator, runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['add', 'remove', 'reset', 'list', { input: 'auto', default: true }] + subcommands: [{ name: 'add' }, { name: 'remove' }, { name: 'reset' }, { name: 'list' }, { name: 'auto', default: true }] }) -export class UserCommand extends SkyraCommand { +export class UserCommand extends SkyraSubcommand { // This subcommand will always ADD roles in to a existing set OR it will create a new set if that set does not exist - public async add(message: GuildMessage, args: SkyraCommand.Args) { + public async add(message: GuildMessage, args: SkyraSubcommand.Args) { return this.handleAdd(message, await args.pick('string'), args); } // This subcommand will always remove roles from a provided role set. - public async remove(message: GuildMessage, args: SkyraCommand.Args) { + public async remove(message: GuildMessage, args: SkyraSubcommand.Args) { const name = await args.pick('string'); const roles = await args.repeat('roleName'); @@ -38,7 +38,7 @@ export class UserCommand extends SkyraCommand { return send(message, args.t(LanguageKeys.Commands.Admin.RoleSetRemoved, { name, roles: roles.map((role) => role.name) })); } - public async reset(message: GuildMessage, args: SkyraCommand.Args) { + public async reset(message: GuildMessage, args: SkyraSubcommand.Args) { const [name, sets] = await Promise.all([ args.pick('string').catch(() => null), // Get all rolesets from settings and check if there is an existing set with the name provided by the user @@ -62,7 +62,7 @@ export class UserCommand extends SkyraCommand { } // This subcommand will run if a user doesn't type add or remove. The bot will then add AND remove based on whether that role is in the set already. - public async auto(message: GuildMessage, args: SkyraCommand.Args) { + public async auto(message: GuildMessage, args: SkyraSubcommand.Args) { const name = await args.pick('string'); // Get all role sets from settings and check if there is an existing set with the name provided by the user diff --git a/src/commands/Animal/bunny.ts b/src/commands/Animal/bunny.ts index 771883a59a8..85c7b40a976 100644 --- a/src/commands/Animal/bunny.ts +++ b/src/commands/Animal/bunny.ts @@ -2,11 +2,11 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SkyraCommand } from '#lib/structures'; import { getColor, getImageUrl } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { fetch, FetchResultTypes } from '@sapphire/fetch'; +import { FetchResultTypes, fetch } from '@sapphire/fetch'; import { send } from '@sapphire/plugin-editable-commands'; import { isNullishOrEmpty } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; import { URL } from 'node:url'; const url = new URL('https://api.bunnies.io/v2/loop/random/?media=gif,png'); @@ -18,7 +18,7 @@ const url = new URL('https://api.bunnies.io/v2/loop/random/?media=gif,png'); requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const { media: { gif }, source: bunnySource @@ -28,7 +28,7 @@ export class UserCommand extends SkyraCommand { const translations = args.t(LanguageKeys.Commands.Animal.BunnyEmbedData); const source = this.getSource(bunnySource); - const embed = new MessageEmbed().setURL(imageUrl).setTitle(translations.title).setColor(getColor(message)).setImage(imageUrl).setTimestamp(); + const embed = new EmbedBuilder().setURL(imageUrl).setTitle(translations.title).setColor(getColor(message)).setImage(imageUrl).setTimestamp(); if (source) { embed.setDescription(`[${translations.source}](${source})`); diff --git a/src/commands/Animal/dog.ts b/src/commands/Animal/dog.ts index be6e75264f5..c473b7fa941 100644 --- a/src/commands/Animal/dog.ts +++ b/src/commands/Animal/dog.ts @@ -2,10 +2,10 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SkyraCommand } from '#lib/structures'; import { getColor, getImageUrl } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { fetch, FetchResultTypes } from '@sapphire/fetch'; +import { FetchResultTypes, fetch } from '@sapphire/fetch'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; @ApplyOptions({ aliases: ['doggo', 'puppy'], @@ -14,10 +14,10 @@ import { Message, MessageEmbed } from 'discord.js'; requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message) { + public override async messageRun(message: Message) { const image = await this.fetchImage(); - const embed = new MessageEmbed().setColor(getColor(message)).setImage(image!).setTimestamp(); + const embed = new EmbedBuilder().setColor(getColor(message)).setImage(image!).setTimestamp(); return send(message, { embeds: [embed] }); } diff --git a/src/commands/Animal/fox.ts b/src/commands/Animal/fox.ts index e0d90fe9d63..c612781e96a 100644 --- a/src/commands/Animal/fox.ts +++ b/src/commands/Animal/fox.ts @@ -2,10 +2,10 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SkyraCommand } from '#lib/structures'; import { getColor, getImageUrl } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { fetch, FetchResultTypes } from '@sapphire/fetch'; +import { FetchResultTypes, fetch } from '@sapphire/fetch'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; import { URL } from 'node:url'; const url = new URL('https://randomfox.ca/floof'); @@ -16,9 +16,9 @@ const url = new URL('https://randomfox.ca/floof'); requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message) { + public override async messageRun(message: Message) { const { image } = await fetch(url, FetchResultTypes.JSON); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(getColor(message)) .setImage(getImageUrl(image) ?? 'https://i.imgur.com/JCtnTv8.png') .setTimestamp(); diff --git a/src/commands/Animal/kitty.ts b/src/commands/Animal/kitty.ts index 892211ff1d6..fb2d79c7518 100644 --- a/src/commands/Animal/kitty.ts +++ b/src/commands/Animal/kitty.ts @@ -2,11 +2,11 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SkyraCommand } from '#lib/structures'; import { getColor, getImageUrl } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { fetch, FetchResultTypes } from '@sapphire/fetch'; -import { fromAsync } from '@sapphire/framework'; +import { FetchResultTypes, fetch } from '@sapphire/fetch'; +import { Option, Result } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; @ApplyOptions({ aliases: ['kitten', 'cat'], @@ -15,12 +15,14 @@ import { Message, MessageEmbed } from 'discord.js'; requiredClientPermissions: [PermissionFlagsBits.AttachFiles, PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message) { - const result = await fromAsync(fetch('https://aws.random.cat/meow', FetchResultTypes.JSON)); - const embed = new MessageEmbed() - .setColor(getColor(message)) - .setImage((result.success && getImageUrl(result.value.file)) || 'https://wallpapercave.com/wp/wp3021105.jpg') - .setTimestamp(); + public override async messageRun(message: Message) { + const result = await Result.fromAsync(fetch('https://aws.random.cat/meow', FetchResultTypes.JSON)); + const image = result + .ok() + .mapInto((value) => Option.from(getImageUrl(value.file))) + .unwrapOr('https://wallpapercave.com/wp/wp3021105.jpg'); + + const embed = new EmbedBuilder().setColor(getColor(message)).setImage(image).setTimestamp(); return send(message, { embeds: [embed] }); } } diff --git a/src/commands/Animal/shibe.ts b/src/commands/Animal/shibe.ts index 5c373f57e2f..3a58519f73a 100644 --- a/src/commands/Animal/shibe.ts +++ b/src/commands/Animal/shibe.ts @@ -2,10 +2,10 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SkyraCommand } from '#lib/structures'; import { getColor, getImageUrl } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { fetch, FetchResultTypes } from '@sapphire/fetch'; +import { FetchResultTypes, fetch } from '@sapphire/fetch'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; @ApplyOptions({ description: LanguageKeys.Commands.Animal.ShibeDescription, @@ -13,9 +13,9 @@ import { Message, MessageEmbed } from 'discord.js'; requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message) { + public override async messageRun(message: Message) { const urls = await fetch<[string]>('https://shibe.online/api/shibes?count=1', FetchResultTypes.JSON); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(getColor(message)) .setImage(getImageUrl(urls[0]) ?? 'https://i.imgur.com/JJL4ErN.jpg') .setTimestamp(); diff --git a/src/commands/Fun/dice.ts b/src/commands/Fun/dice.ts index 5c7fd94064b..e2e763994b4 100644 --- a/src/commands/Fun/dice.ts +++ b/src/commands/Fun/dice.ts @@ -31,7 +31,7 @@ export class UserCommand extends SkyraCommand { */ private readonly kDice20TrailRegExp = /([+-x*])\s*(\d+)/g; - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const amountOrDice = await args.pick('integer', { minimum: 1, maximum: 1024 }).catch(() => args.rest('string')); const content = args.t(LanguageKeys.Commands.Fun.DiceOutput, { result: this.roll(amountOrDice) }); return send(message, content); diff --git a/src/commands/Fun/escaperope.ts b/src/commands/Fun/escaperope.ts index 770e4fa2ae9..be4beaeef4b 100644 --- a/src/commands/Fun/escaperope.ts +++ b/src/commands/Fun/escaperope.ts @@ -5,7 +5,7 @@ import { deleteMessage } from '#utils/functions'; import { getColor, getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { send } from '@sapphire/plugin-editable-commands'; -import { Message, MessageEmbed } from 'discord.js'; +import { EmbedBuilder, Message } from 'discord.js'; @ApplyOptions({ aliases: ['escape'], @@ -13,10 +13,10 @@ import { Message, MessageEmbed } from 'discord.js'; detailedDescription: LanguageKeys.Commands.Fun.EscapeRopeExtended }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { if (message.deletable) await deleteMessage(message).catch(() => null); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(getColor(message)) .setImage(CdnUrls.EscapeRopeGif) .setDescription(args.t(LanguageKeys.Commands.Fun.EscapeRopeOutput, { user: message.author.toString() })) diff --git a/src/commands/Fun/love.ts b/src/commands/Fun/love.ts index cde6680fd2b..c2d5125c9a7 100644 --- a/src/commands/Fun/love.ts +++ b/src/commands/Fun/love.ts @@ -4,8 +4,8 @@ import { CdnUrls } from '#utils/constants'; import { getColor, getDisplayAvatar, getTag } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; @ApplyOptions({ description: LanguageKeys.Commands.Fun.LoveDescription, @@ -13,7 +13,7 @@ import { Message, MessageEmbed } from 'discord.js'; requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const user = await args.pick('userName'); const isSelf = message.author.id === user.id; const percentage = isSelf ? 1 : Math.random(); @@ -36,7 +36,7 @@ export class UserCommand extends SkyraCommand { `${estimatedPercentage}% \`[${'█'.repeat(Math.round(percentage * 40)).padEnd(40, '\u00A0')}]\`\n`, `**${args.t(LanguageKeys.Commands.Fun.LoveResult)}**: ${result}` ].join('\n'); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(getColor(message)) .setAuthor({ name: '❤ Love Meter ❤', iconURL: getDisplayAvatar(message.author, { size: 128 }) }) .setThumbnail(CdnUrls.RevolvingHeartTwemoji) diff --git a/src/commands/Fun/pop.ts b/src/commands/Fun/pop.ts index 8c619ec1d00..eca00495eb1 100644 --- a/src/commands/Fun/pop.ts +++ b/src/commands/Fun/pop.ts @@ -6,7 +6,7 @@ import { getTag, random } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { Argument } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { Message, MessageEmbed } from 'discord.js'; +import { EmbedBuilder, Message } from 'discord.js'; @ApplyOptions({ description: LanguageKeys.Commands.Fun.PopDescription, @@ -20,7 +20,7 @@ export class UserCommand extends SkyraCommand { return this.container.stores.get('arguments').get('integer') as Argument; } - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const time = args.finished ? seconds(30) : await args.pick('timespan', { minimum: seconds(10), maximum: minutes(2) }); const [width, height, length] = await Promise.all([ this.parseOption(args, ['x', 'width'], 8, 1, 10), @@ -32,7 +32,7 @@ export class UserCommand extends SkyraCommand { const solution = this.generateSolution(length); const board = [...this.generateBoard(width, height, pop, solution)].join('\n'); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Indigo) .setTitle(args.t(LanguageKeys.Commands.Fun.PopTitle)) .setDescription(board) @@ -112,7 +112,6 @@ export class UserCommand extends SkyraCommand { minimum, maximum }); - if (result.success) return result.value; - throw result.error; + return result.unwrapRaw(); } } diff --git a/src/commands/Fun/rate.ts b/src/commands/Fun/rate.ts index fc65d6ea12b..b12b48b8d6c 100644 --- a/src/commands/Fun/rate.ts +++ b/src/commands/Fun/rate.ts @@ -15,7 +15,7 @@ export class UserCommand extends SkyraCommand { private devRegex = new RegExp(`^(kyra|favna|${OWNERS.map((owner) => `<@!?${owner}>`).join('|')})$`, 'i'); private botRegex = new RegExp(`^(you|yourself|skyra|<@!${process.env.CLIENT_ID}>)$`, 'i'); - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { // Escape all markdown let rateableThing = await args.rest('string'); diff --git a/src/commands/Games/c4.ts b/src/commands/Games/c4.ts index e25ea3a8caa..fa7f29e2293 100644 --- a/src/commands/Games/c4.ts +++ b/src/commands/Games/c4.ts @@ -7,7 +7,7 @@ import type { GuildMessage } from '#lib/types'; import { promptConfirmation } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; import type { User } from 'discord.js'; @ApplyOptions({ @@ -21,7 +21,7 @@ import type { User } from 'discord.js'; export class UserCommand extends SkyraCommand { private readonly channels = new Set(); - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { if (this.channels.has(message.channel.id)) this.error(LanguageKeys.Commands.Games.GamesProgress); const user = await args.pick('userName'); diff --git a/src/commands/Games/hungergames.ts b/src/commands/Games/hungergames.ts index fdf8955cbc0..be38a9a1ee6 100644 --- a/src/commands/Games/hungergames.ts +++ b/src/commands/Games/hungergames.ts @@ -4,14 +4,14 @@ import { SkyraCommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { minutes } from '#utils/common'; import { deleteMessage, isModerator } from '#utils/functions'; -import { LLRCData, LongLivingReactionCollector } from '#utils/LongLivingReactionCollector'; +import { LongLivingReactionCollector, type LLRCData } from '#utils/LongLivingReactionCollector'; import { cleanMentions } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { canSendMessages } from '@sapphire/discord.js-utilities'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { chunk, isFunction } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; import type { TFunction } from 'i18next'; import { setTimeout as sleep } from 'node:timers/promises'; @@ -27,7 +27,7 @@ export class UserCommand extends SkyraCommand { public readonly playing: Set = new Set(); public readonly kEmojis = ['🇳', '🇾']; - public async messageRun(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.Context) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.RunContext) { const autoFilled = args.getFlags('autofill'); const tributes = args.finished && autoFilled ? [] : args.nextSplit({ times: 50 }); const autoSkip = args.getFlags('autoskip'); @@ -85,7 +85,10 @@ export class UserCommand extends SkyraCommand { : LanguageKeys.Commands.Games.HungerGamesNight; // Main logic of the game - const { results, deaths } = this.makeResultEvents(game, args.t(events).map(HungerGamesUsage.create)); + const { results, deaths } = this.makeResultEvents( + game, + args.t(events).map((usage) => HungerGamesUsage.create(usage)) + ); const texts = this.buildTexts(args.t, game, results, deaths); // Ask for the user to proceed: diff --git a/src/commands/Games/tictactoe.ts b/src/commands/Games/tictactoe.ts index 2d13820a932..ab78f72430d 100644 --- a/src/commands/Games/tictactoe.ts +++ b/src/commands/Games/tictactoe.ts @@ -7,7 +7,7 @@ import type { GuildMessage } from '#lib/types'; import { promptConfirmation } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; import type { User } from 'discord.js'; import type { TFunction } from 'i18next'; @@ -21,7 +21,7 @@ import type { TFunction } from 'i18next'; export class UserCommand extends SkyraCommand { private readonly channels: Set = new Set(); - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { if (this.channels.has(message.channel.id)) this.error(LanguageKeys.Commands.Games.GamesProgress); const user = await args.pick('userName'); diff --git a/src/commands/Games/trivia.ts b/src/commands/Games/trivia.ts index 541dff6cf81..285933a7b75 100644 --- a/src/commands/Games/trivia.ts +++ b/src/commands/Games/trivia.ts @@ -1,4 +1,4 @@ -import { CATEGORIES, getQuestion, QuestionData, QuestionDifficulty, QuestionType } from '#lib/games/TriviaManager'; +import { CATEGORIES, QuestionDifficulty, QuestionType, getQuestion, type QuestionData } from '#lib/games/TriviaManager'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SkyraCommand } from '#lib/structures'; import { floatPromise, minutes, seconds } from '#utils/common'; @@ -7,9 +7,9 @@ import { sendLoadingMessage, shuffle } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { Args } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageCollector, MessageEmbed, User } from 'discord.js'; -import { decode } from 'he'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message, MessageCollector, User } from 'discord.js'; +import he from 'he'; import type { TFunction } from 'i18next'; @ApplyOptions({ @@ -20,7 +20,7 @@ import type { TFunction } from 'i18next'; export class UserCommand extends SkyraCommand { #channels = new Set(); - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const category = await args.pick(UserCommand.category).catch(() => CATEGORIES.general); const questionType = await args.pick(UserCommand.questionType).catch(() => QuestionType.Multiple); const difficulty = await args.pick(UserCommand.questionDifficulty).catch(() => QuestionDifficulty.Easy); @@ -35,8 +35,8 @@ export class UserCommand extends SkyraCommand { const possibleAnswers = questionType === QuestionType.Boolean ? ['True', 'False'] - : shuffle([data.correct_answer, ...data.incorrect_answers].map((ans) => decode(ans))); - const correctAnswer = decode(data.correct_answer); + : shuffle([data.correct_answer, ...data.incorrect_answers].map((ans) => he.decode(ans))); + const correctAnswer = he.decode(data.correct_answer); const questionEmbed = this.buildQuestionEmbed(args.t, data, possibleAnswers); await send(message, { embeds: [questionEmbed] }); @@ -54,7 +54,7 @@ export class UserCommand extends SkyraCommand { .on('collect', (collected: Message) => { if (participants.has(collected.author.id)) return; const attempt = possibleAnswers[parseInt(collected.content, 10) - 1]; - if (attempt === decode(data.correct_answer)) { + if (attempt === correctAnswer) { winner = collected.author; return collector.stop(); } @@ -79,12 +79,12 @@ export class UserCommand extends SkyraCommand { public buildQuestionEmbed(t: TFunction, data: QuestionData, possibleAnswers: string[]) { const titles = t(LanguageKeys.Commands.Games.TriviaEmbedTitles); const questionDisplay = possibleAnswers.map((possible, i) => `${i + 1}. ${possible}`); - return new MessageEmbed() + return new EmbedBuilder() .setAuthor({ name: titles.trivia }) .setTitle(data.category) .setColor(0xf37917) .setThumbnail('http://i.imgur.com/zPtu5aP.png') - .setDescription([`${titles.difficulty}: ${data.difficulty}`, '', decode(data.question), '', questionDisplay.join('\n')].join('\n')); + .setDescription([`${titles.difficulty}: ${data.difficulty}`, '', he.decode(data.question), '', questionDisplay.join('\n')].join('\n')); } private static category = Args.make((parameter, { argument }) => { diff --git a/src/commands/General/help.ts b/src/commands/General/help.ts index f2ffc55cceb..2408d85f864 100644 --- a/src/commands/General/help.ts +++ b/src/commands/General/help.ts @@ -1,15 +1,15 @@ -import { LanguageHelp } from '#lib/i18n/LanguageHelp'; +import { LanguageHelp, type LanguageHelpDisplayOptions } from '#lib/i18n/LanguageHelp'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SkyraCommand } from '#lib/structures'; import { isGuildMessage, isPrivateMessage } from '#utils/common'; -import { getColor } from '#utils/util'; +import { getColor, splitMessage } from '#utils/util'; import { ApplyOptions, RequiresClientPermissions } from '@sapphire/decorators'; import { UserOrMemberMentionRegex } from '@sapphire/discord-utilities'; import { PaginatedMessage } from '@sapphire/discord.js-utilities'; -import { Args, container, fromAsync } from '@sapphire/framework'; +import { Args, container, Result, type MessageCommand } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Collection, Message, MessageEmbed, Util } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Collection, EmbedBuilder, Message } from 'discord.js'; import type { TFunction } from 'i18next'; /** @@ -34,29 +34,29 @@ function sortCommandsAlphabetically(_: SkyraCommand[], __: SkyraCommand[], first guarded: true }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args, context: SkyraCommand.Context) { + public override async messageRun(message: Message, args: SkyraCommand.Args, context: SkyraCommand.RunContext) { if (args.finished) { if (args.getFlags('cat', 'categories')) return this.helpCategories(message, args); if (args.getFlags('all')) return this.all(message, args, context); } const category = await args.pickResult(UserCommand.categories); - if (category.success) return this.display(message, args, category.value - 1, context); + if (category.isOk()) return this.display(message, args, category.unwrap() - 1, context); const page = await args.pickResult('integer', { minimum: 0 }); - if (page.success) return this.display(message, args, page.value - 1, context); + if (page.isOk()) return this.display(message, args, page.unwrap() - 1, context); // Handle case for a single command const command = await args.pickResult('commandName'); - if (command.success) { - const embed = await this.buildCommandHelp(message, args, command.value, this.getCommandPrefix(context)); + if (command.isOk()) { + const embed = await this.buildCommandHelp(message, args, command.unwrap(), this.getCommandPrefix(context)); return send(message, { embeds: [embed] }); } return this.display(message, args, null, context); } - private getCommandPrefix(context: SkyraCommand.Context): string { + private getCommandPrefix(context: SkyraCommand.RunContext): string { return (context.prefix instanceof RegExp && !context.commandPrefix.endsWith(' ')) || UserOrMemberMentionRegex.test(context.commandPrefix) ? `${context.commandPrefix} ` : context.commandPrefix; @@ -77,13 +77,13 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - private async all(message: Message, args: SkyraCommand.Args, context: SkyraCommand.Context) { + private async all(message: Message, args: SkyraCommand.Args, context: SkyraCommand.RunContext) { const fullContent = await this.buildHelp(message, args.t, this.getCommandPrefix(context)); - const contents = Util.splitMessage(fullContent, { char: '\n', maxLength: 2000 }); + const contents = splitMessage(fullContent, { char: '\n', maxLength: 2000 }); for (const content of contents) { - const { success } = await fromAsync(message.author.send(content)); - if (success) continue; + const result = await Result.fromAsync(message.author.send(content)); + if (result.isOk()) continue; if (isPrivateMessage(message)) this.error(LanguageKeys.Commands.General.HelpNoDm); return; @@ -93,7 +93,7 @@ export class UserCommand extends SkyraCommand { } @RequiresClientPermissions(PermissionFlagsBits.EmbedLinks) - private async display(message: Message, args: SkyraCommand.Args, index: number | null, context: SkyraCommand.Context) { + private async display(message: Message, args: SkyraCommand.Args, index: number | null, context: SkyraCommand.RunContext) { const prefix = this.getCommandPrefix(context); const content = args.t(LanguageKeys.Commands.General.HelpAllFlag, { prefix }); @@ -121,7 +121,7 @@ export class UserCommand extends SkyraCommand { const commandsByCategory = await UserCommand.fetchCommands(message); const display = new PaginatedMessage({ - template: new MessageEmbed().setColor(getColor(message)) + template: new EmbedBuilder().setColor(getColor(message)) }) // .setSelectMenuOptions((pageIndex) => ({ label: commandsByCategory.at(pageIndex - 1)![0].fullCategory!.join(' → ') })); @@ -149,14 +149,17 @@ export class UserCommand extends SkyraCommand { .setPossibleFormats(builderData.possibleFormats) .setReminder(builderData.reminders); - const extendedHelpData = args.t(command.detailedDescription, { replace: { prefix: prefixUsed }, postProcess: 'helpUsagePostProcessor' }); + const extendedHelpData = args.t(command.detailedDescription, { + replace: { prefix: prefixUsed }, + postProcess: 'helpUsagePostProcessor' + }) as LanguageHelpDisplayOptions; const extendedHelp = builder.display(command.name, this.formatAliases(args.t, command.aliases), extendedHelpData, prefixUsed); const data = args.t(LanguageKeys.Commands.General.HelpData, { footerName: command.name, titleDescription: args.t(command.description) }); - return new MessageEmbed() + return new EmbedBuilder() .setColor(getColor(message)) .setTimestamp() .setFooter({ text: data.footer }) @@ -193,12 +196,12 @@ export class UserCommand extends SkyraCommand { const command = cmd as SkyraCommand; if (command.hidden) return; - const result = await cmd.preconditions.run(message, command, { command: null! }); - if (!result.success) return; + const result = await cmd.preconditions.messageRun(message, command as MessageCommand, { command: null! }); + if (result.isErr()) return; - const category = filtered.get(command.fullCategory!.join(' → ')); + const category = filtered.get(command.fullCategory.join(' → ')); if (category) category.push(command); - else filtered.set(command.fullCategory!.join(' → '), [command as SkyraCommand]); + else filtered.set(command.fullCategory.join(' → '), [command]); }) ); diff --git a/src/commands/General/info.ts b/src/commands/General/info.ts index cd57fc32bbf..75800334328 100644 --- a/src/commands/General/info.ts +++ b/src/commands/General/info.ts @@ -3,13 +3,13 @@ import type { StatsGeneral, StatsUptime, StatsUsage } from '#lib/i18n/languageKe import { SkyraArgs, SkyraCommand } from '#lib/structures'; import { seconds } from '#utils/common'; import { getColor, getEmbedAuthor } from '#utils/util'; -import { TimestampStyles, time } from '@discordjs/builders'; +import { ActionRowBuilder, ButtonBuilder, TimestampStyles, time, type MessageActionRowComponentBuilder } from '@discordjs/builders'; import { ApplyOptions } from '@sapphire/decorators'; import { version as sapphireVersion } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { roundNumber } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/payloads/v9'; -import { Message, MessageActionRow, MessageButton, MessageEmbed, Permissions, version as djsVersion } from 'discord.js'; +import { ButtonStyle, OAuth2Scopes, PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, PermissionsBitField, version as djsVersion, type Message } from 'discord.js'; import { cpus, uptime, type CpuInfo } from 'os'; @ApplyOptions({ @@ -19,14 +19,10 @@ import { cpus, uptime, type CpuInfo } from 'os'; requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const embed = this.buildEmbed(message, args); const components = this.buildComponents(args); - - return send(message, { - embeds: [embed], - components - }); + return send(message, { embeds: [embed], components }); } private buildEmbed(message: Message, args: SkyraCommand.Args) { @@ -37,51 +33,53 @@ export class UserCommand extends SkyraCommand { usage: this.usageStatistics }); - return new MessageEmbed() + return new EmbedBuilder() .setColor(getColor(message)) .setAuthor(getEmbedAuthor(this.container.client.user!)) .setDescription(args.t(LanguageKeys.Commands.General.InfoBody)) .setTimestamp() - .addField(titles.stats, fields.stats) - .addField(titles.uptime, fields.uptime) - .addField(titles.serverUsage, fields.serverUsage); + .addFields( + { name: titles.stats, value: fields.stats }, + { name: titles.uptime, value: fields.uptime }, + { name: titles.serverUsage, value: fields.serverUsage } + ); } - private buildComponents(args: SkyraArgs): MessageActionRow[] { + private buildComponents(args: SkyraArgs): ActionRowBuilder[] { const componentLabels = args.t(LanguageKeys.Commands.General.InfoComponentLabels); return [ - new MessageActionRow().addComponents( - new MessageButton() // - .setStyle('LINK') + new ActionRowBuilder().addComponents( + new ButtonBuilder() // + .setStyle(ButtonStyle.Link) .setURL(this.inviteLink) .setLabel(componentLabels.addToServer) - .setEmoji('🎉'), - new MessageButton() // - .setStyle('LINK') + .setEmoji({ name: '🎉' }), + new ButtonBuilder() // + .setStyle(ButtonStyle.Link) .setURL('https://discord.gg/6gakFR2') .setLabel(componentLabels.supportServer) - .setEmoji('🆘') + .setEmoji({ name: '🆘' }) ), - new MessageActionRow().addComponents( - new MessageButton() - .setStyle('LINK') + new ActionRowBuilder().addComponents( + new ButtonBuilder() + .setStyle(ButtonStyle.Link) .setURL('https://github.com/skyra-project/skyra') .setLabel(componentLabels.repository) - .setEmoji('<:github2:950888087188283422>'), - new MessageButton() // - .setStyle('LINK') + .setEmoji({ id: '950888087188283422', name: 'github2' }), + new ButtonBuilder() // + .setStyle(ButtonStyle.Link) .setURL('https://donate.skyra.pw/patreon') .setLabel(componentLabels.donate) - .setEmoji('🧡') + .setEmoji({ name: '🧡' }) ) ]; } private get inviteLink() { return this.container.client.generateInvite({ - scopes: ['bot', 'applications.commands'], - permissions: new Permissions([ + scopes: [OAuth2Scopes.Bot, OAuth2Scopes.ApplicationsCommands], + permissions: new PermissionsBitField([ PermissionFlagsBits.ViewChannel, PermissionFlagsBits.ReadMessageHistory, PermissionFlagsBits.SendMessages, diff --git a/src/commands/General/invite.ts b/src/commands/General/invite.ts index 5d576f0c3c1..6fb4dda31cc 100644 --- a/src/commands/General/invite.ts +++ b/src/commands/General/invite.ts @@ -4,8 +4,8 @@ import { BrandingColors } from '#utils/constants'; import { hyperlink } from '@discordjs/builders'; import { ApplyOptions } from '@sapphire/decorators'; import { send } from '@sapphire/plugin-editable-commands'; -import { OAuth2Scopes, PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { OAuth2Scopes, PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; import type { TFunction } from 'i18next'; const flags = ['noperms', 'nopermissions']; @@ -18,22 +18,24 @@ const flags = ['noperms', 'nopermissions']; requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { - const arg = args.nextMaybe(); - const shouldNotAddPermissions = arg.exists ? flags.includes(arg.value.toLowerCase()) : args.getFlags(...flags); + public override messageRun(message: Message, args: SkyraCommand.Args) { + const shouldNotAddPermissions = args.nextMaybe().match({ + some: (value) => flags.includes(value.toLowerCase()), + none: () => args.getFlags(...flags) + }); const embed = this.getEmbed(args.t, shouldNotAddPermissions); return send(message, { embeds: [embed] }); } - private getEmbed(t: TFunction, shouldNotAddPermissions: boolean): MessageEmbed { + private getEmbed(t: TFunction, shouldNotAddPermissions: boolean): EmbedBuilder { const embeddedInviteLink = hyperlink( t(LanguageKeys.Commands.General.InvitePermissionInviteText), this.generateInviteLink(shouldNotAddPermissions) ); const embeddedJoinLink = hyperlink(t(LanguageKeys.Commands.General.InvitePermissionSupportServerText), 'https://discord.com/invite/6gakFR2'); - return new MessageEmbed() // + return new EmbedBuilder() // .setColor(BrandingColors.Primary) .setDescription( [ diff --git a/src/commands/General/ping.ts b/src/commands/General/ping.ts index c012f621a10..9a4bc725315 100644 --- a/src/commands/General/ping.ts +++ b/src/commands/General/ping.ts @@ -10,7 +10,7 @@ import type { Message } from 'discord.js'; detailedDescription: LanguageKeys.Commands.General.PingExtended }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const msg = await send(message, args.t(LanguageKeys.Commands.General.Ping)); const content = args.t(LanguageKeys.Commands.General.PingPong, { diff --git a/src/commands/General/v7-artiel.ts b/src/commands/General/v7-artiel.ts index 856459d993b..c425ee866a7 100644 --- a/src/commands/General/v7-artiel.ts +++ b/src/commands/General/v7-artiel.ts @@ -55,7 +55,7 @@ const row = makeRow(ButtonInviteArtiel, ButtonSkyraV7); hidden: true }) export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { + public override messageRun(message: Message, args: SkyraCommand.Args) { return send(message, makeReplacedMessage(args.commandContext.commandName, row, list)); } } diff --git a/src/commands/General/v7-iriss.ts b/src/commands/General/v7-iriss.ts deleted file mode 100644 index 0ae4d50de61..00000000000 --- a/src/commands/General/v7-iriss.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; -import { ButtonInviteIriss, ButtonSkyraV7, createDeprecatedList, makeReplacedMessage, makeRow } from '#utils/deprecate'; -import { ApplyOptions } from '@sapphire/decorators'; -import { send } from '@sapphire/plugin-editable-commands'; -import type { Message } from 'discord.js'; - -const list = createDeprecatedList({ - entries: [ - { out: '', in: 'suggest' }, - { - out: ['', '', ''], - in: ['resolve-suggestion', 'resu'] - } - ] -}); - -const row = makeRow(ButtonInviteIriss, ButtonSkyraV7); - -@ApplyOptions({ - name: '\u200Bv7-iriss', - aliases: [...list.keys()], - description: LanguageKeys.Commands.General.V7Description, - detailedDescription: LanguageKeys.Commands.General.V7Extended, - generateDashLessAliases: false, - hidden: true -}) -export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { - return send(message, makeReplacedMessage(args.commandContext.commandName, row, list)); - } -} diff --git a/src/commands/General/v7-nayre.ts b/src/commands/General/v7-nayre.ts deleted file mode 100644 index d57ed078db6..00000000000 --- a/src/commands/General/v7-nayre.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; -import { getColor, getEmbedAuthor } from '#utils/util'; -import { ApplyOptions } from '@sapphire/decorators'; -import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; - -@ApplyOptions({ - name: '\u200Bv7-nayre', - aliases: [ - 'balance', - 'bal', - 'credits', - 'coinflip', - 'cf', - 'daily', - 'dailies', - 'higherlower', - 'hilo', - 'hl', - 'pay', - 'slotmachine', - 'slot', - 'slots', - 'slotmachines', - 'vault', - 'bank', - 'wheeloffortune', - 'wof', - 'autorole', - 'autoroles', - 'levelrole', - 'lvlrole', - 'social', - 'leaderboard', - 'lb', - 'top', - 'scoreboard', - 'level', - 'lvl', - 'rank', - 'mylevel', - 'profile', - 'banner', - 'banners', - 'wallpaper', - 'wallpapers', - 'background', - 'backgrounds', - 'setcolor', - 'setcolour', - 'toggledarkmode', - 'darkmode', - 'toggledarktheme', - 'darktheme', - 'reputation', - 'rep' - ], - description: LanguageKeys.Commands.General.V7Description, - detailedDescription: LanguageKeys.Commands.General.V7Extended, - hidden: true, - requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] -}) -export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { - const embed = new MessageEmbed() - .setColor(getColor(message)) - .setAuthor(getEmbedAuthor(this.container.client.user!)) - .setDescription(args.t(LanguageKeys.Commands.General.V7NayreMessage, { command: args.commandContext.commandName })) - .setTimestamp(); - return send(message, { embeds: [embed] }); - } -} diff --git a/src/commands/General/v7-nekokai.ts b/src/commands/General/v7-nekokai.ts deleted file mode 100644 index c64b73290ce..00000000000 --- a/src/commands/General/v7-nekokai.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; -import { ButtonInviteNekokai, ButtonSkyraV7, createDeprecatedList, makeReplacedMessage, makeRow } from '#utils/deprecate'; -import { ApplyOptions } from '@sapphire/decorators'; -import { send } from '@sapphire/plugin-editable-commands'; -import type { Message } from 'discord.js'; - -const list = createDeprecatedList({ - entries: [ - { out: '', in: ['ani-list', 'anime'] }, - { out: '', in: ['kitsu-anime'] }, - { out: '', in: ['manga-list', 'manga'] }, - { out: '', in: ['kitsu-manga'] }, - { out: '', in: ['waifu'] }, - { out: '', in: ['slap'] }, - { out: '', in: ['wbang'] }, - { out: '', in: ['wbanghead'] }, - { out: '', in: ['wbite'] }, - { out: '', in: ['wblush'] }, - { out: '', in: ['wcry'] }, - { out: '', in: ['wcuddle'] }, - { out: '', in: ['wdance'] }, - { out: '', in: ['wgreet', 'wsalute'] }, - { out: '', in: ['whug'] }, - { out: '', in: ['wkiss'] }, - { out: '', in: ['wlewd'] }, - { out: '', in: ['wlick'] }, - { out: '', in: ['wneko'] }, - { out: '', in: ['wnom'] }, - { out: '', in: ['wpat'] }, - { out: '', in: ['wpout'] }, - { out: '', in: ['wpunch'] }, - { out: '', in: ['wslap'] }, - { out: '', in: ['wsleepy'] }, - { out: '', in: ['wsmile'] }, - { out: '', in: ['wsmug'] }, - { out: '', in: ['wstare'] }, - { out: '', in: ['wthumbsup'] }, - { out: '', in: ['wtickle'] } - ] -}); - -const row = makeRow(ButtonInviteNekokai, ButtonSkyraV7); - -@ApplyOptions({ - name: '\u200Bv7-nekokai', - aliases: [...list.keys()], - description: LanguageKeys.Commands.General.V7Description, - detailedDescription: LanguageKeys.Commands.General.V7Extended, - generateDashLessAliases: false, - hidden: true -}) -export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { - return send(message, makeReplacedMessage(args.commandContext.commandName, row, list)); - } -} diff --git a/src/commands/General/v7-pokemon.ts b/src/commands/General/v7-pokemon.ts deleted file mode 100644 index cf33b71dc90..00000000000 --- a/src/commands/General/v7-pokemon.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; -import { ButtonInviteDragonite, ButtonSkyraV7, createDeprecatedList, makeReplacedMessage, makeRow } from '#utils/deprecate'; -import { ApplyOptions } from '@sapphire/decorators'; -import { send } from '@sapphire/plugin-editable-commands'; -import type { Message } from 'discord.js'; - -const list = createDeprecatedList({ - entries: [ - { out: '', in: ['abilities', 'ability', 'pokeability'] }, - { out: '', in: ['flavor', 'flavors', 'flavour', 'flavours'] }, - { out: '', in: ['item', 'pokeitem', 'bag'] }, - { out: '', in: ['learn', 'learnall', 'learnset'] }, - { out: '', in: ['move'] }, - { out: '', in: ['dex', 'dexter', 'mon', 'poke', 'pokedex', 'pokemon'] }, - { out: '', in: ['pokeimage', 'pokesprite', 'sprite'] }, - { out: '', in: ['advantage', 'matchup', 'type', 'weakness'] } - ] -}); - -const row = makeRow(ButtonInviteDragonite, ButtonSkyraV7); - -@ApplyOptions({ - name: '\u200Bv7-pokemon', - aliases: [...list.keys()], - description: LanguageKeys.Commands.General.V7Description, - detailedDescription: LanguageKeys.Commands.General.V7Extended, - generateDashLessAliases: false, - hidden: true -}) -export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { - return send(message, makeReplacedMessage(args.commandContext.commandName, row, list)); - } -} diff --git a/src/commands/General/v7-teryl.ts b/src/commands/General/v7-teryl.ts deleted file mode 100644 index c1072f384a6..00000000000 --- a/src/commands/General/v7-teryl.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; -import { ButtonInviteTeryl, ButtonSkyraV7, createDeprecatedList, makeReplacedMessage, makeRow } from '#utils/deprecate'; -import { inlineCode } from '@discordjs/builders'; -import { ApplyOptions } from '@sapphire/decorators'; -import { send } from '@sapphire/plugin-editable-commands'; -import type { Message } from 'discord.js'; - -const list = createDeprecatedList({ - entries: [ - { out: '', in: ['choice', 'choise', 'choose', 'pick'] }, - { out: '', in: ['color', 'colour'] }, - { out: '', in: ['add-emoji', 'create-emoji'] }, - { out: '', in: ['def', 'defination', 'define', 'definition', 'dictionary'] }, - { out: '', in: ['emoji', 'emote'] }, - { out: '', in: ['poll', 'spoll'] }, - { out: '', in: ['currency', 'exchange', 'money', 'price'] }, - { out: '', in: ['rand', 'rand-reddit', 'reddit'] }, - { out: '', in: ['tag', 'tags', 'custom-command', 'copy-pasta'] }, - { out: '', in: ['twitch', 'followage'] }, - { out: '', in: ['weather'] }, - { out: '', in: ['wiki', 'wikipedia'] }, - { out: '', in: ['youtube', 'yt'] }, - { out: inlineCode('Apps > Get Message JSON'), in: ['content', 'message-source', 'msg-source', 'source'] } - ] -}); - -const row = makeRow(ButtonInviteTeryl, ButtonSkyraV7); - -@ApplyOptions({ - name: '\u200Bv7-teryl', - aliases: [...list.keys()], - description: LanguageKeys.Commands.General.V7Description, - detailedDescription: LanguageKeys.Commands.General.V7Extended, - generateDashLessAliases: false, - hidden: true -}) -export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { - return send(message, makeReplacedMessage(args.commandContext.commandName, row, list)); - } -} diff --git a/src/commands/General/v7.ts b/src/commands/General/v7.ts deleted file mode 100644 index cd22586abb6..00000000000 --- a/src/commands/General/v7.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; -import { ButtonSkyraV7, makeRemovedMessage, makeRow } from '#utils/deprecate'; -import { ApplyOptions } from '@sapphire/decorators'; -import { send } from '@sapphire/plugin-editable-commands'; -import type { Message } from 'discord.js'; - -const row = makeRow(ButtonSkyraV7); - -@ApplyOptions({ - name: '\u200Bv7', - aliases: [ - '8ball', - 'afk', - 'announce', - 'announcement', - 'bd', - 'birthday', - 'birthdays', - 'catfact', - 'chucknorris', - 'country', - 'ctime', - 'current-time', - 'divorce', - 'dsearch', - 'duckduckgo', - 'emojis', - 'emotes', - 'eshop', - 'ffxiv', - 'final-fantasy', - 'flip', - 'flow', - 'g', - 'gc', - 'gcreate', - 'ge', - 'gend', - 'gimage', - 'giveaway-end', - 'giveaway', - 'giveawayschedule', - 'google', - 'googleimage', - 'googlesearch', - 'gr', - 'greroll', - 'groll', - 'gs', - 'gschedule', - 'gsearch', - 'gstart', - 'horoscope', - 'howtoflirt', - 'igdb', - 'img', - 'itunes', - 'letmegooglethat', - 'letmegooglethatforyou', - 'lmgtfy', - 'markov', - 'married', - 'marry', - 'movie', - 'movies', - 'nick', - 'nickname', - 'norris', - 'npm-package', - 'npm', - 'pants', - 'peepolove', - 'pepelove', - 'pnpm-package', - 'pnpm', - 'pun', - 'quote', - 'reddit-user', - 'redditor', - 'reset-birthday', - 'saelem', - 'search', - 'set-birthday', - 'set-starboard-emoji', - 'setbday', - 'show', - 'shows', - 'sse', - 'star', - 'subscribe', - 'tmdb', - 'topinvites', - 'topinvs', - 'trigger', - 'triggers', - 'tv', - 'tvdb', - 'ud', - 'unsubscribe', - 'upbday', - 'upcoming-birthdays', - 'updoot', - 'upvote', - 'urban', - 'urbandictionary', - 'view-birthday', - 'viewbday', - 'waporwave', - 'yarn-package', - 'yarn', - 'zalgo' - ], - description: LanguageKeys.Commands.General.V7Description, - detailedDescription: LanguageKeys.Commands.General.V7Extended, - hidden: true -}) -export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { - return send(message, makeRemovedMessage(args.commandContext.commandName, row)); - } -} diff --git a/src/commands/Management/Configuration/manage-command-auto-delete.ts b/src/commands/Management/Configuration/manage-command-auto-delete.ts index d16c3a33952..d17f87907be 100644 --- a/src/commands/Management/Configuration/manage-command-auto-delete.ts +++ b/src/commands/Management/Configuration/manage-command-auto-delete.ts @@ -1,6 +1,6 @@ import { GuildSettings, readSettings, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; +import { SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { minutes, seconds } from '#utils/common'; @@ -10,16 +10,16 @@ import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { codeBlock } from '@sapphire/utilities'; -@ApplyOptions({ +@ApplyOptions({ aliases: ['mcad'], description: LanguageKeys.Commands.Management.ManageCommandAutoDeleteDescription, detailedDescription: LanguageKeys.Commands.Management.ManageCommandAutoDeleteExtended, permissionLevel: PermissionLevels.Administrator, runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['add', 'remove', 'reset', { input: 'show', default: true }] + subcommands: [{ name: 'add' }, { name: 'remove' }, { name: 'reset' }, { name: 'show', default: true }] }) -export class UserCommand extends SkyraCommand { - public async add(message: GuildMessage, args: SkyraCommand.Args) { +export class UserCommand extends SkyraSubcommand { + public async add(message: GuildMessage, args: SkyraSubcommand.Args) { const channel = await args.pick('textChannelName'); const time = await args.pick('timespan', { minimum: seconds(1), maximum: minutes(2) }); @@ -36,7 +36,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async remove(message: GuildMessage, args: SkyraCommand.Args) { + public async remove(message: GuildMessage, args: SkyraSubcommand.Args) { const channel = await args.pick('textChannelName'); await writeSettings(message.guild, (settings) => { const commandAutoDelete = settings[GuildSettings.CommandAutoDelete]; @@ -53,14 +53,14 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async reset(message: GuildMessage, args: SkyraCommand.Args) { + public async reset(message: GuildMessage, args: SkyraSubcommand.Args) { await writeSettings(message.guild, [[GuildSettings.CommandAutoDelete, []]]); const content = args.t(LanguageKeys.Commands.Management.ManageCommandAutoDeleteReset); return send(message, content); } - public async show(message: GuildMessage, args: SkyraCommand.Args) { + public async show(message: GuildMessage, args: SkyraSubcommand.Args) { const commandAutoDelete = await readSettings(message.guild, GuildSettings.CommandAutoDelete); if (!commandAutoDelete.length) this.error(LanguageKeys.Commands.Management.ManageCommandAutoDeleteShowEmpty); diff --git a/src/commands/Management/Configuration/manage-command-channel.ts b/src/commands/Management/Configuration/manage-command-channel.ts index ea0dd065ec5..d3308b3af2e 100644 --- a/src/commands/Management/Configuration/manage-command-channel.ts +++ b/src/commands/Management/Configuration/manage-command-channel.ts @@ -1,22 +1,22 @@ import { GuildSettings, readSettings, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; +import { SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -@ApplyOptions({ +@ApplyOptions({ aliases: ['mcc'], description: LanguageKeys.Commands.Management.ManageCommandChannelDescription, detailedDescription: LanguageKeys.Commands.Management.ManageCommandChannelExtended, permissionLevel: PermissionLevels.Administrator, runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['add', 'remove', 'reset', { input: 'show', default: true }] + subcommands: [{ name: 'add' }, { name: 'remove' }, { name: 'reset' }, { name: 'show', default: true }] }) -export class UserCommand extends SkyraCommand { - public async add(message: GuildMessage, args: SkyraCommand.Args) { +export class UserCommand extends SkyraSubcommand { + public async add(message: GuildMessage, args: SkyraSubcommand.Args) { const channel = await args.pick('textChannelName'); const command = await args.pick('command'); await writeSettings(message.guild, (settings) => { @@ -38,7 +38,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async remove(message: GuildMessage, args: SkyraCommand.Args) { + public async remove(message: GuildMessage, args: SkyraSubcommand.Args) { const channel = await args.pick('textChannelName'); const command = await args.pick('command'); await writeSettings(message.guild, (settings) => { @@ -65,7 +65,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async reset(message: GuildMessage, args: SkyraCommand.Args) { + public async reset(message: GuildMessage, args: SkyraSubcommand.Args) { const channel = await args.pick('textChannelName'); await writeSettings(message.guild, (settings) => { const disabledCommandsChannels = settings[GuildSettings.DisabledCommandChannels]; @@ -82,7 +82,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async show(message: GuildMessage, args: SkyraCommand.Args) { + public async show(message: GuildMessage, args: SkyraSubcommand.Args) { const channel = await args.pick('textChannelName'); const disabledCommandsChannels = await readSettings(message.guild, GuildSettings.DisabledCommandChannels); diff --git a/src/commands/Management/Configuration/manage-reaction-roles.ts b/src/commands/Management/Configuration/manage-reaction-roles.ts index ba5ac62abc7..5b7aeb06b57 100644 --- a/src/commands/Management/Configuration/manage-reaction-roles.ts +++ b/src/commands/Management/Configuration/manage-reaction-roles.ts @@ -1,6 +1,6 @@ -import { GuildSettings, ReactionRole, readSettings, writeSettings } from '#lib/database'; +import { GuildSettings, readSettings, writeSettings, type ReactionRole } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand, SkyraPaginatedMessage } from '#lib/structures'; +import { SkyraPaginatedMessage, SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { getEmojiString, getEmojiTextFormat } from '#utils/functions'; @@ -11,19 +11,19 @@ import { ApplyOptions, RequiresClientPermissions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { chunk } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Guild, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Guild } from 'discord.js'; -@ApplyOptions({ +@ApplyOptions({ aliases: ['mrr', 'managereactionrole', 'managerolereaction', 'managerolereactions'], description: LanguageKeys.Commands.Management.ManageReactionRolesDescription, detailedDescription: LanguageKeys.Commands.Management.ManageReactionRolesExtended, permissionLevel: PermissionLevels.Administrator, runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['add', 'remove', 'reset', { input: 'show', default: true }] + subcommands: [{ name: 'add' }, { name: 'remove' }, { name: 'reset' }, { name: 'show', default: true }] }) -export class UserCommand extends SkyraCommand { - public async add(message: GuildMessage, args: SkyraCommand.Args) { +export class UserCommand extends SkyraSubcommand { + public async add(message: GuildMessage, args: SkyraSubcommand.Args) { const role = await args.pick('roleName'); if (!args.finished) { const channel = await args.pick('textChannelName'); @@ -72,7 +72,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async remove(message: GuildMessage, args: SkyraCommand.Args) { + public async remove(message: GuildMessage, args: SkyraSubcommand.Args) { const role = await args.pick('roleName'); const messageId = await args.pick('snowflake'); @@ -100,7 +100,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async reset(message: GuildMessage, args: SkyraCommand.Args) { + public async reset(message: GuildMessage, args: SkyraSubcommand.Args) { await writeSettings(message.guild, (settings) => { const reactionRoles = settings[GuildSettings.ReactionRoles]; @@ -116,7 +116,7 @@ export class UserCommand extends SkyraCommand { } @RequiresClientPermissions(PermissionFlagsBits.EmbedLinks) - public async show(message: GuildMessage, args: SkyraCommand.Args) { + public async show(message: GuildMessage, args: SkyraSubcommand.Args) { const reactionRoles = await readSettings(message.guild, GuildSettings.ReactionRoles); if (reactionRoles.length === 0) { this.error(LanguageKeys.Commands.Management.ManageReactionRolesShowEmpty); @@ -125,7 +125,7 @@ export class UserCommand extends SkyraCommand { const response = await sendLoadingMessage(message, args.t); const display = new SkyraPaginatedMessage({ - template: new MessageEmbed().setColor(getColor(message)) + template: new EmbedBuilder().setColor(getColor(message)) }); for (const bulk of chunk(reactionRoles, 15)) { diff --git a/src/commands/Management/Configuration/setIgnoreChannels.ts b/src/commands/Management/Configuration/setIgnoreChannels.ts index 2004456b325..24cea141c1e 100644 --- a/src/commands/Management/Configuration/setIgnoreChannels.ts +++ b/src/commands/Management/Configuration/setIgnoreChannels.ts @@ -5,7 +5,7 @@ import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; import type { GuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; -import { Args, CommandOptionsRunTypeEnum, container, IArgument } from '@sapphire/framework'; +import { Args, CommandOptionsRunTypeEnum, container, Argument } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; @ApplyOptions({ @@ -15,7 +15,7 @@ import { send } from '@sapphire/plugin-editable-commands'; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const channel = await args.pick(UserCommand.hereOrTextChannelResolver); const [oldLength, newLength] = await writeSettings(message.guild, (settings) => { @@ -41,6 +41,6 @@ export class UserCommand extends SkyraCommand { private static hereOrTextChannelResolver = Args.make((argument, context) => { if (argument === 'here') return Args.ok(context.message.channel as GuildTextBasedChannelTypes); - return (container.stores.get('arguments').get('textOrNewsChannelName') as IArgument).run(argument, context); + return (container.stores.get('arguments').get('textOrNewsChannelName') as Argument).run(argument, context); }); } diff --git a/src/commands/Management/Configuration/setPrefix.ts b/src/commands/Management/Configuration/setPrefix.ts index a60cd79342f..85f7b4d8b58 100644 --- a/src/commands/Management/Configuration/setPrefix.ts +++ b/src/commands/Management/Configuration/setPrefix.ts @@ -15,7 +15,7 @@ import { send } from '@sapphire/plugin-editable-commands'; aliases: ['prefix'] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const prefix = await args.pick('string', { minimum: 1, maximum: 10 }); await writeSettings(message.guild, (settings) => { // If it's the same value, throw: diff --git a/src/commands/Management/Helpers/guild-info.ts b/src/commands/Management/Helpers/guild-info.ts index 6bc2d17459b..82ebb73bada 100644 --- a/src/commands/Management/Helpers/guild-info.ts +++ b/src/commands/Management/Helpers/guild-info.ts @@ -10,14 +10,14 @@ import { isCategoryChannel, isNewsChannel, isStageChannel, isTextChannel, isVoic import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { chunk } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { MessageEmbed, Permissions, Role } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, PermissionsBitField, Role } from 'discord.js'; const SORT = (x: Role, y: Role) => Number(y.position > x.position) || Number(x.position === y.position) - 1; const roleMention = (role: Role): string => role.toString(); const roleLimit = 15; -const paginatedMessagePermissions = new Permissions([Permissions.FLAGS.ADD_REACTIONS, Permissions.FLAGS.MANAGE_MESSAGES]); +const paginatedMessagePermissions = new PermissionsBitField([PermissionFlagsBits.AddReactions, PermissionFlagsBits.ManageMessages]); @ApplyOptions({ aliases: ['server-info'], @@ -27,7 +27,7 @@ const paginatedMessagePermissions = new Permissions([Permissions.FLAGS.ADD_REACT runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const color = getColor(message); const roles = this.getRoles(args); @@ -43,9 +43,9 @@ export class UserCommand extends SkyraCommand { private async buildDisplay(args: SkyraCommand.Args, roles: Role[], color: number): Promise { const guild = args.message.guild!; const display = new SkyraPaginatedMessage({ - template: new MessageEmbed() // + template: new EmbedBuilder() // .setColor(color) - .setThumbnail(guild.iconURL({ size: 256, format: 'png', dynamic: true })!) + .setThumbnail(guild.iconURL({ size: 256, extension: 'png' })!) .setTitle(`${guild.name} [${guild.id}]`) }); @@ -58,14 +58,15 @@ export class UserCommand extends SkyraCommand { if (roles.length > roleLimit) { for (const batch of chunk(roles, 20)) { if (batch.length <= 10) { - display.addPageEmbed((embed) => embed.addField(ZeroWidthSpace, batch.map(roleMention).join('\n'))); + display.addPageEmbed((embed) => embed.addFields({ name: ZeroWidthSpace, value: batch.map(roleMention).join('\n') })); } else { const left = batch.slice(0, 10); const right = batch.slice(10); display.addPageEmbed((embed) => - embed - .addField(ZeroWidthSpace, left.map(roleMention).join('\n'), true) - .addField(ZeroWidthSpace, right.map(roleMention).join('\n'), true) + embed.addFields( + { name: ZeroWidthSpace, value: left.map(roleMention).join('\n'), inline: true }, + { name: ZeroWidthSpace, value: right.map(roleMention).join('\n'), inline: true } + ) ); } } @@ -74,51 +75,49 @@ export class UserCommand extends SkyraCommand { return display; } - private async getSummary(args: SkyraCommand.Args, roles: Role[], color: number): Promise { + private async getSummary(args: SkyraCommand.Args, roles: Role[], color: number): Promise { const guild = args.message.guild!; const serverInfoTitles = args.t(LanguageKeys.Commands.Management.GuildInfoTitles); const roleCount = guild.roles.cache.size - 1; - return new MessageEmbed() + return new EmbedBuilder() .setColor(color) - .setThumbnail(guild.iconURL({ size: 256, format: 'png', dynamic: true })!) + .setThumbnail(guild.iconURL({ size: 256, extension: 'png' })!) .setTitle(`${guild.name} [${guild.id}]`) - .addField(args.t(LanguageKeys.Commands.Tools.WhoisMemberRoles, { count: roleCount }), this.getSummaryRoles(args, roles)) - .addField(serverInfoTitles.MEMBERS, await this.getSummaryMembers(args), true) - .addField(serverInfoTitles.CHANNELS, this.getSummaryChannels(args), true) - .addField(serverInfoTitles.OTHER, this.getSummaryOther(args)); + .addFields( + { name: args.t(LanguageKeys.Commands.Tools.WhoisMemberRoles, { count: roleCount }), value: this.getSummaryRoles(args, roles) }, + { name: serverInfoTitles.MEMBERS, value: await this.getSummaryMembers(args), inline: true }, + { name: serverInfoTitles.CHANNELS, value: this.getSummaryChannels(args), inline: true }, + { name: serverInfoTitles.OTHER, value: this.getSummaryOther(args) } + ); } - private getBanner(args: SkyraCommand.Args, color: number): MessageEmbed { + private getBanner(args: SkyraCommand.Args, color: number): EmbedBuilder { const guild = args.message.guild!; - return this.getImage(args.t(LanguageKeys.Commands.Management.GuildInfoBanner), guild.bannerURL({ size: 4096, format: 'png' })!, color); + return this.getImage(args.t(LanguageKeys.Commands.Management.GuildInfoBanner), guild.bannerURL({ size: 4096, extension: 'png' })!, color); } - private getIcon(args: SkyraCommand.Args, color: number): MessageEmbed { + private getIcon(args: SkyraCommand.Args, color: number): EmbedBuilder { const guild = args.message.guild!; - return this.getImage( - args.t(LanguageKeys.Commands.Management.GuildInfoIcon), - guild.iconURL({ size: 4096, format: 'png', dynamic: true })!, - color - ); + return this.getImage(args.t(LanguageKeys.Commands.Management.GuildInfoIcon), guild.iconURL({ size: 4096, extension: 'png' })!, color); } - private getSplash(args: SkyraCommand.Args, color: number): MessageEmbed { + private getSplash(args: SkyraCommand.Args, color: number): EmbedBuilder { const guild = args.message.guild!; - return this.getImage(args.t(LanguageKeys.Commands.Management.GuildInfoSplash), guild.splashURL({ size: 4096, format: 'png' })!, color); + return this.getImage(args.t(LanguageKeys.Commands.Management.GuildInfoSplash), guild.splashURL({ size: 4096, extension: 'png' })!, color); } - private getDiscoverySplash(args: SkyraCommand.Args, color: number): MessageEmbed { + private getDiscoverySplash(args: SkyraCommand.Args, color: number): EmbedBuilder { const guild = args.message.guild!; return this.getImage( args.t(LanguageKeys.Commands.Management.GuildInfoDiscoverySplash), - guild.discoverySplashURL({ size: 4096, format: 'png' })!, + guild.discoverySplashURL({ size: 4096, extension: 'png' })!, color ); } - private getImage(description: string, url: string, color: number): MessageEmbed { - return new MessageEmbed().setColor(color).setDescription(`${description} [→](${url})`).setImage(url).setThumbnail(null!); + private getImage(description: string, url: string, color: number): EmbedBuilder { + return new EmbedBuilder().setColor(color).setDescription(`${description} [→](${url})`).setImage(url).setThumbnail(null!); } private getRoles(args: SkyraCommand.Args): Role[] { diff --git a/src/commands/Management/Helpers/role-info.ts b/src/commands/Management/Helpers/role-info.ts index ce66b6190b1..a52928a4729 100644 --- a/src/commands/Management/Helpers/role-info.ts +++ b/src/commands/Management/Helpers/role-info.ts @@ -6,8 +6,8 @@ import { BrandingColors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { MessageEmbed, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder } from 'discord.js'; @ApplyOptions({ description: LanguageKeys.Commands.Management.RoleInfoDescription, @@ -17,11 +17,11 @@ import { MessageEmbed, Permissions } from 'discord.js'; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const role = args.finished ? message.member.roles.highest : await args.pick('roleName'); const roleInfoTitles = args.t(LanguageKeys.Commands.Management.RoleInfoTitles); - const permissions = role.permissions.has(Permissions.FLAGS.ADMINISTRATOR) + const permissions = role.permissions.has(PermissionFlagsBits.Administrator) ? args.t(LanguageKeys.Commands.Management.RoleInfoAll) : role.permissions.toArray().length > 0 ? role.permissions @@ -36,11 +36,11 @@ export class UserCommand extends SkyraCommand { mentionable: args.t(role.mentionable ? LanguageKeys.Globals.Yes : LanguageKeys.Globals.No) }); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(role.color || BrandingColors.Secondary) .setTitle(`${role.name} [${role.id}]`) .setDescription(description) - .addField(roleInfoTitles.PERMISSIONS, permissions); + .addFields({ name: roleInfoTitles.PERMISSIONS, value: permissions }); return send(message, { embeds: [embed] }); } } diff --git a/src/commands/Management/Members/stickyRoles.ts b/src/commands/Management/Members/stickyRoles.ts index 15febbf5320..89754bfa376 100644 --- a/src/commands/Management/Members/stickyRoles.ts +++ b/src/commands/Management/Members/stickyRoles.ts @@ -1,23 +1,23 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; +import { SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { getStickyRoles } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; -@ApplyOptions({ +@ApplyOptions({ description: LanguageKeys.Commands.Management.StickyRolesDescription, detailedDescription: LanguageKeys.Commands.Management.StickyRolesExtended, permissionLevel: PermissionLevels.Administrator, requiredClientPermissions: [PermissionFlagsBits.ManageRoles], runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['add', 'remove', 'reset', { input: 'show', default: true }] + subcommands: [{ name: 'add' }, { name: 'remove' }, { name: 'reset' }, { name: 'show', default: true }] }) -export class UserCommand extends SkyraCommand { - public async add(message: GuildMessage, args: SkyraCommand.Args) { +export class UserCommand extends SkyraSubcommand { + public async add(message: GuildMessage, args: SkyraSubcommand.Args) { const user = await args.pick('userName'); const role = await args.pick('roleName'); @@ -28,7 +28,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async remove(message: GuildMessage, args: SkyraCommand.Args) { + public async remove(message: GuildMessage, args: SkyraSubcommand.Args) { const user = await args.pick('userName'); const stickyRoles = getStickyRoles(message.guild); @@ -42,7 +42,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async reset(message: GuildMessage, args: SkyraCommand.Args) { + public async reset(message: GuildMessage, args: SkyraSubcommand.Args) { const user = await args.pick('userName'); const stickyRoles = getStickyRoles(message.guild); @@ -55,7 +55,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async show(message: GuildMessage, args: SkyraCommand.Args) { + public async show(message: GuildMessage, args: SkyraSubcommand.Args) { const user = await args.pick('userName'); const stickyRoles = getStickyRoles(message.guild); diff --git a/src/commands/Management/Message Filters/attachmentMode.ts b/src/commands/Management/Message Filters/attachmentMode.ts index 3036c0a1d5b..5eebeb306fa 100644 --- a/src/commands/Management/Message Filters/attachmentMode.ts +++ b/src/commands/Management/Message Filters/attachmentMode.ts @@ -1,8 +1,7 @@ -import { AdderKey, GuildEntity, GuildSettings } from '#lib/database'; +import { GuildSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SelfModerationCommand } from '#lib/moderation'; import { ApplyOptions } from '@sapphire/decorators'; -import type { PickByValue } from '@sapphire/utilities'; @ApplyOptions({ aliases: ['attachment-mode', 'attachments-mode', 'att-mode', 'manageAttachment', 'manageattachment'], @@ -11,10 +10,10 @@ import type { PickByValue } from '@sapphire/utilities'; }) export class UserSelfModerationCommand extends SelfModerationCommand { protected $adder: AdderKey = 'attachments'; - protected keyEnabled: PickByValue = GuildSettings.Selfmod.Attachments.Enabled; - protected keySoftAction: PickByValue = GuildSettings.Selfmod.Attachments.SoftAction; - protected keyHardAction: PickByValue = GuildSettings.Selfmod.Attachments.HardAction; - protected keyHardActionDuration: PickByValue = GuildSettings.Selfmod.Attachments.HardActionDuration; - protected keyThresholdMaximum: PickByValue = GuildSettings.Selfmod.Attachments.ThresholdMaximum; - protected keyThresholdDuration: PickByValue = GuildSettings.Selfmod.Attachments.ThresholdDuration; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.Attachments.Enabled; + protected keySoftAction: GuildSettingsOfType = GuildSettings.Selfmod.Attachments.SoftAction; + protected keyHardAction: GuildSettingsOfType = GuildSettings.Selfmod.Attachments.HardAction; + protected keyHardActionDuration: GuildSettingsOfType = GuildSettings.Selfmod.Attachments.HardActionDuration; + protected keyThresholdMaximum: GuildSettingsOfType = GuildSettings.Selfmod.Attachments.ThresholdMaximum; + protected keyThresholdDuration: GuildSettingsOfType = GuildSettings.Selfmod.Attachments.ThresholdDuration; } diff --git a/src/commands/Management/Message Filters/capitalsMode.ts b/src/commands/Management/Message Filters/capitalsMode.ts index 429b75649d3..7d9b08802e9 100644 --- a/src/commands/Management/Message Filters/capitalsMode.ts +++ b/src/commands/Management/Message Filters/capitalsMode.ts @@ -1,8 +1,7 @@ -import { AdderKey, GuildEntity, GuildSettings } from '#lib/database'; +import { GuildSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SelfModerationCommand } from '#lib/moderation'; import { ApplyOptions } from '@sapphire/decorators'; -import type { PickByValue } from '@sapphire/utilities'; @ApplyOptions({ aliases: ['capitals-mode', 'caps-mode'], @@ -11,10 +10,10 @@ import type { PickByValue } from '@sapphire/utilities'; }) export class UserSelfModerationCommand extends SelfModerationCommand { protected $adder: AdderKey = 'capitals'; - protected keyEnabled: PickByValue = GuildSettings.Selfmod.Capitals.Enabled; - protected keySoftAction: PickByValue = GuildSettings.Selfmod.Capitals.SoftAction; - protected keyHardAction: PickByValue = GuildSettings.Selfmod.Capitals.HardAction; - protected keyHardActionDuration: PickByValue = GuildSettings.Selfmod.Capitals.HardActionDuration; - protected keyThresholdMaximum: PickByValue = GuildSettings.Selfmod.Capitals.ThresholdMaximum; - protected keyThresholdDuration: PickByValue = GuildSettings.Selfmod.Capitals.ThresholdDuration; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.Capitals.Enabled; + protected keySoftAction: GuildSettingsOfType = GuildSettings.Selfmod.Capitals.SoftAction; + protected keyHardAction: GuildSettingsOfType = GuildSettings.Selfmod.Capitals.HardAction; + protected keyHardActionDuration: GuildSettingsOfType = GuildSettings.Selfmod.Capitals.HardActionDuration; + protected keyThresholdMaximum: GuildSettingsOfType = GuildSettings.Selfmod.Capitals.ThresholdMaximum; + protected keyThresholdDuration: GuildSettingsOfType = GuildSettings.Selfmod.Capitals.ThresholdDuration; } diff --git a/src/commands/Management/Message Filters/filter.ts b/src/commands/Management/Message Filters/filter.ts index c728384638a..ae800d831a4 100644 --- a/src/commands/Management/Message Filters/filter.ts +++ b/src/commands/Management/Message Filters/filter.ts @@ -1,7 +1,7 @@ import { GuildEntity, GuildSettings, readSettings, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { IncomingType, OutgoingType } from '#lib/moderation/workers'; -import { SkyraCommand } from '#lib/structures'; +import { SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; @@ -9,15 +9,15 @@ import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { remove as removeConfusables } from 'confusables'; -@ApplyOptions({ +@ApplyOptions({ description: LanguageKeys.Commands.Management.FilterDescription, detailedDescription: LanguageKeys.Commands.Management.FilterExtended, permissionLevel: PermissionLevels.Administrator, runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['add', 'remove', 'reset', { input: 'show', default: true }] + subcommands: [{ name: 'add' }, { name: 'remove' }, { name: 'reset' }, { name: 'show', default: true }] }) -export class UserCommand extends SkyraCommand { - public async add(message: GuildMessage, args: SkyraCommand.Args) { +export class UserCommand extends SkyraSubcommand { + public async add(message: GuildMessage, args: SkyraSubcommand.Args) { const word = await this.getWord(args); await writeSettings(message.guild, async (settings) => { // Check if the word is not filtered: @@ -34,7 +34,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async remove(message: GuildMessage, args: SkyraCommand.Args) { + public async remove(message: GuildMessage, args: SkyraSubcommand.Args) { const word = await this.getWord(args); await writeSettings(message.guild, (settings) => { // Check if the word is not filtered: @@ -52,14 +52,14 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async reset(message: GuildMessage, args: SkyraCommand.Args) { + public async reset(message: GuildMessage, args: SkyraSubcommand.Args) { await writeSettings(message.guild, [[GuildSettings.Selfmod.Filter.Raw, []]]); const content = args.t(LanguageKeys.Commands.Management.FilterReset); return send(message, content); } - public async show(message: GuildMessage, args: SkyraCommand.Args) { + public async show(message: GuildMessage, args: SkyraSubcommand.Args) { const raw = await readSettings(message.guild, GuildSettings.Selfmod.Filter.Raw); const content = raw.length @@ -68,7 +68,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - private async getWord(args: SkyraCommand.Args) { + private async getWord(args: SkyraSubcommand.Args) { const word = await args.pick('string', { maximum: 32 }); return removeConfusables(word.toLowerCase()); } diff --git a/src/commands/Management/Message Filters/filterMode.ts b/src/commands/Management/Message Filters/filterMode.ts index 11f6c9b94f1..513d433dceb 100644 --- a/src/commands/Management/Message Filters/filterMode.ts +++ b/src/commands/Management/Message Filters/filterMode.ts @@ -1,8 +1,7 @@ -import { AdderKey, GuildEntity, GuildSettings } from '#lib/database'; +import { GuildSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SelfModerationCommand } from '#lib/moderation'; import { ApplyOptions } from '@sapphire/decorators'; -import type { PickByValue } from '@sapphire/utilities'; @ApplyOptions({ aliases: ['word-filter-mode'], @@ -11,10 +10,10 @@ import type { PickByValue } from '@sapphire/utilities'; }) export class UserSelfModerationCommand extends SelfModerationCommand { protected $adder: AdderKey = 'words'; - protected keyEnabled: PickByValue = GuildSettings.Selfmod.Filter.Enabled; - protected keySoftAction: PickByValue = GuildSettings.Selfmod.Filter.SoftAction; - protected keyHardAction: PickByValue = GuildSettings.Selfmod.Filter.HardAction; - protected keyHardActionDuration: PickByValue = GuildSettings.Selfmod.Filter.HardActionDuration; - protected keyThresholdMaximum: PickByValue = GuildSettings.Selfmod.Filter.ThresholdMaximum; - protected keyThresholdDuration: PickByValue = GuildSettings.Selfmod.Filter.ThresholdDuration; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.Filter.Enabled; + protected keySoftAction: GuildSettingsOfType = GuildSettings.Selfmod.Filter.SoftAction; + protected keyHardAction: GuildSettingsOfType = GuildSettings.Selfmod.Filter.HardAction; + protected keyHardActionDuration: GuildSettingsOfType = GuildSettings.Selfmod.Filter.HardActionDuration; + protected keyThresholdMaximum: GuildSettingsOfType = GuildSettings.Selfmod.Filter.ThresholdMaximum; + protected keyThresholdDuration: GuildSettingsOfType = GuildSettings.Selfmod.Filter.ThresholdDuration; } diff --git a/src/commands/Management/Message Filters/inviteMode.ts b/src/commands/Management/Message Filters/inviteMode.ts index 0715376961b..c1958da4402 100644 --- a/src/commands/Management/Message Filters/inviteMode.ts +++ b/src/commands/Management/Message Filters/inviteMode.ts @@ -1,8 +1,7 @@ -import { AdderKey, GuildEntity, GuildSettings } from '#lib/database'; +import { GuildSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SelfModerationCommand } from '#lib/moderation'; import { ApplyOptions } from '@sapphire/decorators'; -import type { PickByValue } from '@sapphire/utilities'; @ApplyOptions({ aliases: ['invites-mode', 'inv-mode'], @@ -11,10 +10,10 @@ import type { PickByValue } from '@sapphire/utilities'; }) export class UserSelfModerationCommand extends SelfModerationCommand { protected $adder: AdderKey = 'invites'; - protected keyEnabled: PickByValue = GuildSettings.Selfmod.Invites.Enabled; - protected keySoftAction: PickByValue = GuildSettings.Selfmod.Invites.SoftAction; - protected keyHardAction: PickByValue = GuildSettings.Selfmod.Invites.HardAction; - protected keyHardActionDuration: PickByValue = GuildSettings.Selfmod.Invites.HardActionDuration; - protected keyThresholdMaximum: PickByValue = GuildSettings.Selfmod.Invites.ThresholdMaximum; - protected keyThresholdDuration: PickByValue = GuildSettings.Selfmod.Invites.ThresholdDuration; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.Invites.Enabled; + protected keySoftAction: GuildSettingsOfType = GuildSettings.Selfmod.Invites.SoftAction; + protected keyHardAction: GuildSettingsOfType = GuildSettings.Selfmod.Invites.HardAction; + protected keyHardActionDuration: GuildSettingsOfType = GuildSettings.Selfmod.Invites.HardActionDuration; + protected keyThresholdMaximum: GuildSettingsOfType = GuildSettings.Selfmod.Invites.ThresholdMaximum; + protected keyThresholdDuration: GuildSettingsOfType = GuildSettings.Selfmod.Invites.ThresholdDuration; } diff --git a/src/commands/Management/Message Filters/linkMode.ts b/src/commands/Management/Message Filters/linkMode.ts index 961e4e64dd6..2b7c894dbe6 100644 --- a/src/commands/Management/Message Filters/linkMode.ts +++ b/src/commands/Management/Message Filters/linkMode.ts @@ -1,8 +1,7 @@ -import { AdderKey, GuildEntity, GuildSettings } from '#lib/database'; +import { GuildSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SelfModerationCommand } from '#lib/moderation'; import { ApplyOptions } from '@sapphire/decorators'; -import type { PickByValue } from '@sapphire/utilities'; @ApplyOptions({ aliases: ['link-mode', 'lmode', 'linkfilter', 'extlinks', 'externallinks'], @@ -11,10 +10,10 @@ import type { PickByValue } from '@sapphire/utilities'; }) export class UserSelfModerationCommand extends SelfModerationCommand { protected $adder: AdderKey = 'links'; - protected keyEnabled: PickByValue = GuildSettings.Selfmod.Links.Enabled; - protected keySoftAction: PickByValue = GuildSettings.Selfmod.Links.SoftAction; - protected keyHardAction: PickByValue = GuildSettings.Selfmod.Links.HardAction; - protected keyHardActionDuration: PickByValue = GuildSettings.Selfmod.Links.HardActionDuration; - protected keyThresholdMaximum: PickByValue = GuildSettings.Selfmod.Links.ThresholdMaximum; - protected keyThresholdDuration: PickByValue = GuildSettings.Selfmod.Links.ThresholdDuration; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.Links.Enabled; + protected keySoftAction: GuildSettingsOfType = GuildSettings.Selfmod.Links.SoftAction; + protected keyHardAction: GuildSettingsOfType = GuildSettings.Selfmod.Links.HardAction; + protected keyHardActionDuration: GuildSettingsOfType = GuildSettings.Selfmod.Links.HardActionDuration; + protected keyThresholdMaximum: GuildSettingsOfType = GuildSettings.Selfmod.Links.ThresholdMaximum; + protected keyThresholdDuration: GuildSettingsOfType = GuildSettings.Selfmod.Links.ThresholdDuration; } diff --git a/src/commands/Management/Message Filters/messageMode.ts b/src/commands/Management/Message Filters/messageMode.ts index ae39cbde39e..2d68d9f4640 100644 --- a/src/commands/Management/Message Filters/messageMode.ts +++ b/src/commands/Management/Message Filters/messageMode.ts @@ -1,8 +1,7 @@ -import { AdderKey, GuildEntity, GuildSettings } from '#lib/database'; +import { GuildSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SelfModerationCommand } from '#lib/moderation'; import { ApplyOptions } from '@sapphire/decorators'; -import type { PickByValue } from '@sapphire/utilities'; @ApplyOptions({ aliases: ['message-mode', 'msg-mode', 'm-mode'], @@ -11,10 +10,10 @@ import type { PickByValue } from '@sapphire/utilities'; }) export class UserSelfModerationCommand extends SelfModerationCommand { protected $adder: AdderKey = 'messages'; - protected keyEnabled: PickByValue = GuildSettings.Selfmod.Messages.Enabled; - protected keySoftAction: PickByValue = GuildSettings.Selfmod.Messages.SoftAction; - protected keyHardAction: PickByValue = GuildSettings.Selfmod.Messages.HardAction; - protected keyHardActionDuration: PickByValue = GuildSettings.Selfmod.Messages.HardActionDuration; - protected keyThresholdMaximum: PickByValue = GuildSettings.Selfmod.Messages.ThresholdMaximum; - protected keyThresholdDuration: PickByValue = GuildSettings.Selfmod.Messages.ThresholdDuration; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.Messages.Enabled; + protected keySoftAction: GuildSettingsOfType = GuildSettings.Selfmod.Messages.SoftAction; + protected keyHardAction: GuildSettingsOfType = GuildSettings.Selfmod.Messages.HardAction; + protected keyHardActionDuration: GuildSettingsOfType = GuildSettings.Selfmod.Messages.HardActionDuration; + protected keyThresholdMaximum: GuildSettingsOfType = GuildSettings.Selfmod.Messages.ThresholdMaximum; + protected keyThresholdDuration: GuildSettingsOfType = GuildSettings.Selfmod.Messages.ThresholdDuration; } diff --git a/src/commands/Management/Message Filters/newlineMode.ts b/src/commands/Management/Message Filters/newlineMode.ts index 42258244791..ec2b9b172a9 100644 --- a/src/commands/Management/Message Filters/newlineMode.ts +++ b/src/commands/Management/Message Filters/newlineMode.ts @@ -1,8 +1,7 @@ -import { AdderKey, GuildEntity, GuildSettings } from '#lib/database'; +import { GuildSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SelfModerationCommand } from '#lib/moderation'; import { ApplyOptions } from '@sapphire/decorators'; -import type { PickByValue } from '@sapphire/utilities'; @ApplyOptions({ aliases: ['newline-mode', 'nl-mode'], @@ -11,10 +10,10 @@ import type { PickByValue } from '@sapphire/utilities'; }) export class UserSelfModerationCommand extends SelfModerationCommand { protected $adder: AdderKey = 'newlines'; - protected keyEnabled: PickByValue = GuildSettings.Selfmod.NewLines.Enabled; - protected keySoftAction: PickByValue = GuildSettings.Selfmod.NewLines.SoftAction; - protected keyHardAction: PickByValue = GuildSettings.Selfmod.NewLines.HardAction; - protected keyHardActionDuration: PickByValue = GuildSettings.Selfmod.NewLines.HardActionDuration; - protected keyThresholdMaximum: PickByValue = GuildSettings.Selfmod.NewLines.ThresholdMaximum; - protected keyThresholdDuration: PickByValue = GuildSettings.Selfmod.NewLines.ThresholdDuration; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.NewLines.Enabled; + protected keySoftAction: GuildSettingsOfType = GuildSettings.Selfmod.NewLines.SoftAction; + protected keyHardAction: GuildSettingsOfType = GuildSettings.Selfmod.NewLines.HardAction; + protected keyHardActionDuration: GuildSettingsOfType = GuildSettings.Selfmod.NewLines.HardActionDuration; + protected keyThresholdMaximum: GuildSettingsOfType = GuildSettings.Selfmod.NewLines.ThresholdMaximum; + protected keyThresholdDuration: GuildSettingsOfType = GuildSettings.Selfmod.NewLines.ThresholdDuration; } diff --git a/src/commands/Management/Reaction Filters/reactionMode.ts b/src/commands/Management/Reaction Filters/reactionMode.ts index d7b9df737e2..e2b816e91f6 100644 --- a/src/commands/Management/Reaction Filters/reactionMode.ts +++ b/src/commands/Management/Reaction Filters/reactionMode.ts @@ -1,8 +1,7 @@ -import { AdderKey, GuildEntity, GuildSettings } from '#lib/database'; +import { GuildSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SelfModerationCommand } from '#lib/moderation'; import { ApplyOptions } from '@sapphire/decorators'; -import type { PickByValue } from '@sapphire/utilities'; @ApplyOptions({ aliases: ['reaction-mode', 'r-mode'], @@ -11,10 +10,10 @@ import type { PickByValue } from '@sapphire/utilities'; }) export class UserSelfModerationCommand extends SelfModerationCommand { protected $adder: AdderKey = 'reactions'; - protected keyEnabled: PickByValue = GuildSettings.Selfmod.Reactions.Enabled; - protected keySoftAction: PickByValue = GuildSettings.Selfmod.Reactions.SoftAction; - protected keyHardAction: PickByValue = GuildSettings.Selfmod.Reactions.HardAction; - protected keyHardActionDuration: PickByValue = GuildSettings.Selfmod.Reactions.HardActionDuration; - protected keyThresholdMaximum: PickByValue = GuildSettings.Selfmod.Reactions.ThresholdMaximum; - protected keyThresholdDuration: PickByValue = GuildSettings.Selfmod.Reactions.ThresholdDuration; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.Reactions.Enabled; + protected keySoftAction: GuildSettingsOfType = GuildSettings.Selfmod.Reactions.SoftAction; + protected keyHardAction: GuildSettingsOfType = GuildSettings.Selfmod.Reactions.HardAction; + protected keyHardActionDuration: GuildSettingsOfType = GuildSettings.Selfmod.Reactions.HardActionDuration; + protected keyThresholdMaximum: GuildSettingsOfType = GuildSettings.Selfmod.Reactions.ThresholdMaximum; + protected keyThresholdDuration: GuildSettingsOfType = GuildSettings.Selfmod.Reactions.ThresholdDuration; } diff --git a/src/commands/Management/create-mute.ts b/src/commands/Management/create-mute.ts index 03a22851b26..8102f27cfc0 100644 --- a/src/commands/Management/create-mute.ts +++ b/src/commands/Management/create-mute.ts @@ -5,19 +5,20 @@ import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { minutes } from '#utils/common'; import { Emojis } from '#utils/constants'; -import { getEmojiReactionFormat, getSecurity, promptConfirmation, promptForMessage, SerializedEmoji } from '#utils/functions'; +import { getEmojiReactionFormat, getSecurity, promptConfirmation, promptForMessage, type SerializedEmoji } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; import { canReact } from '@sapphire/discord.js-utilities'; import { Argument, CommandOptionsRunTypeEnum, Result, UserError } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { Permissions, Role } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Role } from 'discord.js'; @ApplyOptions({ cooldownDelay: minutes(5), description: LanguageKeys.Commands.Management.CreateMuteDescription, detailedDescription: LanguageKeys.Commands.Management.CreateMuteExtended, permissionLevel: PermissionLevels.Administrator, - requiredClientPermissions: [Permissions.FLAGS.MANAGE_CHANNELS, Permissions.FLAGS.MANAGE_ROLES], + requiredClientPermissions: [PermissionFlagsBits.ManageChannels, PermissionFlagsBits.ManageRoles], runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { @@ -25,18 +26,19 @@ export class UserCommand extends SkyraCommand { return this.container.stores.get('arguments').get('role') as Argument; } - public async messageRun(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.Context) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.RunContext) { const { t } = args; if (await promptConfirmation(message, t(LanguageKeys.Commands.Moderation.ActionSharedRoleSetupExisting))) { - const role = await this.askForRole(message, args, context); - if (role.success) { - await writeSettings(message.guild, [[GuildSettings.Roles.Muted, role.value.id]]); + const result = await this.askForRole(message, args, context); + if (result.isOk()) { + const role = result.unwrap(); + await writeSettings(message.guild, [[GuildSettings.Roles.Muted, role.id]]); if (canReact(message.channel)) return message.react(getEmojiReactionFormat(Emojis.GreenTickSerialized as SerializedEmoji)); const content = t(LanguageKeys.Commands.Admin.ConfUpdated, { key: GuildSettings.Roles.Muted, - response: role.value.name + response: role.name }); return send(message, content); } @@ -53,7 +55,7 @@ export class UserCommand extends SkyraCommand { return null; } - private async askForRole(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.Context): Promise> { + private async askForRole(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.RunContext): Promise> { const result = await promptForMessage(message, args.t(LanguageKeys.Commands.Moderation.ActionSharedRoleSetupExistingName)); if (result === null) this.error(LanguageKeys.Commands.Moderation.ActionSharedRoleSetupNoMessage); diff --git a/src/commands/Management/permissionNodes.ts b/src/commands/Management/permissionNodes.ts index 9718f39c363..d5365432176 100644 --- a/src/commands/Management/permissionNodes.ts +++ b/src/commands/Management/permissionNodes.ts @@ -1,6 +1,6 @@ -import { GuildSettings, PermissionNodeAction, PermissionsNode, readSettings, writeSettings } from '#lib/database'; +import { GuildSettings, PermissionNodeAction, readSettings, writeSettings, type PermissionsNode } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; +import { SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { resolveOnErrorCodes } from '#utils/common'; @@ -8,19 +8,19 @@ import { ApplyOptions } from '@sapphire/decorators'; import { Args, CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { isNullish } from '@sapphire/utilities'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; +import { RESTJSONErrorCodes } from 'discord-api-types/v10'; import { GuildMember, Role } from 'discord.js'; -@ApplyOptions({ +@ApplyOptions({ aliases: ['pnodes', 'pnode'], permissionLevel: PermissionLevels.Administrator, description: LanguageKeys.Commands.Management.PermissionNodesDescription, detailedDescription: LanguageKeys.Commands.Management.PermissionNodesExtended, - subCommands: ['add', 'remove', 'reset', { input: 'show', default: true }], + subcommands: [{ name: 'add' }, { name: 'remove' }, { name: 'reset' }, { name: 'show', default: true }], runIn: [CommandOptionsRunTypeEnum.GuildAny] }) -export class UserCommand extends SkyraCommand { - public async add(message: GuildMessage, args: SkyraCommand.Args) { +export class UserCommand extends SkyraSubcommand { + public async add(message: GuildMessage, args: SkyraSubcommand.Args) { const target = await args.pick('roleName').catch(() => args.pick('member')); const action = await args.pick(UserCommand.type); @@ -42,7 +42,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async remove(message: GuildMessage, args: SkyraCommand.Args) { + public async remove(message: GuildMessage, args: SkyraSubcommand.Args) { const target = await args.pick('roleName').catch(() => args.pick('member')); const action = await args.pick(UserCommand.type); const command = await args.pick('commandMatch', { owners: false }); @@ -57,7 +57,7 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async reset(message: GuildMessage, args: SkyraCommand.Args) { + public async reset(message: GuildMessage, args: SkyraSubcommand.Args) { const target = await args.pick('roleName').catch(() => args.pick('member')); if (!this.checkPermissions(message, target)) this.error(LanguageKeys.Commands.Management.PermissionNodesHigher); @@ -70,12 +70,12 @@ export class UserCommand extends SkyraCommand { return send(message, content); } - public async show(message: GuildMessage, args: SkyraCommand.Args) { + public async show(message: GuildMessage, args: SkyraSubcommand.Args) { const content = args.finished ? await this.showAll(message, args) : await this.showOne(message, args); return send(message, { content, allowedMentions: { users: [], roles: [] } }); } - private async showOne(message: GuildMessage, args: SkyraCommand.Args) { + private async showOne(message: GuildMessage, args: SkyraSubcommand.Args) { const target = await args.pick('roleName').catch(() => args.pick('member')); if (!this.checkPermissions(message, target)) this.error(LanguageKeys.Commands.Management.PermissionNodesHigher); @@ -89,7 +89,7 @@ export class UserCommand extends SkyraCommand { return this.formatPermissionNode(args, node, isRole, target); } - private async showAll(message: GuildMessage, args: SkyraCommand.Args) { + private async showAll(message: GuildMessage, args: SkyraSubcommand.Args) { const [users, roles] = await readSettings(message.guild, [GuildSettings.Permissions.Users, GuildSettings.Permissions.Roles]); const [fUsers, fRoles] = await Promise.all([this.formatPermissionNodes(args, users, false), this.formatPermissionNodes(args, roles, true)]); const total = fUsers.concat(fRoles); @@ -98,7 +98,7 @@ export class UserCommand extends SkyraCommand { return total.join('\n\n'); } - private async formatPermissionNodes(args: SkyraCommand.Args, nodes: readonly PermissionsNode[], isRole: boolean) { + private async formatPermissionNodes(args: SkyraSubcommand.Args, nodes: readonly PermissionsNode[], isRole: boolean) { const output: string[] = []; for (const node of nodes) { const target = isRole @@ -113,7 +113,7 @@ export class UserCommand extends SkyraCommand { return output; } - private formatPermissionNode(args: SkyraCommand.Args, node: PermissionsNode, isRole: boolean, target: Role | GuildMember) { + private formatPermissionNode(args: SkyraSubcommand.Args, node: PermissionsNode, isRole: boolean, target: Role | GuildMember) { return [ args.t(LanguageKeys.Commands.Management.PermissionNodesShowName, { name: this.formatTarget(isRole, target) }), args.t(LanguageKeys.Commands.Management.PermissionNodesShowAllow, { allow: this.formatCommands(args, node.allow) }), @@ -125,7 +125,7 @@ export class UserCommand extends SkyraCommand { return isRole ? (target as Role).name : (target as GuildMember).displayName; } - private formatCommands(args: SkyraCommand.Args, commands: readonly string[]) { + private formatCommands(args: SkyraSubcommand.Args, commands: readonly string[]) { return commands.length === 0 ? args.t(LanguageKeys.Globals.None) : args.t(LanguageKeys.Globals.AndListValue, { value: commands.map((command) => `\`${command}\``) }); diff --git a/src/commands/Management/roles.ts b/src/commands/Management/roles.ts index 7bd58522067..d5a364c3599 100644 --- a/src/commands/Management/roles.ts +++ b/src/commands/Management/roles.ts @@ -1,25 +1,27 @@ import { GuildSettings, readSettings, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { PaginatedMessageCommand, SkyraPaginatedMessage } from '#lib/structures'; +import { SkyraCommand, SkyraPaginatedMessage } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { getColor, sendLoadingMessage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { chunk } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { MessageEmbed, Role } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Role } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ - aliases: ['pr', 'role', 'public-roles', 'public-role'], - description: LanguageKeys.Commands.Management.RolesDescription, - detailedDescription: LanguageKeys.Commands.Management.RolesExtended, - requiredClientPermissions: [PermissionFlagsBits.ManageRoles, PermissionFlagsBits.ManageMessages], - runIn: [CommandOptionsRunTypeEnum.GuildAny] -}) -export class UserPaginatedMessageCommand extends PaginatedMessageCommand { - public async messageRun(message: GuildMessage, args: PaginatedMessageCommand.Args) { +@ApplyOptions( + SkyraCommand.PaginatedOptions({ + aliases: ['pr', 'role', 'public-roles', 'public-role'], + description: LanguageKeys.Commands.Management.RolesDescription, + detailedDescription: LanguageKeys.Commands.Management.RolesExtended, + requiredClientPermissions: [PermissionFlagsBits.ManageRoles, PermissionFlagsBits.ManageMessages], + runIn: [CommandOptionsRunTypeEnum.GuildAny] + }) +) +export class UserPaginatedMessageCommand extends SkyraCommand { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const [rolesPublic, allRoleSets, rolesRemoveInitial, rolesInitial, rolesInitialHumans, rolesInitialBots] = await readSettings(message.guild, [ GuildSettings.Roles.Public, GuildSettings.Roles.UniqueRoleSets, @@ -130,7 +132,7 @@ export class UserPaginatedMessageCommand extends PaginatedMessageCommand { if (!roles.length) this.error(LanguageKeys.Commands.Management.RolesListEmpty); const display = new SkyraPaginatedMessage({ - template: new MessageEmbed() // + template: new EmbedBuilder() // .setColor(getColor(message)) .setTitle(t(LanguageKeys.Commands.Management.RolesListTitle)) }); diff --git a/src/commands/Misc/remindme.ts b/src/commands/Misc/remindme.ts index 63e8731a8d7..773cf58f80c 100644 --- a/src/commands/Misc/remindme.ts +++ b/src/commands/Misc/remindme.ts @@ -8,8 +8,8 @@ import { ApplyOptions, RequiresClientPermissions } from '@sapphire/decorators'; import { Args } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { chunk, cutText } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; const enum Actions { List = 'list', @@ -33,7 +33,7 @@ const row = makeRow(ButtonInviteTeryl, ButtonSkyraV7); detailedDescription: LanguageKeys.Commands.Misc.RemindMeExtended }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const action = args.finished ? Actions.List : await args.pick(UserCommand.action).catch(() => Actions.Create); return this[action](message, args); } @@ -53,7 +53,7 @@ export class UserCommand extends SkyraCommand { } const response = await sendLoadingMessage(message, args.t); - const display = new SkyraPaginatedMessage({ template: new MessageEmbed().setColor(getColor(message)) }); + const display = new SkyraPaginatedMessage({ template: new EmbedBuilder().setColor(getColor(message)) }); const pages = chunk( tasks.map( (task) => @@ -83,7 +83,7 @@ export class UserCommand extends SkyraCommand { public async show(message: Message, args: SkyraCommand.Args) { const task = await args.pick(UserCommand.task); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(getColor(message)) .setAuthor(getFullEmbedAuthor(message.author, message.url)) .setDescription(task.data.content) diff --git a/src/commands/Misc/snipe.ts b/src/commands/Misc/snipe.ts index f61fd98df05..750b7bdafb4 100644 --- a/src/commands/Misc/snipe.ts +++ b/src/commands/Misc/snipe.ts @@ -7,8 +7,8 @@ import { getColor, getContent, getFullEmbedAuthor, getImage } from '#utils/util' import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder } from 'discord.js'; @ApplyOptions({ aliases: ['sniped'], @@ -19,11 +19,11 @@ import { MessageEmbed } from 'discord.js'; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - public messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override messageRun(message: GuildMessage, args: SkyraCommand.Args) { const sniped = getSnipedMessage(message.channel); if (sniped === null) this.error(LanguageKeys.Commands.Misc.SnipeEmpty); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setTitle(args.t(LanguageKeys.Commands.Misc.SnipeTitle)) .setColor(getColor(sniped)) .setAuthor(getFullEmbedAuthor(sniped.author)) diff --git a/src/commands/Moderation/Management/history.ts b/src/commands/Moderation/Management/history.ts index 095d811ee9d..df7a342fac8 100644 --- a/src/commands/Moderation/Management/history.ts +++ b/src/commands/Moderation/Management/history.ts @@ -1,6 +1,6 @@ import type { ModerationEntity } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand, SkyraPaginatedMessage } from '#lib/structures'; +import { SkyraPaginatedMessage, SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { seconds } from '#utils/common'; @@ -13,27 +13,27 @@ import { ApplyOptions, RequiresClientPermissions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { chunk, cutText } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder } from 'discord.js'; const COLORS = [0x80f31f, 0xa5de0b, 0xc7c101, 0xe39e03, 0xf6780f, 0xfe5326, 0xfb3244]; -@ApplyOptions({ +@ApplyOptions({ aliases: ['hd', 'ho'], description: LanguageKeys.Commands.Moderation.HistoryDescription, detailedDescription: LanguageKeys.Commands.Moderation.HistoryExtended, permissionLevel: PermissionLevels.Moderator, runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['details', { input: 'overview', default: true }] + subcommands: [{ name: 'details' }, { name: 'overview', default: true }] }) -export class UserCommand extends SkyraCommand { - public messageRun(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.Context) { +export class UserCommand extends SkyraSubcommand { + public override messageRun(message: GuildMessage, args: SkyraSubcommand.Args, context: SkyraSubcommand.RunContext) { if (context.commandName === 'hd') return this.details(message, args); if (context.commandName === 'ho') return this.overview(message, args); return super.messageRun(message, args, context); } - public async overview(message: GuildMessage, args: SkyraCommand.Args) { + public async overview(message: GuildMessage, args: SkyraSubcommand.Args) { const target = args.finished ? message.author : await args.pick('userName'); const logs = await getModeration(message.guild).fetch(target.id); let warnings = 0; @@ -71,15 +71,15 @@ export class UserCommand extends SkyraCommand { bansText: args.t(LanguageKeys.Commands.Moderation.HistoryFooterBans, { count: bans }) }); - const embed = new MessageEmbed() // + const embed = new EmbedBuilder() // .setColor(COLORS[index]) .setAuthor(getFullEmbedAuthor(target)) .setFooter({ text: footer }); - return send(message, { embeds: [embed] }); + await send(message, { embeds: [embed] }); } @RequiresClientPermissions(PermissionFlagsBits.EmbedLinks) - public async details(message: GuildMessage, args: SkyraCommand.Args) { + public async details(message: GuildMessage, args: SkyraSubcommand.Args) { const target = args.finished ? message.author : await args.pick('userName'); const response = await sendLoadingMessage(message, args.t); @@ -87,7 +87,7 @@ export class UserCommand extends SkyraCommand { if (!entries.size) this.error(LanguageKeys.Commands.Moderation.ModerationsEmpty); const display = new SkyraPaginatedMessage({ - template: new MessageEmbed() + template: new EmbedBuilder() .setColor(getColor(message)) .setTitle(args.t(LanguageKeys.Commands.Moderation.ModerationsAmount, { count: entries.size })) }); @@ -101,8 +101,7 @@ export class UserCommand extends SkyraCommand { for (const page of chunk([...entries.values()], 10)) { display.addPageEmbed((embed) => { for (const entry of page) { - const { name, value } = this.displayModerationLogFromModerators(usernames, now, entry); - embed.addField(name, value); + embed.addFields(this.displayModerationLogFromModerators(usernames, now, entry)); } return embed; @@ -110,7 +109,7 @@ export class UserCommand extends SkyraCommand { } await display.run(response, message.author); - return response; + await response; } private displayModerationLogFromModerators(users: Map, now: number, entry: ModerationEntity) { diff --git a/src/commands/Moderation/Management/moderations.ts b/src/commands/Moderation/Management/moderations.ts index 6af3c660665..390e79cac15 100644 --- a/src/commands/Moderation/Management/moderations.ts +++ b/src/commands/Moderation/Management/moderations.ts @@ -1,18 +1,18 @@ import type { ModerationEntity } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { PaginatedMessageCommand, SkyraPaginatedMessage } from '#lib/structures'; +import { SkyraCommand, SkyraPaginatedMessage, SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { seconds } from '#utils/common'; import { getModeration } from '#utils/functions'; import { TypeCodes } from '#utils/moderationConstants'; import { getColor, sendLoadingMessage } from '#utils/util'; -import { time, TimestampStyles } from '@discordjs/builders'; +import { TimestampStyles, time } from '@discordjs/builders'; import type { Collection } from '@discordjs/collection'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { chunk, cutText } from '@sapphire/utilities'; -import { MessageEmbed, User } from 'discord.js'; +import { EmbedBuilder, User } from 'discord.js'; const enum Type { Mute, @@ -20,36 +20,38 @@ const enum Type { All } -@ApplyOptions({ - aliases: ['moderation'], - description: LanguageKeys.Commands.Moderation.ModerationsDescription, - detailedDescription: LanguageKeys.Commands.Moderation.ModerationsExtended, - permissionLevel: PermissionLevels.Moderator, - runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: [ - { input: 'mute', output: 'mutes' }, - 'mutes', - { input: 'warning', output: 'warnings' }, - 'warnings', - { input: 'warn', output: 'warnings' }, - { input: 'warns', output: 'warnings' }, - { input: 'all', default: true } - ] -}) -export class UserPaginatedMessageCommand extends PaginatedMessageCommand { - public mutes(message: GuildMessage, args: PaginatedMessageCommand.Args, { commandPrefix }: PaginatedMessageCommand.Context) { +@ApplyOptions( + SkyraSubcommand.PaginatedOptions({ + aliases: ['moderation'], + description: LanguageKeys.Commands.Moderation.ModerationsDescription, + detailedDescription: LanguageKeys.Commands.Moderation.ModerationsExtended, + permissionLevel: PermissionLevels.Moderator, + runIn: [CommandOptionsRunTypeEnum.GuildAny], + subcommands: [ + { name: 'mute', messageRun: 'mutes' }, + { name: 'mutes' }, + { name: 'warning', messageRun: 'warnings' }, + { name: 'warnings' }, + { name: 'warn', messageRun: 'warnings' }, + { name: 'warns', messageRun: 'warnings' }, + { name: 'all', default: true } + ] + }) +) +export class UserPaginatedMessageCommand extends SkyraSubcommand { + public mutes(message: GuildMessage, args: SkyraSubcommand.Args, { commandPrefix }: SkyraSubcommand.RunContext) { return this.handle(message, args, Type.Mute, commandPrefix); } - public warnings(message: GuildMessage, args: PaginatedMessageCommand.Args, { commandPrefix }: PaginatedMessageCommand.Context) { + public warnings(message: GuildMessage, args: SkyraCommand.Args, { commandPrefix }: SkyraCommand.RunContext) { return this.handle(message, args, Type.Warning, commandPrefix); } - public all(message: GuildMessage, args: PaginatedMessageCommand.Args, { commandPrefix }: PaginatedMessageCommand.Context) { + public all(message: GuildMessage, args: SkyraCommand.Args, { commandPrefix }: SkyraCommand.RunContext) { return this.handle(message, args, Type.All, commandPrefix); } - private async handle(message: GuildMessage, args: PaginatedMessageCommand.Args, action: Type, prefix: string) { + private async handle(message: GuildMessage, args: SkyraCommand.Args, action: Type, prefix: string) { const target = args.finished ? null : await args.pick('userName'); const response = await sendLoadingMessage(message, args.t); @@ -59,7 +61,7 @@ export class UserPaginatedMessageCommand extends PaginatedMessageCommand { if (!entries.size) this.error(LanguageKeys.Commands.Moderation.ModerationsEmpty, { prefix }); const display = new SkyraPaginatedMessage({ - template: new MessageEmbed() + template: new EmbedBuilder() .setColor(getColor(message)) .setTitle(args.t(LanguageKeys.Commands.Moderation.ModerationsAmount, { count: entries.size })) }); @@ -78,8 +80,7 @@ export class UserPaginatedMessageCommand extends PaginatedMessageCommand { for (const page of chunk([...entries.values()], 10)) { display.addPageEmbed((embed) => { for (const entry of page) { - const { name, value } = format(entry); - embed.addField(name, value); + embed.addFields(format(entry)); } return embed; diff --git a/src/commands/Moderation/Management/mutes.ts b/src/commands/Moderation/Management/mutes.ts index 459d3dbc10e..9950396c195 100644 --- a/src/commands/Moderation/Management/mutes.ts +++ b/src/commands/Moderation/Management/mutes.ts @@ -1,21 +1,23 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { PaginatedMessageCommand } from '#lib/structures'; +import { SkyraCommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; +import type { UserPaginatedMessageCommand as Moderations } from '#root/commands/Moderation/Management/moderations'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; -import type { UserPaginatedMessageCommand as Moderations } from './moderations'; -@ApplyOptions({ - description: LanguageKeys.Commands.Moderation.MutesDescription, - detailedDescription: LanguageKeys.Commands.Moderation.MutesExtended, - permissionLevel: PermissionLevels.Moderator, - runIn: [CommandOptionsRunTypeEnum.GuildAny] -}) -export class UserPaginatedMessageCommand extends PaginatedMessageCommand { - public messageRun(message: GuildMessage, args: PaginatedMessageCommand.Args, context: PaginatedMessageCommand.Context) { - const moderations = this.store.get('moderations') as Moderations | undefined; - if (typeof moderations === 'undefined') throw new Error('Moderations command not loaded yet.'); - return moderations.mutes(message, args, context); +@ApplyOptions( + SkyraCommand.PaginatedOptions({ + description: LanguageKeys.Commands.Moderation.MutesDescription, + detailedDescription: LanguageKeys.Commands.Moderation.MutesExtended, + permissionLevel: PermissionLevels.Moderator, + runIn: [CommandOptionsRunTypeEnum.GuildAny] + }) +) +export class UserPaginatedMessageCommand extends SkyraCommand { + public override messageRun(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.RunContext) { + const command = this.store.get('moderations') as Moderations | undefined; + if (typeof command === 'undefined') throw new Error('Moderations command not loaded yet.'); + return command.mutes(message, args, context); } } diff --git a/src/commands/Moderation/Management/warnings.ts b/src/commands/Moderation/Management/warnings.ts index 4736753ab16..713fdca3c49 100644 --- a/src/commands/Moderation/Management/warnings.ts +++ b/src/commands/Moderation/Management/warnings.ts @@ -1,21 +1,23 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { PaginatedMessageCommand } from '#lib/structures'; +import { SkyraCommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; +import type { UserPaginatedMessageCommand as Moderations } from '#root/commands/Moderation/Management/moderations'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; -import type { UserPaginatedMessageCommand as Moderations } from './moderations'; -@ApplyOptions({ - description: LanguageKeys.Commands.Moderation.WarningsDescription, - detailedDescription: LanguageKeys.Commands.Moderation.WarningsExtended, - permissionLevel: PermissionLevels.Moderator, - runIn: [CommandOptionsRunTypeEnum.GuildAny] -}) -export class UserPaginatedMessageCommand extends PaginatedMessageCommand { - public messageRun(message: GuildMessage, args: PaginatedMessageCommand.Args, context: PaginatedMessageCommand.Context) { +@ApplyOptions( + SkyraCommand.PaginatedOptions({ + description: LanguageKeys.Commands.Moderation.WarningsDescription, + detailedDescription: LanguageKeys.Commands.Moderation.WarningsExtended, + permissionLevel: PermissionLevels.Moderator, + runIn: [CommandOptionsRunTypeEnum.GuildAny] + }) +) +export class UserPaginatedMessageCommand extends SkyraCommand { + public override messageRun(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.RunContext) { const moderations = this.store.get('moderations') as Moderations | undefined; if (typeof moderations === 'undefined') throw new Error('Moderations command not loaded yet.'); - return moderations.mutes(message, args, context); + return moderations.warnings(message, args, context); } } diff --git a/src/commands/Moderation/Restriction/restrictAttachment.ts b/src/commands/Moderation/Restriction/restrictAttachment.ts index d1a2aa3c0a3..c4a8defe748 100644 --- a/src/commands/Moderation/Restriction/restrictAttachment.ts +++ b/src/commands/Moderation/Restriction/restrictAttachment.ts @@ -6,7 +6,7 @@ import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['restricted-attachment', 'ra'], diff --git a/src/commands/Moderation/Restriction/restrictEmbed.ts b/src/commands/Moderation/Restriction/restrictEmbed.ts index 8393cd3bce6..5b7f0bfae1a 100644 --- a/src/commands/Moderation/Restriction/restrictEmbed.ts +++ b/src/commands/Moderation/Restriction/restrictEmbed.ts @@ -6,7 +6,7 @@ import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['restricted-embed', 're'], diff --git a/src/commands/Moderation/Restriction/restrictEmoji.ts b/src/commands/Moderation/Restriction/restrictEmoji.ts index c1d6206fab6..778451c282d 100644 --- a/src/commands/Moderation/Restriction/restrictEmoji.ts +++ b/src/commands/Moderation/Restriction/restrictEmoji.ts @@ -6,7 +6,7 @@ import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['restrict-external-emoji', 'restricted-emoji', 'restricted-external-emoji', 'ree', 'restrict-emojis'], diff --git a/src/commands/Moderation/Restriction/restrictReaction.ts b/src/commands/Moderation/Restriction/restrictReaction.ts index 0116fbcbe74..a688aa60aa8 100644 --- a/src/commands/Moderation/Restriction/restrictReaction.ts +++ b/src/commands/Moderation/Restriction/restrictReaction.ts @@ -6,7 +6,7 @@ import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['restricted-reaction', 'rr'], diff --git a/src/commands/Moderation/Restriction/restrictVoice.ts b/src/commands/Moderation/Restriction/restrictVoice.ts index 27ace7536d6..319eac8fdd7 100644 --- a/src/commands/Moderation/Restriction/restrictVoice.ts +++ b/src/commands/Moderation/Restriction/restrictVoice.ts @@ -6,7 +6,7 @@ import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['restricted-voice', 'rv'], diff --git a/src/commands/Moderation/Restriction/unrestrictAttachment.ts b/src/commands/Moderation/Restriction/unrestrictAttachment.ts index 4e530e2fe0a..4a4c3e888fe 100644 --- a/src/commands/Moderation/Restriction/unrestrictAttachment.ts +++ b/src/commands/Moderation/Restriction/unrestrictAttachment.ts @@ -5,7 +5,7 @@ import { getSecurity } from '#utils/functions'; import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['un-restricted-attachment', 'ura'], diff --git a/src/commands/Moderation/Restriction/unrestrictEmbed.ts b/src/commands/Moderation/Restriction/unrestrictEmbed.ts index ccd2bc18461..43e03ef67b8 100644 --- a/src/commands/Moderation/Restriction/unrestrictEmbed.ts +++ b/src/commands/Moderation/Restriction/unrestrictEmbed.ts @@ -5,7 +5,7 @@ import { getSecurity } from '#utils/functions'; import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['un-restricted-embed', 'ure'], diff --git a/src/commands/Moderation/Restriction/unrestrictEmoji.ts b/src/commands/Moderation/Restriction/unrestrictEmoji.ts index 71c588f3aaa..269f681fddc 100644 --- a/src/commands/Moderation/Restriction/unrestrictEmoji.ts +++ b/src/commands/Moderation/Restriction/unrestrictEmoji.ts @@ -5,7 +5,7 @@ import { getSecurity } from '#utils/functions'; import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['un-restrict-external-emoji', 'unrestricted-emoji', 'unrestricted-external-emoji', 'uree', 'unrestrict-emojis'], diff --git a/src/commands/Moderation/Restriction/unrestrictReaction.ts b/src/commands/Moderation/Restriction/unrestrictReaction.ts index 97b4b235519..d2ca0311cb1 100644 --- a/src/commands/Moderation/Restriction/unrestrictReaction.ts +++ b/src/commands/Moderation/Restriction/unrestrictReaction.ts @@ -5,7 +5,7 @@ import { getSecurity } from '#utils/functions'; import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['un-restricted-reaction', 'urr'], diff --git a/src/commands/Moderation/Restriction/unrestrictVoice.ts b/src/commands/Moderation/Restriction/unrestrictVoice.ts index 34859d84af3..99284572234 100644 --- a/src/commands/Moderation/Restriction/unrestrictVoice.ts +++ b/src/commands/Moderation/Restriction/unrestrictVoice.ts @@ -5,7 +5,7 @@ import { getSecurity } from '#utils/functions'; import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['un-restricted-voice', 'urv'], diff --git a/src/commands/Moderation/Utilities/case.ts b/src/commands/Moderation/Utilities/case.ts index 28697644745..2703f788a89 100644 --- a/src/commands/Moderation/Utilities/case.ts +++ b/src/commands/Moderation/Utilities/case.ts @@ -1,23 +1,23 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; +import { SkyraCommand, SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { getModeration } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; -@ApplyOptions({ +@ApplyOptions({ description: LanguageKeys.Commands.Moderation.CaseDescription, detailedDescription: LanguageKeys.Commands.Moderation.CaseExtended, permissionLevel: PermissionLevels.Moderator, requiredClientPermissions: [PermissionFlagsBits.EmbedLinks], runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['delete', { input: 'show', default: true }] + subcommands: [{ name: 'delete' }, { name: 'show', default: true }] }) -export class UserCommand extends SkyraCommand { - public async show(message: GuildMessage, args: SkyraCommand.Args) { +export class UserCommand extends SkyraSubcommand { + public async show(message: GuildMessage, args: SkyraSubcommand.Args) { const caseId = await args.pick('case'); const moderation = getModeration(message.guild); diff --git a/src/commands/Moderation/Utilities/permissions.ts b/src/commands/Moderation/Utilities/permissions.ts index 6df5b762153..d91bb98f852 100644 --- a/src/commands/Moderation/Utilities/permissions.ts +++ b/src/commands/Moderation/Utilities/permissions.ts @@ -7,10 +7,10 @@ import { getColor, getTag } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { MessageEmbed, PermissionString, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder } from 'discord.js'; -const PERMISSION_FLAGS = Object.keys(Permissions.FLAGS) as PermissionString[]; +const PERMISSION_FLAGS = Object.keys(PermissionFlagsBits) as (keyof typeof PermissionFlagsBits)[]; @ApplyOptions({ description: LanguageKeys.Commands.Moderation.PermissionsDescription, @@ -20,7 +20,7 @@ const PERMISSION_FLAGS = Object.keys(Permissions.FLAGS) as PermissionString[]; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const user = args.finished ? message.author : await args.pick('userName'); const member = await message.guild.members.fetch(user.id).catch(() => { this.error(LanguageKeys.Misc.UserNotInGuild); @@ -29,7 +29,7 @@ export class UserCommand extends SkyraCommand { const { permissions } = member; const list = [ZeroWidthSpace]; - if (permissions.has(Permissions.FLAGS.ADMINISTRATOR)) { + if (permissions.has(PermissionFlagsBits.Administrator)) { list.push(args.t(LanguageKeys.Commands.Moderation.PermissionsAll)); } else { for (const flag of PERMISSION_FLAGS) { @@ -37,7 +37,7 @@ export class UserCommand extends SkyraCommand { } } - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(getColor(message)) .setTitle(args.t(LanguageKeys.Commands.Moderation.Permissions, { username: getTag(user), id: user.id })) .setDescription(list.join('\n')); diff --git a/src/commands/Moderation/Utilities/reason.ts b/src/commands/Moderation/Utilities/reason.ts index 453b5469423..0cf1f7434ca 100644 --- a/src/commands/Moderation/Utilities/reason.ts +++ b/src/commands/Moderation/Utilities/reason.ts @@ -6,7 +6,7 @@ import { getModeration, sendTemporaryMessage } from '#utils/functions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ description: LanguageKeys.Commands.Moderation.ReasonDescription, @@ -16,7 +16,7 @@ import { PermissionFlagsBits } from 'discord-api-types/v9'; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const cases = await args .pick('case') .then((value) => [value]) diff --git a/src/commands/Moderation/Utilities/slowmode.ts b/src/commands/Moderation/Utilities/slowmode.ts index 0f702bfa202..d64dd070125 100644 --- a/src/commands/Moderation/Utilities/slowmode.ts +++ b/src/commands/Moderation/Utilities/slowmode.ts @@ -6,7 +6,7 @@ import { hours, seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; import type { TextChannel } from 'discord.js'; const MAXIMUM_DURATION = hours(6); @@ -20,7 +20,7 @@ const MAXIMUM_DURATION = hours(6); runIn: [CommandOptionsRunTypeEnum.GuildText] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const cooldown = await args .pick('reset') .then(() => 0) diff --git a/src/commands/Moderation/Utilities/time.ts b/src/commands/Moderation/Utilities/time.ts index fbba0df36b7..b61d0129cdd 100644 --- a/src/commands/Moderation/Utilities/time.ts +++ b/src/commands/Moderation/Utilities/time.ts @@ -10,7 +10,8 @@ import { getTag } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { Args, CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { Permissions, User } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { User } from 'discord.js'; @ApplyOptions({ description: LanguageKeys.Commands.Moderation.TimeDescription, @@ -19,7 +20,7 @@ import { Permissions, User } from 'discord.js'; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const cancel = await args.pick(UserCommand.cancel).catch(() => false); const caseId = await args.pick('case'); @@ -112,7 +113,7 @@ export class UserCommand extends SkyraCommand { } private async checkBan(message: GuildMessage, user: User) { - if (!message.guild.members.me!.permissions.has(Permissions.FLAGS.BAN_MEMBERS)) { + if (!message.guild.members.me!.permissions.has(PermissionFlagsBits.BanMembers)) { this.error(LanguageKeys.Commands.Moderation.UnbanMissingPermission); } @@ -122,7 +123,7 @@ export class UserCommand extends SkyraCommand { } private async checkMute(message: GuildMessage, user: User) { - if (!message.guild.members.me!.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) { + if (!message.guild.members.me!.permissions.has(PermissionFlagsBits.ManageRoles)) { this.error(LanguageKeys.Commands.Moderation.UnmuteMissingPermission); } @@ -132,7 +133,7 @@ export class UserCommand extends SkyraCommand { } private async checkVMute(message: GuildMessage, user: User) { - if (!message.guild.members.me!.permissions.has(Permissions.FLAGS.MUTE_MEMBERS)) { + if (!message.guild.members.me!.permissions.has(PermissionFlagsBits.MuteMembers)) { this.error(LanguageKeys.Commands.Moderation.VmuteMissingPermission); } diff --git a/src/commands/Moderation/addrole.ts b/src/commands/Moderation/addrole.ts index f17cf4b09b8..6564439fbcb 100644 --- a/src/commands/Moderation/addrole.ts +++ b/src/commands/Moderation/addrole.ts @@ -1,12 +1,12 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { HandledCommandContext, ModerationCommand } from '#lib/moderation'; +import { ModerationCommand, type HandledCommandContext } from '#lib/moderation'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { years } from '#utils/common'; import { getSecurity } from '#utils/functions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; import type { Role } from 'discord.js'; @ApplyOptions({ @@ -19,7 +19,7 @@ import type { Role } from 'discord.js'; requiredMember: true }) export class UserModerationCommand extends ModerationCommand { - protected async resolveOverloads(args: ModerationCommand.Args) { + protected override async resolveOverloads(args: ModerationCommand.Args) { return { targets: await args.repeat('user', { times: 10 }), role: await args.pick('roleName'), diff --git a/src/commands/Moderation/ban.ts b/src/commands/Moderation/ban.ts index 6498f4ba47e..e9fc6891b63 100644 --- a/src/commands/Moderation/ban.ts +++ b/src/commands/Moderation/ban.ts @@ -7,7 +7,7 @@ import type { Unlock } from '#utils/moderationConstants'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['b'], @@ -19,7 +19,7 @@ import { PermissionFlagsBits } from 'discord-api-types/v9'; requiredMember: false }) export class UserModerationCommand extends ModerationCommand { - public async prehandle(...[message]: ArgumentTypes) { + public override async prehandle(...[message]: ArgumentTypes) { return (await readSettings(message.guild, GuildSettings.Events.BanAdd)) ? { unlock: getModeration(message.guild).createLock() } : null; } @@ -37,11 +37,11 @@ export class UserModerationCommand extends ModerationCommand { ); } - public posthandle(...[, { preHandled }]: ArgumentTypes['posthandle']>) { + public override posthandle(...[, { preHandled }]: ArgumentTypes['posthandle']>) { if (preHandled) preHandled.unlock(); } - public async checkModeratable(...[message, context]: ArgumentTypes['checkModeratable']>) { + public override async checkModeratable(...[message, context]: ArgumentTypes['checkModeratable']>) { const member = await super.checkModeratable(message, context); if (member && !member.bannable) throw context.args.t(LanguageKeys.Commands.Moderation.BanNotBannable); return member; diff --git a/src/commands/Moderation/dehoist.ts b/src/commands/Moderation/dehoist.ts index be107d411c2..c8e90f05473 100644 --- a/src/commands/Moderation/dehoist.ts +++ b/src/commands/Moderation/dehoist.ts @@ -7,8 +7,8 @@ import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { codeBlock } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { GuildMember, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, GuildMember } from 'discord.js'; import type { TFunction } from 'i18next'; const [kLowestNumberCode, kHighestNumberCode] = ['0'.charCodeAt(0), '9'.charCodeAt(0)]; @@ -24,7 +24,7 @@ const [kLowestNumberCode, kHighestNumberCode] = ['0'.charCodeAt(0), '9'.charCode export class UserCommand extends SkyraCommand { private kLowestCode = 'A'.charCodeAt(0); - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { if (message.guild.members.cache.size !== message.guild.memberCount) { await sendLoadingMessage(message, args.t); await message.guild.members.fetch(); @@ -88,7 +88,7 @@ export class UserCommand extends SkyraCommand { errored: erroredChanges.length, users: message.guild.members.cache.size }); - const embed = new MessageEmbed().setColor(getColor(message)).setTitle(embedLanguage.title); + const embed = new EmbedBuilder().setColor(getColor(message)).setTitle(embedLanguage.title); let { description } = embedLanguage; if (deHoistedMembers <= 0) description = embedLanguage.descriptionNoone; @@ -97,7 +97,7 @@ export class UserCommand extends SkyraCommand { description = erroredChanges.length > 1 ? embedLanguage.descriptionWithMultipleErrors : embedLanguage.descriptionWithError; const erroredNicknames = erroredChanges.map((entry) => `${entry.oldNick} => ${entry.newNick}`).join('\n'); const codeblock = codeBlock('js', erroredNicknames); - embed.addField(embedLanguage.fieldErrorTitle, codeblock); + embed.addFields({ name: embedLanguage.fieldErrorTitle, value: codeblock }); } return embed.setDescription(description); diff --git a/src/commands/Moderation/kick.ts b/src/commands/Moderation/kick.ts index 0e797c9c5ec..71cb15eb1b2 100644 --- a/src/commands/Moderation/kick.ts +++ b/src/commands/Moderation/kick.ts @@ -6,7 +6,7 @@ import type { Unlock } from '#utils/moderationConstants'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['k'], @@ -16,7 +16,7 @@ import { PermissionFlagsBits } from 'discord-api-types/v9'; requiredMember: true }) export class UserModerationCommand extends ModerationCommand { - public async prehandle(...[message]: ArgumentTypes) { + public override async prehandle(...[message]: ArgumentTypes) { return (await readSettings(message.guild, GuildSettings.Channels.Logs.MemberRemove)) ? { unlock: getModeration(message.guild).createLock() } : null; @@ -34,11 +34,11 @@ export class UserModerationCommand extends ModerationCommand { ); } - public posthandle(...[, { preHandled }]: ArgumentTypes['posthandle']>) { + public override posthandle(...[, { preHandled }]: ArgumentTypes['posthandle']>) { if (preHandled) preHandled.unlock(); } - public async checkModeratable(...[message, context]: ArgumentTypes) { + public override async checkModeratable(...[message, context]: ArgumentTypes) { const member = await super.checkModeratable(message, context); if (member && !member.kickable) throw context.args.t(LanguageKeys.Commands.Moderation.KickNotKickable); return member; diff --git a/src/commands/Moderation/lockdown.ts b/src/commands/Moderation/lockdown.ts index cfd42d4fe1c..0f50d0ae1f9 100644 --- a/src/commands/Moderation/lockdown.ts +++ b/src/commands/Moderation/lockdown.ts @@ -1,35 +1,35 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { LockdownManager, SkyraCommand } from '#lib/structures'; +import { LockdownManager, SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { floatPromise } from '#utils/common'; import { assertNonThread, getSecurity } from '#utils/functions'; import { clearAccurateTimeout, setAccurateTimeout } from '#utils/Timers'; import { ApplyOptions } from '@sapphire/decorators'; -import { canSendMessages, NonThreadGuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; +import { canSendMessages, type NonThreadGuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Permissions, Role } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Role } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ +@ApplyOptions({ aliases: ['lock', 'unlock'], description: LanguageKeys.Commands.Moderation.LockdownDescription, detailedDescription: LanguageKeys.Commands.Moderation.LockdownExtended, permissionLevel: PermissionLevels.Moderator, requiredClientPermissions: [PermissionFlagsBits.ManageChannels, PermissionFlagsBits.ManageRoles], runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['lock', 'unlock', { input: 'auto', default: true }] + subcommands: [{ name: 'lock' }, { name: 'unlock' }, { name: 'auto', default: true }] }) -export class UserCommand extends SkyraCommand { - public messageRun(message: GuildMessage, args: SkyraCommand.Args, context: SkyraCommand.Context) { +export class UserCommand extends SkyraSubcommand { + public override messageRun(message: GuildMessage, args: SkyraSubcommand.Args, context: SkyraSubcommand.RunContext) { if (context.commandName === 'lock') return this.lock(message, args); if (context.commandName === 'unlock') return this.unlock(message, args); return super.messageRun(message, args, context); } - public async auto(message: GuildMessage, args: SkyraCommand.Args) { + public async auto(message: GuildMessage, args: SkyraSubcommand.Args) { const role = await args.pick('roleName').catch(() => message.guild.roles.everyone); const channel = args.finished ? assertNonThread(message.channel) : await args.pick('textChannelName'); if (this.getLock(role, channel)) return this.handleUnlock(message, args, role, channel); @@ -38,13 +38,13 @@ export class UserCommand extends SkyraCommand { return this.handleLock(message, args, role, channel, duration); } - public async unlock(message: GuildMessage, args: SkyraCommand.Args) { + public async unlock(message: GuildMessage, args: SkyraSubcommand.Args) { const role = await args.pick('roleName').catch(() => message.guild.roles.everyone); const channel = args.finished ? assertNonThread(message.channel) : await args.pick('textChannelName'); return this.handleUnlock(message, args, role, channel); } - public async lock(message: GuildMessage, args: SkyraCommand.Args) { + public async lock(message: GuildMessage, args: SkyraSubcommand.Args) { const role = await args.pick('roleName').catch(() => message.guild.roles.everyone); const channel = args.finished ? assertNonThread(message.channel) : await args.pick('textChannelName'); const duration = args.finished ? null : await args.pick('timespan', { minimum: 0 }); @@ -53,7 +53,7 @@ export class UserCommand extends SkyraCommand { private async handleLock( message: GuildMessage, - args: SkyraCommand.Args, + args: SkyraSubcommand.Args, role: Role, channel: NonThreadGuildTextBasedChannelTypes, duration: number | null @@ -68,7 +68,7 @@ export class UserCommand extends SkyraCommand { // If they can send, begin locking const response = await send(message, args.t(LanguageKeys.Commands.Moderation.LockdownLocking, { channel: channel.toString() })); - await channel.permissionOverwrites.edit(role, { SEND_MESSAGES: false }); + await channel.permissionOverwrites.edit(role, { SendMessages: false }); if (canSendMessages(message.channel)) { await response.edit(args.t(LanguageKeys.Commands.Moderation.LockdownLock, { channel: channel.toString() })).catch(() => null); } @@ -81,10 +81,10 @@ export class UserCommand extends SkyraCommand { } private isAllowed(role: Role, channel: NonThreadGuildTextBasedChannelTypes): boolean | null { - return channel.permissionOverwrites.cache.get(role.id)?.allow.has(Permissions.FLAGS.SEND_MESSAGES, false) ?? null; + return channel.permissionOverwrites.cache.get(role.id)?.allow.has(PermissionFlagsBits.SendMessages, false) ?? null; } - private async handleUnlock(message: GuildMessage, args: SkyraCommand.Args, role: Role, channel: NonThreadGuildTextBasedChannelTypes) { + private async handleUnlock(message: GuildMessage, args: SkyraSubcommand.Args, role: Role, channel: NonThreadGuildTextBasedChannelTypes) { const entry = this.getLock(role, channel); if (entry === null) this.error(LanguageKeys.Commands.Moderation.LockdownUnlocked, { channel: channel.toString() }); if (entry.timeout) clearAccurateTimeout(entry.timeout); @@ -105,10 +105,10 @@ export class UserCommand extends SkyraCommand { // If the only permission overwrite is the denied SEND_MESSAGES, clean up the entire permission; if the permission // was denied, reset it to the default state, otherwise don't run an extra query - if (overwrites.allow.bitfield === 0n && overwrites.deny.bitfield === Permissions.FLAGS.SEND_MESSAGES) { + if (overwrites.allow.bitfield === 0n && overwrites.deny.bitfield === PermissionFlagsBits.SendMessages) { await overwrites.delete(); - } else if (overwrites.deny.has(Permissions.FLAGS.SEND_MESSAGES)) { - await overwrites.edit({ SEND_MESSAGES: allowed }); + } else if (overwrites.deny.has(PermissionFlagsBits.SendMessages)) { + await overwrites.edit({ SendMessages: allowed }); } if (canSendMessages(message.channel)) { @@ -121,7 +121,7 @@ export class UserCommand extends SkyraCommand { const entry = getSecurity(channel.guild).lockdowns.get(channel.id)?.get(role.id); if (entry) return entry; - const permissions = channel.permissionOverwrites.cache.get(role.id)?.deny.has(Permissions.FLAGS.SEND_MESSAGES); + const permissions = channel.permissionOverwrites.cache.get(role.id)?.deny.has(PermissionFlagsBits.SendMessages); return permissions === true ? { allowed: null, timeout: null } : null; } } diff --git a/src/commands/Moderation/mute.ts b/src/commands/Moderation/mute.ts index d63b5b06b63..de03144736d 100644 --- a/src/commands/Moderation/mute.ts +++ b/src/commands/Moderation/mute.ts @@ -6,7 +6,7 @@ import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['m'], diff --git a/src/commands/Moderation/prune.ts b/src/commands/Moderation/prune.ts index 86de6e4615a..674fd1aec53 100644 --- a/src/commands/Moderation/prune.ts +++ b/src/commands/Moderation/prune.ts @@ -4,7 +4,7 @@ import { SkyraCommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { days, floatPromise, seconds } from '#utils/common'; -import { andMix, BooleanFn } from '#utils/common/comparators'; +import { andMix, type BooleanFn } from '#utils/common/comparators'; import { formatMessage } from '#utils/formatters'; import { sendTemporaryMessage } from '#utils/functions'; import { urlRegex } from '#utils/Links/UrlRegex'; @@ -12,10 +12,10 @@ import { metadata, TypeCodes } from '#utils/moderationConstants'; import { getFullEmbedAuthor, getImageUrl } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { canSendAttachments } from '@sapphire/discord.js-utilities'; -import { Args, CommandOptionsRunTypeEnum, IArgument } from '@sapphire/framework'; +import { Args, Argument, CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { isNullish, isNullishOrEmpty } from '@sapphire/utilities'; -import { PermissionFlagsBits, RESTJSONErrorCodes } from 'discord-api-types/v9'; -import { Collection, MessageAttachment, MessageEmbed, TextChannel } from 'discord.js'; +import { PermissionFlagsBits, RESTJSONErrorCodes } from 'discord-api-types/v10'; +import { AttachmentBuilder, Collection, EmbedBuilder, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; const enum Position { @@ -58,11 +58,11 @@ const includesOptions = ['include', 'includes', 'contain', 'contains'] as const; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - private get timespan(): IArgument { - return this.container.stores.get('arguments').get('timespan') as IArgument; + private get timespan(): Argument { + return this.container.stores.get('arguments').get('timespan') as Argument; } - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const limit = await args.pick('integer', { minimum: 1, maximum: 100 }); const filter = await this.getFilters(args); const rawPosition = args.finished ? null : await args.pick(UserCommand.position); @@ -135,7 +135,7 @@ export class UserCommand extends SkyraCommand { if (parameter === null) return days(14); const argument = this.timespan; - const optionResult = await argument.run(parameter, { + const result = await argument.run(parameter, { args, argument, command: this, @@ -144,8 +144,7 @@ export class UserCommand extends SkyraCommand { minimum: 0, maximum: days(14) }); - if (optionResult.success) return optionResult.value; - throw optionResult.error; + return result.unwrapRaw(); } private async sendPruneLogs(message: GuildMessage, t: TFunction, messages: Collection, rawMessages: readonly string[]) { @@ -168,7 +167,7 @@ export class UserCommand extends SkyraCommand { count: messages.size }); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setAuthor(getFullEmbedAuthor(message.author, message.url)) .setDescription(description) .setColor(UserCommand.kColor) @@ -186,7 +185,7 @@ export class UserCommand extends SkyraCommand { .reverse() .join('\n\n'); const buffer = Buffer.from(`${header}\n\n${processed}`); - return new MessageAttachment(buffer, 'prune.txt'); + return new AttachmentBuilder(buffer, { name: 'prune.txt' }); } private static position = Args.make((parameter, { argument }) => { diff --git a/src/commands/Moderation/removerole.ts b/src/commands/Moderation/removerole.ts index bddeda3f710..e90d07e400e 100644 --- a/src/commands/Moderation/removerole.ts +++ b/src/commands/Moderation/removerole.ts @@ -1,12 +1,12 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { HandledCommandContext, ModerationCommand } from '#lib/moderation'; +import { type HandledCommandContext, ModerationCommand } from '#lib/moderation'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { years } from '#utils/common'; import { getSecurity } from '#utils/functions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; import type { Role } from 'discord.js'; @ApplyOptions({ @@ -19,7 +19,7 @@ import type { Role } from 'discord.js'; requiredMember: true }) export class UserModerationCommand extends ModerationCommand { - protected async resolveOverloads(args: ModerationCommand.Args) { + protected override async resolveOverloads(args: ModerationCommand.Args) { return { targets: await args.repeat('user', { times: 10 }), role: await args.pick('roleName'), diff --git a/src/commands/Moderation/setnickname.ts b/src/commands/Moderation/setnickname.ts index c93cbdd37bb..57e0538eed8 100644 --- a/src/commands/Moderation/setnickname.ts +++ b/src/commands/Moderation/setnickname.ts @@ -1,11 +1,11 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { HandledCommandContext, ModerationCommand } from '#lib/moderation'; +import { ModerationCommand, type HandledCommandContext } from '#lib/moderation'; import type { GuildMessage } from '#lib/types'; import { years } from '#utils/common'; import { getSecurity } from '#utils/functions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['sn'], @@ -16,7 +16,7 @@ import { PermissionFlagsBits } from 'discord-api-types/v9'; requiredMember: true }) export class UserModerationCommand extends ModerationCommand { - protected async resolveOverloads(args: ModerationCommand.Args) { + protected override async resolveOverloads(args: ModerationCommand.Args) { return { targets: await args.repeat('user', { times: 10 }), nickname: args.finished ? null : await args.pick('string'), diff --git a/src/commands/Moderation/softban.ts b/src/commands/Moderation/softban.ts index e052b5c9df6..887834b5490 100644 --- a/src/commands/Moderation/softban.ts +++ b/src/commands/Moderation/softban.ts @@ -7,7 +7,7 @@ import type { Unlock } from '#utils/moderationConstants'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['sb'], @@ -18,7 +18,7 @@ import { PermissionFlagsBits } from 'discord-api-types/v9'; requiredMember: false }) export class UserModerationCommand extends ModerationCommand { - public async prehandle(...[message]: ArgumentTypes) { + public override async prehandle(...[message]: ArgumentTypes) { const [banAdd, banRemove] = await readSettings(message.guild, [GuildSettings.Events.BanAdd, GuildSettings.Events.BanRemove]); return banAdd || banRemove ? { unlock: getModeration(message.guild).createLock() } : null; } @@ -37,11 +37,11 @@ export class UserModerationCommand extends ModerationCommand { ); } - public posthandle(...[, { preHandled }]: ArgumentTypes['posthandle']>) { + public override posthandle(...[, { preHandled }]: ArgumentTypes['posthandle']>) { if (preHandled) preHandled.unlock(); } - public async checkModeratable(...[message, context]: ArgumentTypes) { + public override async checkModeratable(...[message, context]: ArgumentTypes) { const member = await super.checkModeratable(message, context); if (member && !member.bannable) throw context.args.t(LanguageKeys.Commands.Moderation.BanNotBannable); return member; diff --git a/src/commands/Moderation/togglemoderationdm.ts b/src/commands/Moderation/togglemoderationdm.ts index 5fc801a6fa5..b6ea70e4b31 100644 --- a/src/commands/Moderation/togglemoderationdm.ts +++ b/src/commands/Moderation/togglemoderationdm.ts @@ -11,9 +11,9 @@ import { send } from '@sapphire/plugin-editable-commands'; detailedDescription: LanguageKeys.Commands.Moderation.ToggleModerationDmExtended }) export class UserCommand extends SkyraCommand { - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const { users } = this.container.db; - let user = await users.findOne(message.author.id); + let user = await users.findOne({ where: { id: message.author.id } }); if (user) { user.moderationDM = !user.moderationDM; } else { diff --git a/src/commands/Moderation/unban.ts b/src/commands/Moderation/unban.ts index 2647cad81ea..66cae85eb24 100644 --- a/src/commands/Moderation/unban.ts +++ b/src/commands/Moderation/unban.ts @@ -6,10 +6,10 @@ import { getModeration, getSecurity } from '#utils/functions'; import type { Unlock } from '#utils/moderationConstants'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { fromAsync } from '@sapphire/framework'; +import { Result } from '@sapphire/framework'; import { resolveKey } from '@sapphire/plugin-i18next'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['ub'], @@ -19,9 +19,9 @@ import { PermissionFlagsBits } from 'discord-api-types/v9'; requiredMember: false }) export class UserModerationCommand extends ModerationCommand { - public async prehandle(message: GuildMessage) { - const result = await fromAsync(message.guild.bans.fetch()); - const bans = result.success ? result.value.map((ban) => ban.user.id) : null; + public override async prehandle(message: GuildMessage) { + const result = await Result.fromAsync(message.guild.bans.fetch()); + const bans = result.map((value) => value.map((ban) => ban.user.id)).unwrapOr(null); // If the fetch failed, throw an error saying that the fetch failed: if (bans === null) { @@ -52,11 +52,11 @@ export class UserModerationCommand extends ModerationCommand { ); } - public posthandle(...[, { preHandled }]: ArgumentTypes['posthandle']>) { + public override posthandle(...[, { preHandled }]: ArgumentTypes['posthandle']>) { if (preHandled) preHandled.unlock(); } - public checkModeratable(...[message, context]: ArgumentTypes['checkModeratable']>) { + public override checkModeratable(...[message, context]: ArgumentTypes['checkModeratable']>) { if (!context.preHandled.bans.includes(context.target.id)) throw context.args.t(LanguageKeys.Commands.Moderation.GuildBansNotFound); return super.checkModeratable(message, context); } diff --git a/src/commands/Moderation/unmute.ts b/src/commands/Moderation/unmute.ts index f27f66c2241..4a0c5ee6599 100644 --- a/src/commands/Moderation/unmute.ts +++ b/src/commands/Moderation/unmute.ts @@ -6,7 +6,7 @@ import { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['um'], diff --git a/src/commands/Moderation/unwarn.ts b/src/commands/Moderation/unwarn.ts index ba80a297b04..ef90ae55c0d 100644 --- a/src/commands/Moderation/unwarn.ts +++ b/src/commands/Moderation/unwarn.ts @@ -1,6 +1,6 @@ import { GuildSettings, ModerationEntity, readSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { HandledCommandContext, ModerationCommand } from '#lib/moderation'; +import { ModerationCommand, type HandledCommandContext } from '#lib/moderation'; import type { GuildMessage } from '#lib/types'; import { floatPromise } from '#utils/common'; import { deleteMessage, getModeration, getSecurity } from '#utils/functions'; @@ -15,7 +15,7 @@ import { send } from '@sapphire/plugin-editable-commands'; detailedDescription: LanguageKeys.Commands.Moderation.UnwarnExtended }) export class UserModerationCommand extends ModerationCommand { - public async messageRun(message: GuildMessage, args: ModerationCommand.Args) { + public override async messageRun(message: GuildMessage, args: ModerationCommand.Args) { const caseId = await args.pick('case'); const reason = args.finished ? null : await args.rest('string'); diff --git a/src/commands/Moderation/vmute.ts b/src/commands/Moderation/vmute.ts index 0c1f158da06..1a8cca1d239 100644 --- a/src/commands/Moderation/vmute.ts +++ b/src/commands/Moderation/vmute.ts @@ -4,7 +4,7 @@ import { getSecurity } from '#utils/functions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['vm'], @@ -28,7 +28,7 @@ export class UserModerationCommand extends ModerationCommand { ); } - public async checkModeratable(...[message, context]: ArgumentTypes) { + public override async checkModeratable(...[message, context]: ArgumentTypes) { const member = await super.checkModeratable(message, context); if (member && member.voice.serverMute) throw context.args.t(LanguageKeys.Commands.Moderation.MuteMuted); return member; diff --git a/src/commands/Moderation/voicekick.ts b/src/commands/Moderation/voicekick.ts index 0815b08e4b4..e0d0f66def9 100644 --- a/src/commands/Moderation/voicekick.ts +++ b/src/commands/Moderation/voicekick.ts @@ -4,7 +4,7 @@ import { getSecurity } from '#utils/functions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['vk', 'vkick'], @@ -26,7 +26,7 @@ export class UserModerationCommand extends ModerationCommand { ); } - public async checkModeratable(...[message, context]: ArgumentTypes) { + public override async checkModeratable(...[message, context]: ArgumentTypes) { const member = await super.checkModeratable(message, context); if (member && !member.voice.channelId) throw context.args.t(LanguageKeys.Commands.Moderation.GuildMemberNotVoicechannel); return member; diff --git a/src/commands/Moderation/vunmute.ts b/src/commands/Moderation/vunmute.ts index f05da20fcba..bca2a89d771 100644 --- a/src/commands/Moderation/vunmute.ts +++ b/src/commands/Moderation/vunmute.ts @@ -4,7 +4,7 @@ import { getSecurity } from '#utils/functions'; import { getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import type { ArgumentTypes } from '@sapphire/utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; @ApplyOptions({ aliases: ['uvm', 'vum', 'unvmute'], @@ -26,7 +26,7 @@ export class UserModerationCommand extends ModerationCommand { ); } - public async checkModeratable(...[message, context]: ArgumentTypes) { + public override async checkModeratable(...[message, context]: ArgumentTypes) { const member = await super.checkModeratable(message, context); if (member && !member.voice.serverMute) throw context.args.t(LanguageKeys.Commands.Moderation.VmuteUserNotMuted); return member; diff --git a/src/commands/System/Admin/eval.ts b/src/commands/System/Admin/eval.ts index 6d584b94c25..9da3a0e392b 100644 --- a/src/commands/System/Admin/eval.ts +++ b/src/commands/System/Admin/eval.ts @@ -27,7 +27,7 @@ export class UserCommand extends SkyraCommand { private readonly kTimeout = 60000; #cachedEvalContext: object | null = null; - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const code = await args.rest('string'); const wait = args.getOption('timeout', 'wait'); @@ -84,7 +84,7 @@ export class UserCommand extends SkyraCommand { ...require('discord.js'), builders: require('@discordjs/builders'), collection: require('@discordjs/collection'), - types: require('discord-api-types/v9') + types: require('discord-api-types/v10') }, sapphire: { asyncQueue: require('@sapphire/async-queue'), diff --git a/src/commands/System/Admin/reboot.ts b/src/commands/System/Admin/reboot.ts index 4e03dd50b74..626bc8c3bea 100644 --- a/src/commands/System/Admin/reboot.ts +++ b/src/commands/System/Admin/reboot.ts @@ -12,7 +12,7 @@ import type { Message } from 'discord.js'; permissionLevel: PermissionLevels.BotOwner }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const content = args.t(LanguageKeys.Commands.System.Reboot); await send(message, content).catch((error) => this.container.logger.fatal(error)); diff --git a/src/commands/System/donate.ts b/src/commands/System/donate.ts index 809150fd672..128c5a0d7a0 100644 --- a/src/commands/System/donate.ts +++ b/src/commands/System/donate.ts @@ -3,8 +3,8 @@ import { SkyraCommand } from '#lib/structures'; import { isGuildMessage } from '#utils/common'; import { sendTemporaryMessage } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; -import { fromAsync } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; +import { Result } from '@sapphire/result'; import type { Message } from 'discord.js'; @ApplyOptions({ @@ -13,12 +13,12 @@ import type { Message } from 'discord.js'; guarded: true }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const content = args.t(this.detailedDescription).extendedHelp!; if (isGuildMessage(message)) { - const { success } = await fromAsync(message.author.send(content)); - const responseContent = args.t(success ? LanguageKeys.Commands.System.DmSent : LanguageKeys.Commands.System.DmNotSent); + const result = await Result.fromAsync(message.author.send(content)); + const responseContent = args.t(result.isOk() ? LanguageKeys.Commands.System.DmSent : LanguageKeys.Commands.System.DmNotSent); await sendTemporaryMessage(message, responseContent); } else { await send(message, content); diff --git a/src/commands/System/support.ts b/src/commands/System/support.ts index 6e25b74e9db..e8f36c8509a 100644 --- a/src/commands/System/support.ts +++ b/src/commands/System/support.ts @@ -3,8 +3,8 @@ import { SkyraCommand } from '#lib/structures'; import { getColor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Message } from 'discord.js'; @ApplyOptions({ aliases: ['support-server', 'server'], @@ -14,8 +14,8 @@ import { Message, MessageEmbed } from 'discord.js'; requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public messageRun(message: Message, args: SkyraCommand.Args) { - const embed = new MessageEmbed() + public override messageRun(message: Message, args: SkyraCommand.Args) { + const embed = new EmbedBuilder() .setTitle(args.t(LanguageKeys.Commands.System.SupportEmbedTitle, { username: message.author.displayName })) .setDescription(args.t(LanguageKeys.Commands.System.SupportEmbedDescription)) .setColor(getColor(message)); diff --git a/src/commands/Tools/avatar.ts b/src/commands/Tools/avatar.ts index c510558e23d..9d53f3e1519 100644 --- a/src/commands/Tools/avatar.ts +++ b/src/commands/Tools/avatar.ts @@ -3,10 +3,10 @@ import { SkyraCommand } from '#lib/structures'; import { getColor, getDisplayAvatar, getEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { AllowedImageSize, Message, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { type ImageSize, EmbedBuilder, Message } from 'discord.js'; -const VALID_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; +const VALID_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096] as const satisfies readonly ImageSize[]; @ApplyOptions({ aliases: ['a', 'av', 'ava'], @@ -16,23 +16,23 @@ const VALID_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { const user = args.finished ? message.author : await args.pick('userName'); if (!user.avatar) this.error(LanguageKeys.Commands.Tools.AvatarNone); const sizeFlag = args.getOption('size'); const size = sizeFlag ? this.resolveSize(sizeFlag) : 2048; - const embed = new MessageEmbed() // + const embed = new EmbedBuilder() // .setAuthor(getEmbedAuthor(user)) .setColor(getColor(message)) .setImage(getDisplayAvatar(user, { size })); return send(message, { embeds: [embed] }); } - private resolveSize(size: string): AllowedImageSize { - const sizeNum = Number(size); - if (Number.isNaN(sizeNum) || !VALID_SIZES.includes(sizeNum)) return 2048; - return sizeNum as AllowedImageSize; + private resolveSize(parameter: string): ImageSize { + const size = Number(parameter) as ImageSize; + if (Number.isNaN(size) || !VALID_SIZES.includes(size)) return 2048; + return size; } } diff --git a/src/commands/Tools/vote.ts b/src/commands/Tools/vote.ts index 5e0efdb8508..ce0454c5926 100644 --- a/src/commands/Tools/vote.ts +++ b/src/commands/Tools/vote.ts @@ -2,8 +2,8 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { SkyraCommand } from '#lib/structures'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; -import { RESTJSONErrorCodes } from 'discord-api-types/rest/v9'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; +import { RESTJSONErrorCodes } from 'discord-api-types/rest/v10'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; import { DiscordAPIError, Message } from 'discord.js'; @ApplyOptions({ @@ -13,7 +13,7 @@ import { DiscordAPIError, Message } from 'discord.js'; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - public async messageRun(message: Message, args: SkyraCommand.Args) { + public override async messageRun(message: Message, args: SkyraCommand.Args) { if (args.finished) this.error(LanguageKeys.Commands.Tools.VoteContentNeeded); for (const reaction of ['👍', '👎', '🤷']) { diff --git a/src/commands/Tools/whois.ts b/src/commands/Tools/whois.ts index e6bbe552b34..914a04e8b6c 100644 --- a/src/commands/Tools/whois.ts +++ b/src/commands/Tools/whois.ts @@ -9,12 +9,11 @@ import { TimestampStyles, time } from '@discordjs/builders'; import { ApplyOptions } from '@sapphire/decorators'; import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { GuildMember, PermissionString, Permissions, Role, User } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { GuildMember, Role, User } from 'discord.js'; import type { TFunction } from 'i18next'; const sortRanks = (x: Role, y: Role) => Number(y.position > x.position) || Number(x.position === y.position) - 1; -const { FLAGS } = Permissions; @ApplyOptions({ aliases: ['userinfo', 'uinfo', 'user'], @@ -24,21 +23,21 @@ const { FLAGS } = Permissions; runIn: [CommandOptionsRunTypeEnum.GuildAny] }) export class UserCommand extends SkyraCommand { - private readonly kAdministratorPermission = FLAGS.ADMINISTRATOR; - private readonly kKeyPermissions: [PermissionString, bigint][] = [ - ['BAN_MEMBERS', FLAGS.BAN_MEMBERS], - ['KICK_MEMBERS', FLAGS.KICK_MEMBERS], - ['MANAGE_CHANNELS', FLAGS.MANAGE_CHANNELS], - ['MANAGE_EMOJIS_AND_STICKERS', FLAGS.MANAGE_EMOJIS_AND_STICKERS], - ['MANAGE_GUILD', FLAGS.MANAGE_GUILD], - ['MANAGE_MESSAGES', FLAGS.MANAGE_MESSAGES], - ['MANAGE_NICKNAMES', FLAGS.MANAGE_NICKNAMES], - ['MANAGE_ROLES', FLAGS.MANAGE_ROLES], - ['MANAGE_WEBHOOKS', FLAGS.MANAGE_WEBHOOKS], - ['MENTION_EVERYONE', FLAGS.MENTION_EVERYONE] + private readonly kAdministratorPermission = PermissionFlagsBits.Administrator; + private readonly kKeyPermissions: [keyof typeof PermissionFlagsBits, bigint][] = [ + ['BanMembers', PermissionFlagsBits.BanMembers], + ['KickMembers', PermissionFlagsBits.KickMembers], + ['ManageChannels', PermissionFlagsBits.ManageChannels], + ['ManageGuildExpressions', PermissionFlagsBits.ManageGuildExpressions], + ['ManageGuild', PermissionFlagsBits.ManageGuild], + ['ManageMessages', PermissionFlagsBits.ManageMessages], + ['ManageNicknames', PermissionFlagsBits.ManageNicknames], + ['ManageRoles', PermissionFlagsBits.ManageRoles], + ['ManageWebhooks', PermissionFlagsBits.ManageWebhooks], + ['MentionEveryone', PermissionFlagsBits.MentionEveryone] ]; - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const user = args.finished ? message.author : await args.pick('userName'); const member = await message.guild.members.fetch(user.id).catch(() => null); @@ -60,7 +59,7 @@ export class UserCommand extends SkyraCommand { .setColor(Colors.White) .setThumbnail(getDisplayAvatar(user, { size: 256 })) .setDescription(this.getUserInformation(user)) - .addField(titles.createdAt, fields.createdAt) + .addFields({ name: titles.createdAt, value: fields.createdAt }) .setFooter({ text: fields.footer, iconURL: getDisplayAvatar(this.container.client.user!, { size: 128 }) }) .setTimestamp(); } @@ -82,8 +81,8 @@ export class UserCommand extends SkyraCommand { .setColor(member.displayColor || Colors.White) .setThumbnail(getDisplayAvatar(member.user, { size: 256 })) .setDescription(this.getUserInformation(member.user, this.getBoostIcon(member.premiumSinceTimestamp))) - .addField(titles.joined, member.joinedTimestamp ? fields.joinedWithTimestamp : fields.joinedUnknown, true) - .addField(titles.createdAt, fields.createdAt, true) + .addFields({ name: titles.joined, value: member.joinedTimestamp ? fields.joinedWithTimestamp : fields.joinedUnknown, inline: true }) + .addFields({ name: titles.createdAt, value: fields.createdAt, inline: true }) .setFooter({ text: fields.footer, iconURL: getDisplayAvatar(this.container.client.user!, { size: 128 }) }) .setTimestamp(); @@ -108,7 +107,10 @@ export class UserCommand extends SkyraCommand { private applyMemberKeyPermissions(t: TFunction, member: GuildMember, embed: SkyraEmbed) { if (member.permissions.has(this.kAdministratorPermission)) { - embed.addField(t(LanguageKeys.Commands.Tools.WhoisMemberPermissions), t(LanguageKeys.Commands.Tools.WhoisMemberPermissionsAll)); + embed.addFields({ + name: t(LanguageKeys.Commands.Tools.WhoisMemberPermissions), + value: t(LanguageKeys.Commands.Tools.WhoisMemberPermissionsAll) + }); return; } @@ -118,7 +120,7 @@ export class UserCommand extends SkyraCommand { } if (permissions.length > 0) { - embed.addField(t(LanguageKeys.Commands.Tools.WhoisMemberPermissions), permissions.join(', ')); + embed.addFields({ name: t(LanguageKeys.Commands.Tools.WhoisMemberPermissions), value: permissions.join(', ') }); } } diff --git a/src/commands/Twitch/twitchsubscription.ts b/src/commands/Twitch/twitchsubscription.ts index 689f2cec288..073b2440c75 100644 --- a/src/commands/Twitch/twitchsubscription.ts +++ b/src/commands/Twitch/twitchsubscription.ts @@ -1,8 +1,8 @@ import { GuildSubscriptionEntity, TwitchSubscriptionEntity } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand, SkyraPaginatedMessage } from '#lib/structures'; +import { SkyraCommand, SkyraPaginatedMessage, SkyraSubcommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; -import { TwitchEventSubTypes, TwitchHelixUsersSearchResult } from '#lib/types/definitions/Twitch'; +import { TwitchEventSubTypes, type TwitchHelixUsersSearchResult } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { getColor, getFullEmbedAuthor, sendLoadingMessage } from '#utils/util'; import { channelMention } from '@discordjs/builders'; @@ -12,10 +12,10 @@ import { send } from '@sapphire/plugin-editable-commands'; import type { TFunction } from '@sapphire/plugin-i18next'; import { chunk, isNullish, isNullishOrEmpty } from '@sapphire/utilities'; import { envIsDefined } from '@skyra/env-utilities'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Guild, MessageEmbed } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, Guild } from 'discord.js'; -@ApplyOptions({ +@ApplyOptions({ enabled: envIsDefined('TWITCH_CALLBACK', 'TWITCH_CLIENT_ID', 'TWITCH_TOKEN', 'TWITCH_EVENTSUB_SECRET'), aliases: ['twitch-subscription', 't-subscription', 't-sub'], description: LanguageKeys.Commands.Twitch.TwitchSubscriptionDescription, @@ -23,10 +23,10 @@ import { Guild, MessageEmbed } from 'discord.js'; permissionLevel: PermissionLevels.Administrator, requiredClientPermissions: [PermissionFlagsBits.EmbedLinks], runIn: [CommandOptionsRunTypeEnum.GuildAny], - subCommands: ['add', 'remove', 'reset', { input: 'show', default: true }] + subcommands: [{ name: 'add' }, { name: 'remove' }, { name: 'reset' }, { name: 'show', default: true }] }) -export class UserCommand extends SkyraCommand { - public async add(message: GuildMessage, args: SkyraCommand.Args) { +export class UserCommand extends SkyraSubcommand { + public async add(message: GuildMessage, args: SkyraSubcommand.Args) { const streamer = await args.pick(UserCommand.streamer); const channel = await args.pick('channelName'); const subscriptionType = await args.pick(UserCommand.status); @@ -190,7 +190,7 @@ export class UserCommand extends SkyraCommand { // Create the pages and the URD to display them. const pages = chunk(lines, 10); const display = new SkyraPaginatedMessage({ - template: new MessageEmbed() // + template: new EmbedBuilder() // .setAuthor(getFullEmbedAuthor(message.author)) .setColor(getColor(message)) }); diff --git a/src/config.ts b/src/config.ts index 219221cb3b7..e9448272c92 100644 --- a/src/config.ts +++ b/src/config.ts @@ -12,18 +12,14 @@ import type { ServerOptions, ServerOptionsAuth } from '@sapphire/plugin-api'; import type { InternationalizationOptions } from '@sapphire/plugin-i18next'; import { codeBlock, toTitleCase } from '@sapphire/utilities'; import { envParseArray, envParseBoolean, envParseInteger, envParseString, setup } from '@skyra/env-utilities'; -import type { ExcludeEnum } from 'discord.js'; import { - Options, - Permissions, - type ActivitiesOptions, - type ClientOptions, - type DefaultMessageNotificationLevel, - type ExplicitContentFilterLevel, - type PermissionString, - type WebhookClientData -} from 'discord.js'; -import type { ActivityTypes } from 'discord.js/typings/enums'; + ActivityType, + GatewayIntentBits, + GuildDefaultMessageNotifications, + GuildExplicitContentFilter, + PermissionFlagsBits +} from 'discord-api-types/v10'; +import { Options, Partials, type ActivitiesOptions, type ClientOptions, type OAuth2Scopes, type WebhookClientData } from 'discord.js'; import i18next, { type FormatFunction, type InterpolationOptions } from 'i18next'; import { join } from 'node:path'; @@ -51,7 +47,7 @@ function parseApiAuth(): ServerOptionsAuth | undefined { secret: envParseString('OAUTH_SECRET'), cookie: envParseString('OAUTH_COOKIE'), redirect: envParseString('OAUTH_REDIRECT_URI'), - scopes: envParseArray('OAUTH_SCOPE'), + scopes: envParseArray('OAUTH_SCOPE') as OAuth2Scopes[], transformers: [transformOauthGuildsAndUser], domainOverwrite: envParseString('OAUTH_DOMAIN_OVERWRITE') }; @@ -75,7 +71,7 @@ function parsePresenceActivity(): ActivitiesOptions[] { return [ { name: CLIENT_PRESENCE_NAME, - type: envParseString('CLIENT_PRESENCE_TYPE', 'LISTENING') as ExcludeEnum + type: ActivityType[envParseString('CLIENT_PRESENCE_TYPE', 'Listening') as keyof typeof ActivityType] } ]; } @@ -89,10 +85,10 @@ export const PROJECT_ROOT = join(rootFolder, process.env.OVERRIDE_ROOT_PATH ?? ' export const LANGUAGE_ROOT = join(PROJECT_ROOT, 'languages'); function parseInternationalizationDefaultVariablesPermissions() { - const keys = Object.keys(Permissions.FLAGS) as readonly PermissionString[]; + const keys = Object.keys(PermissionFlagsBits) as readonly (keyof typeof PermissionFlagsBits)[]; const entries = keys.map((key) => [key, key] as const); - return Object.fromEntries(entries) as Readonly>; + return Object.fromEntries(entries) as Readonly>; } function parseInternationalizationDefaultVariables() { @@ -135,22 +131,22 @@ function parseInternationalizationInterpolation(): InterpolationOptions { return toTitleCase(value); } case LanguageFormatters.ExplicitContentFilter: { - switch (value as ExplicitContentFilterLevel) { - case 'DISABLED': + switch (value as GuildExplicitContentFilter) { + case GuildExplicitContentFilter.Disabled: return i18next.t(LanguageKeys.Guilds.ExplicitContentFilterDisabled, { ...options, lng: language }); - case 'MEMBERS_WITHOUT_ROLES': + case GuildExplicitContentFilter.MembersWithoutRoles: return i18next.t(LanguageKeys.Guilds.ExplicitContentFilterMembersWithoutRoles, { ...options, lng: language }); - case 'ALL_MEMBERS': + case GuildExplicitContentFilter.AllMembers: return i18next.t(LanguageKeys.Guilds.ExplicitContentFilterAllMembers, { ...options, lng: language }); default: return i18next.t(LanguageKeys.Globals.Unknown, { ...options, lng: language }); } } case LanguageFormatters.MessageNotifications: { - switch (value as DefaultMessageNotificationLevel) { - case 'ALL_MESSAGES': + switch (value as GuildDefaultMessageNotifications) { + case GuildDefaultMessageNotifications.AllMessages: return i18next.t(LanguageKeys.Guilds.MessageNotificationsAll, { ...options, lng: language }); - case 'ONLY_MENTIONS': + case GuildDefaultMessageNotifications.OnlyMentions: return i18next.t(LanguageKeys.Guilds.MessageNotificationsMentions, { ...options, lng: language }); default: return i18next.t(LanguageKeys.Globals.Unknown, { ...options, lng: language }); @@ -169,7 +165,7 @@ function parseInternationalizationInterpolation(): InterpolationOptions { return getHandler(language!).numberCompact.format(value as number); } case LanguageFormatters.Duration: { - return getHandler(language!).duration.format(value as number, options?.precision ?? 2); + return getHandler(language!).duration.format(value as number, (options?.precision as number) ?? 2); } case LanguageFormatters.DateTime: { return getHandler(language!).dateTime.format(value as number); @@ -215,29 +211,30 @@ export const CLIENT_OPTIONS: ClientOptions = { caseInsensitivePrefixes: true, defaultPrefix: envParseString('CLIENT_PREFIX'), intents: [ - 'GUILDS', - 'GUILD_MEMBERS', - 'GUILD_BANS', - 'GUILD_EMOJIS_AND_STICKERS', - 'GUILD_VOICE_STATES', - 'GUILD_MESSAGES', - 'GUILD_MESSAGE_REACTIONS', - 'DIRECT_MESSAGES', - 'DIRECT_MESSAGE_REACTIONS' + GatewayIntentBits.Guilds, + GatewayIntentBits.GuildMembers, + GatewayIntentBits.GuildModeration, + GatewayIntentBits.GuildEmojisAndStickers, + GatewayIntentBits.GuildVoiceStates, + GatewayIntentBits.GuildMessages, + GatewayIntentBits.GuildMessageReactions, + GatewayIntentBits.DirectMessages, + GatewayIntentBits.DirectMessageReactions, + GatewayIntentBits.MessageContent ], loadDefaultErrorListeners: false, + loadMessageCommandListeners: true, makeCache: Options.cacheEverything(), sweepers: { - ...Options.defaultSweeperSettings, + ...Options.DefaultSweeperSettings, messages: { interval: minutes.toSeconds(3), lifetime: minutes.toSeconds(15) } }, - partials: ['CHANNEL'], + partials: [Partials.Channel], presence: { activities: parsePresenceActivity() }, regexPrefix: parseRegExpPrefix(), - restTimeOffset: 0, schedule: { interval: seconds(5) }, nms: { everyone: 5, diff --git a/src/languages/index.ts b/src/languages/index.ts index 43bdc848803..538bb0784e5 100644 --- a/src/languages/index.ts +++ b/src/languages/index.ts @@ -1,10 +1,10 @@ import type { Handler } from '#lib/i18n/structures/Handler'; -import { ExtendedHandler as DeDeHandler } from './de-DE/constants'; -import { ExtendedHandler as EnGbHandler } from './en-GB/constants'; -import { ExtendedHandler as EnUsHandler } from './en-US/constants'; -import { ExtendedHandler as EsEsHandler } from './es-ES/constants'; -import { ExtendedHandler as NbNoHandler } from './nb-NO/constants'; -import { ExtendedHandler as NlNlHandler } from './nl-NL/constants'; +import { ExtendedHandler as DeDeHandler } from '#root/languages/de-DE/constants'; +import { ExtendedHandler as EnGbHandler } from '#root/languages/en-GB/constants'; +import { ExtendedHandler as EnUsHandler } from '#root/languages/en-US/constants'; +import { ExtendedHandler as EsEsHandler } from '#root/languages/es-ES/constants'; +import { ExtendedHandler as NbNoHandler } from '#root/languages/nb-NO/constants'; +import { ExtendedHandler as NlNlHandler } from '#root/languages/nl-NL/constants'; export const handlers = new Map([ ['de-DE', new DeDeHandler()], diff --git a/src/lib/SkyraClient.ts b/src/lib/SkyraClient.ts index 4d271dd5813..d3d77778c55 100644 --- a/src/lib/SkyraClient.ts +++ b/src/lib/SkyraClient.ts @@ -1,58 +1,57 @@ import { GuildSettings, SettingsManager } from '#lib/database'; +import { readSettings } from '#lib/database/settings/functions'; +import { GuildMemberFetchQueue } from '#lib/discord/GuildMemberFetchQueue'; +import { WorkerManager } from '#lib/moderation/workers/WorkerManager'; import { AnalyticsData, InviteStore, ScheduleManager } from '#lib/structures'; +import type { LongLivingReactionCollector } from '#lib/util/LongLivingReactionCollector'; +import { Twitch } from '#lib/util/Notifications/Twitch'; import { CLIENT_OPTIONS, WEBHOOK_ERROR } from '#root/config'; import { isGuildMessage } from '#utils/common'; import { Enumerable } from '@sapphire/decorators'; -import { container, SapphireClient } from '@sapphire/framework'; +import { SapphireClient, container } from '@sapphire/framework'; import type { InternationalizationContext } from '@sapphire/plugin-i18next'; import { envParseBoolean } from '@skyra/env-utilities'; import { Message, WebhookClient } from 'discord.js'; -import { readSettings } from './database/settings/functions'; -import { GuildMemberFetchQueue } from './discord/GuildMemberFetchQueue'; -import { WorkerManager } from './moderation/workers/WorkerManager'; -import type { LongLivingReactionCollector } from './util/LongLivingReactionCollector'; -import { Twitch } from './util/Notifications/Twitch'; export class SkyraClient extends SapphireClient { @Enumerable(false) - public dev = process.env.NODE_ENV !== 'production'; + public override dev = process.env.NODE_ENV !== 'production'; /** * The Schedule manager */ @Enumerable(false) - public schedules: ScheduleManager; + public override schedules: ScheduleManager; /** * The webhook to use for the error event */ @Enumerable(false) - public webhookError: WebhookClient | null = WEBHOOK_ERROR ? new WebhookClient(WEBHOOK_ERROR) : null; + public override webhookError: WebhookClient | null = WEBHOOK_ERROR ? new WebhookClient(WEBHOOK_ERROR) : null; /** * The invite store */ @Enumerable(false) - public invites = new InviteStore(); + public override invites = new InviteStore(); @Enumerable(false) - public readonly analytics: AnalyticsData | null; + public override readonly analytics: AnalyticsData | null; @Enumerable(false) - public readonly guildMemberFetchQueue = new GuildMemberFetchQueue(); + public override readonly guildMemberFetchQueue = new GuildMemberFetchQueue(); @Enumerable(false) - public llrCollectors = new Set(); + public override llrCollectors = new Set(); @Enumerable(false) - public twitch = new Twitch(); + public override twitch = new Twitch(); public constructor() { super(CLIENT_OPTIONS); // Workers container.workers = new WorkerManager(); - container.settings = new SettingsManager(); // Analytics @@ -62,14 +61,14 @@ export class SkyraClient extends SapphireClient { this.analytics = envParseBoolean('INFLUX_ENABLED') ? new AnalyticsData() : null; } - public async login(token?: string) { + public override async login(token?: string) { await container.workers.start(); const loginResponse = await super.login(token); await this.schedules.init(); return loginResponse; } - public async destroy() { + public override async destroy() { await container.workers.destroy(); this.guildMemberFetchQueue.destroy(); this.invites.destroy(); @@ -81,7 +80,7 @@ export class SkyraClient extends SapphireClient { * Retrieves the prefix for the guild. * @param message The message that gives context. */ - public fetchPrefix = async (message: Message) => { + public override fetchPrefix = (message: Message) => { if (isGuildMessage(message)) return readSettings(message.guild, GuildSettings.Prefix); return [process.env.CLIENT_PREFIX, ''] as readonly string[]; }; diff --git a/src/lib/api/ApiTransformers.ts b/src/lib/api/ApiTransformers.ts index dcb59f1641c..bae856531d8 100644 --- a/src/lib/api/ApiTransformers.ts +++ b/src/lib/api/ApiTransformers.ts @@ -1,5 +1,4 @@ import { - ChannelTypeString, isDMChannel, isGuildBasedChannelByGuildKey, isNewsChannel, @@ -7,6 +6,7 @@ import { isThreadChannel, isVoiceChannel } from '@sapphire/discord.js-utilities'; +import type { ChannelType } from 'discord-api-types/v10'; import type { Channel, DMChannel, @@ -18,7 +18,7 @@ import type { Role, TextChannel, ThreadChannel, - ThreadChannelTypes, + ThreadChannelType, User, VoiceChannel } from 'discord.js'; @@ -140,11 +140,10 @@ export interface FlattenedRole { export function flattenChannel(channel: NewsChannel): FlattenedNewsChannel; export function flattenChannel(channel: TextChannel): FlattenedTextChannel; export function flattenChannel(channel: VoiceChannel): FlattenedVoiceChannel; -export function flattenChannel(channel: GuildChannel): FlattenedGuildChannel; export function flattenChannel(channel: DMChannel): FlattenedDMChannel; export function flattenChannel(channel: ThreadChannel): FlattenedThreadChannel; export function flattenChannel(channel: Channel): FlattenedChannel; -export function flattenChannel(channel: Channel) { +export function flattenChannel(channel: Channel | ThreadChannel) { if (isThreadChannel(channel)) return flattenChannelThread(channel as ThreadChannel); if (isNewsChannel(channel)) return flattenChannelNews(channel as NewsChannel); if (isTextChannel(channel)) return flattenChannelText(channel as TextChannel); @@ -157,7 +156,7 @@ export function flattenChannel(channel: Channel) { function flattenChannelNews(channel: NewsChannel): FlattenedNewsChannel { return { id: channel.id, - type: channel.type as FlattenedNewsChannel['type'], + type: channel.type, guildId: channel.guild.id, name: channel.name, rawPosition: channel.rawPosition, @@ -217,7 +216,7 @@ function flattenChannelDM(channel: DMChannel): FlattenedDMChannel { return { id: channel.id, type: channel.type as FlattenedDMChannel['type'], - recipient: channel.recipient.id, + recipient: channel.recipient?.id ?? null, createdTimestamp: channel.createdTimestamp ?? 0 }; } @@ -247,89 +246,66 @@ function flattenChannelFallback(channel: Channel): FlattenedChannel { } export interface FlattenedChannel { - createdTimestamp: number; - id: string; - - type: ChannelTypeString; + type: ChannelType; + createdTimestamp: number; } export interface FlattenedGuildChannel extends FlattenedChannel { + type: ChannelType; guildId: string; - name: string; - parentId: string | null; - permissionOverwrites: [string, PermissionOverwrites][]; - rawPosition: number; - - type: ChannelTypeString; } export interface FlattenedNewsChannel extends FlattenedGuildChannel { - type: 'GUILD_NEWS'; - + type: ChannelType.GuildAnnouncement; nsfw: boolean; - topic: string | null; } export interface FlattenedTextChannel extends FlattenedGuildChannel { + type: ChannelType.GuildText; nsfw: boolean; - rateLimitPerUser: number; - topic: string | null; - - type: 'GUILD_TEXT'; } export interface FlattenedThreadChannel extends Pick { + type: ThreadChannelType; archived: boolean; - archivedTimestamp: number | null; - guildId: string; - name: string; - parentId: string | null; - permissionOverwrites: [string, PermissionOverwrites][]; - rateLimitPerUser: number | null; - rawPosition: number | null; - - type: ThreadChannelTypes; } export interface FlattenedNewsThreadChannel extends FlattenedChannel { - type: 'GUILD_NEWS_THREAD'; + type: ChannelType.AnnouncementThread; } export interface FlattenedPublicThreadChannel extends FlattenedChannel { - type: 'GUILD_PUBLIC_THREAD'; + type: ChannelType.PublicThread; } export interface FlattenedPrivateThreadChannel extends FlattenedChannel { - type: 'GUILD_PRIVATE_THREAD'; + type: ChannelType.PrivateThread; } export interface FlattenedVoiceChannel extends FlattenedGuildChannel { - type: 'GUILD_VOICE'; - + type: ChannelType.GuildVoice; bitrate: number; - userLimit: number; } export interface FlattenedDMChannel extends FlattenedChannel { - type: 'DM'; - - recipient: string; + type: ChannelType.DM; + recipient: string | null; } // #endregion Channel diff --git a/src/lib/api/types.d.ts b/src/lib/api/types.ts similarity index 88% rename from src/lib/api/types.d.ts rename to src/lib/api/types.ts index be4a2437785..bd969d0ef9b 100644 --- a/src/lib/api/types.d.ts +++ b/src/lib/api/types.ts @@ -1,5 +1,5 @@ +import type { FlattenedGuild, FlattenedUser } from '#lib/api/ApiTransformers'; import type { LoginData } from '@sapphire/plugin-api'; -import type { FlattenedGuild, FlattenedUser } from './ApiTransformers'; export interface PartialOauthFlattenedGuild extends Omit { joinedTimestamp: FlattenedGuild['joinedTimestamp'] | null; diff --git a/src/lib/api/utils.ts b/src/lib/api/utils.ts index 2b12fb46b84..9c893cdc201 100644 --- a/src/lib/api/utils.ts +++ b/src/lib/api/utils.ts @@ -1,18 +1,27 @@ +import { flattenGuild } from '#lib/api/ApiTransformers'; +import type { OauthFlattenedGuild, PartialOauthFlattenedGuild, TransformedLoginData } from '#lib/api/types'; import * as GuildSettings from '#lib/database/keys/settings/All'; import { readSettings } from '#lib/database/settings'; import type { SkyraCommand } from '#lib/structures'; import { createFunctionPrecondition } from '@sapphire/decorators'; import { container } from '@sapphire/framework'; -import { ApiRequest, ApiResponse, HttpCodes, LoginData } from '@sapphire/plugin-api'; +import { ApiRequest, ApiResponse, HttpCodes, type LoginData } from '@sapphire/plugin-api'; import { RateLimitManager } from '@sapphire/ratelimits'; import { hasAtLeastOneKeyInMap } from '@sapphire/utilities'; -import type { RESTAPIPartialCurrentUserGuild } from 'discord-api-types/v9'; -import { Client, Guild, GuildMember, Permissions } from 'discord.js'; -import { flattenGuild } from './ApiTransformers'; -import type { OauthFlattenedGuild, PartialOauthFlattenedGuild, TransformedLoginData } from './types'; +import { + GuildDefaultMessageNotifications, + GuildExplicitContentFilter, + GuildMFALevel, + GuildPremiumTier, + GuildVerificationLevel, + Locale, + PermissionFlagsBits, + type RESTAPIPartialCurrentUserGuild +} from 'discord-api-types/v10'; +import { Client, Guild, GuildMember, PermissionsBitField } from 'discord.js'; function isAdmin(member: GuildMember, roles: readonly string[]): boolean { - return roles.length === 0 ? member.permissions.has(Permissions.FLAGS.MANAGE_GUILD) : hasAtLeastOneKeyInMap(member.roles.cache, roles); + return roles.length === 0 ? member.permissions.has(PermissionFlagsBits.ManageGuild) : hasAtLeastOneKeyInMap(member.roles.cache, roles); } export const authenticated = () => @@ -66,7 +75,7 @@ export async function canManage(guild: Guild, member: GuildMember): Promise { if (oauthGuild.owner) return true; - if (typeof guild === 'undefined') return new Permissions(BigInt(oauthGuild.permissions)).has(Permissions.FLAGS.MANAGE_GUILD); + if (typeof guild === 'undefined') return new PermissionsBitField(BigInt(oauthGuild.permissions)).has(PermissionFlagsBits.ManageGuild); const member = await guild.members.fetch(id).catch(() => null); if (!member) return false; @@ -87,25 +96,25 @@ async function transformGuild(client: Client, userId: string, data: RESTAPIParti available: true, banner: null, channels: [], - defaultMessageNotifications: 'ONLY_MENTIONS', + defaultMessageNotifications: GuildDefaultMessageNotifications.OnlyMentions, description: null, widgetEnabled: false, - explicitContentFilter: 'DISABLED', + explicitContentFilter: GuildExplicitContentFilter.Disabled, icon: data.icon, id: data.id, joinedTimestamp: null, - mfaLevel: 'NONE', + mfaLevel: GuildMFALevel.None, name: data.name, ownerId: data.owner ? userId : null, partnered: false, - preferredLocale: 'en-US', + preferredLocale: Locale.EnglishUS, premiumSubscriptionCount: null, - premiumTier: 'NONE', + premiumTier: GuildPremiumTier.None, roles: [], splash: null, systemChannelId: null, vanityURLCode: null, - verificationLevel: 'NONE', + verificationLevel: GuildVerificationLevel.None, verified: false } : flattenGuild(guild); diff --git a/src/lib/database/database.config.ts b/src/lib/database/database.config.ts index e05591e0ea9..f278f60877c 100644 --- a/src/lib/database/database.config.ts +++ b/src/lib/database/database.config.ts @@ -2,33 +2,21 @@ import '#root/config'; // Import everything else: import { envParseBoolean, envParseInteger, envParseString } from '@skyra/env-utilities'; -import { join } from 'node:path'; -import { Connection, ConnectionOptions, createConnection, getConnection } from 'typeorm'; +import { fileURLToPath } from 'node:url'; +import { DataSource, type DataSourceOptions } from 'typeorm'; import { SnakeNamingStrategy } from 'typeorm-naming-strategies'; -import './repositories/ClientRepository'; -export const config: ConnectionOptions = { +export const config: DataSourceOptions = { type: 'postgres', host: envParseString('PGSQL_DATABASE_HOST'), port: envParseInteger('PGSQL_DATABASE_PORT'), username: envParseString('PGSQL_DATABASE_USER'), password: envParseString('PGSQL_DATABASE_PASSWORD'), database: envParseString('PGSQL_DATABASE_NAME'), - entities: [join(__dirname, 'entities/*Entity.js')], - migrations: [join(__dirname, 'migrations/*.js')], - cli: { - entitiesDir: 'src/lib/database/entities', - migrationsDir: 'src/lib/database/migrations', - subscribersDir: 'src/lib/database/subscribers' - }, + entities: [fileURLToPath(new URL('entities/*Entity.js', import.meta.url))], + migrations: [fileURLToPath(new URL('migrations/*.js', import.meta.url))], namingStrategy: new SnakeNamingStrategy(), logging: envParseBoolean('TYPEORM_DEBUG_LOGS', false) }; -export const connect = (): Promise => { - try { - return Promise.resolve(getConnection()); - } catch { - return createConnection(config); - } -}; +export const connect = () => new DataSource(config).initialize(); diff --git a/src/lib/database/entities/BannerEntity.ts b/src/lib/database/entities/BannerEntity.ts deleted file mode 100644 index 45ebcad53d8..00000000000 --- a/src/lib/database/entities/BannerEntity.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm'; - -@Entity('banner', { schema: 'public' }) -export class BannerEntity extends BaseEntity { - @PrimaryColumn('varchar', { length: 6 }) - public id!: string; - - @Column('varchar', { length: 32 }) - public group!: string; - - @Column('varchar', { length: 128 }) - public title!: string; - - @Column('varchar', { length: 19 }) - public authorId!: string; - - @Column('integer') - public price!: number; -} diff --git a/src/lib/database/entities/GuildEntity.ts b/src/lib/database/entities/GuildEntity.ts index fd2f099611d..63cc5b816e2 100644 --- a/src/lib/database/entities/GuildEntity.ts +++ b/src/lib/database/entities/GuildEntity.ts @@ -1,17 +1,17 @@ import { ConfigurableKey, configurableKeys } from '#lib/database/settings/ConfigurableKey'; +import type { IBaseEntity } from '#lib/database/settings/base/IBaseEntity'; +import { AdderManager } from '#lib/database/settings/structures/AdderManager'; +import { PermissionNodeManager } from '#lib/database/settings/structures/PermissionNodeManager'; +import { kBigIntTransformer } from '#lib/database/utils/Transformers'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { create } from '#utils/Security/RegexCreator'; import { minutes, years } from '#utils/common'; import type { SerializedEmoji } from '#utils/functions'; import { container } from '@sapphire/framework'; import { RateLimitManager } from '@sapphire/ratelimits'; -import { NonNullObject, arrayStrictEquals } from '@sapphire/utilities'; +import { arrayStrictEquals, type NonNullObject, type PickByValue } from '@sapphire/utilities'; import type { TFunction } from 'i18next'; import { AfterInsert, AfterLoad, AfterRemove, AfterUpdate, BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm'; -import type { IBaseEntity } from '../settings/base/IBaseEntity'; -import { AdderManager } from '../settings/structures/AdderManager'; -import { PermissionNodeManager } from '../settings/structures/PermissionNodeManager'; -import { kBigIntTransformer } from '../utils/Transformers'; @Entity('guilds', { schema: 'public' }) export class GuildEntity extends BaseEntity implements IBaseEntity { @@ -719,6 +719,10 @@ export class GuildEntity extends BaseEntity implements IBaseEntity { } } +export type GuildSettingsKeys = Exclude; +export type GuildSettingsEntries = Pick; +export type GuildSettingsOfType = PickByValue; + export interface PermissionsNode { allow: string[]; diff --git a/src/lib/database/entities/GuildSubscriptionEntity.ts b/src/lib/database/entities/GuildSubscriptionEntity.ts index 67a558848b2..362bf311f3b 100644 --- a/src/lib/database/entities/GuildSubscriptionEntity.ts +++ b/src/lib/database/entities/GuildSubscriptionEntity.ts @@ -1,12 +1,12 @@ +import { TwitchSubscriptionEntity } from '#lib/database/entities/TwitchSubscriptionEntity'; import { BaseEntity, Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm'; -import { TwitchSubscriptionEntity } from './TwitchSubscriptionEntity'; @Entity('guild_subscription', { schema: 'public' }) export class GuildSubscriptionEntity extends BaseEntity { @PrimaryColumn('varchar', { length: 19 }) public guildId!: string; - @ManyToOne(() => TwitchSubscriptionEntity, (twitchSubscription) => twitchSubscription.id, { primary: true, cascade: true, eager: true }) + @ManyToOne(() => TwitchSubscriptionEntity, (twitchSubscription) => twitchSubscription.id, { cascade: true, eager: true }) @JoinColumn() public subscription!: TwitchSubscriptionEntity; diff --git a/src/lib/database/entities/ModerationEntity.ts b/src/lib/database/entities/ModerationEntity.ts index 1015b086703..c03638748d1 100644 --- a/src/lib/database/entities/ModerationEntity.ts +++ b/src/lib/database/entities/ModerationEntity.ts @@ -1,25 +1,25 @@ import { GuildSettings } from '#lib/database/keys'; +import { readSettings } from '#lib/database/settings'; +import { kBigIntTransformer } from '#lib/database/utils/Transformers'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { ModerationManager, ModerationManagerUpdateData } from '#lib/moderation'; import { Events } from '#lib/types/Enums'; import { minutes, years } from '#utils/common'; import { - ModerationTypeAssets, TypeBits, TypeCodes, TypeMetadata, TypeVariation, TypeVariationAppealNames, - metadata + metadata, + type ModerationTypeAssets } from '#utils/moderationConstants'; import { getDisplayAvatar, getFullEmbedAuthor, getTag } from '#utils/util'; import { UserError, container } from '@sapphire/framework'; import { Duration, Time } from '@sapphire/time-utilities'; -import { NonNullObject, isNullishOrZero, isNumber, tryParseURL } from '@sapphire/utilities'; -import { MessageEmbed, User } from 'discord.js'; +import { isNullishOrZero, isNumber, tryParseURL, type NonNullObject } from '@sapphire/utilities'; +import { EmbedBuilder, User } from 'discord.js'; import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm'; -import { readSettings } from '../settings'; -import { kBigIntTransformer } from '../utils/Transformers'; @Entity('moderation', { schema: 'public' }) export class ModerationEntity extends BaseEntity { @@ -326,7 +326,7 @@ export class ModerationEntity extends BaseEntity { { reason: this.reason, prefix, caseId: this.caseId, formattedDuration } ); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(this.color) .setAuthor(getFullEmbedAuthor(moderator)) .setDescription(`${body}\n${reason}`) diff --git a/src/lib/database/entities/ScheduleEntity.ts b/src/lib/database/entities/ScheduleEntity.ts index c02787779b4..63b83885b26 100644 --- a/src/lib/database/entities/ScheduleEntity.ts +++ b/src/lib/database/entities/ScheduleEntity.ts @@ -2,7 +2,7 @@ import type { ScheduleManager } from '#lib/structures/managers/ScheduleManager'; import { Events } from '#lib/types/Enums'; import { container } from '@sapphire/framework'; import { Cron } from '@sapphire/time-utilities'; -import { BaseEntity, Column, Entity, PrimaryGeneratedColumn, ValueTransformer } from 'typeorm'; +import { BaseEntity, Column, Entity, PrimaryGeneratedColumn, type ValueTransformer } from 'typeorm'; const cronTransformer: ValueTransformer = { from(value: string | null) { diff --git a/src/lib/database/entities/TwitchSubscriptionEntity.ts b/src/lib/database/entities/TwitchSubscriptionEntity.ts index 01aec316bde..ca90407f006 100644 --- a/src/lib/database/entities/TwitchSubscriptionEntity.ts +++ b/src/lib/database/entities/TwitchSubscriptionEntity.ts @@ -1,6 +1,6 @@ +import { GuildSubscriptionEntity } from '#lib/database/entities/GuildSubscriptionEntity'; import { TwitchEventSubTypes } from '#lib/types'; import { BaseEntity, Column, Entity, Index, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; -import { GuildSubscriptionEntity } from './GuildSubscriptionEntity'; @Index(['streamerId', 'subscriptionType'], { unique: true }) @Entity('twitch_subscriptions', { schema: 'public' }) diff --git a/src/lib/database/entities/index.ts b/src/lib/database/entities/index.ts index 0e2692c7716..886889c10af 100644 --- a/src/lib/database/entities/index.ts +++ b/src/lib/database/entities/index.ts @@ -1,8 +1,7 @@ -export * from './BannerEntity'; -export * from './ClientEntity'; -export * from './GuildEntity'; -export * from './GuildSubscriptionEntity'; -export * from './ModerationEntity'; -export * from './ScheduleEntity'; -export * from './TwitchSubscriptionEntity'; -export * from './UserEntity'; +export * from '#lib/database/entities/ClientEntity'; +export * from '#lib/database/entities/GuildEntity'; +export * from '#lib/database/entities/GuildSubscriptionEntity'; +export * from '#lib/database/entities/ModerationEntity'; +export * from '#lib/database/entities/ScheduleEntity'; +export * from '#lib/database/entities/TwitchSubscriptionEntity'; +export * from '#lib/database/entities/UserEntity'; diff --git a/src/lib/database/index.ts b/src/lib/database/index.ts index a95432786ea..8e07564c369 100644 --- a/src/lib/database/index.ts +++ b/src/lib/database/index.ts @@ -1,6 +1,5 @@ -export * from './entities'; -export * from './keys'; -export * from './repositories/ClientRepository'; -export * from './settings'; -export * from './utils/DbSet'; -export * from './utils/matchers'; +export * from '#lib/database/entities'; +export * from '#lib/database/keys'; +export * from '#lib/database/settings'; +export * from '#lib/database/utils/DbSet'; +export * from '#lib/database/utils/matchers/index'; diff --git a/src/lib/database/keys/index.ts b/src/lib/database/keys/index.ts index 7a6fcbc20f2..7c7592ef5cb 100644 --- a/src/lib/database/keys/index.ts +++ b/src/lib/database/keys/index.ts @@ -1 +1 @@ -export * as GuildSettings from './settings/All'; +export * as GuildSettings from '#lib/database/keys/settings/All'; diff --git a/src/lib/database/keys/settings/All.ts b/src/lib/database/keys/settings/All.ts index 92bca962b7c..fcae88e26ae 100644 --- a/src/lib/database/keys/settings/All.ts +++ b/src/lib/database/keys/settings/All.ts @@ -1,9 +1,9 @@ -export * as Channels from './Channels'; -export * as Events from './Events'; -export * as Messages from './Messages'; -export * as Permissions from './Permissions'; -export * as Roles from './Roles'; -export * as Selfmod from './Selfmod/All'; +export * as Channels from '#lib/database/keys/settings/Channels'; +export * as Events from '#lib/database/keys/settings/Events'; +export * as Messages from '#lib/database/keys/settings/Messages'; +export * as Permissions from '#lib/database/keys/settings/Permissions'; +export * as Roles from '#lib/database/keys/settings/Roles'; +export * as Selfmod from '#lib/database/keys/settings/Selfmod/All'; export const Prefix = 'prefix'; export const Language = 'language'; diff --git a/src/lib/database/keys/settings/Channels.ts b/src/lib/database/keys/settings/Channels.ts index be881836cde..b13548de282 100644 --- a/src/lib/database/keys/settings/Channels.ts +++ b/src/lib/database/keys/settings/Channels.ts @@ -1,4 +1,4 @@ -export * as Ignore from './Channels/Ignore'; -export * as Logs from './Channels/Logs'; +export * as Ignore from '#lib/database/keys/settings/Channels/Ignore'; +export * as Logs from '#lib/database/keys/settings/Channels/Logs'; export const MediaOnly = 'channelsMediaOnly'; diff --git a/src/lib/database/keys/settings/Messages.ts b/src/lib/database/keys/settings/Messages.ts index 25d1780cd77..34b14140f37 100644 --- a/src/lib/database/keys/settings/Messages.ts +++ b/src/lib/database/keys/settings/Messages.ts @@ -5,4 +5,4 @@ export const ModerationMessageDisplay = 'messagesModerationMessageDisplay'; export const ModerationAutoDelete = 'messagesModerationAutoDelete'; export const ModeratorNameDisplay = 'messagesModeratorNameDisplay'; -export * as AutoDelete from './AutoDelete/All'; +export * as AutoDelete from '#lib/database/keys/settings/AutoDelete/All'; diff --git a/src/lib/database/keys/settings/Selfmod/All.ts b/src/lib/database/keys/settings/Selfmod/All.ts index e5b38ab307b..6b14aa1467c 100644 --- a/src/lib/database/keys/settings/Selfmod/All.ts +++ b/src/lib/database/keys/settings/Selfmod/All.ts @@ -1,11 +1,11 @@ -export * as Attachments from './Attachments'; -export * as Capitals from './Capitals'; -export * as Filter from './Filter'; -export * as Invites from './Invites'; -export * as Links from './Links'; -export * as Messages from './Messages'; -export * as NewLines from './Newlines'; -export * as NoMentionSpam from './NoMentionSpam'; -export * as Reactions from './Reactions'; +export * as Attachments from '#lib/database/keys/settings/Selfmod/Attachments'; +export * as Capitals from '#lib/database/keys/settings/Selfmod/Capitals'; +export * as Filter from '#lib/database/keys/settings/Selfmod/Filter'; +export * as Invites from '#lib/database/keys/settings/Selfmod/Invites'; +export * as Links from '#lib/database/keys/settings/Selfmod/Links'; +export * as Messages from '#lib/database/keys/settings/Selfmod/Messages'; +export * as NewLines from '#lib/database/keys/settings/Selfmod/Newlines'; +export * as NoMentionSpam from '#lib/database/keys/settings/Selfmod/NoMentionSpam'; +export * as Reactions from '#lib/database/keys/settings/Selfmod/Reactions'; export const IgnoreChannels = 'selfmodIgnoreChannels'; diff --git a/src/lib/database/migrations/1594413973851-V01_MigrateClientStorage.ts b/src/lib/database/migrations/1594413973851-V01_MigrateClientStorage.ts index 49f0451033d..2cdb858aa96 100644 --- a/src/lib/database/migrations/1594413973851-V01_MigrateClientStorage.ts +++ b/src/lib/database/migrations/1594413973851-V01_MigrateClientStorage.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { Table, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V01MigrateClientStorage1594413973851 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1594582514749-V02_MigrateDashboardUsers.ts b/src/lib/database/migrations/1594582514749-V02_MigrateDashboardUsers.ts index 1bea8cb8f96..ee119a2fd0f 100644 --- a/src/lib/database/migrations/1594582514749-V02_MigrateDashboardUsers.ts +++ b/src/lib/database/migrations/1594582514749-V02_MigrateDashboardUsers.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { Table, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V02MigrateDashboardUsers1594582514749 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1594582905434-V04_MigrateGiveaways.ts b/src/lib/database/migrations/1594582905434-V04_MigrateGiveaways.ts index a7279c38ef6..27b15edfc96 100644 --- a/src/lib/database/migrations/1594582905434-V04_MigrateGiveaways.ts +++ b/src/lib/database/migrations/1594582905434-V04_MigrateGiveaways.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V04MigrateGiveaways1594582905434 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1594583103788-V05_MigrateGuilds.ts b/src/lib/database/migrations/1594583103788-V05_MigrateGuilds.ts index 2dfee794c31..9c89563ac60 100644 --- a/src/lib/database/migrations/1594583103788-V05_MigrateGuilds.ts +++ b/src/lib/database/migrations/1594583103788-V05_MigrateGuilds.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; const guildChangeTypeColumns = [ ['command-autodelete', 'text[]', 'text[]'], diff --git a/src/lib/database/migrations/1594583300041-V07_MigrateModeration.ts b/src/lib/database/migrations/1594583300041-V07_MigrateModeration.ts index 1042e36b09a..627e7f6e4d5 100644 --- a/src/lib/database/migrations/1594583300041-V07_MigrateModeration.ts +++ b/src/lib/database/migrations/1594583300041-V07_MigrateModeration.ts @@ -1,5 +1,5 @@ import type { NonNullObject } from '@sapphire/utilities'; -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V07MigrateModeration1594583300041 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1594625931497-V08_MigrateUsers.ts b/src/lib/database/migrations/1594625931497-V08_MigrateUsers.ts index d26a4eb2919..4c839d09604 100644 --- a/src/lib/database/migrations/1594625931497-V08_MigrateUsers.ts +++ b/src/lib/database/migrations/1594625931497-V08_MigrateUsers.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn, TableForeignKey } from 'typeorm'; +import { Table, TableColumn, TableForeignKey, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V08MigrateUsers1594625931497 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1594629639526-V10_MigrateTwitchSubscription.ts b/src/lib/database/migrations/1594629639526-V10_MigrateTwitchSubscription.ts index 5a422f5791b..72e505148fd 100644 --- a/src/lib/database/migrations/1594629639526-V10_MigrateTwitchSubscription.ts +++ b/src/lib/database/migrations/1594629639526-V10_MigrateTwitchSubscription.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { Table, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V10MigrateTwitchSubscription1594629639526 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1594649287397-V11_MigrateRpg.ts b/src/lib/database/migrations/1594649287397-V11_MigrateRpg.ts index dec439f920f..f8df0f164d3 100644 --- a/src/lib/database/migrations/1594649287397-V11_MigrateRpg.ts +++ b/src/lib/database/migrations/1594649287397-V11_MigrateRpg.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableCheck, TableColumn, TableForeignKey, TableIndex } from 'typeorm'; +import { Table, TableCheck, TableColumn, TableForeignKey, TableIndex, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V11MigrateRpg1594649287397 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1594757329224-V13_MigrateAnalytics.ts b/src/lib/database/migrations/1594757329224-V13_MigrateAnalytics.ts index b0dc16d776f..2c88e5526a7 100644 --- a/src/lib/database/migrations/1594757329224-V13_MigrateAnalytics.ts +++ b/src/lib/database/migrations/1594757329224-V13_MigrateAnalytics.ts @@ -3,7 +3,7 @@ import { InfluxDB, Point } from '@influxdata/influxdb-client'; import { BucketsAPI } from '@influxdata/influxdb-client-apis'; import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; -import { MigrationInterface, QueryRunner, Table, TableCheck, TableColumn } from 'typeorm'; +import { Table, TableCheck, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; const CATEGORIES_FILE = '1594757329224-V13_MigrateAnalytics.json'; const INFLUX_ALL_COMMANDS_SCRIPT = `from(bucket: "${process.env.INFLUX_ORG_ANALYTICS_BUCKET}") |> range(start: 0) |> filter(fn: (r) => r["_measurement"] == "commands") |> sum(column: "_value")`; diff --git a/src/lib/database/migrations/1594843508131-V14_FixRpgGuildRankEntity.ts b/src/lib/database/migrations/1594843508131-V14_FixRpgGuildRankEntity.ts index 6e679f053f8..f906bd04c62 100644 --- a/src/lib/database/migrations/1594843508131-V14_FixRpgGuildRankEntity.ts +++ b/src/lib/database/migrations/1594843508131-V14_FixRpgGuildRankEntity.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn, TableForeignKey } from 'typeorm'; +import { TableColumn, TableForeignKey, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V14FixRpgGuildRankEntity1594843508131 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1594922379627-V15_ClearDashboardUsers.ts b/src/lib/database/migrations/1594922379627-V15_ClearDashboardUsers.ts index 078b78be987..81431147079 100644 --- a/src/lib/database/migrations/1594922379627-V15_ClearDashboardUsers.ts +++ b/src/lib/database/migrations/1594922379627-V15_ClearDashboardUsers.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { Table, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V15ClearDashboardUsers1594922379627 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1595064247769-V16_CreateSpousesTable.ts b/src/lib/database/migrations/1595064247769-V16_CreateSpousesTable.ts index a17edbfa902..1022ed82374 100644 --- a/src/lib/database/migrations/1595064247769-V16_CreateSpousesTable.ts +++ b/src/lib/database/migrations/1595064247769-V16_CreateSpousesTable.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn, TableForeignKey } from 'typeorm'; +import { Table, TableColumn, TableForeignKey, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V16CreateSpousesTable1595064247769 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1596289368633-V18_CreateIgnoreLogs.ts b/src/lib/database/migrations/1596289368633-V18_CreateIgnoreLogs.ts index e95625623b9..3ab2c6e63e2 100644 --- a/src/lib/database/migrations/1596289368633-V18_CreateIgnoreLogs.ts +++ b/src/lib/database/migrations/1596289368633-V18_CreateIgnoreLogs.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; const NEW_COLUMNS = ['channels.ignore.all', 'channels.ignore.message-edit', 'channels.ignore.message-delete', 'channels.ignore.reaction-add']; diff --git a/src/lib/database/migrations/1596299849081-V19_MigrateReactionRoles.ts b/src/lib/database/migrations/1596299849081-V19_MigrateReactionRoles.ts index 953222cb44c..9b1a4e2b170 100644 --- a/src/lib/database/migrations/1596299849081-V19_MigrateReactionRoles.ts +++ b/src/lib/database/migrations/1596299849081-V19_MigrateReactionRoles.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V19MigrateReactionRoles1596299849081 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1597088981807-V20_UpdateGuildEntityChecks.ts b/src/lib/database/migrations/1597088981807-V20_UpdateGuildEntityChecks.ts index 455be443110..e3ca092e39e 100644 --- a/src/lib/database/migrations/1597088981807-V20_UpdateGuildEntityChecks.ts +++ b/src/lib/database/migrations/1597088981807-V20_UpdateGuildEntityChecks.ts @@ -1,5 +1,4 @@ -import { MigrationInterface, QueryRunner, TableCheck } from 'typeorm'; -import { RandomGenerator } from 'typeorm/util/RandomGenerator'; +import { TableCheck, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V20UpdateGuildEntityChecks1597088981807 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { @@ -217,6 +216,6 @@ export class V20UpdateGuildEntityChecks1597088981807 implements MigrationInterfa const tableName = 'guilds'; const replacedTableName = tableName.replace('.', '_'); const key = `${replacedTableName}_${expression}`; - return `CHK_${RandomGenerator.sha1(key).slice(0, 26)}`; + return `CHK_${key}`; } } diff --git a/src/lib/database/migrations/1597266996401-V21_AddMissingChecks.ts b/src/lib/database/migrations/1597266996401-V21_AddMissingChecks.ts index 6ce67173272..07c99c2f2a4 100644 --- a/src/lib/database/migrations/1597266996401-V21_AddMissingChecks.ts +++ b/src/lib/database/migrations/1597266996401-V21_AddMissingChecks.ts @@ -1,5 +1,4 @@ -import { MigrationInterface, QueryRunner, TableCheck } from 'typeorm'; -import { RandomGenerator } from 'typeorm/util/RandomGenerator'; +import { TableCheck, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V21AddMissingChecks1597266996401 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { @@ -105,6 +104,6 @@ export class V21AddMissingChecks1597266996401 implements MigrationInterface { const tableName = 'guilds'; const replacedTableName = tableName.replace('.', '_'); const key = `${replacedTableName}_${expression}`; - return `CHK_${RandomGenerator.sha1(key).slice(0, 26)}`; + return `CHK_${key}`; } } diff --git a/src/lib/database/migrations/1598010877863-V22_AddSelfStarCapabilities.ts b/src/lib/database/migrations/1598010877863-V22_AddSelfStarCapabilities.ts index 45a99232fae..7c9321d41d7 100644 --- a/src/lib/database/migrations/1598010877863-V22_AddSelfStarCapabilities.ts +++ b/src/lib/database/migrations/1598010877863-V22_AddSelfStarCapabilities.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V22AddSelfStarCapabilities1598010877863 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1598083459734-V23_AddGIData.ts b/src/lib/database/migrations/1598083459734-V23_AddGIData.ts index aff61f3f6f5..9b2004984fd 100644 --- a/src/lib/database/migrations/1598083459734-V23_AddGIData.ts +++ b/src/lib/database/migrations/1598083459734-V23_AddGIData.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn, TableForeignKey } from 'typeorm'; +import { Table, TableColumn, TableForeignKey, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V23AddGIData1598083459734 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1606138444111-V29_AttachmentMode.ts b/src/lib/database/migrations/1606138444111-V29_AttachmentMode.ts index ad8a85ef716..5eb7610c890 100644 --- a/src/lib/database/migrations/1606138444111-V29_AttachmentMode.ts +++ b/src/lib/database/migrations/1606138444111-V29_AttachmentMode.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V29AttachmentMode1606138444111 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1606411800922-V30_AttachmentModeChecks.ts b/src/lib/database/migrations/1606411800922-V30_AttachmentModeChecks.ts index 7c680d96611..ad7396a3ace 100644 --- a/src/lib/database/migrations/1606411800922-V30_AttachmentModeChecks.ts +++ b/src/lib/database/migrations/1606411800922-V30_AttachmentModeChecks.ts @@ -1,5 +1,4 @@ -import { MigrationInterface, QueryRunner, TableCheck } from 'typeorm'; -import { RandomGenerator } from 'typeorm/util/RandomGenerator'; +import { TableCheck, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V30AttachmentModeChecks1606411800922 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { @@ -222,6 +221,6 @@ export class V30AttachmentModeChecks1606411800922 implements MigrationInterface const tableName = 'guilds'; const replacedTableName = tableName.replace('.', '_'); const key = `${replacedTableName}_${expression}`; - return `CHK_${RandomGenerator.sha1(key).slice(0, 26)}`; + return `CHK_${key}`; } } diff --git a/src/lib/database/migrations/1606948188150-V32_SeparatedMemberNameUpdateLogs.ts b/src/lib/database/migrations/1606948188150-V32_SeparatedMemberNameUpdateLogs.ts index 68b9867bf7c..ba2a1a8e063 100644 --- a/src/lib/database/migrations/1606948188150-V32_SeparatedMemberNameUpdateLogs.ts +++ b/src/lib/database/migrations/1606948188150-V32_SeparatedMemberNameUpdateLogs.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V32SeparatedMemberNameUpdateLogs1606948188150 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1610659806881-V34_IncreasedModerationDurations.ts b/src/lib/database/migrations/1610659806881-V34_IncreasedModerationDurations.ts index 19d0cd90c5c..66c8e55c768 100644 --- a/src/lib/database/migrations/1610659806881-V34_IncreasedModerationDurations.ts +++ b/src/lib/database/migrations/1610659806881-V34_IncreasedModerationDurations.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableCheck } from 'typeorm'; +import { TableCheck, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V34IncreasedModerationDurations1610659806881 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1612574048431-V35_RemoveRaidColumns.ts b/src/lib/database/migrations/1612574048431-V35_RemoveRaidColumns.ts index 26021e13a67..788df3160d0 100644 --- a/src/lib/database/migrations/1612574048431-V35_RemoveRaidColumns.ts +++ b/src/lib/database/migrations/1612574048431-V35_RemoveRaidColumns.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V35RemoveRaidColumns1612574048431 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1615269810077-V37_BirthdayIntegration.ts b/src/lib/database/migrations/1615269810077-V37_BirthdayIntegration.ts index f02eef8576b..2f60502fde0 100644 --- a/src/lib/database/migrations/1615269810077-V37_BirthdayIntegration.ts +++ b/src/lib/database/migrations/1615269810077-V37_BirthdayIntegration.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V37BirthdayIntegration1615269810077 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1616188199786-V40_AddSocialIgnoredRoles.ts b/src/lib/database/migrations/1616188199786-V40_AddSocialIgnoredRoles.ts index 6b236be13a9..eb69b28db37 100644 --- a/src/lib/database/migrations/1616188199786-V40_AddSocialIgnoredRoles.ts +++ b/src/lib/database/migrations/1616188199786-V40_AddSocialIgnoredRoles.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V40AddSocialIgnoredRoles1616188199786 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1616191193015-V41_AddMusicAllowedVoiceChannelsAndRoles.ts b/src/lib/database/migrations/1616191193015-V41_AddMusicAllowedVoiceChannelsAndRoles.ts index 46da91301fe..15b97984c4d 100644 --- a/src/lib/database/migrations/1616191193015-V41_AddMusicAllowedVoiceChannelsAndRoles.ts +++ b/src/lib/database/migrations/1616191193015-V41_AddMusicAllowedVoiceChannelsAndRoles.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V41AddMusicAllowedVoiceChannelsAndRoles1616191193015 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1616201639503-V42_AddAllowedRolesIntoGiveaways.ts b/src/lib/database/migrations/1616201639503-V42_AddAllowedRolesIntoGiveaways.ts index 04dc5cfe268..27767cea0d9 100644 --- a/src/lib/database/migrations/1616201639503-V42_AddAllowedRolesIntoGiveaways.ts +++ b/src/lib/database/migrations/1616201639503-V42_AddAllowedRolesIntoGiveaways.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V42AddAllowedRolesIntoGiveaways1616201639503 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1617272351741-V44_AddAutoDeleteIgnoreOptions.ts b/src/lib/database/migrations/1617272351741-V44_AddAutoDeleteIgnoreOptions.ts index bf62d10315b..91391109fce 100644 --- a/src/lib/database/migrations/1617272351741-V44_AddAutoDeleteIgnoreOptions.ts +++ b/src/lib/database/migrations/1617272351741-V44_AddAutoDeleteIgnoreOptions.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V44AddAutoDeleteIgnoreOptions1617272351741 implements MigrationInterface { private readonly names = [ diff --git a/src/lib/database/migrations/1617314282232-V46_AddStarboardMaximumAge.ts b/src/lib/database/migrations/1617314282232-V46_AddStarboardMaximumAge.ts index 1e915ef5e2f..eeeebcc79cf 100644 --- a/src/lib/database/migrations/1617314282232-V46_AddStarboardMaximumAge.ts +++ b/src/lib/database/migrations/1617314282232-V46_AddStarboardMaximumAge.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V46AddStarboardMaximumAge1617314282232 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1617645345960-V47_AddNewLogsChannels.ts b/src/lib/database/migrations/1617645345960-V47_AddNewLogsChannels.ts index 9ea17e75ee2..0d79104390a 100644 --- a/src/lib/database/migrations/1617645345960-V47_AddNewLogsChannels.ts +++ b/src/lib/database/migrations/1617645345960-V47_AddNewLogsChannels.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V47AddNewLogsChannels1617645345960 implements MigrationInterface { private readonly names: readonly string[] = [ diff --git a/src/lib/database/migrations/1617890802896-V48_AddSeparateInitialRoles.ts b/src/lib/database/migrations/1617890802896-V48_AddSeparateInitialRoles.ts index d66288a9384..56e679c93aa 100644 --- a/src/lib/database/migrations/1617890802896-V48_AddSeparateInitialRoles.ts +++ b/src/lib/database/migrations/1617890802896-V48_AddSeparateInitialRoles.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V48AddSeparateInitialRoles1617890802896 implements MigrationInterface { private readonly keys = ['roles.initial-humans', 'roles.initial-bots']; diff --git a/src/lib/database/migrations/1618951687674-V50_RemoveDatabaseChecks.ts b/src/lib/database/migrations/1618951687674-V50_RemoveDatabaseChecks.ts index ef5b915ebb8..7aa10cd5350 100644 --- a/src/lib/database/migrations/1618951687674-V50_RemoveDatabaseChecks.ts +++ b/src/lib/database/migrations/1618951687674-V50_RemoveDatabaseChecks.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableCheck } from 'typeorm'; +import { Table, TableCheck, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V50RemoveDatabaseChecks1618951687674 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1619089555427-V51_NewSocialFeaturesAndValueRename.ts b/src/lib/database/migrations/1619089555427-V51_NewSocialFeaturesAndValueRename.ts index a10c5b4bc66..bde028d7729 100644 --- a/src/lib/database/migrations/1619089555427-V51_NewSocialFeaturesAndValueRename.ts +++ b/src/lib/database/migrations/1619089555427-V51_NewSocialFeaturesAndValueRename.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V51NewSocialFeaturesAndValueRename1619089555427 implements MigrationInterface { private oldRegExp = /%ROLE%|%MEMBER%|%MEMBERNAME%|%GUILD%|%POINTS%/g; diff --git a/src/lib/database/migrations/1619969827210-V52_JoinAndLeaveMessageAutoDelete.ts b/src/lib/database/migrations/1619969827210-V52_JoinAndLeaveMessageAutoDelete.ts index e201b176ba7..6625750ae6b 100644 --- a/src/lib/database/migrations/1619969827210-V52_JoinAndLeaveMessageAutoDelete.ts +++ b/src/lib/database/migrations/1619969827210-V52_JoinAndLeaveMessageAutoDelete.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V52JoinAndLeaveMessageAutoDelete1619969827210 implements MigrationInterface { private readonly keys = ['messages.farewell-auto-delete', 'messages.greeting-auto-delete']; diff --git a/src/lib/database/migrations/1620050724729-V53_AfkSettings.ts b/src/lib/database/migrations/1620050724729-V53_AfkSettings.ts index 03bf0fc3122..b5d4cff85aa 100644 --- a/src/lib/database/migrations/1620050724729-V53_AfkSettings.ts +++ b/src/lib/database/migrations/1620050724729-V53_AfkSettings.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V53AfkSettings1620050724729 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1626169505546-V54_EventsModernization.ts b/src/lib/database/migrations/1626169505546-V54_EventsModernization.ts index 23213077767..697e3e4ff2d 100644 --- a/src/lib/database/migrations/1626169505546-V54_EventsModernization.ts +++ b/src/lib/database/migrations/1626169505546-V54_EventsModernization.ts @@ -1,5 +1,5 @@ -import { isNullish, Nullish } from '@sapphire/utilities'; -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { isNullish, type Nullish } from '@sapphire/utilities'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V54EventsModernization1626169505546 implements MigrationInterface { private readonly oldChannelKeys = ['channels.logs.member', 'channels.logs.message', 'channels.logs.nsfw-message'] as const; diff --git a/src/lib/database/migrations/1627318321333-V55_MediaOnlyChannels.ts b/src/lib/database/migrations/1627318321333-V55_MediaOnlyChannels.ts index 242d31d3fac..5a09ede7a83 100644 --- a/src/lib/database/migrations/1627318321333-V55_MediaOnlyChannels.ts +++ b/src/lib/database/migrations/1627318321333-V55_MediaOnlyChannels.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V55MediaOnlyChannels1627318321333 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1629315603851-V56_MigrateTwitchToEventSub.ts b/src/lib/database/migrations/1629315603851-V56_MigrateTwitchToEventSub.ts index 32db37e0711..fb603385aa2 100644 --- a/src/lib/database/migrations/1629315603851-V56_MigrateTwitchToEventSub.ts +++ b/src/lib/database/migrations/1629315603851-V56_MigrateTwitchToEventSub.ts @@ -1,6 +1,6 @@ -import { TwitchEventSubTypes } from '#lib/types/definitions/Twitch'; import { Twitch } from '#lib/util/Notifications/Twitch'; -import { MigrationInterface, QueryRunner, Table, TableColumn, TableForeignKey, TableUnique } from 'typeorm'; +import { Table, TableColumn, TableForeignKey, TableUnique, type MigrationInterface, type QueryRunner } from 'typeorm'; +import { TwitchEventSubTypes } from '#lib/types/Twitch'; export class V56MigrateTwitchToEventSub1629315603851 implements MigrationInterface { private twitch = new Twitch(); diff --git a/src/lib/database/migrations/1633184279614-V57_MigrateReactionRolesAndTriggers.ts b/src/lib/database/migrations/1633184279614-V57_MigrateReactionRolesAndTriggers.ts index ddca279b310..26884a9311d 100644 --- a/src/lib/database/migrations/1633184279614-V57_MigrateReactionRolesAndTriggers.ts +++ b/src/lib/database/migrations/1633184279614-V57_MigrateReactionRolesAndTriggers.ts @@ -1,7 +1,7 @@ import type { SerializedEmoji } from '#utils/functions'; import { TwemojiRegex } from '@sapphire/discord-utilities'; import type { MigrationInterface, QueryRunner } from 'typeorm'; -import type { ReactionRole } from '../entities/GuildEntity'; +import type { ReactionRole } from '#lib/database/entities/GuildEntity'; export class V57MigrateReactionRolesAndTriggers1633184279614 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1633201003755-V58_GiveawayAuthor.ts b/src/lib/database/migrations/1633201003755-V58_GiveawayAuthor.ts index fa73f673573..ba546e28068 100644 --- a/src/lib/database/migrations/1633201003755-V58_GiveawayAuthor.ts +++ b/src/lib/database/migrations/1633201003755-V58_GiveawayAuthor.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V58GiveawayAuthor1633201003755 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1634379789387-V61_AddMusicAutoLeave.ts b/src/lib/database/migrations/1634379789387-V61_AddMusicAutoLeave.ts index 8f2971104d9..7b3b8910785 100644 --- a/src/lib/database/migrations/1634379789387-V61_AddMusicAutoLeave.ts +++ b/src/lib/database/migrations/1634379789387-V61_AddMusicAutoLeave.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V61AddMusicAutoLeave1634379789387 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1646161749171-V62_VersionSevenRemoveGuildSettings.ts b/src/lib/database/migrations/1646161749171-V62_VersionSevenRemoveGuildSettings.ts index c51236be3c2..288b4f9fb16 100644 --- a/src/lib/database/migrations/1646161749171-V62_VersionSevenRemoveGuildSettings.ts +++ b/src/lib/database/migrations/1646161749171-V62_VersionSevenRemoveGuildSettings.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V62VersionSevenRemoveGuildSettings1646161749171 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1646162907066-V63_VersionSevenRemoveStarboard.ts b/src/lib/database/migrations/1646162907066-V63_VersionSevenRemoveStarboard.ts index b1857965212..2050b7275b7 100644 --- a/src/lib/database/migrations/1646162907066-V63_VersionSevenRemoveStarboard.ts +++ b/src/lib/database/migrations/1646162907066-V63_VersionSevenRemoveStarboard.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { Table, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V63VersionSevenRemoveStarboard1646162907066 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1646163533583-V64_VersionSevenRemoveSpouses.ts b/src/lib/database/migrations/1646163533583-V64_VersionSevenRemoveSpouses.ts index 66da8a775b5..315d28306d4 100644 --- a/src/lib/database/migrations/1646163533583-V64_VersionSevenRemoveSpouses.ts +++ b/src/lib/database/migrations/1646163533583-V64_VersionSevenRemoveSpouses.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn, TableForeignKey } from 'typeorm'; +import { Table, TableColumn, TableForeignKey, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V64VersionSevenRemoveSpouses1646163533583 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1648974657502-V67_RemoveAudioSettings.ts b/src/lib/database/migrations/1648974657502-V67_RemoveAudioSettings.ts index 4552c01a399..8d5e631af34 100644 --- a/src/lib/database/migrations/1648974657502-V67_RemoveAudioSettings.ts +++ b/src/lib/database/migrations/1648974657502-V67_RemoveAudioSettings.ts @@ -1,5 +1,5 @@ import { hours } from '#utils/common'; -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V67RemoveAudioSettings1648974657502 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1654278189464-V68_PartialRemoveSuggestionSettings.ts b/src/lib/database/migrations/1654278189464-V68_PartialRemoveSuggestionSettings.ts index 48b71a7de4c..e5c81ed0d6d 100644 --- a/src/lib/database/migrations/1654278189464-V68_PartialRemoveSuggestionSettings.ts +++ b/src/lib/database/migrations/1654278189464-V68_PartialRemoveSuggestionSettings.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V68PartialRemoveSuggestionSettings1654278189464 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1654346108374-V69_RemoveTriggers.ts b/src/lib/database/migrations/1654346108374-V69_RemoveTriggers.ts index ed3399e1a6a..9f459b4c5cf 100644 --- a/src/lib/database/migrations/1654346108374-V69_RemoveTriggers.ts +++ b/src/lib/database/migrations/1654346108374-V69_RemoveTriggers.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; +import { TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V69RemoveTriggers1654346108374 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1662215154740-V70_RemoveUserGameIntegration.ts b/src/lib/database/migrations/1662215154740-V70_RemoveUserGameIntegration.ts index 033f7a52365..bc2520bdbec 100644 --- a/src/lib/database/migrations/1662215154740-V70_RemoveUserGameIntegration.ts +++ b/src/lib/database/migrations/1662215154740-V70_RemoveUserGameIntegration.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { Table, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V70RemoveUserGameIntegration1662215154740 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1662215310736-V71_RemoveRpg.ts b/src/lib/database/migrations/1662215310736-V71_RemoveRpg.ts index 9bc0e466a4d..c5cfefa89d0 100644 --- a/src/lib/database/migrations/1662215310736-V71_RemoveRpg.ts +++ b/src/lib/database/migrations/1662215310736-V71_RemoveRpg.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table } from 'typeorm'; +import { Table, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V71RemoveRpg1662215310736 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1662216686859-V72_RemoveSocial.ts b/src/lib/database/migrations/1662216686859-V72_RemoveSocial.ts index 7e29511972f..d5d3a1170b5 100644 --- a/src/lib/database/migrations/1662216686859-V72_RemoveSocial.ts +++ b/src/lib/database/migrations/1662216686859-V72_RemoveSocial.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { Table, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V72RemoveSocial1662216686859 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/migrations/1662291099795-V73_RemoveSuggestions.ts b/src/lib/database/migrations/1662291099795-V73_RemoveSuggestions.ts index a16dfae78f7..a0aa30e02e6 100644 --- a/src/lib/database/migrations/1662291099795-V73_RemoveSuggestions.ts +++ b/src/lib/database/migrations/1662291099795-V73_RemoveSuggestions.ts @@ -1,4 +1,4 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm'; +import { Table, TableColumn, type MigrationInterface, type QueryRunner } from 'typeorm'; export class V73RemoveSuggestions1662291099795 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/src/lib/database/repositories/ClientRepository.ts b/src/lib/database/repositories/ClientRepository.ts deleted file mode 100644 index b8f4fa378dc..00000000000 --- a/src/lib/database/repositories/ClientRepository.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* eslint-disable @typescript-eslint/unified-signatures */ -import { ClientEntity } from '#lib/database/entities/ClientEntity'; -import { EntityRepository, FindOneOptions, Repository } from 'typeorm'; - -@EntityRepository(ClientEntity) -export class ClientRepository extends Repository { - public async ensure(options?: FindOneOptions) { - return (await this.findOne(process.env.CLIENT_ID, options)) ?? new ClientEntity(); - } -} diff --git a/src/lib/database/settings/ConfigurableKey.ts b/src/lib/database/settings/ConfigurableKey.ts index 8921af4d504..99a302ab719 100644 --- a/src/lib/database/settings/ConfigurableKey.ts +++ b/src/lib/database/settings/ConfigurableKey.ts @@ -1,9 +1,9 @@ import type { GuildEntity } from '#lib/database/entities/GuildEntity'; -import { NonEmptyArray, SchemaGroup } from '#lib/database/settings/schema/SchemaGroup'; -import { ConfigurableKeyValueOptions, SchemaKey } from '#lib/database/settings/schema/SchemaKey'; +import { SchemaGroup, type NonEmptyArray } from '#lib/database/settings/schema/SchemaGroup'; +import { SchemaKey, type ConfigurableKeyValueOptions } from '#lib/database/settings/schema/SchemaKey'; import { Collection } from '@discordjs/collection'; import { isFunction, isNumber, isPrimitive } from '@sapphire/utilities'; -import { ColumnOptions, ColumnType, getMetadataArgsStorage } from 'typeorm'; +import { getMetadataArgsStorage, type ColumnOptions, type ColumnType } from 'typeorm'; export const configurableKeys = new Collection(); export const configurableGroups = new SchemaGroup(); diff --git a/src/lib/database/settings/SettingsManager.ts b/src/lib/database/settings/SettingsManager.ts index 212d7bc65ee..40b807b0974 100644 --- a/src/lib/database/settings/SettingsManager.ts +++ b/src/lib/database/settings/SettingsManager.ts @@ -1,6 +1,6 @@ -import { GuildSettingsCollection } from './structures/collections/GuildSettingsCollection'; -import { SerializerStore } from './structures/SerializerStore'; -import { TaskStore } from './structures/TaskStore'; +import { GuildSettingsCollection } from '#lib/database/settings/structures/collections/GuildSettingsCollection'; +import { SerializerStore } from '#lib/database/settings/structures/SerializerStore'; +import { TaskStore } from '#lib/database/settings/structures/TaskStore'; export class SettingsManager { public readonly serializers = new SerializerStore(); diff --git a/src/lib/database/settings/Utils.ts b/src/lib/database/settings/Utils.ts index 0819c4e4b25..5d60a94aa33 100644 --- a/src/lib/database/settings/Utils.ts +++ b/src/lib/database/settings/Utils.ts @@ -1,10 +1,10 @@ +import type { GuildEntity } from '#lib/database/entities/GuildEntity'; +import type { ISchemaValue } from '#lib/database/settings/base/ISchemaValue'; +import type { SchemaGroup } from '#lib/database/settings/schema/SchemaGroup'; +import type { SchemaKey } from '#lib/database/settings/schema/SchemaKey'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { SkyraArgs } from '#lib/structures'; import { UserError } from '@sapphire/framework'; -import type { GuildEntity } from '../entities/GuildEntity'; -import type { ISchemaValue } from './base/ISchemaValue'; -import type { SchemaGroup } from './schema/SchemaGroup'; -import type { SchemaKey } from './schema/SchemaKey'; export function isSchemaGroup(groupOrKey: ISchemaValue): groupOrKey is SchemaGroup { return groupOrKey.type === 'Group'; diff --git a/src/lib/database/settings/base/ISchemaValue.d.ts b/src/lib/database/settings/base/ISchemaValue.ts similarity index 100% rename from src/lib/database/settings/base/ISchemaValue.d.ts rename to src/lib/database/settings/base/ISchemaValue.ts diff --git a/src/lib/database/settings/base/SettingsCollection.ts b/src/lib/database/settings/base/SettingsCollection.ts index ca0f519e5ed..71977e0273e 100644 --- a/src/lib/database/settings/base/SettingsCollection.ts +++ b/src/lib/database/settings/base/SettingsCollection.ts @@ -1,6 +1,6 @@ +import type { IBaseEntity } from '#lib/database/settings/base/IBaseEntity'; import { Collection } from '@discordjs/collection'; import { RWLock } from 'async-rwlock'; -import type { IBaseEntity } from './IBaseEntity'; export interface SettingsCollectionCallback { (entity: T): Promise | R; @@ -10,7 +10,7 @@ export abstract class SettingsCollection extends Collecti private readonly queue = new Map>(); private readonly locks = new Map(); - public delete(key: string) { + public override delete(key: string) { this.locks.delete(key); return super.delete(key); } diff --git a/src/lib/database/settings/functions.ts b/src/lib/database/settings/functions.ts index 3d5cc4e3301..87175a7d241 100644 --- a/src/lib/database/settings/functions.ts +++ b/src/lib/database/settings/functions.ts @@ -1,7 +1,7 @@ +import type { GuildEntity } from '#lib/database/entities/GuildEntity'; +import type { SettingsCollectionCallback } from '#lib/database/settings/base/SettingsCollection'; import { container } from '@sapphire/framework'; import type { GuildResolvable } from 'discord.js'; -import type { GuildEntity } from '../entities/GuildEntity'; -import type { SettingsCollectionCallback } from './base/SettingsCollection'; type K = keyof V; type V = GuildEntity; diff --git a/src/lib/database/settings/index.ts b/src/lib/database/settings/index.ts index 6d4e123eb45..bca17c9e34f 100644 --- a/src/lib/database/settings/index.ts +++ b/src/lib/database/settings/index.ts @@ -1,16 +1,16 @@ -export * from './base/IBaseEntity'; -export * from './base/IBaseManager'; -export * from './base/SettingsCollection'; -export * from './ConfigurableKey'; -export * from './functions'; -export * from './schema/SchemaGroup'; -export * from './schema/SchemaKey'; -export * from './SettingsManager'; -export * from './structures/AdderManager'; -export * from './structures/collections/GuildSettingsCollection'; -export * from './structures/PermissionNodeManager'; -export * from './structures/Serializer'; -export * from './structures/SerializerStore'; -export * from './structures/Task'; -export * from './structures/TaskStore'; -export * from './Utils'; +export * from '#lib/database/settings/base/IBaseEntity'; +export * from '#lib/database/settings/base/IBaseManager'; +export * from '#lib/database/settings/base/SettingsCollection'; +export * from '#lib/database/settings/ConfigurableKey'; +export * from '#lib/database/settings/functions'; +export * from '#lib/database/settings/schema/SchemaGroup'; +export * from '#lib/database/settings/schema/SchemaKey'; +export * from '#lib/database/settings/SettingsManager'; +export * from '#lib/database/settings/structures/AdderManager'; +export * from '#lib/database/settings/structures/collections/GuildSettingsCollection'; +export * from '#lib/database/settings/structures/PermissionNodeManager'; +export * from '#lib/database/settings/structures/Serializer'; +export * from '#lib/database/settings/structures/SerializerStore'; +export * from '#lib/database/settings/structures/Task'; +export * from '#lib/database/settings/structures/TaskStore'; +export * from '#lib/database/settings/Utils'; diff --git a/src/lib/database/settings/schema/SchemaGroup.ts b/src/lib/database/settings/schema/SchemaGroup.ts index 5e523ff9ca9..6d3c61fb64d 100644 --- a/src/lib/database/settings/schema/SchemaGroup.ts +++ b/src/lib/database/settings/schema/SchemaGroup.ts @@ -1,9 +1,9 @@ import type { GuildEntity } from '#lib/database/entities/GuildEntity'; import type { ISchemaValue } from '#lib/database/settings/base/ISchemaValue'; +import type { SchemaKey } from '#lib/database/settings/schema/SchemaKey'; +import { AliasedCollection } from '#lib/database/settings/structures/collections/AliasedCollection'; import { codeBlock, isNullish, toTitleCase } from '@sapphire/utilities'; import type { TFunction } from 'i18next'; -import { AliasedCollection } from '../structures/collections/AliasedCollection'; -import type { SchemaKey } from './SchemaKey'; export type NonEmptyArray = [T, ...T[]]; @@ -19,7 +19,7 @@ export class SchemaGroup extends AliasedCollection impleme this.parent = parent; } - public set(key: string, value: ISchemaValue) { + public override set(key: string, value: ISchemaValue) { // Add auto-alias: if (key.includes('-')) { this.aliases.set(key.replaceAll('-', ''), value); diff --git a/src/lib/database/settings/schema/SchemaKey.ts b/src/lib/database/settings/schema/SchemaKey.ts index 68fbab41b88..4b9b3371d58 100644 --- a/src/lib/database/settings/schema/SchemaKey.ts +++ b/src/lib/database/settings/schema/SchemaKey.ts @@ -1,13 +1,13 @@ import type { GuildEntity } from '#lib/database/entities/GuildEntity'; import type { ISchemaValue } from '#lib/database/settings/base/ISchemaValue'; -import type { Serializer, SerializerUpdateContext } from '#lib/database/settings/structures/Serializer'; +import type { SchemaGroup } from '#lib/database/settings/schema/SchemaGroup'; +import type { Serializer } from '#lib/database/settings/structures/Serializer'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { SkyraArgs } from '#lib/structures'; import type { CustomGet } from '#lib/types'; import { container } from '@sapphire/framework'; -import { isNullish, NonNullObject } from '@sapphire/utilities'; +import { isNullish, type NonNullObject } from '@sapphire/utilities'; import type { TFunction } from 'i18next'; -import type { SchemaGroup } from './SchemaGroup'; export class SchemaKey implements ISchemaValue { /** @@ -95,8 +95,12 @@ export class SchemaKey implemen const context = this.getContext(settings, args.t); const result = await serializer.parse(args, context); - if (result.success) return result.value; - throw result.error.message; + return result.match({ + ok: (value) => value, + err: (error) => { + throw error.message; + } + }); } public stringify(settings: GuildEntity, t: TFunction, value: GuildEntity[K]): string { @@ -120,15 +124,13 @@ export class SchemaKey implemen return isNullish(value) ? t(LanguageKeys.Commands.Admin.ConfSettingNotSet) : serializer.stringify(value, context); } - public getContext(settings: GuildEntity, language: TFunction): SerializerUpdateContext { - const context: SerializerUpdateContext = { + public getContext(settings: GuildEntity, language: TFunction): Serializer.UpdateContext { + return { entity: settings, guild: settings.guild, t: language, entry: this - }; - - return context; + } satisfies Serializer.UpdateContext; } } diff --git a/src/lib/database/settings/structures/AdderManager.ts b/src/lib/database/settings/structures/AdderManager.ts index a01bd59cf4f..bb17c479a35 100644 --- a/src/lib/database/settings/structures/AdderManager.ts +++ b/src/lib/database/settings/structures/AdderManager.ts @@ -2,7 +2,7 @@ import type { GuildEntity } from '#lib/database/entities/GuildEntity'; import { GuildSettings } from '#lib/database/keys'; import type { IBaseManager } from '#lib/database/settings/base/IBaseManager'; import { Adder } from '#lib/database/utils/Adder'; -import { isNullishOrZero, Nullish } from '@sapphire/utilities'; +import { isNullishOrZero, type Nullish } from '@sapphire/utilities'; export type AdderKey = 'attachments' | 'capitals' | 'links' | 'messages' | 'newlines' | 'invites' | 'words' | 'reactions'; diff --git a/src/lib/database/settings/structures/PermissionNodeManager.ts b/src/lib/database/settings/structures/PermissionNodeManager.ts index 2fef9deedd9..16c587626b6 100644 --- a/src/lib/database/settings/structures/PermissionNodeManager.ts +++ b/src/lib/database/settings/structures/PermissionNodeManager.ts @@ -1,5 +1,6 @@ import type { GuildEntity, PermissionsNode } from '#lib/database/entities/GuildEntity'; import { GuildSettings } from '#lib/database/keys'; +import type { IBaseManager } from '#lib/database/settings/base/IBaseManager'; import { matchAny } from '#lib/database/utils/matchers/Command'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { SkyraCommand } from '#lib/structures'; @@ -7,7 +8,6 @@ import { Collection } from '@discordjs/collection'; import { UserError } from '@sapphire/framework'; import { arrayStrictEquals } from '@sapphire/utilities'; import { GuildMember, Role, User } from 'discord.js'; -import type { IBaseManager } from '../base/IBaseManager'; export const enum PermissionNodeAction { Allow, diff --git a/src/lib/database/settings/structures/Serializer.ts b/src/lib/database/settings/structures/Serializer.ts index c2baa8e2579..4bae8680f9e 100644 --- a/src/lib/database/settings/structures/Serializer.ts +++ b/src/lib/database/settings/structures/Serializer.ts @@ -3,22 +3,11 @@ import type { SchemaKey } from '#lib/database/settings/schema/SchemaKey'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { translate } from '#lib/i18n/translate'; import type { SkyraArgs } from '#lib/structures'; -import { AliasPiece, AliasPieceOptions, ArgumentError, UserError } from '@sapphire/framework'; +import { AliasPiece, ArgumentError, UserError } from '@sapphire/framework'; import type { Awaitable, NonNullObject } from '@sapphire/utilities'; import type { Guild } from 'discord.js'; import type { TFunction } from 'i18next'; - -export interface Ok { - success: true; - value: T; -} - -export interface Err { - success: false; - error: E; -} - -export type Result = Ok | Err; +import { Result } from '@sapphire/result'; export type SerializerResult = Result; export type AsyncSerializerResult = Promise>; @@ -29,13 +18,13 @@ export abstract class Serializer extends AliasPiece { * @param value The value to parsed. * @param context The context for the key. */ - public abstract parse(args: Serializer.Args, context: SerializerUpdateContext): SerializerResult | AsyncSerializerResult; + public abstract parse(args: Serializer.Args, context: Serializer.UpdateContext): SerializerResult | AsyncSerializerResult; /** * Check whether or not the value is valid. * @param value The value to check. */ - public abstract isValid(value: T, context: SerializerUpdateContext): Awaitable; + public abstract isValid(value: T, context: Serializer.UpdateContext): Awaitable; /** * The stringify method to be overwritten in actual Serializers @@ -43,7 +32,7 @@ export abstract class Serializer extends AliasPiece { * @param guild The guild given for context in this call */ // eslint-disable-next-line @typescript-eslint/no-unused-vars - public stringify(data: T, _context: SerializerUpdateContext): string { + public stringify(data: T, _context: Serializer.UpdateContext): string { return String(data); } @@ -59,10 +48,10 @@ export abstract class Serializer extends AliasPiece { /** * Returns a SerializerResult from a Result. * @param args The Args parser. - * @param value The result to handle. + * @param result The result to handle. */ - protected result(args: Serializer.Args, value: Result): SerializerResult { - return value.success ? value : this.errorFromArgument(args, value.error); + protected result(args: Serializer.Args, result: Result): SerializerResult { + return result.mapErrInto((error) => this.errorFromArgument(args, error)); } /** @@ -70,7 +59,7 @@ export abstract class Serializer extends AliasPiece { * @param value The value to return. */ protected ok(value: T): SerializerResult { - return { success: true, value }; + return Result.ok(value); } /** @@ -78,7 +67,7 @@ export abstract class Serializer extends AliasPiece { * @param error The message of the error. */ protected error(error: string): SerializerResult { - return { success: false, error: new Error(error) }; + return Result.err(new Error(error)); } protected errorFromArgument(args: Serializer.Args, error: UserError): SerializerResult; @@ -100,7 +89,7 @@ export abstract class Serializer extends AliasPiece { * @param entry The schema entry that manages the key * @param language The language that is used for this context */ - protected minOrMax(value: T, length: number, { entry: { minimum, maximum, inclusive, name }, t }: SerializerUpdateContext): SerializerResult { + protected minOrMax(value: T, length: number, { entry: { minimum, maximum, inclusive, name }, t }: Serializer.UpdateContext): SerializerResult { if (minimum !== null && maximum !== null) { if ((length >= minimum && length <= maximum && inclusive) || (length > minimum && length < maximum && !inclusive)) { return this.ok(value); @@ -155,8 +144,9 @@ export abstract class Serializer extends AliasPiece { } export namespace Serializer { - export type Options = AliasPieceOptions; + export type Options = AliasPiece.Options; export type Args = SkyraArgs; + export type UpdateContext = SerializerUpdateContext; } export interface SerializerUpdateContext { diff --git a/src/lib/database/settings/structures/SerializerStore.ts b/src/lib/database/settings/structures/SerializerStore.ts index 7d74b205359..b2806e7ea50 100644 --- a/src/lib/database/settings/structures/SerializerStore.ts +++ b/src/lib/database/settings/structures/SerializerStore.ts @@ -1,5 +1,5 @@ +import { Serializer } from '#lib/database/settings/structures/Serializer'; import { AliasStore } from '@sapphire/framework'; -import { Serializer } from './Serializer'; export class SerializerStore extends AliasStore> { /** diff --git a/src/lib/database/settings/structures/Task.ts b/src/lib/database/settings/structures/Task.ts index 2eb0a59bccf..6ab9000b3bf 100644 --- a/src/lib/database/settings/structures/Task.ts +++ b/src/lib/database/settings/structures/Task.ts @@ -1,5 +1,5 @@ import type { PartialResponseValue } from '#lib/database/entities'; -import { Piece, PieceOptions } from '@sapphire/framework'; +import { Piece } from '@sapphire/framework'; import type { Awaitable } from '@sapphire/utilities'; export abstract class Task extends Piece { @@ -11,5 +11,5 @@ export abstract class Task extends Piece { } export namespace Task { - export type Options = PieceOptions; + export type Options = Piece.Options; } diff --git a/src/lib/database/settings/structures/TaskStore.ts b/src/lib/database/settings/structures/TaskStore.ts index 5e5c9a0defa..0270bdef5b8 100644 --- a/src/lib/database/settings/structures/TaskStore.ts +++ b/src/lib/database/settings/structures/TaskStore.ts @@ -1,5 +1,5 @@ +import { Task } from '#lib/database/settings/structures/Task'; import { Store } from '@sapphire/framework'; -import { Task } from './Task'; export class TaskStore extends Store { /** @@ -7,7 +7,7 @@ export class TaskStore extends Store { * @param client The client that instantiates this store */ public constructor() { - super(Task as any, { name: 'tasks' }); + super(Task, { name: 'tasks' }); this.container.client.stores.register(this); } } diff --git a/src/lib/database/settings/structures/collections/AliasedCollection.ts b/src/lib/database/settings/structures/collections/AliasedCollection.ts index 2445877685a..6e1b9ddda09 100644 --- a/src/lib/database/settings/structures/collections/AliasedCollection.ts +++ b/src/lib/database/settings/structures/collections/AliasedCollection.ts @@ -6,7 +6,7 @@ export class AliasedCollection extends Collection { */ public readonly aliases = new Collection(); - public get(key: K): V | undefined { + public override get(key: K): V | undefined { return super.get(key) ?? this.aliases.get(key); } } diff --git a/src/lib/database/settings/structures/collections/GuildSettingsCollection.ts b/src/lib/database/settings/structures/collections/GuildSettingsCollection.ts index 4effeaf9071..274da6fd436 100644 --- a/src/lib/database/settings/structures/collections/GuildSettingsCollection.ts +++ b/src/lib/database/settings/structures/collections/GuildSettingsCollection.ts @@ -1,5 +1,5 @@ import { GuildEntity } from '#lib/database/entities/GuildEntity'; -import { SettingsCollection, SettingsCollectionCallback } from '#lib/database/settings/base/SettingsCollection'; +import { SettingsCollection, type SettingsCollectionCallback } from '#lib/database/settings/base/SettingsCollection'; import { container } from '@sapphire/framework'; export interface GuildSettingsCollectionCallback extends SettingsCollectionCallback {} @@ -7,7 +7,7 @@ export interface GuildSettingsCollectionCallback extends SettingsCollectionCa export class GuildSettingsCollection extends SettingsCollection { public async fetch(key: string): Promise { const { guilds } = container.db; - const existing = await guilds.findOne(key); + const existing = await guilds.findOne({ where: { id: key } }); if (existing) { this.set(key, existing); return existing; diff --git a/src/lib/database/utils/DbSet.ts b/src/lib/database/utils/DbSet.ts index e7483a8c002..8bf1fdd9a7c 100644 --- a/src/lib/database/utils/DbSet.ts +++ b/src/lib/database/utils/DbSet.ts @@ -1,18 +1,16 @@ -import type { Connection, FindConditions, FindManyOptions, Repository } from 'typeorm'; -import { connect } from '../database.config'; -import { BannerEntity } from '../entities/BannerEntity'; -import { GuildEntity } from '../entities/GuildEntity'; -import { GuildSubscriptionEntity } from '../entities/GuildSubscriptionEntity'; -import { ModerationEntity } from '../entities/ModerationEntity'; -import { ScheduleEntity } from '../entities/ScheduleEntity'; -import { TwitchSubscriptionEntity } from '../entities/TwitchSubscriptionEntity'; -import { UserEntity } from '../entities/UserEntity'; -import { ClientRepository } from '../repositories/ClientRepository'; +import { connect } from '#lib/database/database.config'; +import { ClientEntity } from '#lib/database/entities/ClientEntity'; +import { GuildEntity } from '#lib/database/entities/GuildEntity'; +import { GuildSubscriptionEntity } from '#lib/database/entities/GuildSubscriptionEntity'; +import { ModerationEntity } from '#lib/database/entities/ModerationEntity'; +import { ScheduleEntity } from '#lib/database/entities/ScheduleEntity'; +import { TwitchSubscriptionEntity } from '#lib/database/entities/TwitchSubscriptionEntity'; +import { UserEntity } from '#lib/database/entities/UserEntity'; +import type { DataSource, FindManyOptions, FindOptions, Repository } from 'typeorm'; export class DbSet { - public readonly connection: Connection; - public readonly banners: Repository; - public readonly clients: ClientRepository; + public readonly connection: DataSource; + public readonly clients: Repository; public readonly guilds: Repository; public readonly guildSubscriptions: Repository; public readonly moderations: Repository; @@ -20,10 +18,9 @@ export class DbSet { public readonly twitchSubscriptions: Repository; public readonly users: Repository; - private constructor(connection: Connection) { + private constructor(connection: DataSource) { this.connection = connection; - this.banners = this.connection.getRepository(BannerEntity); - this.clients = this.connection.getCustomRepository(ClientRepository); + this.clients = this.connection.getRepository(ClientEntity); this.guilds = this.connection.getRepository(GuildEntity); this.guildSubscriptions = this.connection.getRepository(GuildSubscriptionEntity); this.moderations = this.connection.getRepository(ModerationEntity); @@ -33,7 +30,7 @@ export class DbSet { } public async fetchModerationDirectMessageEnabled(id: string) { - const entry = await this.users.findOne(id, { select: ['moderationDM'] }); + const entry = await this.users.findOne({ where: { id }, select: ['moderationDM'] }); return entry?.moderationDM ?? true; } @@ -46,8 +43,8 @@ export class DbSet { * Finds entities that match given conditions. */ // eslint-disable-next-line @typescript-eslint/unified-signatures - public fetchModerationEntry(conditions?: FindConditions): Promise; - public async fetchModerationEntry(optionsOrConditions?: FindConditions | FindManyOptions) { + public fetchModerationEntry(conditions?: FindOptions): Promise; + public async fetchModerationEntry(optionsOrConditions?: FindOptions | FindManyOptions) { return this.moderations.findOne(optionsOrConditions as any); } @@ -60,8 +57,8 @@ export class DbSet { * Finds entities that match given conditions. */ // eslint-disable-next-line @typescript-eslint/unified-signatures - public fetchModerationEntries(conditions?: FindConditions): Promise; - public async fetchModerationEntries(optionsOrConditions?: FindConditions | FindManyOptions) { + public fetchModerationEntries(conditions?: FindOptions): Promise; + public async fetchModerationEntries(optionsOrConditions?: FindOptions | FindManyOptions) { return this.moderations.find(optionsOrConditions as any); } diff --git a/src/lib/database/utils/matchers/index.ts b/src/lib/database/utils/matchers/index.ts index c30585e2512..6d277c8b4a1 100644 --- a/src/lib/database/utils/matchers/index.ts +++ b/src/lib/database/utils/matchers/index.ts @@ -1 +1 @@ -export * as CommandMatcher from './Command'; +export * as CommandMatcher from '#lib/database/utils/matchers/Command'; diff --git a/src/lib/discord/Api.ts b/src/lib/discord/Api.ts index 983da8db589..079521d1a78 100644 --- a/src/lib/discord/Api.ts +++ b/src/lib/discord/Api.ts @@ -1,1107 +1,7 @@ +import { API } from '@discordjs/core/http-only'; import { container } from '@sapphire/framework'; +let instance: API; export function api() { - return Reflect.get(container.client, 'api') as Api; + return (instance ??= new API(container.client.rest)); } - -interface Api { - channels: ApiChannels; - guilds: ApiGuilds; - invites: ApiInvites; - users: ApiUsers; - voice: ApiVoice; - webhooks: ApiWebhooks; -} - -interface ApiChannels { - (channelId: string): ApiChannelsChannel; -} - -/** - * @endpoint /channels/{channel.id} - */ -interface ApiChannelsChannel { - /** - * Get a channel by ID. Returns a channel object. - * @url https://discord.com/developers/docs/resources/channel#get-channel - */ - get: ApiMethods['get']; - - /** - * Update a channel's settings. Requires the `MANAGE_CHANNELS` permission for the guild. Returns a channel on - * success, and a 400 BAD REQUEST on invalid parameters. Fires a Channel Update Gateway event. If modifying a - * category, individual Channel Update events will fire for each child channel that also changes. - * @url https://discord.com/developers/docs/resources/channel#modify-channel - */ - put: ApiMethods['put']; - - /** - * Update a channel's settings. Requires the `MANAGE_CHANNELS` permission for the guild. Returns a channel on - * success, and a 400 BAD REQUEST on invalid parameters. Fires a Channel Update Gateway event. If modifying a - * category, individual Channel Update events will fire for each child channel that also changes. - * @url https://discord.com/developers/docs/resources/channel#modify-channel - */ - patch: ApiMethods['patch']; - - /** - * Delete a channel, or close a private message. Requires the `MANAGE_CHANNELS` permission for the guild. Deleting a - * category does not delete its child channels; they will have their `parent_id` removed and a Channel Update - * Gateway event will fire for each of them. Returns a channel object on success. Fires a Channel Delete Gateway - * event. - * @url https://discord.com/developers/docs/resources/channel#deleteclose-channel - */ - delete: ApiMethods['delete']; - - /** - * Messages endpoints. - */ - messages: ApiChannelsChannelMessages; - - /** - * Permissions endpoints. - */ - permissions: ApiChannelsChannelPermissions; - - /** - * Invites endpoints. - */ - invites: ApiChannelsChannelInvites; - - /** - * Typing endpoints. - */ - typing: ApiChannelsChannelTyping; - - /** - * Pins endpoints. - */ - pins: ApiChannelsChannelPins; - - /** - * Webhook endpoints. - */ - webhooks: ApiChannelsChannelWebhooks; -} - -/** - * @endpoint /channels/{channel.id}/messages - */ -interface ApiChannelsChannelMessages { - /** - * Returns the messages for a channel. If operating on a guild channel, this endpoint requires the `VIEW_CHANNEL` - * permission to be present on the current user. If the current user is missing the `READ_MESSAGE_HISTORY` - * permission in the channel then this will return no messages (since they cannot read the message history). Returns - * an array of message objects on success. - * @url https://discord.com/developers/docs/resources/channel#get-channel-messages - */ - get: ApiMethods['get']; - - /** - * Post a message to a guild text or DM channel. If operating on a guild channel, this endpoint requires the - * `SEND_MESSAGES` permission to be present on the current user. If the `tts` field is set to `true`, the - * `SEND_TTS_MESSAGES` permission is required for the message to be spoken. Returns a message object. Fires a - * Message Create Gateway event. See message formatting for more information on how to properly format messages. - * @url https://discord.com/developers/docs/resources/channel#create-message - */ - post: ApiMethods['post']; - - /** - * Bulk delete endpoints. - */ - 'bulk-delete': ApiChannelsChannelMessagesBulkDelete; - - (messageId: string): ApiChannelsChannelMessagesMessage; -} - -/** - * @endpoint /channels/{channel.id}/messages/{message.id} - */ -interface ApiChannelsChannelMessagesMessage { - /** - * Returns a specific message in the channel. If operating on a guild channel, this endpoint requires the - * `READ_MESSAGE_HISTORY` permission to be present on the current user. Returns a message object on success. - * @url https://discord.com/developers/docs/resources/channel#get-channel-message - */ - get: ApiMethods['get']; - - /** - * Edit a previously sent message. You can only edit messages that have been sent by the current user. Returns a - * message object. Fires a Message Update Gateway event. - * @url https://discord.com/developers/docs/resources/channel#edit-message - */ - patch: ApiMethods['patch']; - - /** - * Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the current - * user, this endpoint requires the `MANAGE_MESSAGES` permission. Returns a 204 empty response on success. Fires a - * Message Delete Gateway event. - * @url https://discord.com/developers/docs/resources/channel#delete-message - */ - delete: ApiMethods['delete']; - - reactions: ApiChannelsChannelMessagesMessageReactions; -} - -/** - * @endpoint /channels/{channel.id}/messages/{message.id}/reactions - */ -interface ApiChannelsChannelMessagesMessageReactions { - /** - * Deletes all reactions on a message. This endpoint requires the `MANAGE_MESSAGES` permission to be present on the - * current user. - * @url https://discord.com/developers/docs/resources/channel#delete-all-reactions - */ - delete: ApiMethods['delete']; - - (emoji: string): ApiChannelsChannelMessagesMessageReactionsEmoji; - (emoji: string, userId: '@me'): ApiChannelsChannelMessagesMessageReactionsEmojiMe; - (emoji: string, userId: string): ApiChannelsChannelMessagesMessageReactionsEmojiUser; -} - -/** - * @endpoint /channels/{channel.id}/messages/{message.id}/reactions/{emoji} - */ -interface ApiChannelsChannelMessagesMessageReactionsEmoji { - /** - * Get a list of users that reacted with this emoji. Returns an array of user objects on success. - * @url https://discord.com/developers/docs/resources/channel#get-reactions - */ - get: ApiMethods['get']; - - /** - * Deletes all the reactions for a given emoji on a message. This endpoint requires the `MANAGE_MESSAGES` permission - * to be present on the current user. - * @url https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji - */ - delete: ApiMethods['delete']; - - (userId: '@me'): ApiChannelsChannelMessagesMessageReactionsEmojiMe; - >(userId: '@me', key: T): ApiChannelsChannelMessagesMessageReactionsEmojiMe[T]; - - (userId: string): ApiChannelsChannelMessagesMessageReactionsEmojiUser; - >( - userId: string, - key: T - ): ApiChannelsChannelMessagesMessageReactionsEmojiUser[T]; -} - -/** - * @endpoint /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me - */ -interface ApiChannelsChannelMessagesMessageReactionsEmojiMe { - /** - * Create a reaction for the message. `emoji` takes the form of `name:id` for custom guild emoji, or Unicode - * characters. This endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. - * Additionally, if nobody else has reacted to the message using this emoji, this endpoint requires the - * `ADD_REACTIONS` permission to be present on the current user. Returns a 204 empty response on success. - * @url https://discord.com/developers/docs/resources/channel#create-reaction - */ - put: ApiMethods['put']; - - /** - * Delete a reaction the current user has made for the message. Returns a 204 empty response on success. - * @url https://discord.com/developers/docs/resources/channel#delete-own-reaction - */ - delete: ApiMethods['delete']; -} - -/** - * @endpoint /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id} - */ -interface ApiChannelsChannelMessagesMessageReactionsEmojiUser { - /** - * Deletes another user's reaction. This endpoint requires the `MANAGE_MESSAGES` permission to be present on the - * current user. Returns a 204 empty response on success. - * @url https://discord.com/developers/docs/resources/channel#delete-user-reaction - */ - delete: ApiMethods['delete']; -} - -/** - * @endpoint /channels/{channel.id}/messages/bulk-delete - */ -interface ApiChannelsChannelMessagesBulkDelete { - /** - * Delete multiple messages in a single request. This endpoint can only be used on guild channels and requires the - * `MANAGE_MESSAGES` permission. Returns a 204 empty response on success. Fires a Message Delete Bulk Gateway event. - * - * Any message IDs given that do not exist or are invalid will count towards the minimum and maximum message count - * (currently 2 and 100 respectively). Additionally, duplicated IDs will only be counted once. - */ - post: ApiMethods['post']; -} - -interface ApiChannelsChannelPermissions { - (permissionId: string): ApiChannelsChannelPermissionsPermission; -} - -/** - * @endpoint /channels/{channel.id}/permissions/{overwrite.id} - */ -interface ApiChannelsChannelPermissionsPermission { - /** - * Edit the channel permission overwrites for a user or role in a channel. Only usable for guild channels. Requires - * the `MANAGE_ROLES` permission. Returns a 204 empty response on success. For more information about permissions, - * see permissions. - * @url https://discord.com/developers/docs/resources/channel#edit-channel-permissions - */ - put: ApiMethods['put']; - - /** - * Delete a channel permission overwrite for a user or role in a channel. Only usable for guild channels. Requires - * the `MANAGE_ROLES` permission. Returns a 204 empty response on success. For more information about permissions, - * see permissions. - * @url https://discord.com/developers/docs/resources/channel#delete-channel-permission - */ - delete: ApiMethods['delete']; -} - -/** - * @endpoint /channels/{channel.id}/invites - */ -interface ApiChannelsChannelInvites { - /** - * Returns a list of invite objects (with invite metadata) for the channel. Only usable for guild channels. Requires - * the `MANAGE_CHANNELS` permission. - * @url https://discord.com/developers/docs/resources/channel#get-channel-invites - */ - get: ApiMethods['get']; - - /** - * Create a new invite object for the channel. Only usable for guild channels. Requires the `CREATE_INSTANT_INVITE` - * permission. All JSON parameters for this route are optional, however the request body is not. If you are not - * sending any fields, you still have to send an empty JSON object (`{}`). Returns an invite object. - * @url https://discord.com/developers/docs/resources/channel#create-channel-invite - */ - post: ApiMethods['post']; -} - -/** - * @endpoint /channels/{channel.id}/typing - */ -interface ApiChannelsChannelTyping { - /** - * Post a typing indicator for the specified channel. Generally bots should not implement this route. However, if a - * bot is responding to a command and expects the computation to take a few seconds, this endpoint may be called to - * let the user know that the bot is processing their message. Returns a 204 empty response on success. Fires a - * Typing Start Gateway event. - * @url https://discord.com/developers/docs/resources/channel#trigger-typing-indicator - */ - post: ApiMethods['post']; -} - -/** - * @endpoint /channels/{channel.id}/pins - */ -interface ApiChannelsChannelPins { - /** - * Returns all pinned messages in the channel as an array of message objects. - * @url https://discord.com/developers/docs/resources/channel#get-pinned-messages - */ - get: ApiMethods['get']; - - (messageId: string): ApiChannelsChannelPinsMessage; -} - -/** - * @endpoint /channels/{channel.id}/pins/{message.id} - */ -interface ApiChannelsChannelPinsMessage { - /** - * Pin a message in a channel. Requires the `MANAGE_MESSAGES` permission. Returns a 204 empty response on success. - * @url https://discord.com/developers/docs/resources/channel#add-pinned-channel-message - */ - put: ApiMethods['put']; - - /** - * Delete a pinned message in a channel. Requires the `MANAGE_MESSAGES` permission. Returns a 204 empty response on - * success. - * @url https://discord.com/developers/docs/resources/channel#delete-pinned-channel-message - */ - delete: ApiMethods['delete']; -} - -/** - * @endpoint /channels/{channel.id}/webhooks - */ -interface ApiChannelsChannelWebhooks { - /** - * Returns a list of channel webhook objects. Requires the `MANAGE_WEBHOOKS` permission. - * @url https://discord.com/developers/docs/resources/webhook#get-channel-webhooks - */ - get: ApiMethods['get']; - - /** - * Create a new webhook. Requires the `MANAGE_WEBHOOKS` permission. Returns a webhook object on success. - * @url https://discord.com/developers/docs/resources/webhook#create-webhook - */ - post: ApiMethods['post']; -} - -/** - * @endpoint /guilds - */ -interface ApiGuilds { - /** - * Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event. - * @url https://discord.com/developers/docs/resources/guild#create-guild - */ - post: ApiMethods['post']; - - (guildId: string): ApiGuildsGuild; - >(guildId: string, key: T): ApiGuildsGuild[T]; - , S extends R>(guildId: string, key: T, subKey: S): ApiGuildsGuild[T][S]; -} - -/** - * @endpoint /guilds/{guild.id} - */ -interface ApiGuildsGuild { - /** - * Returns the guild object for the given id. - * @url https://discord.com/developers/docs/resources/guild#get-guild - */ - get: ApiMethods['get']; - - /** - * Modify a guild's settings. Requires the `MANAGE_GUILD` permission. Returns the updated guild object on success. - * Fires a Guild Update Gateway event. - * @url https://discord.com/developers/docs/resources/guild#modify-guild - */ - patch: ApiMethods['patch']; - - /** - * Delete a guild permanently. User must be owner. Returns `204 No Content` on success. Fires a Guild Delete Gateway - * event. - * @url https://discord.com/developers/docs/resources/guild#delete-guild - */ - delete: ApiMethods['delete']; - - /** - * Channel endpoints. - */ - channels: ApiGuildsGuildChannels; - - /** - * Member endpoints. - */ - members: ApiGuildsGuildMembers; - - /** - * Ban endpoints. - */ - bans: ApiGuildsGuildBans; - - /** - * Role endpoints. - */ - roles: ApiGuildsGuildRoles; - - /** - * Prune endpoints. - */ - prune: ApiGuildsGuildPrune; - - /** - * Region endpoints. - */ - regions: ApiGuildsGuildRegions; - - /** - * Invite endpoints. - */ - invites: ApiGuildsGuildInvites; - - /** - * Integration endpoints. - */ - integrations: ApiGuildsGuildIntegrations; - - /** - * Emojis endpoints. - */ - emojis: ApiGuildsGuildEmojis; - - /** - * Webhook endpoints. - */ - webhooks: ApiGuildsGuildWebhooks; - - /** - * Embed endpoints. - */ - embed: ApiGuildsGuildEmbed; - - /** - * Vanity URL endpoints. - */ - 'vanity-url': ApiGuildsGuildVanityUrl; - - /** - * Widget endpoints. - */ - 'widget.png': ApiGuildsGuildWidget; - - /** - * Audit-Logs endpoints. - */ - 'audit-logs': ApiGuildsGuildAuditLogs; -} - -/** - * @endpoint /guilds/{guild.id}/channels - */ -interface ApiGuildsGuildChannels { - /** - * Returns a list of guild channel objects. - * @url https://discord.com/developers/docs/resources/guild#get-guild-channels - */ - get: ApiMethods['get']; - - /** - * Create a new channel object for the guild. Requires the `MANAGE_CHANNELS` permission. Returns the new channel - * object on success. Fires a Channel Create Gateway event. - * @url https://discord.com/developers/docs/resources/guild#create-guild-channel - */ - post: ApiMethods['post']; - - /** - * Modify the positions of a set of channel objects for the guild. Requires `MANAGE_CHANNELS` permission. Returns a - * 204 empty response on success. Fires multiple Channel Update Gateway events. - * @url https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions - */ - patch: ApiMethods['patch']; -} - -/** - * @endpoint /guilds/{guild.id}/members - */ -interface ApiGuildsGuildMembers { - /** - * Returns a list of guild member objects that are members of the guild. - * @url https://discord.com/developers/docs/resources/guild#list-guild-members - */ - get: ApiMethods['get']; - - '@me': ApiGuildsGuildMembersMe; - - search: APiGuildsGuildMembersFetch; - - (memberId: '@me'): ApiGuildsGuildMembersMe; - >(memberId: '@me', key: T): ApiGuildsGuildMembersMe[T]; - - (memberId: string): ApiGuildsGuildMembersMember; - >(memberId: string, key: T): ApiGuildsGuildMembersMember[T]; -} - -/** - * @endpoint /guilds/{guild.id}/members/{user.id} - */ -interface ApiGuildsGuildMembersMember { - /** - * Returns a guild member object for the specified user. - * @url https://discord.com/developers/docs/resources/guild#get-guild-member - */ - get: ApiMethods['get']; - - /** - * Adds a user to the guild, provided you have a valid oauth2 access token for the user with the `guilds.join` - * scope. Returns a 201 Created with the guild member as the body, or 204 No Content if the user is already a member - * of the guild. Fires a Guild Member Add Gateway event. Requires the bot to have the `CREATE_INSTANT_INVITE` - * permission. - * @url https://discord.com/developers/docs/resources/guild#add-guild-member - */ - put: ApiMethods['put']; - - /** - * Modify attributes of a guild member. Returns a 204 empty response on success. Fires a Guild Member Update Gateway - * event. If the `channel_id` is set to null, this will force the target user to be disconnected from voice. - * @url https://discord.com/developers/docs/resources/guild#modify-guild-member - */ - patch: ApiMethods['patch']; - - /** - * Remove a member from a guild. Requires `KICK_MEMBERS` permission. Returns a 204 empty response on success. Fires - * a Guild Member Remove Gateway event. - * @url https://discord.com/developers/docs/resources/guild#remove-guild-member - */ - delete: ApiMethods['delete']; - - roles: ApiGuildsGuildMembersMemberRoles; -} - -interface ApiGuildsGuildMembersMemberRoles { - (roleId: string): ApiGuildsGuildMembersMemberRolesRole; -} - -/** - * @endpoint /guilds/{guild.id}/members/{user.id}/roles/{role.id} - */ -interface ApiGuildsGuildMembersMemberRolesRole { - /** - * Adds a role to a guild member. Requires the `MANAGE_ROLES` permission. Returns a 204 empty response on success. - * Fires a Guild Member Update Gateway event. - * @url https://discord.com/developers/docs/resources/guild#add-guild-member-role - */ - put: ApiMethods['put']; - - /** - * Removes a role from a guild member. Requires the `MANAGE_ROLES` permission. Returns a 204 empty response on - * success. Fires a Guild Member Update Gateway event. - * @url https://discord.com/developers/docs/resources/guild#remove-guild-member-role - */ - delete: ApiMethods['delete']; -} - -interface ApiGuildsGuildMembersMe { - nick: ApiGuildsGuildMembersMeNick; -} - -interface APiGuildsGuildMembersFetch { - get: ApiMethods['get']; -} - -/** - * @endpoint /guilds/{guild.id}/members/@me/nick - */ -interface ApiGuildsGuildMembersMeNick { - /** - * Modifies the nickname of the current user in a guild. Returns a 200 with the nickname on success. Fires a Guild - * Member Update Gateway event. - * @url https://discord.com/developers/docs/resources/guild#modify-current-user-nick - */ - patch: ApiMethods['patch']; -} - -/** - * @endpoint /guilds/{guild.id}/bans - */ -interface ApiGuildsGuildBans { - /** - * Returns a list of ban objects for the users banned from this guild. Requires the `BAN_MEMBERS` permission. - * @url https://discord.com/developers/docs/resources/guild#get-guild-bans - */ - get: ApiMethods['get']; - - (userId: string): ApiGuildsGuildBansUser; -} - -/** - * @endpoint /guilds/{guild.id}/bans/{user.id} - */ -interface ApiGuildsGuildBansUser { - /** - * Returns a ban object for the given user or a 404 not found if the ban cannot be found. Requires the `BAN_MEMBERS` - * permission. - * @url https://discord.com/developers/docs/resources/guild#get-guild-ban - */ - get: ApiMethods['get']; - - /** - * Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the `BAN_MEMBERS` - * permission. Returns a 204 empty response on success. Fires a Guild Ban Add Gateway event. - * @url https://discord.com/developers/docs/resources/guild#create-guild-ban - */ - put: ApiMethods['put']; - - /** - * Remove the ban for a user. Requires the `BAN_MEMBERS` permissions. Returns a 204 empty response on success. Fires - * a Guild Ban Remove Gateway event. - * @url https://discord.com/developers/docs/resources/guild#remove-guild-ban - */ - delete: ApiMethods['delete']; -} - -/** - * @endpoint /guilds/{guild.id}/roles - */ -interface ApiGuildsGuildRoles { - /** - * Returns a list of role objects for the guild. - * @url https://discord.com/developers/docs/resources/guild#get-guild-roles - */ - get: ApiMethods['get']; - - /** - * Create a new role for the guild. Requires the `MANAGE_ROLES` permission. Returns the new role object on success. - * Fires a Guild Role Create Gateway event. All JSON params are optional. - * @url https://discord.com/developers/docs/resources/guild#create-guild-role - */ - post: ApiMethods['post']; - - /** - * Modify the positions of a set of role objects for the guild. Requires the `MANAGE_ROLES` permission. Returns a - * list of all of the guild's role objects on success. Fires multiple Guild Role Update Gateway events. - * @url https://discord.com/developers/docs/resources/guild#modify-guild-role-positions - */ - patch: ApiMethods['patch']; - - (roleId: string): ApiGuildsGuildRolesRole; -} - -/** - * @endpoint /guilds/{guild.id}/roles/{role.id} - */ -interface ApiGuildsGuildRolesRole { - /** - * Delete a guild role. Requires the `MANAGE_ROLES` permission. Returns a 204 empty response on success. Fires a - * Guild Role Delete Gateway event. - * @url https://discord.com/developers/docs/resources/guild#delete-guild-role - */ - delete: ApiMethods['delete']; -} - -/** - * @endpoint /guilds/{guild.id}/prune - */ -interface ApiGuildsGuildPrune { - /** - * Returns an object with one 'pruned' key indicating the number of members that would be removed in a prune - * operation. Requires the `KICK_MEMBERS` permission. - * @url https://discord.com/developers/docs/resources/guild#get-guild-prune-count - */ - get: ApiMethods['get']; - - /** - * Begin a prune operation. Requires the `KICK_MEMBERS` permission. Returns an object with one 'pruned' key - * indicating the number of members that were removed in the prune operation. For large guilds it's recommended to - * set the `compute_prune_count` option to `false`, forcing 'pruned' to `null`. Fires multiple Guild Member Remove - * Gateway events. - * @url https://discord.com/developers/docs/resources/guild#begin-guild-prune - */ - post: ApiMethods['post']; -} - -/** - * @endpoint /guilds/{guild.id}/regions - */ -interface ApiGuildsGuildRegions { - /** - * Returns a list of voice region objects for the guild. Unlike the similar `/voice` route, this returns VIP servers - * when the guild is VIP-enabled. - * @url https://discord.com/developers/docs/resources/guild#get-guild-voice-regions - */ - get: ApiMethods['get']; -} - -/** - * @endpoint /guilds/{guild.id}/invites - */ -interface ApiGuildsGuildInvites { - /** - * Returns a list of invite objects (with invite metadata) for the guild. Requires the `MANAGE_GUILD` permission. - * @url https://discord.com/developers/docs/resources/guild#get-guild-invites - */ - get: ApiMethods['get']; -} - -/** - * @endpoint /guilds/{guild.id}/integrations - */ -interface ApiGuildsGuildIntegrations { - /** - * Returns a list of integration objects for the guild. Requires the `MANAGE_GUILD` permission. - * @url https://discord.com/developers/docs/resources/guild#get-guild-integrations - */ - get: ApiMethods['get']; - - /** - * Attach an integration object from the current user to the guild. Requires the `MANAGE_GUILD` permission. Returns - * a 204 empty response on success. Fires a Guild Integrations Update Gateway event. - * @url https://discord.com/developers/docs/resources/guild#create-guild-integration - */ - post: ApiMethods['post']; - - /** - * Modify the behavior and settings of an integration object for the guild. Requires the `MANAGE_GUILD` permission. - * Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event. - * @url https://discord.com/developers/docs/resources/guild#modify-guild-integration - */ - patch: ApiMethods['patch']; - - (integrationId: string): ApiGuildsGuildIntegrationsIntegration; - >(integrationId: string, key: T): ApiGuildsGuildIntegrationsIntegration[T]; -} - -/** - * @endpoint /guilds/{guild.id}/integrations/{integration.id} - */ -interface ApiGuildsGuildIntegrationsIntegration { - /** - * Delete the attached integration object for the guild. Requires the `MANAGE_GUILD` permission. Returns a 204 empty - * response on success. Fires a Guild Integrations Update Gateway event. - * @url https://discord.com/developers/docs/resources/guild#delete-guild-integration - */ - delete: ApiMethods['delete']; - - sync: ApiGuildsGuildIntegrationsIntegrationSync; -} - -/** - * @endpoint /guilds/{guild.id}/integrations/{integration.id}/sync - */ -interface ApiGuildsGuildIntegrationsIntegrationSync { - /** - * Sync an integration. Requires the `MANAGE_GUILD` permission. Returns a 204 empty response on success. - * @url https://discord.com/developers/docs/resources/guild#sync-guild-integration - */ - post: ApiMethods['post']; -} - -/** - * @endpoint /guilds/{guild.id}/emojis - */ -interface ApiGuildsGuildEmojis { - /** - * Returns a list of emoji objects for the given guild. - * @url https://discord.com/developers/docs/resources/emoji#list-guild-emojis - */ - get: ApiMethods['get']; - - /** - * Create a new emoji for the guild. Requires the `MANAGE_EMOJIS_AND_STICKERS` permission. Returns the new emoji - * object on success. Fires a Guild Emojis Update Gateway event. - * @url https://discord.com/developers/docs/resources/emoji#create-guild-emoji - */ - post: ApiMethods['post']; - - (emoji: string): ApiGuildsGuildEmojisEmoji; -} - -/** - * @endpoint /guilds/{guild.id}/emojis/{emoji.id} - */ -interface ApiGuildsGuildEmojisEmoji { - /** - * Returns an emoji object for the given guild and emoji IDs. - * @url https://discord.com/developers/docs/resources/emoji#get-guild-emoji - */ - get: ApiMethods['get']; - - /** - * Modify the given emoji. Requires the `MANAGE_EMOJIS_AND_STICKERS` permission. Returns the updated emoji object on - * success. Fires a Guild Emojis Update Gateway event. - * @url https://discord.com/developers/docs/resources/emoji#modify-guild-emoji - */ - patch: ApiMethods['patch']; - - /** - * Delete the given emoji. Requires the `MANAGE_EMOJIS_AND_STICKERS` permission. Returns `204 No Content` on success. - * Fires a Guild Emojis Update Gateway event. - * @url https://discord.com/developers/docs/resources/emoji#delete-guild-emoji - */ - delete: ApiMethods['delete']; -} - -/** - * @endpoint /guilds/{guild.id}/webhooks - */ -interface ApiGuildsGuildWebhooks { - /** - * Returns a list of guild webhook objects. Requires the `MANAGE_WEBHOOKS` permission. - * @url https://discord.com/developers/docs/resources/webhook#get-guild-webhooks - */ - get: ApiMethods['get']; -} - -/** - * @endpoint /guilds/{guild.id}/embed - */ -interface ApiGuildsGuildEmbed { - /** - * Returns the guild embed object. Requires the `MANAGE_GUILD` permission. - * @url https://discord.com/developers/docs/resources/guild#get-guild-embed - */ - get: ApiMethods['get']; - - /** - * Modify a guild embed object for the guild. All attributes may be passed in with JSON and modified. Requires the - * `MANAGE_GUILD` permission. Returns the updated guild embed object. - * @url https://discord.com/developers/docs/resources/guild#modify-guild-embed - */ - patch: ApiMethods['patch']; -} - -/** - * @endpoint /guilds/{guild.id}/vanity-url - */ -interface ApiGuildsGuildVanityUrl { - /** - * Returns a partial invite object for guilds with that feature enabled. Requires the `MANAGE_GUILD` permission. - * `code` will be null if a vanity url for the guild is not set. - * @url https://discord.com/developers/docs/resources/guild#get-guild-vanity-url - */ - get: ApiMethods['get']; -} - -/** - * /guilds/{guild.id}/widget.png - */ -interface ApiGuildsGuildWidget { - /** - * Returns a PNG image widget for the guild. Requires no permissions or authentication. The same documentation also - * applies to `embed.png`. - * @url https://discord.com/developers/docs/resources/guild#get-guild-widget-image - */ - get: ApiMethods['get']; -} - -/** - * /guilds/{guild.id}/audit-logs - */ -interface ApiGuildsGuildAuditLogs { - get: ApiMethods['get']; -} - -interface ApiInvites { - (inviteId: string): ApiInvitesInvite; -} - -/** - * @endpoint /invites/{invite.code} - */ -interface ApiInvitesInvite { - /** - * Returns an invite object for the given code. - * @url https://discord.com/developers/docs/resources/invite#get-invite - */ - get: ApiMethods['get']; - - /** - * Delete an invite. Requires the `MANAGE_CHANNELS` permission on the channel this invite belongs to, or - * `MANAGE_GUILD` to remove any invite across the guild. Returns an invite object on success. - * @url https://discord.com/developers/docs/resources/invite#delete-invite - */ - delete: ApiMethods['delete']; -} - -interface ApiUsers { - '@me': ApiUsersMe; - - (userId: '@me'): ApiUsersMe; - >(userId: '@me', key: T): ApiUsersMe[T]; - , S extends R>(userId: '@me', key: T, subKey: S): ApiUsersMe[T][S]; - - (userId: string): ApiUsersUser; -} - -/** - * @endpoint /users/{user.id} - */ -interface ApiUsersUser { - /** - * Returns a user object for a given user ID. - * @url https://discord.com/developers/docs/resources/user#get-user - */ - get: ApiMethods['get']; -} - -/** - * @endpoint /users/@me - */ -interface ApiUsersMe { - /** - * Returns the user object of the requester's account. For OAuth2, this requires the identify scope, which will - * return the object without an email, and optionally the email scope, which returns the object with an email. - * @url https://discord.com/developers/docs/resources/user#get-current-user - */ - get: ApiMethods['get']; - - /** - * Modify the requester's user account settings. Returns a user object on success. - * @url https://discord.com/developers/docs/resources/user#modify-current-user - */ - patch: ApiMethods['patch']; - - /** - * Guild-related endpoints. - */ - guilds: ApiUsersMeGuilds; - - /** - * Channel-related endpoints. - */ - channels: ApiUsersMeChannels; - - /** - * Connection-related endpoints. - */ - connections: ApiUsersMeConnections; -} - -/** - * @endpoint /users/@me/guilds - */ -interface ApiUsersMeGuilds { - /** - * Returns a list of partial guild objects the current user is a member of. Requires the `guilds` OAuth2 scope. - * @url https://discord.com/developers/docs/resources/user#get-current-user-guilds - */ - get: ApiMethods['get']; - - /** - * Guild-related endpoints. - */ - (guildId: string): ApiUsersMeGuildsGuild; -} - -/** - * @endpoint /users/@me/guilds/{guild.id} - */ -interface ApiUsersMeGuildsGuild { - /** - * Leave a guild. Returns a 204 empty response on success. - * @url https://discord.com/developers/docs/resources/user#leave-guild - */ - delete: ApiMethods['delete']; -} - -/** - * @endpoint /users/@me/channels - */ -interface ApiUsersMeChannels { - /** - * Returns a list of DM channel objects. For bots, this is no longer a supported method of getting recent DMs, and - * will return an empty array. - * @url https://discord.com/developers/docs/resources/user#get-user-dms - */ - get: ApiMethods['get']; - - /** - * Create a new DM channel with a user. Returns a DM channel object. - * @url https://discord.com/developers/docs/resources/user#create-dm - */ - post: ApiMethods['post']; -} - -interface ApiUsersMeConnections { - /** - * Returns a list of connection objects. Requires the `connections` OAuth2 scope. - * @url https://discord.com/developers/docs/resources/user#get-user-connections - */ - get: ApiMethods['get']; -} - -interface ApiVoice { - regions: ApiVoiceRegions; -} - -/** - * @endpoint /voice/regions - */ -interface ApiVoiceRegions { - /** - * Returns an array of voice region objects that can be used when creating servers. - * @url https://discord.com/developers/docs/resources/voice#list-voice-regions - */ - get: ApiMethods['get']; -} - -interface ApiWebhooks { - /** - * Access to a webhook by its ID. - */ - (webhookId: string): ApiWebhooksWebhook; -} - -/** - * @endpoint /webhooks/{webhook.id} - */ -interface ApiWebhooksWebhook { - /** - * Returns the new webhook object for the given id. - * @url https://discord.com/developers/docs/resources/webhook#get-webhook - */ - get: ApiMethods['get']; - - /** - * Modify a webhook. Requires the `MANAGE_WEBHOOKS` permission. Returns the updated webhook object on success. - * @url https://discord.com/developers/docs/resources/webhook#modify-webhook - */ - patch: ApiMethods['patch']; - - /** - * Delete a webhook permanently. User must be owner. Returns a 204 NO CONTENT response on success. - * @url https://discord.com/developers/docs/resources/webhook#delete-webhook - */ - delete: ApiMethods['delete']; - - /** - * Access to a token. - */ - (token: string): ApiWebhooksWebhookToken; -} - -/** - * @endpoint /webhooks/{webhook.id}/{webhook.token} - */ -interface ApiWebhooksWebhookToken { - /** - * Same as the non-token version, except this call does not require authentication and returns no user in the - * webhook object. - * @url https://discord.com/developers/docs/resources/webhook#get-webhook-with-token - */ - get: ApiMethods['get']; - - /** - * Same as the non-token version, except this call does not require authentication, does not accept a `channel_id` - * parameter in the body, and does not return a user in the webhook object. - * @url https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token - */ - patch: ApiMethods['patch']; - - /** - * Same as the non-token version, except this call does not require authentication. - * @url https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token - */ - delete: ApiMethods['delete']; - - /** - * Sends a message. - * @url https://discord.com/developers/docs/resources/webhook#execute-webhook - */ - post: ApiMethods['post']; - - /** - * The slack endpoint. - */ - slack: ApiWebhooksWebhookTokenSlack; - - /** - * The github endpoint. - */ - github: ApiWebhooksWebhookTokenGitHub; -} - -/** - * @endpoint /webhooks/{webhook.id}/{webhook.token}/slack - */ -interface ApiWebhooksWebhookTokenSlack { - /** - * Sends a message with the Slack format. - * @url https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook - */ - post: ApiMethods['post']; -} - -/** - * @endpoint /webhooks/{webhook.id}/{webhook.token}/github - */ -interface ApiWebhooksWebhookTokenGitHub { - /** - * Sends a message with the GitHub format. - * @url https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook - */ - post: ApiMethods['post']; -} - -interface ApiMethods { - // eslint-disable-next-line @typescript-eslint/ban-types - get(data?: { query?: {} }): Promise; - post(data: unknown): Promise; - put(data?: unknown): Promise; - patch(data: unknown): Promise; - delete(data?: { reason?: string }): Promise; -} - -type R = Exclude; diff --git a/src/lib/discord/SkyraEmbed.ts b/src/lib/discord/SkyraEmbed.ts index 14facb21970..f38b4cbedda 100644 --- a/src/lib/discord/SkyraEmbed.ts +++ b/src/lib/discord/SkyraEmbed.ts @@ -1,7 +1,7 @@ import { ZeroWidthSpace } from '#utils/constants'; -import { MessageEmbed } from 'discord.js'; +import { EmbedBuilder } from 'discord.js'; -export class SkyraEmbed extends MessageEmbed { +export class SkyraEmbed extends EmbedBuilder { public splitFields(contentOrTitle: string | string[], rawContent?: string | string[]) { if (typeof contentOrTitle === 'undefined') return this; @@ -16,16 +16,17 @@ export class SkyraEmbed extends MessageEmbed { } if (Array.isArray(content)) content = content.join('\n'); - if (title === ZeroWidthSpace && !this.description && content.length < 4096) { - this.description = content; + if (title === ZeroWidthSpace && !this.data.description && content.length < 4096) { + this.data.description = content; return this; } let x: number; let slice: string; + this.data.fields ??= []; while (content.length) { if (content.length < 1024) { - this.fields.push({ name: title, value: content, inline: false }); + this.data.fields.push({ name: title, value: content, inline: false }); return this; } @@ -34,7 +35,7 @@ export class SkyraEmbed extends MessageEmbed { if (x === -1) x = slice.lastIndexOf(' '); if (x === -1) x = 1024; - this.fields.push({ name: title, value: content.trim().slice(0, x), inline: false }); + this.data.fields.push({ name: title, value: content.trim().slice(0, x), inline: false }); content = content.slice(x + 1); title = ZeroWidthSpace; } diff --git a/src/lib/discord/index.ts b/src/lib/discord/index.ts index 7260541bf40..f446de57570 100644 --- a/src/lib/discord/index.ts +++ b/src/lib/discord/index.ts @@ -1,2 +1,2 @@ -export * from './GuildMemberFetchQueue'; -export * from './SkyraEmbed'; +export * from '#lib/discord/GuildMemberFetchQueue'; +export * from '#lib/discord/SkyraEmbed'; diff --git a/src/lib/games/base/BaseBotController.ts b/src/lib/games/base/BaseBotController.ts index b139939f9db..3626c214f8a 100644 --- a/src/lib/games/base/BaseBotController.ts +++ b/src/lib/games/base/BaseBotController.ts @@ -1,4 +1,4 @@ -import { BaseController } from './BaseController'; +import { BaseController } from '#lib/games/base/BaseController'; export abstract class BaseBotController extends BaseController { public constructor() { diff --git a/src/lib/games/base/BaseController.ts b/src/lib/games/base/BaseController.ts index 13e3c33bd94..af1ba52a233 100644 --- a/src/lib/games/base/BaseController.ts +++ b/src/lib/games/base/BaseController.ts @@ -1,4 +1,4 @@ -import { BaseGame, GameTurn } from './BaseGame'; +import { BaseGame, GameTurn } from '#lib/games/base/BaseGame'; export abstract class BaseController { public readonly name: string; diff --git a/src/lib/games/base/BaseGame.ts b/src/lib/games/base/BaseGame.ts index 6092ce987f5..37c9e27c413 100644 --- a/src/lib/games/base/BaseGame.ts +++ b/src/lib/games/base/BaseGame.ts @@ -1,7 +1,7 @@ +import type { BaseController } from '#lib/games/base/BaseController'; import { fetchT } from '@sapphire/plugin-i18next'; import type { Client, Message } from 'discord.js'; import type { TFunction } from 'i18next'; -import type { BaseController } from './BaseController'; export const enum GameTurn { PlayerA, diff --git a/src/lib/games/base/BaseReactionController.ts b/src/lib/games/base/BaseReactionController.ts index 916f7bc5891..354971b4935 100644 --- a/src/lib/games/base/BaseReactionController.ts +++ b/src/lib/games/base/BaseReactionController.ts @@ -1,13 +1,13 @@ import { api } from '#lib/discord/Api'; +import { BaseController } from '#lib/games/base/BaseController'; +import type { BaseReactionGame } from '#lib/games/base/BaseReactionGame'; import { Events } from '#lib/types/Enums'; -import { getEmojiString } from '#utils/functions'; import type { LLRCData } from '#utils/LongLivingReactionCollector'; +import { getEmojiString } from '#utils/functions'; import { cast } from '#utils/util'; import { container } from '@sapphire/framework'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; +import { RESTJSONErrorCodes } from 'discord-api-types/v10'; import { DiscordAPIError } from 'discord.js'; -import { BaseController } from './BaseController'; -import type { BaseReactionGame } from './BaseReactionGame'; export abstract class BaseReactionController extends BaseController { public readonly userId: string; @@ -50,7 +50,7 @@ export abstract class BaseReactionController extends BaseController { protected async removeEmoji(reaction: LLRCData, emoji: string, userId: string): Promise { try { - await api().channels(reaction.channel.id).messages(reaction.messageId).reactions(emoji)(userId).delete(); + await api().channels.deleteUserMessageReaction(reaction.channel.id, reaction.messageId, emoji, userId); } catch (error) { if (error instanceof DiscordAPIError) { if (error.code === RESTJSONErrorCodes.UnknownMessage || error.code === RESTJSONErrorCodes.UnknownEmoji) return; diff --git a/src/lib/games/base/BaseReactionGame.ts b/src/lib/games/base/BaseReactionGame.ts index 1ba17b44f8a..2decb86d72f 100644 --- a/src/lib/games/base/BaseReactionGame.ts +++ b/src/lib/games/base/BaseReactionGame.ts @@ -1,11 +1,11 @@ +import type { BaseController } from '#lib/games/base/BaseController'; +import { BaseGame } from '#lib/games/base/BaseGame'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { Events } from '#lib/types/Enums'; import { LongLivingReactionCollector } from '#utils/LongLivingReactionCollector'; import { sendLoadingMessage } from '#utils/util'; import { send } from '@sapphire/plugin-editable-commands'; import type { Message } from 'discord.js'; -import type { BaseController } from './BaseController'; -import { BaseGame } from './BaseGame'; export abstract class BaseReactionGame extends BaseGame { public readonly reactions: readonly string[]; @@ -26,7 +26,7 @@ export abstract class BaseReactionGame extends BaseGame { this.listener = new LongLivingReactionCollector(); } - protected async onStart(): Promise { + protected override async onStart(): Promise { try { this.message = await sendLoadingMessage(this.message, this.t); for (const reaction of this.reactions) await this.message.react(reaction); @@ -41,7 +41,7 @@ export abstract class BaseReactionGame extends BaseGame { return this.listener.ended; } - protected onEnd(): Promise { + protected override onEnd(): Promise { this.listener.end(); return super.onEnd(); } diff --git a/src/lib/games/connect-four/ConnectFourBotController.ts b/src/lib/games/connect-four/ConnectFourBotController.ts index 7a05b28c6ee..0224aaee98b 100644 --- a/src/lib/games/connect-four/ConnectFourBotController.ts +++ b/src/lib/games/connect-four/ConnectFourBotController.ts @@ -1,7 +1,7 @@ +import { BaseBotController } from '#lib/games/base/BaseBotController'; +import type { ConnectFourGame } from '#lib/games/connect-four/ConnectFourGame'; import { cast } from '#utils/util'; import { connectFour } from '@skyra/ai'; -import { BaseBotController } from '../base/BaseBotController'; -import type { ConnectFourGame } from './ConnectFourGame'; export class ConnectFourBotController extends BaseBotController { private readonly depth: number; diff --git a/src/lib/games/connect-four/ConnectFourGame.ts b/src/lib/games/connect-four/ConnectFourGame.ts index 09f0d7d408b..c8d88abe286 100644 --- a/src/lib/games/connect-four/ConnectFourGame.ts +++ b/src/lib/games/connect-four/ConnectFourGame.ts @@ -1,11 +1,11 @@ +import type { BaseController } from '#lib/games/base/BaseController'; +import { GameStatus } from '#lib/games/base/BaseGame'; +import { BaseReactionGame } from '#lib/games/base/BaseReactionGame'; +import { Emojis } from '#lib/games/connect-four/lib/constants'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { minutes } from '#utils/common'; import type { SerializedEmoji } from '#utils/functions'; import type { Message } from 'discord.js'; -import type { BaseController } from '../base/BaseController'; -import { GameStatus } from '../base/BaseGame'; -import { BaseReactionGame } from '../base/BaseReactionGame'; -import { Emojis } from './lib/constants'; export enum Cell { Empty, @@ -28,7 +28,7 @@ export class ConnectFourGame extends BaseReactionGame { super(message, playerA, playerB, ConnectFourGame.emojis, minutes(5), turn); } - public get finished() { + public override get finished() { return super.finished || this.winner !== null || this.isTableFull(); } diff --git a/src/lib/games/connect-four/ConnectFourHumanController.ts b/src/lib/games/connect-four/ConnectFourHumanController.ts index 09de6d82fda..4e4f0550740 100644 --- a/src/lib/games/connect-four/ConnectFourHumanController.ts +++ b/src/lib/games/connect-four/ConnectFourHumanController.ts @@ -1,6 +1,6 @@ +import { BaseReactionController } from '#lib/games/base/BaseReactionController'; +import type { ConnectFourGame } from '#lib/games/connect-four/ConnectFourGame'; import { cast } from '#utils/util'; -import { BaseReactionController } from '../base/BaseReactionController'; -import type { ConnectFourGame } from './ConnectFourGame'; export class ConnectFourHumanController extends BaseReactionController { public async await(): Promise { diff --git a/src/lib/games/tic-tac-toe/TicTacToeBotController.ts b/src/lib/games/tic-tac-toe/TicTacToeBotController.ts index 37dd826f348..f87227b1a9d 100644 --- a/src/lib/games/tic-tac-toe/TicTacToeBotController.ts +++ b/src/lib/games/tic-tac-toe/TicTacToeBotController.ts @@ -1,7 +1,7 @@ +import { BaseBotController } from '#lib/games/base/BaseBotController'; +import type { TicTacToeGame } from '#lib/games/tic-tac-toe/TicTacToeGame'; import { cast } from '#utils/util'; import { ticTacToe } from '@skyra/ai'; -import { BaseBotController } from '../base/BaseBotController'; -import type { TicTacToeGame } from './TicTacToeGame'; export class TicTacToeBotController extends BaseBotController { public await(): number { diff --git a/src/lib/games/tic-tac-toe/TicTacToeGame.ts b/src/lib/games/tic-tac-toe/TicTacToeGame.ts index c8fe56d0475..c7fb697b429 100644 --- a/src/lib/games/tic-tac-toe/TicTacToeGame.ts +++ b/src/lib/games/tic-tac-toe/TicTacToeGame.ts @@ -1,10 +1,10 @@ +import type { BaseController } from '#lib/games/base/BaseController'; +import { GameStatus } from '#lib/games/base/BaseGame'; +import { BaseReactionGame } from '#lib/games/base/BaseReactionGame'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { minutes } from '#utils/common'; import type { SerializedEmoji } from '#utils/functions'; import type { Message } from 'discord.js'; -import type { BaseController } from '../base/BaseController'; -import { GameStatus } from '../base/BaseGame'; -import { BaseReactionGame } from '../base/BaseReactionGame'; export class TicTacToeGame extends BaseReactionGame { public readonly board = new Uint8Array(9); @@ -13,7 +13,7 @@ export class TicTacToeGame extends BaseReactionGame { super(message, playerA, playerB, TicTacToeGame.emojis, minutes(5), turn); } - public get finished() { + public override get finished() { return super.finished || this.board.every((cell) => cell !== 0) || this.check() !== null; } diff --git a/src/lib/games/tic-tac-toe/TicTacToeHumanController.ts b/src/lib/games/tic-tac-toe/TicTacToeHumanController.ts index cd75acaa454..7614190f243 100644 --- a/src/lib/games/tic-tac-toe/TicTacToeHumanController.ts +++ b/src/lib/games/tic-tac-toe/TicTacToeHumanController.ts @@ -1,6 +1,6 @@ +import { BaseReactionController } from '#lib/games/base/BaseReactionController'; +import type { TicTacToeGame } from '#lib/games/tic-tac-toe/TicTacToeGame'; import { cast } from '#utils/util'; -import { BaseReactionController } from '../base/BaseReactionController'; -import type { TicTacToeGame } from './TicTacToeGame'; export class TicTacToeHumanController extends BaseReactionController { public async await(): Promise { diff --git a/src/lib/i18n/languageKeys/index.ts b/src/lib/i18n/languageKeys/index.ts index b90c43db328..322bbf4f3bd 100644 --- a/src/lib/i18n/languageKeys/index.ts +++ b/src/lib/i18n/languageKeys/index.ts @@ -1 +1 @@ -export * as LanguageKeys from './keys/All'; +export * as LanguageKeys from '#lib/i18n/languageKeys/keys/All'; diff --git a/src/lib/i18n/languageKeys/keys/All.ts b/src/lib/i18n/languageKeys/keys/All.ts index d9e7c8b0855..19f93ba1bc2 100644 --- a/src/lib/i18n/languageKeys/keys/All.ts +++ b/src/lib/i18n/languageKeys/keys/All.ts @@ -1,12 +1,12 @@ -export * as Arguments from './Arguments'; -export * as Assertions from './Assertions'; -export * as Commands from './Commands'; -export * as Events from './events/All'; -export * as FuzzySearch from './FuzzySearch'; -export * as Globals from './Globals'; -export * as Guilds from './Guilds'; -export * as Misc from './Misc'; -export * as Preconditions from './Preconditions'; -export * as Serializers from './Serializers'; -export * as Settings from './Settings'; -export * as System from './System'; +export * as Arguments from '#lib/i18n/languageKeys/keys/Arguments'; +export * as Assertions from '#lib/i18n/languageKeys/keys/Assertions'; +export * as Commands from '#lib/i18n/languageKeys/keys/Commands'; +export * as Events from '#lib/i18n/languageKeys/keys/events/All'; +export * as FuzzySearch from '#lib/i18n/languageKeys/keys/FuzzySearch'; +export * as Globals from '#lib/i18n/languageKeys/keys/Globals'; +export * as Guilds from '#lib/i18n/languageKeys/keys/Guilds'; +export * as Misc from '#lib/i18n/languageKeys/keys/Misc'; +export * as Preconditions from '#lib/i18n/languageKeys/keys/Preconditions'; +export * as Serializers from '#lib/i18n/languageKeys/keys/Serializers'; +export * as Settings from '#lib/i18n/languageKeys/keys/Settings'; +export * as System from '#lib/i18n/languageKeys/keys/System'; diff --git a/src/lib/i18n/languageKeys/keys/Commands.ts b/src/lib/i18n/languageKeys/keys/Commands.ts index 463d2921645..6ee483ad281 100644 --- a/src/lib/i18n/languageKeys/keys/Commands.ts +++ b/src/lib/i18n/languageKeys/keys/Commands.ts @@ -1,11 +1,11 @@ -export * as Admin from './commands/Admin'; -export * as Animal from './commands/Animal'; -export * as Fun from './commands/Fun'; -export * as Games from './commands/Games'; -export * as General from './commands/General'; -export * as Management from './commands/Management'; -export * as Misc from './commands/Misc'; -export * as Moderation from './commands/Moderation'; -export * as System from './commands/System'; -export * as Tools from './commands/Tools'; -export * as Twitch from './commands/Twitch'; +export * as Admin from '#lib/i18n/languageKeys/keys/commands/Admin'; +export * as Animal from '#lib/i18n/languageKeys/keys/commands/Animal'; +export * as Fun from '#lib/i18n/languageKeys/keys/commands/Fun'; +export * as Games from '#lib/i18n/languageKeys/keys/commands/Games'; +export * as General from '#lib/i18n/languageKeys/keys/commands/General'; +export * as Management from '#lib/i18n/languageKeys/keys/commands/Management'; +export * as Misc from '#lib/i18n/languageKeys/keys/commands/Misc'; +export * as Moderation from '#lib/i18n/languageKeys/keys/commands/Moderation'; +export * as System from '#lib/i18n/languageKeys/keys/commands/System'; +export * as Tools from '#lib/i18n/languageKeys/keys/commands/Tools'; +export * as Twitch from '#lib/i18n/languageKeys/keys/commands/Twitch'; diff --git a/src/lib/i18n/languageKeys/keys/Serializers.ts b/src/lib/i18n/languageKeys/keys/Serializers.ts index 3ab2b71dfce..c00d9a83427 100644 --- a/src/lib/i18n/languageKeys/keys/Serializers.ts +++ b/src/lib/i18n/languageKeys/keys/Serializers.ts @@ -38,4 +38,4 @@ export const UnknownRole = T('serializers:unknownRole'); export const UnknownUser = T('serializers:unknownUser'); export const Unsupported = T('serializers:unsupported'); -export * as DisabledCommandChannels from './DisabledCommandChannels/All'; +export * as DisabledCommandChannels from '#lib/i18n/languageKeys/keys/DisabledCommandChannels/All'; diff --git a/src/lib/i18n/languageKeys/keys/Settings.ts b/src/lib/i18n/languageKeys/keys/Settings.ts index df02e8cf450..a6f45738f98 100644 --- a/src/lib/i18n/languageKeys/keys/Settings.ts +++ b/src/lib/i18n/languageKeys/keys/Settings.ts @@ -73,5 +73,5 @@ export const SelfmodReactionsIgnoredRoles = T('settings:selfmodReactionsIgnoredR export const SelfmodReactionsAllowed = T('settings:selfmodReactionsAllowed'); export const DashboardOnlyKey = T('settings:dashboardOnlyKey'); -export * as Channels from './settings/Channels'; -export * as Gateway from './settings/Gateway'; +export * as Channels from '#lib/i18n/languageKeys/keys/settings/Channels'; +export * as Gateway from '#lib/i18n/languageKeys/keys/settings/Gateway'; diff --git a/src/lib/i18n/languageKeys/keys/events/All.ts b/src/lib/i18n/languageKeys/keys/events/All.ts index e0635521ed0..357dc88cf2f 100644 --- a/src/lib/i18n/languageKeys/keys/events/All.ts +++ b/src/lib/i18n/languageKeys/keys/events/All.ts @@ -1,7 +1,7 @@ -export * as Errors from './errors/All'; -export * as Guilds from './guilds/All'; -export * as Messages from './messages/All'; -export * as Moderation from './moderation/All'; -export * as NoMentionSpam from './NoMentionSpam'; -export * as Reactions from './reactions/All'; -export * as Twitch from './twitch/All'; +export * as NoMentionSpam from '#lib/i18n/languageKeys/keys/events/NoMentionSpam'; +export * as Errors from '#lib/i18n/languageKeys/keys/events/errors/All'; +export * as Guilds from '#lib/i18n/languageKeys/keys/events/guilds/All'; +export * as Messages from '#lib/i18n/languageKeys/keys/events/messages/All'; +export * as Moderation from '#lib/i18n/languageKeys/keys/events/moderation/All'; +export * as Reactions from '#lib/i18n/languageKeys/keys/events/reactions/All'; +export * as Twitch from '#lib/i18n/languageKeys/keys/events/twitch/All'; diff --git a/src/lib/i18n/languageKeys/keys/events/guilds/All.ts b/src/lib/i18n/languageKeys/keys/events/guilds/All.ts index d53e86e90fc..8fc1cad41e9 100644 --- a/src/lib/i18n/languageKeys/keys/events/guilds/All.ts +++ b/src/lib/i18n/languageKeys/keys/events/guilds/All.ts @@ -1,2 +1,2 @@ -export * as Logs from './Logs'; -export * as Members from './Members'; +export * as Logs from '#lib/i18n/languageKeys/keys/events/guilds/Logs'; +export * as Members from '#lib/i18n/languageKeys/keys/events/guilds/Members'; diff --git a/src/lib/i18n/languageKeys/keys/events/guilds/Logs.ts b/src/lib/i18n/languageKeys/keys/events/guilds/Logs.ts index 79173eedd50..645539c6e0c 100644 --- a/src/lib/i18n/languageKeys/keys/events/guilds/Logs.ts +++ b/src/lib/i18n/languageKeys/keys/events/guilds/Logs.ts @@ -1,7 +1,7 @@ -import { Difference, FT, T, Value, Values } from '#lib/types'; -import type { DefaultMessageNotificationLevel, ExplicitContentFilterLevel, VerificationLevel } from 'discord.js'; +import { FT, T, type Difference, type Value, type Values } from '#lib/types'; +import type { GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildVerificationLevel } from 'discord.js'; -type Notifications = DefaultMessageNotificationLevel | number; +type Notifications = GuildDefaultMessageNotifications; export const ChannelCreate = T('events/guilds-logs:channelCreate'); export const ChannelCreateParent = FT('events/guilds-logs:channelCreateParent'); @@ -85,7 +85,7 @@ export const ServerUpdateDescription = FT('events/guilds-logs:server export const ServerUpdateDiscoverySplashAdded = FT('events/guilds-logs:serverUpdateDiscoverySplashAdded'); export const ServerUpdateDiscoverySplashRemoved = FT('events/guilds-logs:serverUpdateDiscoverySplashRemoved'); export const ServerUpdateDiscoverySplash = FT('events/guilds-logs:serverUpdateDiscoverySplash'); -export const ServerUpdateExplicitContentFilter = FT>('events/guilds-logs:serverUpdateExplicitContentFilter'); +export const ServerUpdateExplicitContentFilter = FT>('events/guilds-logs:serverUpdateExplicitContentFilter'); export const ServerUpdateFeaturesAdded = FT('events/guilds-logs:serverUpdateFeaturesAdded'); export const ServerUpdateFeaturesRemoved = FT('events/guilds-logs:serverUpdateFeaturesRemoved'); export const ServerUpdateIconAdded = FT('events/guilds-logs:serverUpdateIconAdded'); @@ -122,7 +122,7 @@ export const ServerUpdateSystemChannel = FT('events/guilds-logs:serv export const ServerUpdateVanityUrlAdded = FT('events/guilds-logs:serverUpdateVanityUrlAdded'); export const ServerUpdateVanityUrlRemoved = FT('events/guilds-logs:serverUpdateVanityUrlRemoved'); export const ServerUpdateVanityUrl = FT('events/guilds-logs:serverUpdateVanityUrl'); -export const ServerUpdateVerificationLevel = FT>('events/guilds-logs:serverUpdateVerificationLevel'); +export const ServerUpdateVerificationLevel = FT>('events/guilds-logs:serverUpdateVerificationLevel'); export const ServerUpdateWidgetChannelAdded = FT('events/guilds-logs:serverUpdateWidgetChannelAdded'); export const ServerUpdateWidgetChannelRemoved = FT('events/guilds-logs:serverUpdateWidgetChannelRemoved'); export const ServerUpdateWidgetChannel = FT('events/guilds-logs:serverUpdateWidgetChannel'); diff --git a/src/lib/i18n/languageKeys/keys/events/moderation/All.ts b/src/lib/i18n/languageKeys/keys/events/moderation/All.ts index b5d4a161f87..93f6aaf3477 100644 --- a/src/lib/i18n/languageKeys/keys/events/moderation/All.ts +++ b/src/lib/i18n/languageKeys/keys/events/moderation/All.ts @@ -1 +1 @@ -export * as Messages from './Messages'; +export * as Messages from '#lib/i18n/languageKeys/keys/events/moderation/Messages'; diff --git a/src/lib/i18n/languageKeys/keys/settings/Channels.ts b/src/lib/i18n/languageKeys/keys/settings/Channels.ts index fa8405ec43d..ad17a9160f0 100644 --- a/src/lib/i18n/languageKeys/keys/settings/Channels.ts +++ b/src/lib/i18n/languageKeys/keys/settings/Channels.ts @@ -1,6 +1,6 @@ import { T } from '#lib/types'; -export * as Ignore from './channels/Ignore'; -export * as Logs from './channels/Logs'; +export * as Ignore from '#lib/i18n/languageKeys/keys/settings/channels/Ignore'; +export * as Logs from '#lib/i18n/languageKeys/keys/settings/channels/Logs'; export const MediaOnly = T('settings:channelsMediaOnly'); diff --git a/src/lib/i18n/structures/Handler.ts b/src/lib/i18n/structures/Handler.ts index 1c4ee4c9bcd..71cf56d83e6 100644 --- a/src/lib/i18n/structures/Handler.ts +++ b/src/lib/i18n/structures/Handler.ts @@ -1,4 +1,4 @@ -import { DurationFormatAssetsTime, DurationFormatter } from '@sapphire/time-utilities'; +import { DurationFormatter, type DurationFormatAssetsTime } from '@sapphire/time-utilities'; export abstract class Handler { public readonly name: string; diff --git a/src/lib/i18n/translate.ts b/src/lib/i18n/translate.ts index e689ecdd540..0d823f8568c 100644 --- a/src/lib/i18n/translate.ts +++ b/src/lib/i18n/translate.ts @@ -1,8 +1,8 @@ +import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { SkyraArgs } from '#lib/structures'; import { DecoratorIdentifiers } from '@sapphire/decorators'; import { Identifiers } from '@sapphire/framework'; import type { TFunction } from '@sapphire/plugin-i18next'; -import { LanguageKeys } from './languageKeys'; export function translate(identifier: string): string { switch (identifier) { diff --git a/src/lib/moderation/index.ts b/src/lib/moderation/index.ts index c1a879f159a..c581dcf632e 100644 --- a/src/lib/moderation/index.ts +++ b/src/lib/moderation/index.ts @@ -1,2 +1,2 @@ -export * from './managers'; -export * from './structures'; +export * from '#lib/moderation/managers/index'; +export * from '#lib/moderation/structures/index'; diff --git a/src/lib/moderation/managers/ModerationManager.ts b/src/lib/moderation/managers/ModerationManager.ts index 803138a9559..4f3015398fc 100644 --- a/src/lib/moderation/managers/ModerationManager.ts +++ b/src/lib/moderation/managers/ModerationManager.ts @@ -1,13 +1,13 @@ import { ModerationEntity } from '#lib/database/entities'; import { GuildSettings } from '#lib/database/keys'; import { readSettings } from '#lib/database/settings'; -import { createReferPromise, floatPromise, ReferredPromise, seconds } from '#utils/common'; +import { createReferPromise, floatPromise, seconds, type ReferredPromise } from '#utils/common'; import { cast } from '#utils/util'; import { Collection, type CollectionConstructor } from '@discordjs/collection'; import { AsyncQueue } from '@sapphire/async-queue'; import type { GuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; import { container } from '@sapphire/framework'; -import { isNullish, StrictRequired } from '@sapphire/utilities'; +import { isNullish, type StrictRequired } from '@sapphire/utilities'; import { DiscordAPIError, Guild } from 'discord.js'; import { In } from 'typeorm'; diff --git a/src/lib/moderation/managers/index.ts b/src/lib/moderation/managers/index.ts index b34ba245186..84836bfbe07 100644 --- a/src/lib/moderation/managers/index.ts +++ b/src/lib/moderation/managers/index.ts @@ -1,2 +1,2 @@ -export * from './ModerationManager'; -export * from './StickyRoleManager'; +export * from '#lib/moderation/managers/ModerationManager'; +export * from '#lib/moderation/managers/StickyRoleManager'; diff --git a/src/lib/moderation/structures/ModerationCommand.ts b/src/lib/moderation/structures/ModerationCommand.ts index b8c2a74f769..17d6ce616e8 100644 --- a/src/lib/moderation/structures/ModerationCommand.ts +++ b/src/lib/moderation/structures/ModerationCommand.ts @@ -7,7 +7,7 @@ import { floatPromise, seconds, years } from '#utils/common'; import { deleteMessage, isGuildOwner } from '#utils/functions'; import type { ModerationActionsSendOptions } from '#utils/Security/ModerationActions'; import { cast, getTag } from '#utils/util'; -import { Args, CommandOptionsRunTypeEnum, PieceContext } from '@sapphire/framework'; +import { Args, CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { free, send } from '@sapphire/plugin-editable-commands'; import type { User } from 'discord.js'; @@ -22,7 +22,7 @@ export abstract class ModerationCommand extends SkyraCommand { */ public optionalDuration: boolean; - protected constructor(context: PieceContext, options: ModerationCommand.Options) { + protected constructor(context: ModerationCommand.Context, options: ModerationCommand.Options) { super(context, { cooldownDelay: seconds(5), flags: ['no-author', 'authored', 'no-dm', 'dm'], @@ -37,8 +37,13 @@ export abstract class ModerationCommand extends SkyraCommand { this.optionalDuration = options.optionalDuration!; } - public messageRun(message: GuildMessage, args: ModerationCommand.Args, context: ModerationCommand.Context): Promise; - public async messageRun(message: GuildMessage, args: ModerationCommand.Args) { + public override messageRun( + message: GuildMessage, + args: ModerationCommand.Args, + context: ModerationCommand.RunContext + ): Promise; + + public override async messageRun(message: GuildMessage, args: ModerationCommand.Args) { const resolved = await this.resolveOverloads(args); const preHandled = await this.prehandle(message, resolved); const processed = [] as Array<{ log: ModerationEntity; target: User }>; @@ -183,9 +188,13 @@ export abstract class ModerationCommand extends SkyraCommand { if (!this.optionalDuration) return null; const result = await args.pickResult('timespan', { minimum: 0, maximum: years(5) }); - if (result.success) return result.value; - if (result.error.identifier === LanguageKeys.Arguments.TimeSpan) return null; - throw result.error; + return result.match({ + ok: (value) => value, + err: (error) => { + if (error.identifier === LanguageKeys.Arguments.TimeSpan) return null; + throw error; + } + }); } } @@ -200,6 +209,7 @@ export namespace ModerationCommand { export type Args = SkyraCommand.Args; export type Context = SkyraCommand.Context; + export type RunContext = SkyraCommand.RunContext; } export interface CommandContext { diff --git a/src/lib/moderation/structures/ModerationListener.ts b/src/lib/moderation/structures/ModerationListener.ts index 44470d9a07c..314fcef3f7c 100644 --- a/src/lib/moderation/structures/ModerationListener.ts +++ b/src/lib/moderation/structures/ModerationListener.ts @@ -1,14 +1,13 @@ -import { GuildEntity, readSettings } from '#lib/database'; +import { readSettings, type GuildSettingsOfType } from '#lib/database'; +import type { HardPunishment } from '#lib/moderation/structures/ModerationMessageListener'; +import { SelfModeratorBitField, SelfModeratorHardActionFlags } from '#lib/moderation/structures/SelfModeratorBitField'; import { seconds } from '#utils/common'; import { getModeration, getSecurity } from '#utils/functions'; import { Listener } from '@sapphire/framework'; -import type { PickByValue } from '@sapphire/utilities'; -import type { Guild, MessageEmbed } from 'discord.js'; -import type { HardPunishment } from './ModerationMessageListener'; -import { SelfModeratorBitField, SelfModeratorHardActionFlags } from './SelfModeratorBitField'; +import type { EmbedBuilder, Guild } from 'discord.js'; export abstract class ModerationListener extends Listener { - public abstract run(...params: V): unknown; + public abstract override run(...params: V): unknown; protected processSoftPunishment(args: Readonly, preProcessed: T, bitField: SelfModeratorBitField) { if (bitField.has(SelfModeratorBitField.FLAGS.DELETE)) this.onDelete(args, preProcessed); @@ -104,12 +103,18 @@ export abstract class ModerationListener exten unlock(); } - protected abstract keyEnabled: PickByValue; - protected abstract softPunishmentPath: PickByValue; + protected abstract keyEnabled: GuildSettingsOfType; + protected abstract softPunishmentPath: GuildSettingsOfType; protected abstract hardPunishmentPath: HardPunishment; protected abstract preProcess(args: Readonly): Promise | T | null; protected abstract onLog(args: Readonly, value: T): unknown; protected abstract onDelete(args: Readonly, value: T): unknown; protected abstract onAlert(args: Readonly, value: T): unknown; - protected abstract onLogMessage(args: Readonly, value: T): Promise | MessageEmbed; + protected abstract onLogMessage(args: Readonly, value: T): Promise | EmbedBuilder; +} + +export namespace ModerationListener { + export type Options = Listener.Options; + export type JSON = Listener.JSON; + export type Context = Listener.Context; } diff --git a/src/lib/moderation/structures/ModerationMessageListener.ts b/src/lib/moderation/structures/ModerationMessageListener.ts index de5350d52a0..430f91ddb92 100644 --- a/src/lib/moderation/structures/ModerationMessageListener.ts +++ b/src/lib/moderation/structures/ModerationMessageListener.ts @@ -1,26 +1,26 @@ -import { AdderKey, GuildEntity, GuildSettings, readSettings } from '#lib/database'; +import { GuildEntity, GuildSettings, readSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import type { AdderError } from '#lib/database/utils/Adder'; +import { SelfModeratorBitField, SelfModeratorHardActionFlags } from '#lib/moderation/structures/SelfModeratorBitField'; import type { CustomFunctionGet, CustomGet, GuildMessage } from '#lib/types'; import { Events } from '#lib/types/Enums'; import { floatPromise, seconds } from '#utils/common'; import { getModeration, getSecurity, isModerator } from '#utils/functions'; -import { GuildTextBasedChannelTypes, canSendMessages } from '@sapphire/discord.js-utilities'; -import { Listener, ListenerOptions, PieceContext } from '@sapphire/framework'; -import type { Awaitable, Nullish, PickByValue } from '@sapphire/utilities'; -import type { GuildMember, MessageEmbed } from 'discord.js'; +import { canSendMessages, type GuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; +import { Listener } from '@sapphire/framework'; +import type { Awaitable, Nullish } from '@sapphire/utilities'; +import type { EmbedBuilder, GuildMember } from 'discord.js'; import type { TFunction } from 'i18next'; -import { SelfModeratorBitField, SelfModeratorHardActionFlags } from './SelfModeratorBitField'; export abstract class ModerationMessageListener extends Listener { - private readonly keyEnabled: PickByValue; - private readonly ignoredRolesPath: PickByValue; - private readonly ignoredChannelsPath: PickByValue; - private readonly softPunishmentPath: PickByValue; + private readonly keyEnabled: GuildSettingsOfType; + private readonly ignoredRolesPath: GuildSettingsOfType; + private readonly ignoredChannelsPath: GuildSettingsOfType; + private readonly softPunishmentPath: GuildSettingsOfType; private readonly hardPunishmentPath: HardPunishment; private readonly reasonLanguageKey: CustomGet; private readonly reasonLanguageKeyWithMaximum: CustomFunctionGet; - public constructor(context: PieceContext, options: ModerationMessageListener.Options) { + public constructor(context: ModerationMessageListener.Context, options: ModerationMessageListener.Options) { super(context, { ...options, event: Events.GuildUserMessage }); this.keyEnabled = options.keyEnabled; @@ -178,7 +178,7 @@ export abstract class ModerationMessageListener extends Listener { protected abstract preProcess(message: GuildMessage): Promise | T | null; protected abstract onDelete(message: GuildMessage, language: TFunction, value: T): Awaitable; protected abstract onAlert(message: GuildMessage, language: TFunction, value: T): Awaitable; - protected abstract onLogMessage(message: GuildMessage, language: TFunction, value: T): Awaitable; + protected abstract onLogMessage(message: GuildMessage, language: TFunction, value: T): Awaitable; private checkPreRun(message: GuildMessage) { return readSettings( @@ -210,19 +210,21 @@ export abstract class ModerationMessageListener extends Listener { } export interface HardPunishment { - action: PickByValue; - actionDuration: PickByValue; + action: GuildSettingsOfType; + actionDuration: GuildSettingsOfType; adder: AdderKey; } export namespace ModerationMessageListener { - export interface Options extends ListenerOptions { - keyEnabled: PickByValue; - ignoredRolesPath: PickByValue; - ignoredChannelsPath: PickByValue; - softPunishmentPath: PickByValue; + export interface Options extends Listener.Options { + keyEnabled: GuildSettingsOfType; + ignoredRolesPath: GuildSettingsOfType; + ignoredChannelsPath: GuildSettingsOfType; + softPunishmentPath: GuildSettingsOfType; hardPunishmentPath: HardPunishment; reasonLanguageKey: CustomGet; reasonLanguageKeyWithMaximum: CustomFunctionGet; } + export type JSON = Listener.JSON; + export type Context = Listener.Context; } diff --git a/src/lib/moderation/structures/ModerationTask.ts b/src/lib/moderation/structures/ModerationTask.ts index 5978b070aea..404f4d6b328 100644 --- a/src/lib/moderation/structures/ModerationTask.ts +++ b/src/lib/moderation/structures/ModerationTask.ts @@ -1,4 +1,4 @@ -import { GuildSettings, PartialResponseValue, readSettings, ResponseType, Task } from '#lib/database'; +import { GuildSettings, type PartialResponseValue, readSettings, ResponseType, Task } from '#lib/database'; import type { SchemaKeys } from '#utils/moderationConstants'; import type { ModerationActionsSendOptions } from '#utils/Security/ModerationActions'; import type { Guild, User } from 'discord.js'; diff --git a/src/lib/moderation/structures/SelfModerationCommand.ts b/src/lib/moderation/structures/SelfModerationCommand.ts index 00c659e3a31..2e5d72314e8 100644 --- a/src/lib/moderation/structures/SelfModerationCommand.ts +++ b/src/lib/moderation/structures/SelfModerationCommand.ts @@ -1,13 +1,13 @@ -import { AdderKey, configurableKeys, GuildEntity, readSettings, writeSettings } from '#lib/database'; +import { configurableKeys, readSettings, writeSettings, type AdderKey, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; +import { SelfModeratorBitField, SelfModeratorHardActionFlags } from '#lib/moderation/structures/SelfModeratorBitField'; import { SkyraCommand } from '#lib/structures'; import type { GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; -import { CommandOptionsRunTypeEnum, PieceContext } from '@sapphire/framework'; +import { CommandOptionsRunTypeEnum } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { codeBlock, PickByValue } from '@sapphire/utilities'; +import { codeBlock } from '@sapphire/utilities'; import type { TFunction } from 'i18next'; -import { SelfModeratorBitField, SelfModeratorHardActionFlags } from './SelfModeratorBitField'; export enum AKeys { Enable, @@ -85,7 +85,7 @@ export const kHardActions = new Map([ ]); export abstract class SelfModerationCommand extends SkyraCommand { - protected constructor(context: PieceContext, options: SelfModerationCommand.Options) { + protected constructor(context: SkyraCommand.Context, options: SelfModerationCommand.Options) { super(context, { permissionLevel: PermissionLevels.Administrator, runIn: [CommandOptionsRunTypeEnum.GuildAny], @@ -93,7 +93,7 @@ export abstract class SelfModerationCommand extends SkyraCommand { }); } - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const type = this.getAction(args); if (type === AKeys.Show) return this.show(message); @@ -297,12 +297,12 @@ export abstract class SelfModerationCommand extends SkyraCommand { } protected abstract $adder: AdderKey; - protected abstract keyEnabled: PickByValue; - protected abstract keySoftAction: PickByValue; - protected abstract keyHardAction: PickByValue; - protected abstract keyHardActionDuration: PickByValue; - protected abstract keyThresholdMaximum: PickByValue; - protected abstract keyThresholdDuration: PickByValue; + protected abstract keyEnabled: GuildSettingsOfType; + protected abstract keySoftAction: GuildSettingsOfType; + protected abstract keyHardAction: GuildSettingsOfType; + protected abstract keyHardActionDuration: GuildSettingsOfType; + protected abstract keyThresholdMaximum: GuildSettingsOfType; + protected abstract keyThresholdDuration: GuildSettingsOfType; } export namespace SelfModerationCommand { diff --git a/src/lib/moderation/structures/SetUpModerationCommand.ts b/src/lib/moderation/structures/SetUpModerationCommand.ts index 35d0b5604da..47dd9c314cc 100644 --- a/src/lib/moderation/structures/SetUpModerationCommand.ts +++ b/src/lib/moderation/structures/SetUpModerationCommand.ts @@ -1,19 +1,19 @@ -import { GuildEntity, readSettings, writeSettings } from '#lib/database'; +import { readSettings, writeSettings, type GuildSettingsOfType } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; +import { ModerationCommand } from '#lib/moderation/structures/ModerationCommand'; import type { GuildMessage } from '#lib/types'; -import { getSecurity, isAdmin, promptConfirmation, promptForMessage } from '#utils/functions'; import type { ModerationSetupRestriction } from '#utils/Security/ModerationActions'; -import type { Argument, PieceContext } from '@sapphire/framework'; +import { getSecurity, isAdmin, promptConfirmation, promptForMessage } from '#utils/functions'; +import type { Argument } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import type { PickByValue } from '@sapphire/utilities'; +import type { Nullish } from '@sapphire/utilities'; import type { Role } from 'discord.js'; -import { ModerationCommand } from './ModerationCommand'; export abstract class SetUpModerationCommand extends ModerationCommand { - public readonly roleKey: PickByValue; + public readonly roleKey: GuildSettingsOfType; public readonly setUpKey: ModerationSetupRestriction; - public constructor(context: PieceContext, options: SetUpModerationCommand.Options) { + public constructor(context: ModerationCommand.Context, options: SetUpModerationCommand.Options) { super(context, options); this.roleKey = options.roleKey; this.setUpKey = options.setUpKey; @@ -23,12 +23,16 @@ export abstract class SetUpModerationCommand extends ModerationCommand { return this.container.stores.get('arguments').get('role') as Argument; } - public async messageRun(message: GuildMessage, args: ModerationCommand.Args, context: ModerationCommand.Context): Promise { + public override async messageRun( + message: GuildMessage, + args: ModerationCommand.Args, + context: ModerationCommand.RunContext + ): Promise { await this.inhibit(message, args, context); return super.messageRun(message, args, context); } - public async inhibit(message: GuildMessage, args: ModerationCommand.Args, context: ModerationCommand.Context) { + public async inhibit(message: GuildMessage, args: ModerationCommand.Args, context: ModerationCommand.RunContext) { // If the command messageRun is not this one (potentially help command) or the guild is null, return with no error. const [id, t] = await readSettings(message.guild, (settings) => [settings[this.roleKey], settings.getLanguage()]); @@ -42,9 +46,8 @@ export abstract class SetUpModerationCommand extends ModerationCommand { } if (await promptConfirmation(message, t(LanguageKeys.Commands.Moderation.ActionSharedRoleSetupExisting))) { - const role = await this.askForRole(message, args, context); - if (!role.success) return this.error(role.error); - await writeSettings(message.guild, [[this.roleKey, role.value.id]]); + const role = (await this.askForRole(message, args, context)).unwrapRaw(); + await writeSettings(message.guild, [[this.roleKey, role.id]]); } else if (await promptConfirmation(message, t(LanguageKeys.Commands.Moderation.ActionSharedRoleSetupNew))) { await getSecurity(message.guild).actions.restrictionSetup(message, this.setUpKey); @@ -57,7 +60,7 @@ export abstract class SetUpModerationCommand extends ModerationCommand { return undefined; } - protected async askForRole(message: GuildMessage, args: SetUpModerationCommand.Args, context: SetUpModerationCommand.Context) { + protected async askForRole(message: GuildMessage, args: SetUpModerationCommand.Args, context: SetUpModerationCommand.RunContext) { const result = await promptForMessage(message, args.t(LanguageKeys.Commands.Moderation.ActionSharedRoleSetupExistingName)); if (result === null) this.error(LanguageKeys.Commands.Moderation.ActionSharedRoleSetupNoMessage); @@ -71,10 +74,11 @@ export namespace SetUpModerationCommand { * The ModerationCommand Options */ export interface Options extends ModerationCommand.Options { - roleKey: PickByValue; + roleKey: GuildSettingsOfType; setUpKey: ModerationSetupRestriction; } export type Args = ModerationCommand.Args; export type Context = ModerationCommand.Context; + export type RunContext = ModerationCommand.RunContext; } diff --git a/src/lib/moderation/structures/index.ts b/src/lib/moderation/structures/index.ts index 5d52bc183ef..9341faa620c 100644 --- a/src/lib/moderation/structures/index.ts +++ b/src/lib/moderation/structures/index.ts @@ -1,7 +1,7 @@ -export * from './ModerationCommand'; -export * from './ModerationListener'; -export * from './ModerationMessageListener'; -export * from './ModerationTask'; -export * from './SelfModerationCommand'; -export * from './SelfModeratorBitField'; -export * from './SetUpModerationCommand'; +export * from '#lib/moderation/structures/ModerationCommand'; +export * from '#lib/moderation/structures/ModerationListener'; +export * from '#lib/moderation/structures/ModerationMessageListener'; +export * from '#lib/moderation/structures/ModerationTask'; +export * from '#lib/moderation/structures/SelfModerationCommand'; +export * from '#lib/moderation/structures/SelfModeratorBitField'; +export * from '#lib/moderation/structures/SetUpModerationCommand'; diff --git a/src/lib/moderation/workers/WorkerHandler.ts b/src/lib/moderation/workers/WorkerHandler.ts index f4d7e01dfee..4bde24505d2 100644 --- a/src/lib/moderation/workers/WorkerHandler.ts +++ b/src/lib/moderation/workers/WorkerHandler.ts @@ -1,13 +1,11 @@ -import { rootFolder } from '#utils/constants'; +import { WorkerResponseHandler } from '#lib/moderation/workers/WorkerResponseHandler'; +import { OutgoingType, type IncomingPayload, type NoId, type OutgoingPayload } from '#lib/moderation/workers/types'; import { AsyncQueue } from '@sapphire/async-queue'; import { container } from '@sapphire/framework'; import { envParseString } from '@skyra/env-utilities'; import { cyan, green, red, yellow } from 'colorette'; import { once } from 'node:events'; -import { join } from 'node:path'; import { Worker } from 'node:worker_threads'; -import { IncomingPayload, NoId, OutgoingPayload, OutgoingType } from './types'; -import { WorkerResponseHandler } from './WorkerResponseHandler'; export class WorkerHandler { public lastHeartBeat!: number; @@ -63,7 +61,7 @@ export class WorkerHandler { public spawn() { this.online = false; this.lastHeartBeat = 0; - this.worker = new Worker(WorkerHandler.workerTsLoader, { + this.worker = new Worker(WorkerHandler.filename, { workerData: { path: WorkerHandler.filename } @@ -132,8 +130,8 @@ export class WorkerHandler { } } - private static readonly workerTsLoader = join(rootFolder, 'scripts', 'workerTsLoader.js'); private static readonly logsEnabled = process.env.NODE_ENV !== 'test'; - private static readonly filename = join(__dirname, `worker.${envParseString('NODE_ENV') === 'test' ? 't' : 'j'}s`); + private static readonly filename = new URL(`./worker.${envParseString('NODE_ENV') === 'test' ? 't' : 'j'}s`, import.meta.url); + private static readonly maximumId = Number.MAX_SAFE_INTEGER; } diff --git a/src/lib/moderation/workers/WorkerManager.ts b/src/lib/moderation/workers/WorkerManager.ts index 0dbc8e8b929..5478d632ddd 100644 --- a/src/lib/moderation/workers/WorkerManager.ts +++ b/src/lib/moderation/workers/WorkerManager.ts @@ -1,7 +1,13 @@ import { envParseInteger } from '@skyra/env-utilities'; import { cpus } from 'node:os'; -import type { IncomingPayload, IncomingRunRegExpPayload, NoId, OutgoingNoContentPayload, OutgoingRegExpMatchPayload } from './types'; -import { WorkerHandler } from './WorkerHandler'; +import type { + IncomingPayload, + IncomingRunRegExpPayload, + NoId, + OutgoingNoContentPayload, + OutgoingRegExpMatchPayload +} from '#lib/moderation/workers/types'; +import { WorkerHandler } from '#lib/moderation/workers/WorkerHandler'; export class WorkerManager { public readonly workers: WorkerHandler[] = []; @@ -19,8 +25,8 @@ export class WorkerManager { await Promise.all(this.workers.map((worker) => worker.start())); } - public async send(data: NoId, delay?: number | null): Promise; - public async send(data: NoId, delay?: number | null) { + public send(data: NoId, delay?: number | null): Promise; + public send(data: NoId, delay?: number | null) { return this.getIdealWorker().send(data, delay); } diff --git a/src/lib/moderation/workers/WorkerResponseHandler.ts b/src/lib/moderation/workers/WorkerResponseHandler.ts index 505b85e8b33..2fdddf37752 100644 --- a/src/lib/moderation/workers/WorkerResponseHandler.ts +++ b/src/lib/moderation/workers/WorkerResponseHandler.ts @@ -1,6 +1,6 @@ -import { createReferPromise, ReferredPromise } from '#utils/common'; -import { TimeoutError } from './errors'; -import type { OutgoingPayload } from './types'; +import { createReferPromise, type ReferredPromise } from '#utils/common'; +import { TimeoutError } from '#lib/moderation/workers/errors/TimeoutError'; +import type { OutgoingPayload } from '#lib/moderation/workers/types'; export class WorkerResponseHandler { private id = -1; diff --git a/src/lib/moderation/workers/errors/index.ts b/src/lib/moderation/workers/errors/index.ts deleted file mode 100644 index 3a1bf590f0c..00000000000 --- a/src/lib/moderation/workers/errors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './TimeoutError'; diff --git a/src/lib/moderation/workers/index.ts b/src/lib/moderation/workers/index.ts index 609ae534358..86d29664f0b 100644 --- a/src/lib/moderation/workers/index.ts +++ b/src/lib/moderation/workers/index.ts @@ -1,5 +1,5 @@ -export * from './errors'; -export * from './types'; -export * from './WorkerHandler'; -export * from './WorkerManager'; -export * from './WorkerResponseHandler'; +export * from '#lib/moderation/workers/WorkerHandler'; +export * from '#lib/moderation/workers/WorkerManager'; +export * from '#lib/moderation/workers/WorkerResponseHandler'; +export * from '#lib/moderation/workers/errors/TimeoutError'; +export * from '#lib/moderation/workers/types'; diff --git a/src/lib/moderation/workers/worker.ts b/src/lib/moderation/workers/worker.ts index 72312190b69..67c26e202c0 100644 --- a/src/lib/moderation/workers/worker.ts +++ b/src/lib/moderation/workers/worker.ts @@ -1,9 +1,13 @@ +import type { IncomingPayload, IncomingRunRegExpPayload, OutgoingPayload } from '#lib/moderation/workers/types'; import { remove as removeConfusables } from 'confusables'; import { isMainThread, parentPort } from 'node:worker_threads'; -import { IncomingPayload, IncomingRunRegExpPayload, IncomingType, OutgoingPayload, OutgoingType } from './types'; if (isMainThread || parentPort === null) throw new Error('The Worker may only be ran via the worker_threads fork method!'); +const { IncomingType, OutgoingType } = (await import( + process.env.NODE_ENV === 'test' ? './types.ts' : '#lib/moderation/workers/types' +)) as typeof import('./types.js'); + function post(message: OutgoingPayload) { return parentPort!.postMessage(message); } diff --git a/src/lib/setup/index.ts b/src/lib/setup/index.ts index b1216c5f45c..1f1071ea94d 100644 --- a/src/lib/setup/index.ts +++ b/src/lib/setup/index.ts @@ -1,14 +1,14 @@ // Config must be the first to be loaded, as it sets the env: -import 'reflect-metadata'; import '#root/config'; +import 'reflect-metadata'; // Import everything else: +import '#lib/setup/PaginatedMessage'; import '#utils/Sanitizer/initClean'; import '@sapphire/plugin-api/register'; +import '@sapphire/plugin-editable-commands/register'; import '@sapphire/plugin-i18next/register'; import '@sapphire/plugin-logger/register'; -import '@sapphire/plugin-editable-commands/register'; -import './PaginatedMessage'; import * as colorette from 'colorette'; import { inspect } from 'node:util'; diff --git a/src/lib/structures/AnalyticsData.ts b/src/lib/structures/AnalyticsData.ts index 50902cf1269..52f4946276b 100644 --- a/src/lib/structures/AnalyticsData.ts +++ b/src/lib/structures/AnalyticsData.ts @@ -1,5 +1,5 @@ import { parseAnalytics } from '#root/config'; -import { InfluxDB, QueryApi, WriteApi } from '@influxdata/influxdb-client'; +import { InfluxDB, type QueryApi, type WriteApi } from '@influxdata/influxdb-client'; import { envParseBoolean, envParseString } from '@skyra/env-utilities'; export class AnalyticsData { diff --git a/src/lib/structures/InviteStore.ts b/src/lib/structures/InviteStore.ts index f8c2c2d71d0..b40ec87777a 100644 --- a/src/lib/structures/InviteStore.ts +++ b/src/lib/structures/InviteStore.ts @@ -1,7 +1,7 @@ import { api } from '#lib/discord/Api'; import { minutes, resolveOnErrorCodes } from '#utils/common'; import { Collection } from '@discordjs/collection'; -import { RESTGetAPIInviteResult, RESTJSONErrorCodes } from 'discord-api-types/v9'; +import { RESTJSONErrorCodes, type RESTGetAPIInviteResult } from 'discord-api-types/v10'; export class InviteStore extends Collection { private readonly interval = setInterval(() => { @@ -17,7 +17,7 @@ export class InviteStore extends Collection { const previous = this.get(code); if (typeof previous !== 'undefined') return previous; - const data = (await resolveOnErrorCodes(api().invites(code).get(), RESTJSONErrorCodes.UnknownInvite)) as RESTGetAPIInviteResult | null; + const data = (await resolveOnErrorCodes(api().invites.get(code), RESTJSONErrorCodes.UnknownInvite)) as RESTGetAPIInviteResult | null; if (data === null) { const resolved: InviteCodeEntry = { valid: false, fetchedAt: Date.now() }; this.set(code, resolved); diff --git a/src/lib/structures/SettingsMenu.ts b/src/lib/structures/SettingsMenu.ts index 74569e6d56c..3972cc12623 100644 --- a/src/lib/structures/SettingsMenu.ts +++ b/src/lib/structures/SettingsMenu.ts @@ -1,21 +1,20 @@ import { configurableGroups, isSchemaGroup, readSettings, remove, SchemaGroup, SchemaKey, set, writeSettings } from '#lib/database/settings'; import { api } from '#lib/discord/Api'; import { LanguageKeys } from '#lib/i18n/languageKeys'; +import { SkyraArgs } from '#lib/structures/commands/SkyraArgs'; +import type { SkyraCommand } from '#lib/structures/commands/SkyraCommand'; import type { GuildMessage } from '#lib/types'; import { Events } from '#lib/types/Enums'; import { floatPromise, minutes } from '#utils/common'; import { ZeroWidthSpace } from '#utils/constants'; import { deleteMessage } from '#utils/functions'; -import { LLRCData, LongLivingReactionCollector } from '#utils/LongLivingReactionCollector'; +import { LongLivingReactionCollector, type LLRCData } from '#utils/LongLivingReactionCollector'; import { getColor, getFullEmbedAuthor, sendLoadingMessage } from '#utils/util'; -import { container } from '@sapphire/framework'; +import { container, type MessageCommand } from '@sapphire/framework'; import { deepClone } from '@sapphire/utilities'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; -import { DiscordAPIError, MessageCollector, MessageEmbed } from 'discord.js'; +import { RESTJSONErrorCodes } from 'discord-api-types/v10'; +import { DiscordAPIError, EmbedBuilder, MessageCollector } from 'discord.js'; import type { TFunction } from 'i18next'; -import * as Lexure from 'lexure'; -import { SkyraArgs } from './commands/parsers/SkyraArgs'; -import type { SkyraCommand } from './commands/SkyraCommand'; const EMOJIS = { BACK: '◀', STOP: '⏹' }; const TIMEOUT = minutes(15); @@ -34,7 +33,7 @@ export class SettingsMenu { private messageCollector: MessageCollector | null = null; private errorMessage: string | null = null; private llrc: LongLivingReactionCollector | null = null; - private readonly embed: MessageEmbed; + private readonly embed: EmbedBuilder; private response: GuildMessage | null = null; private oldValue: unknown = undefined; @@ -42,14 +41,14 @@ export class SettingsMenu { this.message = message; this.t = language; this.schema = configurableGroups; - this.embed = new MessageEmbed().setAuthor(getFullEmbedAuthor(this.message.author)); + this.embed = new EmbedBuilder().setAuthor(getFullEmbedAuthor(this.message.author)); } private get updatedValue(): boolean { return this.oldValue !== undefined; } - public async init(context: SkyraCommand.Context): Promise { + public async init(context: SkyraCommand.RunContext): Promise { this.response = await sendLoadingMessage(this.message, this.t); await this.response.react(EMOJIS.STOP); this.llrc = new LongLivingReactionCollector().setListener(this.onReaction.bind(this)).setEndListener(this.stop.bind(this)); @@ -111,7 +110,7 @@ export class SettingsMenu { .setTimestamp(); } - private async onMessage(message: GuildMessage, context: SkyraCommand.Context) { + private async onMessage(message: GuildMessage, context: SkyraCommand.RunContext) { // In case of messages that do not have a content, like attachments, ignore if (!message.content) return; @@ -126,12 +125,8 @@ export class SettingsMenu { this.errorMessage = this.t(LanguageKeys.Commands.Admin.ConfMenuInvalidKey); } } else { - // parser context - const conf = container.stores.get('commands').get('conf') as SkyraCommand; - // eslint-disable-next-line @typescript-eslint/dot-notation - const lexureParser = new Lexure.Parser(conf['lexer'].setInput(message.content).lex()); - const lexureArgs = new Lexure.Args(lexureParser.parse()); - const args = new SkyraArgs(this.message, conf, lexureArgs, context, this.t); + const conf = container.stores.get('commands').get('conf') as MessageCommand; + const args = SkyraArgs.from(conf, message, message.content, context, this.t); const commandLowerCase = args.next().toLowerCase(); if (commandLowerCase === 'set') await this.tryUpdate(UpdateType.Set, args); @@ -162,12 +157,14 @@ export class SettingsMenu { private async _removeReactionFromUser(reaction: string, userId: string) { if (!this.response) return; + + const channelId = this.response.channel.id; + const messageId = this.response.id; + const reactionId = encodeURIComponent(reaction); try { - return await api() - .channels(this.message.channel.id) - .messages(this.response.id) - .reactions(encodeURIComponent(reaction), userId === this.message.client.user!.id ? '@me' : userId) - .delete(); + return await (userId === this.message.client.user!.id + ? api().channels.deleteUserMessageReaction(channelId, messageId, reactionId, userId) + : api().channels.deleteOwnMessageReaction(channelId, messageId, reactionId)); } catch (error) { if (error instanceof DiscordAPIError) { if (error.code === RESTJSONErrorCodes.UnknownMessage) { diff --git a/src/lib/structures/SkyraLazyPaginatedMessage.ts b/src/lib/structures/SkyraLazyPaginatedMessage.ts index 2a6e1c7df2c..03a6d45edf7 100644 --- a/src/lib/structures/SkyraLazyPaginatedMessage.ts +++ b/src/lib/structures/SkyraLazyPaginatedMessage.ts @@ -1,5 +1,5 @@ import { minutes } from '#utils/common'; -import { LazyPaginatedMessage, PaginatedMessageOptions } from '@sapphire/discord.js-utilities'; +import { LazyPaginatedMessage, type PaginatedMessageOptions } from '@sapphire/discord.js-utilities'; export class SkyraLazyPaginatedMessage extends LazyPaginatedMessage { public constructor(options: PaginatedMessageOptions = {}, idle = minutes(5)) { diff --git a/src/lib/structures/SkyraPaginatedMessage.ts b/src/lib/structures/SkyraPaginatedMessage.ts index 162cde90a5c..3fe919cef80 100644 --- a/src/lib/structures/SkyraPaginatedMessage.ts +++ b/src/lib/structures/SkyraPaginatedMessage.ts @@ -1,5 +1,5 @@ import { minutes } from '#utils/common'; -import { PaginatedMessage, PaginatedMessageOptions } from '@sapphire/discord.js-utilities'; +import { PaginatedMessage, type PaginatedMessageOptions } from '@sapphire/discord.js-utilities'; export class SkyraPaginatedMessage extends PaginatedMessage { public constructor(options: PaginatedMessageOptions = {}, idle = minutes(5)) { diff --git a/src/lib/structures/commands/ChannelConfigurationCommand.ts b/src/lib/structures/commands/ChannelConfigurationCommand.ts index 77a334e8c0f..2e2688ce48a 100644 --- a/src/lib/structures/commands/ChannelConfigurationCommand.ts +++ b/src/lib/structures/commands/ChannelConfigurationCommand.ts @@ -1,20 +1,20 @@ -import type { GuildEntity } from '#lib/database'; +import type { GuildSettingsOfType } from '#lib/database'; import { writeSettings } from '#lib/database/settings'; import { LanguageKeys } from '#lib/i18n/languageKeys'; +import { SkyraCommand } from '#lib/structures/commands/SkyraCommand'; import type { CustomFunctionGet, GuildMessage } from '#lib/types'; import { PermissionLevels } from '#lib/types/Enums'; import { assertNonThread } from '#utils/functions'; -import { Args, CommandOptionsRunTypeEnum, container, IArgument, PieceContext } from '@sapphire/framework'; +import { Args, Argument, CommandOptionsRunTypeEnum, container } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import type { Nullish, PickByValue } from '@sapphire/utilities'; +import type { Nullish } from '@sapphire/utilities'; import type { TextChannel } from 'discord.js'; -import { SkyraCommand } from './SkyraCommand'; export abstract class ChannelConfigurationCommand extends SkyraCommand { private readonly responseKey: CustomFunctionGet; - private readonly settingsKey: PickByValue; + private readonly settingsKey: GuildSettingsOfType; - public constructor(context: PieceContext, options: ChannelConfigurationCommand.Options) { + public constructor(context: SkyraCommand.Context, options: ChannelConfigurationCommand.Options) { super(context, { permissionLevel: PermissionLevels.Administrator, runIn: [CommandOptionsRunTypeEnum.GuildAny], @@ -25,7 +25,7 @@ export abstract class ChannelConfigurationCommand extends SkyraCommand { this.settingsKey = options.settingsKey; } - public async messageRun(message: GuildMessage, args: SkyraCommand.Args) { + public override async messageRun(message: GuildMessage, args: SkyraCommand.Args) { const channel = await args.pick(ChannelConfigurationCommand.hereOrTextChannelResolver); await writeSettings(message.guild, (settings) => { @@ -44,7 +44,7 @@ export abstract class ChannelConfigurationCommand extends SkyraCommand { private static hereOrTextChannelResolver = Args.make((argument, context) => { if (argument === 'here') return Args.ok(assertNonThread(context.message.channel) as TextChannel); - return (container.stores.get('arguments').get('textChannelName') as IArgument).run(argument, context); + return (container.stores.get('arguments').get('textChannelName') as Argument).run(argument, context); }); } @@ -54,7 +54,7 @@ export namespace ChannelConfigurationCommand { */ export type Options = SkyraCommand.Options & { responseKey: CustomFunctionGet; - settingsKey: PickByValue; + settingsKey: GuildSettingsOfType; }; export type Args = SkyraCommand.Args; diff --git a/src/lib/structures/commands/PaginatedMessageCommand.ts b/src/lib/structures/commands/PaginatedMessageCommand.ts deleted file mode 100644 index 78e9353da37..00000000000 --- a/src/lib/structures/commands/PaginatedMessageCommand.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { seconds } from '#utils/common'; -import type { CommandContext, PieceContext } from '@sapphire/framework'; -import type { PermissionResolvable } from 'discord.js'; -import { SkyraCommand } from './SkyraCommand'; - -export abstract class PaginatedMessageCommand extends SkyraCommand { - public constructor(context: PieceContext, options: PaginatedMessageCommand.Options) { - super(context, { - cooldownDelay: seconds(15), - // Merge in all given options - ...options, - // Add all requiredPermissions set in the command, along EMBED_LINKS to send MessageEmbed's - requiredClientPermissions: [...((options.requiredClientPermissions as PermissionResolvable[] | undefined) ?? []), 'EMBED_LINKS'] - }); - } -} - -export namespace PaginatedMessageCommand { - /** - * The PaginatedMessageCommand Options - */ - export type Options = SkyraCommand.Options; - /** - * The PaginatedMessageCommand Args - */ - export type Args = SkyraCommand.Args; - - /** - * The PaginatedMessageCommand CommandContext - */ - export type Context = CommandContext; -} diff --git a/src/lib/structures/commands/parsers/SkyraArgs.ts b/src/lib/structures/commands/SkyraArgs.ts similarity index 59% rename from src/lib/structures/commands/parsers/SkyraArgs.ts rename to src/lib/structures/commands/SkyraArgs.ts index 3dfe8fbbe38..63da9a510f7 100644 --- a/src/lib/structures/commands/parsers/SkyraArgs.ts +++ b/src/lib/structures/commands/SkyraArgs.ts @@ -1,13 +1,12 @@ -import type { SkyraCommand } from '#lib/structures'; -import { Args, CommandContext, isOk, Result, UserError } from '@sapphire/framework'; +import { Args, Result, UserError, type MessageCommand } from '@sapphire/framework'; +import { ArgumentStream, Parser } from '@sapphire/lexure'; import type { Message } from 'discord.js'; import type { TFunction } from 'i18next'; -import type { Args as LexureArgs } from 'lexure'; export class SkyraArgs extends Args { - public t: TFunction; + public override t: TFunction; - public constructor(message: Message, command: SkyraCommand, parser: LexureArgs, context: CommandContext, t: TFunction) { + public constructor(message: Message, command: MessageCommand, parser: ArgumentStream, context: MessageCommand.RunContext, t: TFunction) { super(message, command, parser, context); this.t = t; } @@ -21,12 +20,14 @@ export class SkyraArgs extends Args { if (this.parser.finished) return this.missingArguments(); const values: string[] = []; - const parts = this.parser - .many() - .reduce((acc, token) => `${acc}${token.value}${token.trailing}`, '') - .split(delimiter); + const parts = this.parser.many(); + if (parts.isNone()) return this.missingArguments(); - for (const part of parts) { + const tokens = parts + .unwrap() + .reduce((acc, token) => `${acc}${token.leading}${token.value}`, '') + .split(delimiter); + for (const part of tokens) { const trimmed = part.trim(); if (trimmed.length === 0) continue; @@ -43,14 +44,15 @@ export class SkyraArgs extends Args { * @returns An array of values. */ public nextSplit(options?: SkyraArgs.NextSplitOptions) { - const result = this.nextSplitResult(options); - if (isOk(result)) return result.value; - throw result.error; + return this.nextSplitResult(options).unwrapRaw(); } -} -export interface SkyraArgs { - command: SkyraCommand; + public static from(command: MessageCommand, message: Message, parameters: string, context: MessageCommand.RunContext, t: TFunction) { + const parser = new Parser(command.strategy); + // eslint-disable-next-line @typescript-eslint/dot-notation + const args = new ArgumentStream(parser.run(command['lexer'].run(parameters))); + return new SkyraArgs(message, command, args, context, t); + } } export namespace SkyraArgs { diff --git a/src/lib/structures/commands/SkyraCommand.ts b/src/lib/structures/commands/SkyraCommand.ts index 5d1f24b9006..debb4fa6f93 100644 --- a/src/lib/structures/commands/SkyraCommand.ts +++ b/src/lib/structures/commands/SkyraCommand.ts @@ -1,97 +1,62 @@ import type { LanguageHelpDisplayOptions } from '#lib/i18n/LanguageHelp'; -import type { CustomGet } from '#lib/types'; -import { PermissionLevels } from '#lib/types/Enums'; -import { OWNERS } from '#root/config'; -import { seconds } from '#utils/common'; -import { CommandContext, PieceContext, PreconditionContainerArray, UserError } from '@sapphire/framework'; -import { fetchT } from '@sapphire/plugin-i18next'; -import { SubCommandPluginCommand } from '@sapphire/plugin-subcommands'; -import type { Message } from 'discord.js'; -import * as Lexure from 'lexure'; -import { SkyraArgs } from './parsers/SkyraArgs'; - -export abstract class SkyraCommand extends SubCommandPluginCommand { +import { SkyraArgs } from '#lib/structures/commands/SkyraArgs'; +import { + SkyraCommandConstructorDefaults, + implementSkyraCommandError, + implementSkyraCommandPaginatedOptions, + implementSkyraCommandParseConstructorPreConditionsPermissionLevel, + implementSkyraCommandPreParse, + type ExtendOptions +} from '#lib/structures/commands/base/BaseSkyraCommandUtilities'; +import { PermissionLevels, type CustomGet } from '#lib/types'; +import { Command, UserError, type Awaitable, type MessageCommand, type PieceContext } from '@sapphire/framework'; +import { type Message } from 'discord.js'; + +/** + * The base class for all Skyra commands. + * @seealso {@link SkyraSubcommand} for subcommand support. + */ +export abstract class SkyraCommand extends Command { public readonly guarded: boolean; public readonly hidden: boolean; public readonly permissionLevel: PermissionLevels; - public readonly description: CustomGet; + public declare readonly detailedDescription: CustomGet; + public declare readonly description: CustomGet; public constructor(context: PieceContext, options: SkyraCommand.Options) { - super(context, { cooldownDelay: seconds(10), cooldownLimit: 2, cooldownFilteredUsers: OWNERS, generateDashLessAliases: true, ...options }); - - this.guarded = options.guarded ?? false; - this.hidden = options.hidden ?? false; - this.permissionLevel = options.permissionLevel ?? PermissionLevels.Everyone; - this.description = options.description; + super(context, { ...SkyraCommandConstructorDefaults, ...options }); + this.guarded = options.guarded ?? SkyraCommandConstructorDefaults.guarded; + this.hidden = options.hidden ?? SkyraCommandConstructorDefaults.hidden; + this.permissionLevel = options.permissionLevel ?? SkyraCommandConstructorDefaults.permissionLevel; } + public abstract override messageRun(message: Message, args: SkyraCommand.Args, context: MessageCommand.RunContext): Awaitable; + /** * The pre-parse method. This method can be overridden by plugins to define their own argument parser. * @param message The message that triggered the command. * @param parameters The raw parameters as a single string. * @param context The command-context used in this execution. */ - public async preParse(message: Message, parameters: string, context: CommandContext): Promise { - const parser = new Lexure.Parser(this.lexer.setInput(parameters).lex()).setUnorderedStrategy(this.strategy); - const args = new Lexure.Args(parser.parse()); - return new SkyraArgs(message, this, args, context, await fetchT(message)); + public override messagePreParse(message: Message, parameters: string, context: MessageCommand.RunContext): Promise { + return implementSkyraCommandPreParse(this as MessageCommand, message, parameters, context); } protected error(identifier: string | UserError, context?: unknown): never { - throw typeof identifier === 'string' ? new UserError({ identifier, context }) : identifier; + implementSkyraCommandError(identifier, context); } - protected parseConstructorPreConditions(options: SkyraCommand.Options): void { + protected override parseConstructorPreConditions(options: SkyraCommand.Options): void { super.parseConstructorPreConditions(options); - this.parseConstructorPreConditionsPermissionLevel(options); + implementSkyraCommandParseConstructorPreConditionsPermissionLevel(this, options.permissionLevel); } - protected parseConstructorPreConditionsPermissionLevel(options: SkyraCommand.Options): void { - if (options.permissionLevel === PermissionLevels.BotOwner) { - this.preconditions.append('BotOwner'); - return; - } - - const container = new PreconditionContainerArray(['BotOwner'], this.preconditions); - switch (options.permissionLevel ?? PermissionLevels.Everyone) { - case PermissionLevels.Everyone: - container.append('Everyone'); - break; - case PermissionLevels.Moderator: - container.append('Moderator'); - break; - case PermissionLevels.Administrator: - container.append('Administrator'); - break; - case PermissionLevels.ServerOwner: - container.append('ServerOwner'); - break; - default: - throw new Error( - `SkyraCommand[${this.name}]: "permissionLevel" was specified as an invalid permission level (${options.permissionLevel}).` - ); - } - - this.preconditions.append(container); - } -} - -export interface SkyraCommand { - detailedDescription: CustomGet; + public static readonly PaginatedOptions = implementSkyraCommandPaginatedOptions; } export namespace SkyraCommand { - /** - * The SkyraCommand Options - */ - export type Options = SubCommandPluginCommand.Options & { - description: CustomGet; - detailedDescription: CustomGet; - guarded?: boolean; - hidden?: boolean; - permissionLevel?: number; - }; - + export type Options = ExtendOptions; export type Args = SkyraArgs; - export type Context = CommandContext; + export type Context = Command.Context; + export type RunContext = MessageCommand.RunContext; } diff --git a/src/lib/structures/commands/SkyraSubcommand.ts b/src/lib/structures/commands/SkyraSubcommand.ts new file mode 100644 index 00000000000..15747acc6e8 --- /dev/null +++ b/src/lib/structures/commands/SkyraSubcommand.ts @@ -0,0 +1,63 @@ +import type { LanguageHelpDisplayOptions } from '#lib/i18n/LanguageHelp'; +import { SkyraArgs } from '#lib/structures/commands/SkyraArgs'; +import { + SkyraCommandConstructorDefaults, + implementSkyraCommandError, + implementSkyraCommandPaginatedOptions, + implementSkyraCommandParseConstructorPreConditionsPermissionLevel, + implementSkyraCommandPreParse, + type ExtendOptions +} from '#lib/structures/commands/base/BaseSkyraCommandUtilities'; +import type { CustomGet } from '#lib/types'; +import { PermissionLevels } from '#lib/types/Enums'; +import { UserError, type MessageCommand, type PieceContext } from '@sapphire/framework'; +import { Subcommand } from '@sapphire/plugin-subcommands'; +import type { Message } from 'discord.js'; + +/** + * The base class for all Skyra commands with subcommands. + * @seealso {@link SkyraCommand}. + */ +export class SkyraSubcommand extends Subcommand { + public readonly guarded: boolean; + public readonly hidden: boolean; + public readonly permissionLevel: PermissionLevels; + public declare readonly detailedDescription: CustomGet; + public override readonly description: CustomGet; + + public constructor(context: PieceContext, options: SkyraSubcommand.Options) { + super(context, { ...SkyraCommandConstructorDefaults, ...options }); + this.guarded = options.guarded ?? SkyraCommandConstructorDefaults.guarded; + this.hidden = options.hidden ?? SkyraCommandConstructorDefaults.hidden; + this.permissionLevel = options.permissionLevel ?? SkyraCommandConstructorDefaults.permissionLevel; + this.description = options.description; + } + + /** + * The pre-parse method. This method can be overridden by plugins to define their own argument parser. + * @param message The message that triggered the command. + * @param parameters The raw parameters as a single string. + * @param context The command-context used in this execution. + */ + public override messagePreParse(message: Message, parameters: string, context: MessageCommand.RunContext): Promise { + return implementSkyraCommandPreParse(this as MessageCommand, message, parameters, context); + } + + protected error(identifier: string | UserError, context?: unknown): never { + implementSkyraCommandError(identifier, context); + } + + protected override parseConstructorPreConditions(options: SkyraSubcommand.Options): void { + super.parseConstructorPreConditions(options); + implementSkyraCommandParseConstructorPreConditionsPermissionLevel(this, options.permissionLevel); + } + + public static readonly PaginatedOptions = implementSkyraCommandPaginatedOptions; +} + +export namespace SkyraSubcommand { + export type Options = ExtendOptions; + export type Args = SkyraArgs; + export type Context = Subcommand.Context; + export type RunContext = MessageCommand.RunContext; +} diff --git a/src/lib/structures/commands/base/BaseSkyraCommandUtilities.ts b/src/lib/structures/commands/base/BaseSkyraCommandUtilities.ts new file mode 100644 index 00000000000..921a776130b --- /dev/null +++ b/src/lib/structures/commands/base/BaseSkyraCommandUtilities.ts @@ -0,0 +1,80 @@ +import type { LanguageHelpDisplayOptions } from '#lib/i18n/LanguageHelp'; +import { SkyraArgs } from '#lib/structures/commands/SkyraArgs'; +import { PermissionLevels, type CustomGet } from '#lib/types'; +import { OWNERS } from '#root/config'; +import { seconds } from '#utils/common'; +import { Command, PreconditionContainerArray, UserError, type MessageCommand } from '@sapphire/framework'; +import { fetchT } from '@sapphire/plugin-i18next'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { PermissionsBitField, type Message } from 'discord.js'; + +export const SkyraCommandConstructorDefaults = { + cooldownDelay: seconds(10), + cooldownLimit: 2, + cooldownFilteredUsers: OWNERS, + generateDashLessAliases: true, + guarded: false, + hidden: false, + permissionLevel: PermissionLevels.Everyone +} satisfies Partial>; + +export async function implementSkyraCommandPreParse( + command: MessageCommand, + message: Message, + parameters: string, + context: MessageCommand.RunContext +): Promise { + return SkyraArgs.from(command, message, parameters, context, await fetchT(message)); +} + +export function implementSkyraCommandError(identifier: string | UserError, context?: unknown): never { + throw typeof identifier === 'string' ? new UserError({ identifier, context }) : identifier; +} + +export function implementSkyraCommandParseConstructorPreConditionsPermissionLevel( + command: Command, + permissionLevel: PermissionLevels = PermissionLevels.Everyone +): void { + if (permissionLevel === PermissionLevels.BotOwner) { + command.preconditions.append('BotOwner'); + return; + } + + const container = new PreconditionContainerArray(['BotOwner'], command.preconditions); + switch (permissionLevel) { + case PermissionLevels.Everyone: + container.append('Everyone'); + break; + case PermissionLevels.Moderator: + container.append('Moderator'); + break; + case PermissionLevels.Administrator: + container.append('Administrator'); + break; + case PermissionLevels.ServerOwner: + container.append('ServerOwner'); + break; + default: + throw new Error(`SkyraCommand[${command.name}]: "permissionLevel" was specified as an invalid permission level (${permissionLevel}).`); + } + + command.preconditions.append(container); +} + +export function implementSkyraCommandPaginatedOptions = ExtendOptions>(options?: T): T { + return { + cooldownDelay: seconds(15), + // Merge in all given options + ...options, + // Add all requiredPermissions set in the command, along EmbedLinks to send EmbedBuilder's + requiredClientPermissions: new PermissionsBitField(options?.requiredClientPermissions).add(PermissionFlagsBits.EmbedLinks) + } as unknown as T; +} + +export type ExtendOptions = T & { + description: CustomGet; + detailedDescription: CustomGet; + guarded?: boolean; + hidden?: boolean; + permissionLevel?: number; +}; diff --git a/src/lib/structures/commands/index.ts b/src/lib/structures/commands/index.ts index 3885cfa9070..7d8cd10c1aa 100644 --- a/src/lib/structures/commands/index.ts +++ b/src/lib/structures/commands/index.ts @@ -1,4 +1,4 @@ -export * from './ChannelConfigurationCommand'; -export * from './PaginatedMessageCommand'; -export * from './parsers'; -export * from './SkyraCommand'; +export * from '#lib/structures/commands/ChannelConfigurationCommand'; +export * from '#lib/structures/commands/SkyraArgs'; +export * from '#lib/structures/commands/SkyraCommand'; +export * from '#lib/structures/commands/SkyraSubcommand'; diff --git a/src/lib/structures/commands/parsers/index.ts b/src/lib/structures/commands/parsers/index.ts deleted file mode 100644 index 486f38a64cc..00000000000 --- a/src/lib/structures/commands/parsers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './SkyraArgs'; diff --git a/src/lib/structures/index.ts b/src/lib/structures/index.ts index 10af9b521d5..ad59d976751 100644 --- a/src/lib/structures/index.ts +++ b/src/lib/structures/index.ts @@ -1,9 +1,9 @@ -export * from './AnalyticsData'; -export * from './commands'; -export * from './InviteStore'; -export * from './listeners'; -export * from './managers'; -export * from './preconditions'; -export * from './SettingsMenu'; -export * from './SkyraLazyPaginatedMessage'; -export * from './SkyraPaginatedMessage'; +export * from '#lib/structures/AnalyticsData'; +export * from '#lib/structures/commands/index'; +export * from '#lib/structures/InviteStore'; +export * from '#lib/structures/listeners/index'; +export * from '#lib/structures/managers'; +export * from '#lib/structures/preconditions/index'; +export * from '#lib/structures/SettingsMenu'; +export * from '#lib/structures/SkyraLazyPaginatedMessage'; +export * from '#lib/structures/SkyraPaginatedMessage'; diff --git a/src/lib/structures/listeners/AnalyticsListener.ts b/src/lib/structures/listeners/AnalyticsListener.ts index b16c74d4c1b..baf0731f7b1 100644 --- a/src/lib/structures/listeners/AnalyticsListener.ts +++ b/src/lib/structures/listeners/AnalyticsListener.ts @@ -1,16 +1,16 @@ import { Tags } from '#lib/types/AnalyticsSchema'; import type { Point } from '@influxdata/influxdb-client'; -import { Listener, ListenerOptions, PieceContext } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { envParseBoolean } from '@skyra/env-utilities'; export abstract class AnalyticsListener extends Listener { public tags: [Tags, string][] = []; - public constructor(context: PieceContext, options?: AnalyticsListener.Options) { + public constructor(context: Listener.Context, options?: AnalyticsListener.Options) { super(context, { ...options, enabled: envParseBoolean('INFLUX_ENABLED') }); } - public onLoad() { + public override onLoad() { this.initTags(); return super.onLoad(); } @@ -32,10 +32,10 @@ export abstract class AnalyticsListener extends Listener { } protected initTags() { - this.tags.push([Tags.Client, process.env.CLIENT_ID], [Tags.OriginEvent, this.event]); + this.tags.push([Tags.Client, process.env.CLIENT_ID], [Tags.OriginEvent, this.event as string]); } } export namespace AnalyticsListener { - export type Options = Omit; + export type Options = Omit; } diff --git a/src/lib/structures/listeners/index.ts b/src/lib/structures/listeners/index.ts index c9ed6d045be..a92c9a76079 100644 --- a/src/lib/structures/listeners/index.ts +++ b/src/lib/structures/listeners/index.ts @@ -1,2 +1,2 @@ -export * from './AnalyticsListener'; -export * from './ShardListener'; +export * from '#lib/structures/listeners/AnalyticsListener'; +export * from '#lib/structures/listeners/ShardListener'; diff --git a/src/lib/structures/managers/LockdownManager.ts b/src/lib/structures/managers/LockdownManager.ts index ca008e7ced8..6050beac4b9 100644 --- a/src/lib/structures/managers/LockdownManager.ts +++ b/src/lib/structures/managers/LockdownManager.ts @@ -30,7 +30,7 @@ export class LockdownManager extends Collection, - makeMessage: () => Promise | MessageEmbed + key: GuildSettingsOfType, + makeMessage: () => Promise | EmbedBuilder ): boolean; emit(event: Events.ReactionBlocked, data: LLRCData, emoji: string): boolean; - emit(event: Events.MoneyTransaction, target: User, moneyChange: number, moneyBeforeChange: number): boolean; - emit(event: Events.MoneyPayment, message: Message, user: User, target: User, money: number): boolean; emit(event: Events.ResourceAnalyticsSync): boolean; emit(event: Events.TwitchStreamHookedAnalytics, status: TwitchStreamStatus): boolean; emit(event: Events.TwitchStreamOnline, data: TwitchEventSubOnlineEvent): boolean; @@ -113,14 +108,8 @@ declare module 'i18next' { lng: string; ns?: string; - (key: CustomGet, options?: TOptionsBase | string): TReturn; - (key: CustomGet, defaultValue: TReturn, options?: TOptionsBase | string): TReturn; - (key: CustomFunctionGet, options?: TOptions): TReturn; - ( - key: CustomFunctionGet, - defaultValue: TReturn, - options?: TOptions - ): TReturn; + (key: CustomGet): TReturn; + (key: CustomFunctionGet, options?: TArgs): TReturn; } } diff --git a/src/lib/types/Discord.d.ts b/src/lib/types/Discord.d.ts deleted file mode 100644 index 63b2e64896c..00000000000 --- a/src/lib/types/Discord.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { GuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; -import type { DMChannel, Guild, GuildMember, Message } from 'discord.js'; - -export interface GuildMessage extends Message { - channel: GuildTextBasedChannelTypes; - readonly guild: Guild; - readonly member: GuildMember; -} - -export interface DMMessage extends Message { - channel: DMChannel; - readonly guild: null; - readonly member: null; -} diff --git a/src/lib/types/Discord.ts b/src/lib/types/Discord.ts new file mode 100644 index 00000000000..701ac4d45d4 --- /dev/null +++ b/src/lib/types/Discord.ts @@ -0,0 +1,4 @@ +import type { GuildMember, Message } from 'discord.js'; + +export type GuildMessage = Message & { member: GuildMember }; +export type DMMessage = Message; diff --git a/src/lib/types/Enums.ts b/src/lib/types/Enums.ts index 4a93be6cbc9..97ad0f9a3c1 100644 --- a/src/lib/types/Enums.ts +++ b/src/lib/types/Enums.ts @@ -3,12 +3,6 @@ export const enum Events { Error = 'error', PreMessageParsed = 'preMessageParsed', ArgumentError = 'argumentError', - CommandError = 'commandError', - CommandInhibited = 'commandInhibited', - CommandRun = 'commandRun', - CommandDenied = 'commandDenied', - CommandSuccess = 'commandSuccess', - CommandUnknown = 'commandUnknown', CommandUsageAnalytics = 'commandUsageAnalytics', CoreSettingsDelete = 'coreSettingsDelete', CoreSettingsUpdate = 'coreSettingsUpdate', @@ -34,8 +28,6 @@ export const enum Events { MessageUpdate = 'messageUpdate', ModerationEntryAdd = 'moderationEntryAdd', ModerationEntryEdit = 'moderationEntryEdit', - MoneyPayment = 'moneyPayment', - MoneyTransaction = 'moneyTransaction', NotMutedMemberAdd = 'notMutedMemberAdd', Raw = 'raw', RawMemberAdd = 'rawMemberAdd', diff --git a/src/lib/types/definitions/Internals.ts b/src/lib/types/Internals.ts similarity index 100% rename from src/lib/types/definitions/Internals.ts rename to src/lib/types/Internals.ts diff --git a/src/lib/types/definitions/Twitch.ts b/src/lib/types/Twitch.ts similarity index 100% rename from src/lib/types/definitions/Twitch.ts rename to src/lib/types/Twitch.ts diff --git a/src/lib/types/Utils.ts b/src/lib/types/Utils.ts index ead9bde05a5..281e7b437dc 100644 --- a/src/lib/types/Utils.ts +++ b/src/lib/types/Utils.ts @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/ban-types */ - export type CustomGet = K & { __type__: TCustom }; export function T(k: string): CustomGet { diff --git a/src/lib/types/definitions/index.ts b/src/lib/types/definitions/index.ts deleted file mode 100644 index e89b40367cd..00000000000 --- a/src/lib/types/definitions/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './Internals'; -export * from './Twitch'; diff --git a/src/lib/types/index.ts b/src/lib/types/index.ts index b6ff001d71d..ea82ce34efc 100644 --- a/src/lib/types/index.ts +++ b/src/lib/types/index.ts @@ -1,3 +1,5 @@ -export * from './definitions'; -export type { DMMessage, GuildMessage } from './Discord'; -export * from './Utils'; +export * from '#lib/types/Discord'; +export * from '#lib/types/Enums'; +export * from '#lib/types/Internals'; +export * from '#lib/types/Twitch'; +export * from '#lib/types/Utils'; diff --git a/src/lib/util/Links/UrlRegex.ts b/src/lib/util/Links/UrlRegex.ts index 2359faa9b82..ddb380a05b5 100644 --- a/src/lib/util/Links/UrlRegex.ts +++ b/src/lib/util/Links/UrlRegex.ts @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -import { TLDs } from './TLDs'; +import { TLDs } from '#lib/util/Links/TLDs'; export function urlRegex({ requireProtocol = true, exact = false, tlds = false }: UrlRegexOptions = {}) { const protocol = `(?:(?:[a-z]+:)?//)${requireProtocol ? '' : '?'}`; diff --git a/src/lib/util/LongLivingReactionCollector.ts b/src/lib/util/LongLivingReactionCollector.ts index c760bf9fca6..c1cb89930c1 100644 --- a/src/lib/util/LongLivingReactionCollector.ts +++ b/src/lib/util/LongLivingReactionCollector.ts @@ -1,8 +1,8 @@ +import { minutes } from '#utils/common'; import type { GuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; import { container } from '@sapphire/framework'; import { noop } from '@sapphire/utilities'; import type { Guild, User } from 'discord.js'; -import { minutes } from './common'; export type LongLivingReactionCollectorListener = (reaction: LLRCData) => void; diff --git a/src/lib/util/Notifications/Twitch.ts b/src/lib/util/Notifications/Twitch.ts index f503c3cc834..9cf2adefa1a 100644 --- a/src/lib/util/Notifications/Twitch.ts +++ b/src/lib/util/Notifications/Twitch.ts @@ -1,16 +1,16 @@ import { - TwitchEventSubResult, TwitchEventSubTypes, - TwitchHelixBearerToken, - TwitchHelixGameSearchResult, - TwitchHelixOauth2Result, - TwitchHelixResponse, - TwitchHelixStreamsResult, - TwitchHelixUserFollowsResult, - TwitchHelixUsersSearchResult -} from '#lib/types/definitions/Twitch'; + type TwitchEventSubResult, + type TwitchHelixBearerToken, + type TwitchHelixGameSearchResult, + type TwitchHelixOauth2Result, + type TwitchHelixResponse, + type TwitchHelixStreamsResult, + type TwitchHelixUserFollowsResult, + type TwitchHelixUsersSearchResult +} from '#lib/types'; import { Enumerable, EnumerableMethod } from '@sapphire/decorators'; -import { fetch, FetchMethods, FetchResultTypes } from '@sapphire/fetch'; +import { FetchMethods, FetchResultTypes, fetch } from '@sapphire/fetch'; import { MimeTypes } from '@sapphire/plugin-api'; import { RateLimitManager } from '@sapphire/ratelimits'; import { Time } from '@sapphire/time-utilities'; diff --git a/src/lib/util/Security/GuildSecurity.ts b/src/lib/util/Security/GuildSecurity.ts index f5c1515944f..c7a6d5e626a 100644 --- a/src/lib/util/Security/GuildSecurity.ts +++ b/src/lib/util/Security/GuildSecurity.ts @@ -1,6 +1,6 @@ import { LockdownManager } from '#lib/structures'; +import { ModerationActions } from '#lib/util/Security/ModerationActions'; import type { Guild } from 'discord.js'; -import { ModerationActions } from './ModerationActions'; /** * @version 3.0.0 diff --git a/src/lib/util/Security/ModerationActions.ts b/src/lib/util/Security/ModerationActions.ts index d675d62588c..a3d456d6c6a 100644 --- a/src/lib/util/Security/ModerationActions.ts +++ b/src/lib/util/Security/ModerationActions.ts @@ -1,4 +1,4 @@ -import type { GuildEntity, ModerationEntity } from '#lib/database/entities'; +import type { GuildSettingsOfType, ModerationEntity } from '#lib/database/entities'; import { GuildSettings } from '#lib/database/keys'; import { readSettings, writeSettings } from '#lib/database/settings'; import { api } from '#lib/discord/Api'; @@ -11,20 +11,20 @@ import { getFullEmbedAuthor } from '#utils/util'; import { isCategoryChannel, isNewsChannel, isStageChannel, isTextChannel, isVoiceChannel } from '@sapphire/discord.js-utilities'; import { UserError, container } from '@sapphire/framework'; import { fetchT, resolveKey } from '@sapphire/plugin-i18next'; -import { Nullish, PickByValue, isNullish, isNullishOrEmpty, isNullishOrZero } from '@sapphire/utilities'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; +import { isNullish, isNullishOrEmpty, isNullishOrZero, type Nullish } from '@sapphire/utilities'; +import { PermissionFlagsBits, RESTJSONErrorCodes } from 'discord-api-types/v10'; import { DiscordAPIError, + EmbedBuilder, Guild, GuildChannel, GuildMember, Message, - MessageEmbed, - PermissionOverwriteOptions, - Permissions, + PermissionsBitField, Role, - RoleData, - User + User, + type PermissionOverwriteOptions, + type RoleData } from 'discord.js'; import type { TFunction } from 'i18next'; @@ -114,25 +114,22 @@ const kRoleChannelOverwriteOptions = new Map (log.extraData as { role?: string })?.role === role.id); return (await moderationLog.create())!; @@ -337,7 +301,7 @@ export class ModerationActions { const options = ModerationActions.fillOptions(rawOptions, TypeCodes.UnAddRole); const moderationLog = getModeration(this.guild).create(options); await this.sendDM(moderationLog, sendOptions); - await api().guilds(this.guild.id).members(rawOptions.userId).roles(role.id).delete({ reason: rawOptions.reason! }); + await api().guilds.removeRoleFromMember(this.guild.id, rawOptions.userId, role.id, { reason: rawOptions.reason! }); await this.cancelLastLogTaskFromUser(options.userId, TypeCodes.AddRole, (log) => (log.extraData as { role?: string })?.role === role.id); return (await moderationLog.create())!; @@ -347,11 +311,9 @@ export class ModerationActions { const options = ModerationActions.fillOptions({ ...rawOptions, extraData: { role: role.id } }, TypeCodes.RemoveRole); const moderationLog = getModeration(this.guild).create(options); await this.sendDM(moderationLog, sendOptions); - await api() - .guilds(this.guild.id) - .members(rawOptions.userId) - .roles(role.id) - .delete({ reason: await this.getReason('removeRole', moderationLog.reason) }); + await api().guilds.removeRoleFromMember(this.guild.id, rawOptions.userId, role.id, { + reason: await this.getReason('removeRole', moderationLog.reason) + }); await this.cancelLastLogTaskFromUser(options.userId, TypeCodes.RemoveRole, (log) => (log.extraData as { role?: string })?.role === role.id); return (await moderationLog.create())!; @@ -361,7 +323,7 @@ export class ModerationActions { const options = ModerationActions.fillOptions(rawOptions, TypeCodes.UnRemoveRole); const moderationLog = getModeration(this.guild).create(options); await this.sendDM(moderationLog, sendOptions); - await api().guilds(this.guild.id).members(rawOptions.userId).roles(role.id).put({ reason: rawOptions.reason }); + await api().guilds.addRoleToMember(this.guild.id, rawOptions.userId, role.id, { reason: rawOptions.reason ?? undefined }); await this.cancelLastLogTaskFromUser(options.userId, TypeCodes.RemoveRole, (log) => (log.extraData as { role?: string })?.role === role.id); return (await moderationLog.create())!; @@ -387,7 +349,7 @@ export class ModerationActions { } // If Skyra does not have permissions to manage permissions, abort. - if (!(await this.fetchMe()).permissions.has(Permissions.FLAGS.MANAGE_ROLES)) { + if (!(await this.fetchMe()).permissions.has(PermissionFlagsBits.ManageRoles)) { throw await resolveKey(this.guild, LanguageKeys.Commands.Moderation.MuteCannotManageRoles); } @@ -402,12 +364,7 @@ export class ModerationActions { const options = ModerationActions.fillOptions(rawOptions, TypeCodes.Kick); const moderationLog = getModeration(this.guild).create(options); await this.sendDM(moderationLog, sendOptions); - await api() - .guilds(this.guild.id) - .members(options.userId) - .delete({ - reason: await this.getReason('kick', moderationLog.reason) - }); + await api().guilds.removeMember(this.guild.id, options.userId, { reason: await this.getReason('kick', moderationLog.reason) }); return (await moderationLog.create())!; } @@ -417,25 +374,21 @@ export class ModerationActions { await this.sendDM(moderationLog, sendOptions); const t = await fetchT(this.guild); - await api() - .guilds(this.guild.id) - .bans(options.userId) - .put({ - data: { - delete_message_seconds: seconds ?? 0 - }, + await api().guilds.banUser( + this.guild.id, + options.userId, + { delete_message_seconds: seconds ?? 0 }, + { reason: moderationLog.reason ? t(LanguageKeys.Commands.Moderation.ActionSoftBanReason, { reason: moderationLog.reason! }) : t(LanguageKeys.Commands.Moderation.ActionSoftBanNoReason) - }); - await api() - .guilds(this.guild.id) - .bans(options.userId) - .delete({ - reason: moderationLog.reason - ? t(LanguageKeys.Commands.Moderation.ActionUnSoftBanReason, { reason: moderationLog.reason! }) - : t(LanguageKeys.Commands.Moderation.ActionUnSoftBanNoReason) - }); + } + ); + await api().guilds.unbanUser(this.guild.id, options.userId, { + reason: moderationLog.reason + ? t(LanguageKeys.Commands.Moderation.ActionUnSoftBanReason, { reason: moderationLog.reason! }) + : t(LanguageKeys.Commands.Moderation.ActionUnSoftBanNoReason) + }); return (await moderationLog.create())!; } @@ -443,16 +396,12 @@ export class ModerationActions { const options = ModerationActions.fillOptions(rawOptions, TypeCodes.Ban); const moderationLog = getModeration(this.guild).create(options); await this.sendDM(moderationLog, sendOptions); - await api() - .guilds(this.guild.id) - .bans(options.userId) - .put({ - data: { - delete_message_seconds: seconds ?? 0 - }, - reason: await this.getReason('ban', moderationLog.reason) - }); - + await api().guilds.banUser( + this.guild.id, + options.userId, + { delete_message_seconds: seconds ?? 0 }, + { reason: await this.getReason('ban', moderationLog.reason) } + ); await this.cancelLastLogTaskFromUser(options.userId, TypeCodes.Ban); return (await moderationLog.create())!; } @@ -460,10 +409,7 @@ export class ModerationActions { public async unBan(rawOptions: ModerationActionOptions, sendOptions?: ModerationActionsSendOptions) { const options = ModerationActions.fillOptions(rawOptions, TypeCodes.UnBan); const moderationLog = getModeration(this.guild).create(options); - await api() - .guilds(this.guild.id) - .bans(options.userId) - .delete({ reason: await this.getReason('ban', moderationLog.reason, true) }); + await api().guilds.unbanUser(this.guild.id, options.userId, { reason: await this.getReason('ban', moderationLog.reason, true) }); await this.sendDM(moderationLog, sendOptions); await this.cancelLastLogTaskFromUser(options.userId, TypeCodes.Ban); @@ -473,10 +419,7 @@ export class ModerationActions { public async voiceMute(rawOptions: ModerationActionOptions, sendOptions?: ModerationActionsSendOptions) { const options = ModerationActions.fillOptions(rawOptions, TypeCodes.VoiceMute); const moderationLog = getModeration(this.guild).create(options); - await api() - .guilds(this.guild.id) - .members(options.userId) - .patch({ data: { mute: true }, reason: await this.getReason('vmute', moderationLog.reason) }); + await api().guilds.editMember(this.guild.id, options.userId, { mute: true }, { reason: await this.getReason('vmute', moderationLog.reason) }); await this.sendDM(moderationLog, sendOptions); await this.cancelLastLogTaskFromUser(options.userId, TypeCodes.VoiceMute); @@ -486,10 +429,12 @@ export class ModerationActions { public async unVoiceMute(rawOptions: ModerationActionOptions, sendOptions?: ModerationActionsSendOptions) { const options = ModerationActions.fillOptions(rawOptions, TypeCodes.UnVoiceMute); const moderationLog = getModeration(this.guild).create(options); - await api() - .guilds(this.guild.id) - .members(options.userId) - .patch({ data: { mute: false }, reason: await this.getReason('vmute', moderationLog.reason, true) }); + await api().guilds.editMember( + this.guild.id, + options.userId, + { mute: false }, + { reason: await this.getReason('vmute', moderationLog.reason, true) } + ); await this.sendDM(moderationLog, sendOptions); await this.cancelLastLogTaskFromUser(options.userId, TypeCodes.VoiceMute); @@ -499,10 +444,12 @@ export class ModerationActions { public async voiceKick(rawOptions: ModerationActionOptions, sendOptions?: ModerationActionsSendOptions) { const options = ModerationActions.fillOptions(rawOptions, TypeCodes.VoiceKick); const moderationLog = getModeration(this.guild).create(options); - await api() - .guilds(this.guild.id) - .members(options.userId) - .patch({ data: { channel_id: null }, reason: await this.getReason('vkick', moderationLog.reason) }); + await api().guilds.editMember( + this.guild.id, + options.userId, + { channel_id: null }, + { reason: await this.getReason('vkick', moderationLog.reason) } + ); await this.sendDM(moderationLog, sendOptions); return (await moderationLog.create())!; } @@ -639,7 +586,7 @@ export class ModerationActions { public async userIsBanned(user: User) { try { - await api().guilds(this.guild.id).bans(user.id).get(); + await api().guilds.getMemberBan(this.guild.id, user.id); return true; } catch (error) { if (!(error instanceof DiscordAPIError)) throw await resolveKey(this.guild, LanguageKeys.System.FetchBansFail); @@ -659,7 +606,7 @@ export class ModerationActions { return member?.voice.serverMute ?? false; } - private async sharedRoleSetup(message: Message, key: RoleDataKey, path: PickByValue) { + private async sharedRoleSetup(message: Message, key: RoleDataKey, path: GuildSettingsOfType) { const roleData = kRoleDataOptions.get(key)!; const role = await this.guild.roles.create({ ...roleData, @@ -726,7 +673,7 @@ export class ModerationActions { reason: entry.reason, duration: entry.duration }); - const embed = new MessageEmbed() // + const embed = new EmbedBuilder() // .setDescription(description) .setFooter({ text: t(LanguageKeys.Commands.Moderation.ModerationDmFooter) }); @@ -771,7 +718,7 @@ export class ModerationActions { const extracted = ModerationActions.muteExtractRoles(member, position); extracted.keepRoles.push(roleId); - await member.edit({ roles: extracted.keepRoles }, reason); + await member.edit({ roles: extracted.keepRoles, reason }); return extracted.removedRoles; } @@ -798,7 +745,7 @@ export class ModerationActions { const { position } = (await this.fetchMe()).roles.highest; const rawRoleIds = Array.isArray(moderationLog.extraData) ? (moderationLog.extraData as string[]) : []; const roles = this.unmuteExtractRoles(member, roleId, position, rawRoleIds); - await member.edit({ roles }, reason); + await member.edit({ roles, reason }); return roles; } @@ -855,29 +802,29 @@ export class ModerationActions { return [...roles]; } - private async addStickyRestriction(id: string, key: PickByValue) { + private async addStickyRestriction(id: string, key: GuildSettingsOfType) { const [roleId] = await readSettings(this.guild, (settings) => [settings[key]]); if (isNullish(roleId)) throw new UserError({ identifier: LanguageKeys.Misc.RestrictionNotConfigured }); return getStickyRoles(this.guild).add(id, roleId); } - private async addRestrictionRole(id: string, key: PickByValue) { + private async addRestrictionRole(id: string, key: GuildSettingsOfType) { const [roleId] = await readSettings(this.guild, (settings) => [settings[key]]); if (isNullish(roleId)) throw new UserError({ identifier: LanguageKeys.Misc.RestrictionNotConfigured }); - await api().guilds(this.guild.id).members(id).roles(roleId).put(); + await api().guilds.addRoleToMember(this.guild.id, id, roleId); } - private async removeStickyRestriction(id: string, key: PickByValue) { + private async removeStickyRestriction(id: string, key: GuildSettingsOfType) { const [roleId] = await readSettings(this.guild, (settings) => [settings[key]]); if (isNullish(roleId)) throw new UserError({ identifier: LanguageKeys.Misc.RestrictionNotConfigured }); return getStickyRoles(this.guild).remove(id, roleId); } - private async removeRestrictionRole(id: string, key: PickByValue) { + private async removeRestrictionRole(id: string, key: GuildSettingsOfType) { const [roleId] = await readSettings(this.guild, (settings) => [settings[key]]); if (isNullish(roleId)) throw new UserError({ identifier: LanguageKeys.Misc.RestrictionNotConfigured }); try { - await api().guilds(this.guild.id).members(id).roles(roleId).delete(); + await api().guilds.removeRoleFromMember(this.guild.id, id, roleId); } catch (error) { if ((error as DiscordAPIError).code !== RESTJSONErrorCodes.UnknownMember) throw error; } @@ -1017,7 +964,7 @@ interface RolePermissionOverwriteOption { interface RolePermissionOverwriteOptionField { options: PermissionOverwriteOptions; - permissions: Permissions; + permissions: PermissionsBitField; } export type ModerationActionOptions = Omit; diff --git a/src/lib/util/bits.ts b/src/lib/util/bits.ts index e24c5bfd2e1..5a1cb470482 100644 --- a/src/lib/util/bits.ts +++ b/src/lib/util/bits.ts @@ -1,48 +1,12 @@ -import type { Constructor } from '@sapphire/utilities'; -import { BitField, Permissions, SystemChannelFlags } from 'discord.js'; -import { max } from './common'; +import { BitField, enumToObject } from '@sapphire/bitfield'; +import { GuildSystemChannelFlags, PermissionFlagsBits } from 'discord-api-types/v10'; -function toMap(ctor: Constructor>) { - return new Map(Object.entries(Reflect.get(ctor, 'FLAGS')).map(([key, value]) => [value as N, key as S] as const)); -} - -function toInitialOffset(map: Map) { - let i: number; - let max: number; - for (i = 0, max = Math.max(...map.keys()); max !== 0; ++i, max >>= 1); - return i; -} - -function toInitialBigIntOffset(map: Map) { - let i: bigint; - let maximum: bigint; - for (i = 0n, maximum = max(...map.keys()); maximum !== 0n; ++i, maximum >>= 1n); - return i; -} - -function toArray(map: Map, maxOffset: N, bits: N): S[] { - const output: S[] = []; - - const [zeroValue, bitValue] = (typeof bits == 'bigint' ? [0n, 1n] : [0, 1]) as [N, N]; - for (let i = zeroValue; i <= maxOffset; ++i) { - const offset = (bitValue << i) as N; - if ((bits & offset) === zeroValue) continue; - - const value = map.get(offset); - if (value !== undefined) output.push(value); - } - - return output; -} - -export const permissionsFlags = toMap(Permissions); -export const permissionsOffset = toInitialBigIntOffset(permissionsFlags); +export const PermissionsBits = new BitField(PermissionFlagsBits); export function toPermissionsArray(bits: bigint) { - return toArray(permissionsFlags, permissionsOffset, bits); + return PermissionsBits.toArray(bits); } -export const channelFlags = toMap(SystemChannelFlags); -export const channelOffset = toInitialOffset(channelFlags); +export const SystemChannelFlag = new BitField(enumToObject(GuildSystemChannelFlags)); export function toChannelsArray(bits: number) { - return toArray(channelFlags, channelOffset, bits); + return SystemChannelFlag.toArray(bits); } diff --git a/src/lib/util/common/index.ts b/src/lib/util/common/index.ts index c4f876f7293..b6594290487 100644 --- a/src/lib/util/common/index.ts +++ b/src/lib/util/common/index.ts @@ -1,5 +1,5 @@ -export * from './comparators'; -export * from './guards'; -export * from './iterators'; -export * from './promises'; -export * from './times'; +export * from '#utils/common/comparators'; +export * from '#utils/common/guards'; +export * from '#utils/common/iterators'; +export * from '#utils/common/promises'; +export * from '#utils/common/times'; diff --git a/src/lib/util/common/promises.ts b/src/lib/util/common/promises.ts index a9967edc9cc..0533a6d9a97 100644 --- a/src/lib/util/common/promises.ts +++ b/src/lib/util/common/promises.ts @@ -1,13 +1,13 @@ import { container } from '@sapphire/framework'; -import { Awaitable, isThenable } from '@sapphire/utilities'; -import type { RESTJSONErrorCodes } from 'discord-api-types/v9'; +import { isThenable, type Awaitable } from '@sapphire/utilities'; +import type { RESTJSONErrorCodes } from 'discord-api-types/v10'; import { DiscordAPIError } from 'discord.js'; export async function resolveOnErrorCodes(promise: Promise, ...codes: readonly RESTJSONErrorCodes[]) { try { return await promise; } catch (error) { - if (error instanceof DiscordAPIError && codes.includes(error.code)) return null; + if (error instanceof DiscordAPIError && codes.includes(error.code as RESTJSONErrorCodes)) return null; throw error; } } diff --git a/src/lib/util/deprecate.ts b/src/lib/util/deprecate.ts index 020fe9bc206..3ac9444cc69 100644 --- a/src/lib/util/deprecate.ts +++ b/src/lib/util/deprecate.ts @@ -1,8 +1,7 @@ import { Invites } from '#lib/util/constants'; -import { ButtonBuilder, inlineCode } from '@discordjs/builders'; +import { ActionRowBuilder, ButtonBuilder, inlineCode, type MessageActionRowComponentBuilder } from '@discordjs/builders'; import { isNullishOrEmpty } from '@sapphire/utilities'; -import { ButtonStyle, type APIButtonComponent } from 'discord-api-types/v9'; -import { MessageActionRow } from 'discord.js'; +import { ButtonStyle } from 'discord-api-types/v10'; export function createDeprecatedList(options: Options) { const values = new Map(); @@ -22,13 +21,13 @@ export function createDeprecatedList(options: Options) { return values; } -export function makeRemovedMessage(alias: string, row: MessageActionRow) { +export function makeRemovedMessage(alias: string, row: ActionRowBuilder) { const content = `The command ${inlineCode(alias)} has been removed, please read more information about this change with the button below.`; return { content, components: [row], allowedMentions: { users: [], roles: [] } }; } const listFormatter = new Intl.ListFormat('en-US', { type: 'disjunction' }); -export function makeReplacedMessage(alias: string, row: MessageActionRow, list: Map) { +export function makeReplacedMessage(alias: string, row: ActionRowBuilder, list: Map) { const replacement = list.get(alias); const content = `The command ${inlineCode(alias)} has been removed${ isNullishOrEmpty(replacement) ? '' : `, please use ${listFormatter.format(replacement)} instead` @@ -36,45 +35,24 @@ export function makeReplacedMessage(alias: string, row: MessageActionRow, list: return { content, components: [row], allowedMentions: { users: [], roles: [] } }; } -export function makeRow(...buttons: readonly APIButtonComponent[]) { - return new MessageActionRow().addComponents(...buttons); +export function makeRow(...buttons: readonly ButtonBuilder[]) { + return new ActionRowBuilder().addComponents(...buttons); } -export const ButtonSkyraV7: APIButtonComponent = new ButtonBuilder() +export const ButtonSkyraV7 = new ButtonBuilder() // .setLabel('Blog Post') .setStyle(ButtonStyle.Link) - .setURL('https://blog.skyra.pw/skyra-v7') - .toJSON(); + .setURL('https://blog.skyra.pw/skyra-v7'); -export const ButtonInviteDragonite: APIButtonComponent = new ButtonBuilder() - .setLabel('Invite Dragonite') - .setStyle(ButtonStyle.Link) - .setURL(Invites.Dragonite) - .toJSON(); - -export const ButtonInviteIriss: APIButtonComponent = new ButtonBuilder() - .setLabel('Invite Iriss') - .setStyle(ButtonStyle.Link) - .setURL(Invites.Iriss) - .toJSON(); - -export const ButtonInviteNekokai: APIButtonComponent = new ButtonBuilder() - .setLabel('Invite Nekokai') - .setStyle(ButtonStyle.Link) - .setURL(Invites.Nekokai) - .toJSON(); - -export const ButtonInviteTeryl: APIButtonComponent = new ButtonBuilder() +export const ButtonInviteTeryl = new ButtonBuilder() // .setLabel('Invite Teryl') .setStyle(ButtonStyle.Link) - .setURL(Invites.Teryl) - .toJSON(); + .setURL(Invites.Teryl); -export const ButtonInviteArtiel: APIButtonComponent = new ButtonBuilder() +export const ButtonInviteArtiel = new ButtonBuilder() // .setLabel('Invite Artiel') .setStyle(ButtonStyle.Link) - .setURL(Invites.Artiel) - .toJSON(); + .setURL(Invites.Artiel); export interface Options { entries: { out: string | readonly string[]; in: string | readonly string[] }[]; diff --git a/src/lib/util/formatters.ts b/src/lib/util/formatters.ts index b61776c253c..3c704943cb5 100644 --- a/src/lib/util/formatters.ts +++ b/src/lib/util/formatters.ts @@ -1,7 +1,8 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { GuildMessage } from '#lib/types'; import { cleanMentions, getTag } from '#utils/util'; -import type { EmbedField, Guild, MessageAttachment, MessageEmbed, MessageEmbedFooter, MessageEmbedImage, User } from 'discord.js'; +import type { APIEmbedField } from 'discord-api-types/v10'; +import type { Attachment, Embed, EmbedAssetData, EmbedFooterData, Guild, User } from 'discord.js'; import type { TFunction } from 'i18next'; export function formatMessage(t: TFunction, message: GuildMessage): string { @@ -43,30 +44,11 @@ function formatContent(guild: Guild, content: string): string { .join('\n'); } -export function formatAttachment(attachment: MessageAttachment): string { +export function formatAttachment(attachment: Attachment): string { return `📂 [${attachment.name}: ${attachment.url}]`; } -function formatEmbed(guild: Guild, embed: MessageEmbed): string { - switch (embed.type) { - case 'video': - return formatEmbedVideo(embed); - case 'image': - return formatEmbedImage(embed); - default: - return formatEmbedRich(guild, embed); - } -} - -function formatEmbedVideo(embed: MessageEmbed): string { - return `📹 [${embed.url}]${embed.provider ? ` (${embed.provider.name}).` : ''}`; -} - -function formatEmbedImage(embed: MessageEmbed): string { - return `🖼️ [${embed.url}]${embed.provider ? ` (${embed.provider.name}).` : ''}`; -} - -function formatEmbedRich(guild: Guild, embed: MessageEmbed): string { +function formatEmbed(guild: Guild, embed: Embed): string { if (embed.provider === null) { const output: string[] = []; if (embed.title) output.push(formatEmbedRichTitle(embed.title)); @@ -90,7 +72,7 @@ function formatEmbedRichUrl(url: string): string { return `> 📎 ${url}`; } -function formatEmbedRichAuthor(author: Exclude): string { +function formatEmbedRichAuthor(author: Exclude): string { return `> 👤 ${author.iconURL ? `[${author.iconURL}] ` : ''}${author.name || '-'}${author.url ? ` <${author.url}>` : ''}`; } @@ -101,21 +83,21 @@ function formatEmbedRichDescription(guild: Guild, description: string): string { .join('\n'); } -function formatEmbedRichField(guild: Guild, field: EmbedField): string { +function formatEmbedRichField(guild: Guild, field: APIEmbedField): string { return `> #> ${field.name}\n${cleanMentions(guild, field.value) .split('\n') .map((line) => `> > ${line}`) .join('\n')}`; } -function formatEmbedRichImage(image: MessageEmbedImage): string { +function formatEmbedRichImage(image: EmbedAssetData): string { return `>🖼️ [${image.url}]`; } -function formatEmbedRichFooter(footer: MessageEmbedFooter): string { +function formatEmbedRichFooter(footer: EmbedFooterData): string { return `>_ ${footer.iconURL ? `[${footer.iconURL}]${footer.text ? ' - ' : ''}` : ''}${footer.text ?? ''}`; } -function formatEmbedRichProvider(embed: MessageEmbed): string { +function formatEmbedRichProvider(embed: Embed): string { return `🔖 [${embed.url}]${embed.provider ? ` (${embed.provider.name}).` : ''}`; } diff --git a/src/lib/util/functions/index.ts b/src/lib/util/functions/index.ts index 83f6dd5d0a2..dc946579e3b 100644 --- a/src/lib/util/functions/index.ts +++ b/src/lib/util/functions/index.ts @@ -1,5 +1,5 @@ -export * from './channels'; -export * from './emojis'; -export * from './guild'; -export * from './messages'; -export * from './permissions'; +export * from '#lib/util/functions/channels'; +export * from '#lib/util/functions/emojis'; +export * from '#lib/util/functions/guild'; +export * from '#lib/util/functions/messages'; +export * from '#lib/util/functions/permissions'; diff --git a/src/lib/util/functions/messages.ts b/src/lib/util/functions/messages.ts index f5a4eaa5766..15f0db5d630 100644 --- a/src/lib/util/functions/messages.ts +++ b/src/lib/util/functions/messages.ts @@ -4,10 +4,10 @@ import { floatPromise, minutes, resolveOnErrorCodes } from '#utils/common'; import { canReact, canRemoveAllReactions } from '@sapphire/discord.js-utilities'; import { container } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; -import { resolveKey, StringMap, TOptions } from '@sapphire/plugin-i18next'; +import { resolveKey, type TOptions } from '@sapphire/plugin-i18next'; import type { NonNullObject } from '@sapphire/utilities'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; -import type { Message, MessageOptions, UserResolvable } from 'discord.js'; +import { RESTJSONErrorCodes } from 'discord-api-types/v10'; +import type { Message, MessageCreateOptions, UserResolvable } from 'discord.js'; import { setTimeout as sleep } from 'node:timers/promises'; const messageCommands = new WeakMap(); @@ -45,14 +45,13 @@ async function deleteMessageImmediately(message: Message): Promise { * @returns The deleted message. */ export async function deleteMessage(message: Message, time = 0): Promise { - if (message.deleted) return message; if (time === 0) return deleteMessageImmediately(message); const lastEditedTimestamp = message.editedTimestamp; await sleep(time); // If it was deleted or edited, cancel: - if (message.deleted || message.editedTimestamp !== lastEditedTimestamp) { + if (message.editedTimestamp !== lastEditedTimestamp) { return message; } @@ -66,7 +65,7 @@ export async function deleteMessage(message: Message, time = 0): Promise { +export async function sendTemporaryMessage(message: Message, options: string | MessageCreateOptions, timer = minutes(1)): Promise { if (typeof options === 'string') options = { content: options }; const response = (await send(message, options)) as Message; @@ -107,16 +106,17 @@ export function sendLocalizedMessage(message: Message, key: LocalizedSimpleKey): * // ➡ "Pong! Current latency is 42ms." * ``` */ -export function sendLocalizedMessage(message: Message, options: LocalizedMessageOptions): Promise; +export function sendLocalizedMessage(message: Message, options: LocalizedMessageOptions): Promise; export async function sendLocalizedMessage(message: Message, options: LocalizedSimpleKey | LocalizedMessageOptions) { if (typeof options === 'string') options = { key: options }; + // @ts-expect-error 2345: Complex overloads const content = await resolveKey(message, options.key, options.formatOptions); return send(message, { ...options, content }); } type LocalizedSimpleKey = CustomGet; -type LocalizedMessageOptions = Omit & +type LocalizedMessageOptions = Omit & ( | { key: LocalizedSimpleKey; @@ -131,7 +131,7 @@ type LocalizedMessageOptions = Omit { +export async function promptForMessage(message: Message, sendOptions: string | MessageCreateOptions, time = minutes(1)): Promise { const response = await message.channel.send(sendOptions); const responses = await message.channel.awaitMessages({ filter: (msg) => msg.author === message.author, time, max: 1 }); floatPromise(deleteMessage(response)); diff --git a/src/lib/util/functions/permissions.ts b/src/lib/util/functions/permissions.ts index 34c9abca86e..4c12c8d0676 100644 --- a/src/lib/util/functions/permissions.ts +++ b/src/lib/util/functions/permissions.ts @@ -3,7 +3,8 @@ import { GuildSettings } from '#lib/database/keys'; import { readSettings } from '#lib/database/settings'; import { OWNERS } from '#root/config'; import { hasAtLeastOneKeyInMap } from '@sapphire/utilities'; -import { GuildMember, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { GuildMember } from 'discord.js'; export function isModerator(member: GuildMember) { return isGuildOwner(member) || readSettings(member, (settings) => checkModerator(member, settings) || checkAdministrator(member, settings)); @@ -23,10 +24,10 @@ export function isOwner(member: GuildMember) { function checkModerator(member: GuildMember, settings: GuildEntity) { const roles = settings[GuildSettings.Roles.Moderator]; - return roles.length === 0 ? member.permissions.has(Permissions.FLAGS.BAN_MEMBERS) : hasAtLeastOneKeyInMap(member.roles.cache, roles); + return roles.length === 0 ? member.permissions.has(PermissionFlagsBits.BanMembers) : hasAtLeastOneKeyInMap(member.roles.cache, roles); } function checkAdministrator(member: GuildMember, settings: GuildEntity) { const roles = settings[GuildSettings.Roles.Admin]; - return roles.length === 0 ? member.permissions.has(Permissions.FLAGS.MANAGE_GUILD) : hasAtLeastOneKeyInMap(member.roles.cache, roles); + return roles.length === 0 ? member.permissions.has(PermissionFlagsBits.ManageGuild) : hasAtLeastOneKeyInMap(member.roles.cache, roles); } diff --git a/src/lib/util/moderation-utilities.ts b/src/lib/util/moderation-utilities.ts index 23fcde7b55b..3ba81cc00b9 100644 --- a/src/lib/util/moderation-utilities.ts +++ b/src/lib/util/moderation-utilities.ts @@ -1,5 +1,5 @@ import type { SkyraArgs } from '#lib/structures'; -import { seconds } from './common'; +import { seconds } from '#utils/common'; export const SecondsOptions = ['s', 'sec', 'secs', 'second', 'seconds'] as const; export const MinutesOptions = ['m', 'min', 'mins', 'minute', 'minutes'] as const; diff --git a/src/lib/util/util.ts b/src/lib/util/util.ts index e7727236d19..00e0a2bd1ab 100644 --- a/src/lib/util/util.ts +++ b/src/lib/util/util.ts @@ -1,16 +1,16 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { GuildMessage } from '#lib/types'; +import { BrandingColors, ZeroWidthSpace } from '#lib/util/constants'; import { send } from '@sapphire/plugin-editable-commands'; -import { isNullishOrEmpty, Nullish, tryParseURL } from '@sapphire/utilities'; -import type { APIUser } from 'discord-api-types/v9'; +import { isNullishOrEmpty, tryParseURL, type Nullish } from '@sapphire/utilities'; +import { PermissionFlagsBits, type APIUser } from 'discord-api-types/v10'; import { - MessageEmbed, - Permissions, - type AllowedImageSize, - type DynamicImageFormat, + EmbedBuilder, type EmbedAuthorData, type Guild, type GuildChannel, + type ImageExtension, + type ImageSize, type Message, type MessageMentionTypes, type ThreadChannel, @@ -18,7 +18,6 @@ import { type UserResolvable } from 'discord.js'; import type { TFunction } from 'i18next'; -import { BrandingColors, ZeroWidthSpace } from './constants'; const ONE_TO_TEN = new Map([ [0, { emoji: '😪', color: 0x5b1100 }], @@ -148,11 +147,11 @@ export interface AvatarOptions { * * @defaultValue `'webp'` */ - extension?: DynamicImageFormat; + extension?: ImageExtension; /** * The size specified in the image URL */ - size?: AllowedImageSize; + size?: ImageSize; /** * Whether or not to prefer the static version of an image asset. */ @@ -249,6 +248,41 @@ export function cleanMentions(guild: Guild, input: string) { export const anyMentionRegExp = /<(@[!&]?|#)(\d{17,19})>/g; export const hereOrEveryoneMentionRegExp = /@(?:here|everyone)/; +/** + * Splits a message into multiple messages if it exceeds a certain length, using a specified character as the delimiter. + * @param content The message to split. + * @param options The options for splitting the message. + * @returns An array of messages split from the original message. + * @throws An error if the content cannot be split. + */ +export function splitMessage(content: string, options: SplitMessageOptions) { + if (content.length <= options.maxLength) return [content]; + + let last = 0; + const messages = [] as string[]; + while (last < content.length) { + // If the last chunk can fit the rest of the content, push it and break: + if (content.length - last <= options.maxLength) { + messages.push(content.slice(last)); + break; + } + + // Find the last best index to split the chunk: + const index = content.lastIndexOf(options.char, options.maxLength + last); + if (index === -1) throw new Error('Unable to split content.'); + + messages.push(content.slice(last, index + 1)); + last = index + 1; + } + + return messages; +} + +export interface SplitMessageOptions { + char: string; + maxLength: number; +} + /** * Extracts mentions from a body of text. * @remark Preserves the mentions in the content, if you want to remove them use `cleanMentions`. @@ -318,7 +352,7 @@ export function cast(value: unknown): T { * @example validateChannelAccess(channel, message.author) */ export function validateChannelAccess(channel: GuildChannel | ThreadChannel, user: UserResolvable) { - return (channel.guild !== null && channel.permissionsFor(user)?.has(Permissions.FLAGS.VIEW_CHANNEL)) || false; + return (channel.guild !== null && channel.permissionsFor(user)?.has(PermissionFlagsBits.ViewChannel)) || false; } /** @@ -337,7 +371,7 @@ export const shuffle = (array: T[]): T[] => { export const random = (num: number) => Math.floor(Math.random() * num); export const sendLoadingMessage = (message: T, t: TFunction): Promise => { - const embed = new MessageEmbed().setDescription(pickRandom(t(LanguageKeys.System.Loading))).setColor(BrandingColors.Secondary); + const embed = new EmbedBuilder().setDescription(pickRandom(t(LanguageKeys.System.Loading))).setColor(BrandingColors.Secondary); return send(message, { embeds: [embed] }) as Promise; }; diff --git a/src/listeners/commands/commandSuccessAnalytics.ts b/src/listeners/commands/commandSuccessAnalytics.ts deleted file mode 100644 index e7263f00a4b..00000000000 --- a/src/listeners/commands/commandSuccessAnalytics.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { SkyraCommand } from '#lib/structures'; -import { Events } from '#lib/types/Enums'; -import { ApplyOptions } from '@sapphire/decorators'; -import { CommandSuccessPayload, Listener, ListenerOptions } from '@sapphire/framework'; - -@ApplyOptions({ event: Events.CommandSuccess }) -export class UserListener extends Listener { - public run(payload: CommandSuccessPayload) { - const command = payload.command as SkyraCommand; - this.container.client.emit(Events.CommandUsageAnalytics, command.name, command.category); - } -} diff --git a/src/listeners/commands/commandDenied.ts b/src/listeners/commands/messageCommandDenied.ts similarity index 61% rename from src/listeners/commands/commandDenied.ts rename to src/listeners/commands/messageCommandDenied.ts index ad4d26361b1..1b2598557be 100644 --- a/src/listeners/commands/commandDenied.ts +++ b/src/listeners/commands/messageCommandDenied.ts @@ -1,17 +1,17 @@ import { translate } from '#lib/i18n/translate'; import { sendTemporaryMessage } from '#utils/functions'; -import { CommandDeniedPayload, Events, Listener, UserError } from '@sapphire/framework'; +import { Events, Listener, UserError, type MessageCommandDeniedPayload } from '@sapphire/framework'; import { resolveKey } from '@sapphire/plugin-i18next'; import type { Message } from 'discord.js'; -export class UserListener extends Listener { - public async run(error: UserError, { message, command }: CommandDeniedPayload) { +export class UserListener extends Listener { + public async run(error: UserError, { message, command }: MessageCommandDeniedPayload) { // `context: { silent: true }` should make UserError silent: // Use cases for this are for example permissions error when running the `eval` command. if (Reflect.get(Object(error.context), 'silent')) return; const identifier = translate(error.identifier); - return this.alert(message, await resolveKey(message, identifier, { message, command, ...(error.context as any) })); + return this.alert(message, (await resolveKey(message, identifier, { message, command, ...(error.context as any) })) as string); } private alert(message: Message, content: string) { diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/messageCommandError.ts similarity index 83% rename from src/listeners/commands/commandError.ts rename to src/listeners/commands/messageCommandError.ts index 99d61224792..d37f8c499a4 100644 --- a/src/listeners/commands/commandError.ts +++ b/src/listeners/commands/messageCommandError.ts @@ -1,23 +1,25 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { translate } from '#lib/i18n/translate'; -import type { SkyraCommand } from '#lib/structures'; +import type { SkyraArgs } from '#lib/structures'; import { OWNERS } from '#root/config'; -import { Colors, rootFolder, ZeroWidthSpace } from '#utils/constants'; +import { Colors, ZeroWidthSpace, rootFolder } from '#utils/constants'; import { sendTemporaryMessage } from '#utils/functions'; -import { Args, ArgumentError, Command, CommandErrorPayload, Events, Listener, UserError } from '@sapphire/framework'; -import { codeBlock, cutText, NonNullObject } from '@sapphire/utilities'; -import { captureException } from '@sentry/hub'; +import { Args, ArgumentError, Command, Events, Listener, UserError, type MessageCommandErrorPayload } from '@sapphire/framework'; +import { codeBlock, cutText, type NonNullObject } from '@sapphire/utilities'; +import { captureException } from '@sentry/core'; import { envIsDefined } from '@skyra/env-utilities'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; -import { DiscordAPIError, HTTPError, Message, MessageEmbed } from 'discord.js'; +import { RESTJSONErrorCodes, Routes } from 'discord-api-types/v10'; +import { DiscordAPIError, EmbedBuilder, HTTPError, Message } from 'discord.js'; import type { TFunction } from 'i18next'; const ignoredCodes = [RESTJSONErrorCodes.UnknownChannel, RESTJSONErrorCodes.UnknownMessage]; -export class UserListener extends Listener { +export class UserListener extends Listener { private readonly sentry = envIsDefined('SENTRY_URL'); - public async run(error: Error, { message, piece, parameters, args }: CommandErrorPayload) { + public async run(error: Error, { message, command, parameters, args: unknownArgs }: MessageCommandErrorPayload) { + const args = unknownArgs as SkyraArgs; + // If the error was a string or an UserError, send it to the user: if (typeof error === 'string') return this.stringError(message, args.t, error); if (error instanceof ArgumentError) return this.argumentError(message, args.t, error); @@ -31,7 +33,7 @@ export class UserListener extends Listener { } // Extract useful information about the DiscordAPIError - if (error instanceof DiscordAPIError || error instanceof HTTPError) { + if (error instanceof DiscordAPIError) { if (this.isSilencedError(args, error)) return; client.emit(Events.Error, error); } else { @@ -39,7 +41,6 @@ export class UserListener extends Listener { } // Send a detailed message: - const command = piece as SkyraCommand; await this.sendErrorChannel(message, command, parameters, error); // Emit where the error was emitted @@ -53,16 +54,16 @@ export class UserListener extends Listener { return undefined; } - private isSilencedError(args: Args, error: DiscordAPIError | HTTPError) { + private isSilencedError(args: Args, error: DiscordAPIError) { return ( // If it's an unknown channel or an unknown message, ignore: - ignoredCodes.includes(error.code) || + ignoredCodes.includes(error.code as number) || // If it's a DM message reply after a block, ignore: this.isDirectMessageReplyAfterBlock(args, error) ); } - private isDirectMessageReplyAfterBlock(args: Args, error: DiscordAPIError | HTTPError) { + private isDirectMessageReplyAfterBlock(args: Args, error: DiscordAPIError) { // When sending a message to a user who has blocked the bot, Discord replies with 50007 "Cannot send messages to this user": if (error.code !== RESTJSONErrorCodes.CannotSendMessagesToThisUser) return false; @@ -70,7 +71,7 @@ export class UserListener extends Listener { if (args.message.guild !== null) return false; // If the query was made to the message's channel, then it was a DM response: - return error.path === `/channels/${args.message.channel.id}/messages`; + return error.url === Routes.channelMessages(args.message.channel.id); } private generateUnexpectedErrorMessage(args: Args, error: Error) { @@ -103,7 +104,8 @@ export class UserListener extends Listener { if (Reflect.get(Object(error.context), 'silent')) return; const identifier = translate(error.identifier); - return this.alert(message, t(identifier, error.context as any)); + const content = t(identifier, error.context as any) as string; + return this.alert(message, content); } private alert(message: Message, content: string) { @@ -121,7 +123,7 @@ export class UserListener extends Listener { lines.splice(2, 0, this.getPathLine(error), this.getCodeLine(error)); } - const embed = new MessageEmbed().setDescription(lines.join('\n')).setColor(Colors.Red).setTimestamp(); + const embed = new EmbedBuilder().setDescription(lines.join('\n')).setColor(Colors.Red).setTimestamp(); try { await webhook.send({ embeds: [embed] }); } catch (err) { @@ -150,7 +152,7 @@ export class UserListener extends Listener { * @param error The error to format. */ private getPathLine(error: DiscordAPIError | HTTPError): string { - return `**Path**: ${error.method.toUpperCase()} ${error.path}`; + return `**Path**: ${error.method.toUpperCase()} ${error.url}`; } /** @@ -158,7 +160,7 @@ export class UserListener extends Listener { * @param error The error to format. */ private getCodeLine(error: DiscordAPIError | HTTPError): string { - return `**Code**: ${error.code}`; + return `**Code**: ${'code' in error ? error.code : error.status}`; } /** diff --git a/src/listeners/commands/commandRunAttach.ts b/src/listeners/commands/messageCommandRunAttach.ts similarity index 58% rename from src/listeners/commands/commandRunAttach.ts rename to src/listeners/commands/messageCommandRunAttach.ts index 81d6662ceb1..f9b5820acff 100644 --- a/src/listeners/commands/commandRunAttach.ts +++ b/src/listeners/commands/messageCommandRunAttach.ts @@ -1,11 +1,11 @@ import type { SkyraCommand } from '#lib/structures'; import { setCommand } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import type { Message } from 'discord.js'; -@ApplyOptions({ event: Events.CommandRun }) -export class UserListener extends Listener { +@ApplyOptions({ event: Events.MessageCommandRun }) +export class UserListener extends Listener { public run(message: Message, command: SkyraCommand) { setCommand(message, command); } diff --git a/src/listeners/commands/messageCommandSuccessAnalytics.ts b/src/listeners/commands/messageCommandSuccessAnalytics.ts new file mode 100644 index 00000000000..a73f4e728b7 --- /dev/null +++ b/src/listeners/commands/messageCommandSuccessAnalytics.ts @@ -0,0 +1,12 @@ +import type { SkyraCommand } from '#lib/structures'; +import { Events as SkyraEvents } from '#lib/types'; +import { ApplyOptions } from '@sapphire/decorators'; +import { Events, Listener, type MessageCommandSuccessPayload } from '@sapphire/framework'; + +@ApplyOptions({ event: Events.MessageCommandSuccess }) +export class UserListener extends Listener { + public run(payload: MessageCommandSuccessPayload) { + const command = payload.command as SkyraCommand; + this.container.client.emit(SkyraEvents.CommandUsageAnalytics, command.name, command.category); + } +} diff --git a/src/listeners/commands/commandSuccessAutoDelete.ts b/src/listeners/commands/messageCommandSuccessAutoDelete.ts similarity index 63% rename from src/listeners/commands/commandSuccessAutoDelete.ts rename to src/listeners/commands/messageCommandSuccessAutoDelete.ts index 5a73dc5b08b..2c9f6f7a528 100644 --- a/src/listeners/commands/commandSuccessAutoDelete.ts +++ b/src/listeners/commands/messageCommandSuccessAutoDelete.ts @@ -1,13 +1,12 @@ import { GuildSettings, readSettings } from '#lib/database'; -import { Events } from '#lib/types/Enums'; import { isGuildMessage } from '#utils/common'; import { deleteMessage } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; -import { CommandSuccessPayload, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener, type MessageCommandSuccessPayload } from '@sapphire/framework'; -@ApplyOptions({ event: Events.CommandSuccess }) -export class UserListener extends Listener { - public async run({ message }: CommandSuccessPayload) { +@ApplyOptions({ event: Events.MessageCommandSuccess }) +export class UserListener extends Listener { + public async run({ message }: MessageCommandSuccessPayload) { if (!isGuildMessage(message)) return; const commandAutoDelete = await readSettings(message.guild, GuildSettings.CommandAutoDelete); diff --git a/src/listeners/commands/commandSuccessLogger.ts b/src/listeners/commands/messageCommandSuccessLogger.ts similarity index 72% rename from src/listeners/commands/commandSuccessLogger.ts rename to src/listeners/commands/messageCommandSuccessLogger.ts index 02fecdd6182..c08fabb7c26 100644 --- a/src/listeners/commands/commandSuccessLogger.ts +++ b/src/listeners/commands/messageCommandSuccessLogger.ts @@ -1,12 +1,12 @@ import { ApplyOptions } from '@sapphire/decorators'; -import { Command, CommandSuccessPayload, Events, Listener, ListenerOptions, LogLevel } from '@sapphire/framework'; +import { Command, Events, Listener, LogLevel, type MessageCommandSuccessPayload } from '@sapphire/framework'; import type { Logger } from '@sapphire/plugin-logger'; import { cyan } from 'colorette'; import type { Guild, User } from 'discord.js'; -@ApplyOptions({ event: Events.CommandSuccess }) -export class UserListener extends Listener { - public run({ message, command }: CommandSuccessPayload) { +@ApplyOptions({ event: Events.MessageCommandSuccess }) +export class UserListener extends Listener { + public run({ message, command }: MessageCommandSuccessPayload) { const shard = this.shard(message.guild?.shardId ?? 0); const commandName = this.command(command); const author = this.author(message.author); @@ -14,7 +14,7 @@ export class UserListener extends Listener { this.container.logger.debug(`${shard} - ${commandName} ${author} ${sentAt}`); } - public onLoad() { + public override onLoad() { this.enabled = (this.container.logger as Logger).level <= LogLevel.Debug; return super.onLoad(); } diff --git a/src/listeners/errors/error.ts b/src/listeners/errors/error.ts index 9dde7eefc9a..6feab6b3dbe 100644 --- a/src/listeners/errors/error.ts +++ b/src/listeners/errors/error.ts @@ -7,10 +7,10 @@ export class UserListener extends Listener { public run(error: Error) { const { logger } = this.container; if (error instanceof DiscordAPIError) { - logger.warn(`[API ERROR] [CODE: ${error.code}] ${error.message}${NEWLINE} [PATH: ${error.method} ${error.path}]`); + logger.warn(`[API ERROR] [CODE: ${error.code}] ${error.message}${NEWLINE} [PATH: ${error.method} ${error.url}]`); logger.fatal(error.stack); } else if (error instanceof HTTPError) { - logger.warn(`[HTTP ERROR] [CODE: ${error.code}] ${error.message}${NEWLINE} [PATH: ${error.method} ${error.path}]`); + logger.warn(`[HTTP ERROR] [CODE: ${error.status}] ${error.message}${NEWLINE} [PATH: ${error.method} ${error.url}]`); logger.fatal(error.stack); } else { logger.error(error); diff --git a/src/listeners/errors/listenerError.ts b/src/listeners/errors/listenerError.ts index c1e0c73f22c..be327bc6bae 100644 --- a/src/listeners/errors/listenerError.ts +++ b/src/listeners/errors/listenerError.ts @@ -1,4 +1,4 @@ -import { Events, Listener, ListenerErrorPayload } from '@sapphire/framework'; +import { Events, Listener, type ListenerErrorPayload } from '@sapphire/framework'; export class UserListener extends Listener { public run(error: Error, context: ListenerErrorPayload) { diff --git a/src/listeners/errors/listenerErrorSentry.ts b/src/listeners/errors/listenerErrorSentry.ts index a8b2f73de14..9bd9ddf075d 100644 --- a/src/listeners/errors/listenerErrorSentry.ts +++ b/src/listeners/errors/listenerErrorSentry.ts @@ -1,5 +1,5 @@ import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerErrorPayload } from '@sapphire/framework'; +import { Events, Listener, type ListenerErrorPayload } from '@sapphire/framework'; import { captureException } from '@sentry/node'; import { envIsDefined } from '@skyra/env-utilities'; diff --git a/src/listeners/guildMessageLog.ts b/src/listeners/guildMessageLog.ts index 0ee35419fb9..62a34a921ed 100644 --- a/src/listeners/guildMessageLog.ts +++ b/src/listeners/guildMessageLog.ts @@ -1,15 +1,15 @@ -import { GuildEntity, writeSettings } from '#lib/database'; +import { writeSettings, type GuildSettingsOfType } from '#lib/database'; import { canSendEmbeds } from '@sapphire/discord.js-utilities'; import { Listener } from '@sapphire/framework'; -import { Awaitable, isNullish, Nullish, PickByValue } from '@sapphire/utilities'; -import { DiscordAPIError, Guild, HTTPError, MessageEmbed, MessageOptions, TextChannel } from 'discord.js'; +import { isNullish, type Awaitable, type Nullish } from '@sapphire/utilities'; +import { DiscordAPIError, EmbedBuilder, Guild, HTTPError, TextChannel, type MessageCreateOptions } from 'discord.js'; export class UserListener extends Listener { public async run( guild: Guild, logChannelId: string | Nullish, - key: PickByValue, - makeMessage: () => Awaitable + key: GuildSettingsOfType, + makeMessage: () => Awaitable ) { if (isNullish(logChannelId)) return; @@ -23,13 +23,13 @@ export class UserListener extends Listener { if (!canSendEmbeds(channel)) return; const processed = await makeMessage(); - const options: MessageOptions = processed instanceof MessageEmbed ? { embeds: [processed] } : processed; + const options: MessageCreateOptions = processed instanceof EmbedBuilder ? { embeds: [processed] } : processed; try { await channel.send(options); } catch (error) { this.container.logger.fatal( error instanceof DiscordAPIError || error instanceof HTTPError - ? `Failed to send '${key}' log for guild ${guild} in channel ${channel.name}. Error: [${error.code} - ${error.method} | ${error.path}] ${error.message}` + ? `Failed to send '${key}' log for guild ${guild} in channel ${channel.name}. Error: [${error.status} - ${error.method} | ${error.url}] ${error.message}` : `Failed to send '${key}' log for guild ${guild} in channel ${channel.name}. Error: ${(error as Error).message}` ); } diff --git a/src/listeners/guilds/channels/channelCreateNotify.ts b/src/listeners/guilds/channels/channelCreateNotify.ts index a5fa1b021bd..f172179ae51 100644 --- a/src/listeners/guilds/channels/channelCreateNotify.ts +++ b/src/listeners/guilds/channels/channelCreateNotify.ts @@ -5,16 +5,14 @@ import { seconds } from '#utils/common'; import { Colors, LongWidthSpace } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; import { isNsfwChannel } from '@sapphire/discord.js-utilities'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { CategoryChannel, GuildChannel, MessageEmbed, NewsChannel, PermissionOverwrites, StoreChannel, TextChannel, VoiceChannel } from 'discord.js'; +import { ChannelType, EmbedBuilder, GuildChannel, NewsChannel, OverwriteType, PermissionOverwrites, TextChannel, VoiceChannel } from 'discord.js'; import type { TFunction } from 'i18next'; -type GuildBasedChannel = TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel; - -@ApplyOptions({ event: Events.ChannelCreate }) +@ApplyOptions({ event: Events.ChannelCreate }) export class UserListener extends Listener { - public async run(next: GuildBasedChannel) { + public async run(next: GuildChannel) { const [channelId, t] = await readSettings(next.guild, (settings) => [ settings[GuildSettings.Channels.Logs.ChannelCreate], settings.getLanguage() @@ -28,30 +26,28 @@ export class UserListener extends Listener { } const changes: string[] = [...this.getChannelInformation(t, next)]; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Green) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setDescription(changes.join('\n')) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.ChannelCreate) }) .setTimestamp(); await channel.send({ embeds: [embed] }); } - private *getChannelInformation(t: TFunction, channel: GuildBasedChannel) { + private *getChannelInformation(t: TFunction, channel: GuildChannel) { yield* this.getGuildChannelInformation(t, channel); switch (channel.type) { - case 'GUILD_TEXT': - yield* this.getTextChannelInformation(t, channel); - break; - case 'GUILD_VOICE': - yield* this.getVoiceChannelInformation(t, channel); + case ChannelType.GuildText: + yield* this.getTextChannelInformation(t, channel as TextChannel); break; - case 'GUILD_NEWS': - yield* this.getNewsChannelInformation(t, channel); + case ChannelType.GuildStageVoice: + case ChannelType.GuildVoice: + yield* this.getVoiceChannelInformation(t, channel as VoiceChannel); break; - case 'GUILD_STORE': - yield* this.getStoreChannelInformation(t, channel); + case ChannelType.GuildAnnouncement: + yield* this.getNewsChannelInformation(t, channel as NewsChannel); break; default: // No Op @@ -60,7 +56,7 @@ export class UserListener extends Listener { yield* this.getChannelPermissionOverwrites(t, channel); } - private *getGuildChannelInformation(t: TFunction, channel: GuildBasedChannel) { + private *getGuildChannelInformation(t: TFunction, channel: GuildChannel) { if (channel.parentId) yield t(LanguageKeys.Events.Guilds.Logs.ChannelCreateParent, { value: `<#${channel.parentId}>` }); yield t(LanguageKeys.Events.Guilds.Logs.ChannelCreatePosition, { value: channel.position }); } @@ -101,10 +97,6 @@ export class UserListener extends Listener { if (channel.topic) yield this.displayTopic(t, channel.topic); } - private *getStoreChannelInformation(t: TFunction, channel: StoreChannel) { - if (isNsfwChannel(channel)) yield this.displayNsfw(t); - } - private displayNsfw(t: TFunction) { return t(LanguageKeys.Events.Guilds.Logs.ChannelCreateNsfw); } @@ -126,7 +118,7 @@ export class UserListener extends Listener { } private displayMention(permissions: PermissionOverwrites) { - if (permissions.type === 'member') return `<@${permissions.id}>`; + if (permissions.type === OverwriteType.Member) return `<@${permissions.id}>`; if (permissions.id === permissions.channel.guild.id) return '@everyone'; return `<@&${permissions.id}>`; } diff --git a/src/listeners/guilds/channels/channelDeleteNotify.ts b/src/listeners/guilds/channels/channelDeleteNotify.ts index 0a215bfd026..300bcb7fefb 100644 --- a/src/listeners/guilds/channels/channelDeleteNotify.ts +++ b/src/listeners/guilds/channels/channelDeleteNotify.ts @@ -2,14 +2,14 @@ import { GuildSettings, readSettings, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { Colors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { CategoryChannel, MessageEmbed, NewsChannel, StoreChannel, TextChannel, VoiceChannel } from 'discord.js'; +import { EmbedBuilder, type CategoryChannel, type NewsChannel, type TextChannel, type VoiceChannel } from 'discord.js'; import type { TFunction } from 'i18next'; -type GuildBasedChannel = TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel; +type GuildBasedChannel = TextChannel | VoiceChannel | CategoryChannel | NewsChannel; -@ApplyOptions({ event: Events.ChannelDelete }) +@ApplyOptions({ event: Events.ChannelDelete }) export class UserListener extends Listener { public async run(next: GuildBasedChannel) { const [channelId, t] = await readSettings(next.guild, (settings) => [ @@ -25,9 +25,9 @@ export class UserListener extends Listener { } const changes = [...this.getChannelInformation(t, next)]; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Red) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setDescription(changes.join('\n')) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.ChannelDelete) }) .setTimestamp(); diff --git a/src/listeners/guilds/channels/channelUpdateNotify.ts b/src/listeners/guilds/channels/channelUpdateNotify.ts index e0e25002001..2586580e104 100644 --- a/src/listeners/guilds/channels/channelUpdateNotify.ts +++ b/src/listeners/guilds/channels/channelUpdateNotify.ts @@ -5,17 +5,27 @@ import { seconds } from '#utils/common'; import { differenceBitField, differenceMap } from '#utils/common/comparators'; import { Colors, LongWidthSpace } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { GuildBasedChannelTypes, isDMChannel, isNsfwChannel, NonThreadGuildBasedChannelTypes } from '@sapphire/discord.js-utilities'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { isDMChannel, isNsfwChannel, type GuildBasedChannelTypes, type NonThreadGuildBasedChannelTypes } from '@sapphire/discord.js-utilities'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { DMChannel, GuildChannel, MessageEmbed, NewsChannel, PermissionOverwrites, StoreChannel, TextChannel, VoiceChannel } from 'discord.js'; +import { + ChannelType, + DMChannel, + EmbedBuilder, + GuildChannel, + NewsChannel, + OverwriteType, + PermissionOverwrites, + TextChannel, + VoiceChannel +} from 'discord.js'; import type { TFunction } from 'i18next'; -type ChannelType = DMChannel | GuildChannel; +type Channel = DMChannel | GuildChannel; -@ApplyOptions({ event: Events.ChannelUpdate }) +@ApplyOptions({ event: Events.ChannelUpdate }) export class UserListener extends Listener { - public async run(previous: ChannelType, next: ChannelType) { + public async run(previous: Channel, next: Channel) { if (isDMChannel(next)) return; const [channelId, t] = await readSettings(next.guild, (settings) => [ @@ -33,9 +43,9 @@ export class UserListener extends Listener { const changes: string[] = [...this.differenceChannel(t, previous as GuildBasedChannelTypes, next as GuildBasedChannelTypes)]; if (changes.length === 0) return; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Yellow) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setDescription(changes.join('\n')) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.ChannelUpdate) }) .setTimestamp(); @@ -43,34 +53,32 @@ export class UserListener extends Listener { } private *differenceChannel(t: TFunction, previous: GuildBasedChannelTypes, next: GuildBasedChannelTypes) { - const isThread = next.isThread(); - yield* this.differenceGuildChannel(t, previous, next); + + const isThread = next.isThread(); if (!isThread) { - yield* this.differencePositions(t, previous as NonThreadGuildBasedChannelTypes, next); + yield* this.differencePositions(t, previous as NonThreadGuildBasedChannelTypes, next as NonThreadGuildBasedChannelTypes); } if (previous.type !== next.type) return; switch (next.type) { - case 'GUILD_TEXT': + case ChannelType.GuildText: yield* this.differenceTextChannel(t, previous as TextChannel, next as TextChannel); break; - case 'GUILD_VOICE': + case ChannelType.GuildStageVoice: + case ChannelType.GuildVoice: yield* this.differenceVoiceChannel(t, previous as VoiceChannel, next as VoiceChannel); break; - case 'GUILD_NEWS': + case ChannelType.GuildAnnouncement: yield* this.differenceNewsChannel(t, previous as NewsChannel, next as NewsChannel); break; - case 'GUILD_STORE': - yield* this.differenceStoreChannel(t, previous as StoreChannel, next as StoreChannel); - break; default: // No Op } if (!isThread) { - yield* this.differencePermissionOverwrites(t, previous as NonThreadGuildBasedChannelTypes, next); + yield* this.differencePermissionOverwrites(t, previous as NonThreadGuildBasedChannelTypes, next as NonThreadGuildBasedChannelTypes); } } @@ -191,10 +199,6 @@ export class UserListener extends Listener { if (previous.topic !== next.topic) yield this.displayTopic(t, previous.topic, next.topic); } - private *differenceStoreChannel(t: TFunction, previous: StoreChannel, next: StoreChannel) { - if (isNsfwChannel(previous) !== isNsfwChannel(next)) yield this.displayNsfw(t, isNsfwChannel(previous), isNsfwChannel(next)); - } - private displayNsfw(t: TFunction, previous: boolean, next: boolean) { return t(LanguageKeys.Events.Guilds.Logs.ChannelUpdateNsfw, { previous: t(previous ? LanguageKeys.Globals.Yes : LanguageKeys.Globals.No), @@ -225,7 +229,7 @@ export class UserListener extends Listener { } private displayMention(permissions: PermissionOverwrites) { - if (permissions.type === 'member') return `<@${permissions.id}>`; + if (permissions.type === OverwriteType.Member) return `<@${permissions.id}>`; if (permissions.id === permissions.channel.guild.id) return '@everyone'; return `<@&${permissions.id}>`; } diff --git a/src/listeners/guilds/emojis/emojiCreateNotify.ts b/src/listeners/guilds/emojis/emojiCreateNotify.ts index 4b90b5a3a5c..db52901a874 100644 --- a/src/listeners/guilds/emojis/emojiCreateNotify.ts +++ b/src/listeners/guilds/emojis/emojiCreateNotify.ts @@ -2,12 +2,12 @@ import { GuildSettings, readSettings, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { Colors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { GuildEmoji, MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, GuildEmoji, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ event: Events.GuildEmojiCreate }) +@ApplyOptions({ event: Events.GuildEmojiCreate }) export class UserListener extends Listener { public async run(next: GuildEmoji) { const [channelId, t] = await readSettings(next.guild, (settings) => [ @@ -23,10 +23,10 @@ export class UserListener extends Listener { } const changes: string[] = [...this.getEmojiInformation(t, next)]; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Green) .setThumbnail(next.url) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setDescription(changes.join('\n')) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.EmojiCreate) }) .setTimestamp(); diff --git a/src/listeners/guilds/emojis/emojiDeleteNotify.ts b/src/listeners/guilds/emojis/emojiDeleteNotify.ts index adc0ce4c9fc..811147d9a8b 100644 --- a/src/listeners/guilds/emojis/emojiDeleteNotify.ts +++ b/src/listeners/guilds/emojis/emojiDeleteNotify.ts @@ -2,11 +2,11 @@ import { GuildSettings, readSettings, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { Colors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { GuildEmoji, MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, GuildEmoji, TextChannel } from 'discord.js'; -@ApplyOptions({ event: Events.GuildEmojiDelete }) +@ApplyOptions({ event: Events.GuildEmojiDelete }) export class UserListener extends Listener { public async run(next: GuildEmoji) { const [channelId, t] = await readSettings(next.guild, (settings) => [ @@ -21,10 +21,10 @@ export class UserListener extends Listener { return; } - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Red) .setThumbnail(next.url) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.EmojiDelete) }) .setTimestamp(); await channel.send({ embeds: [embed] }); diff --git a/src/listeners/guilds/emojis/emojiUpdateNotify.ts b/src/listeners/guilds/emojis/emojiUpdateNotify.ts index 6e830375446..b4e986098fe 100644 --- a/src/listeners/guilds/emojis/emojiUpdateNotify.ts +++ b/src/listeners/guilds/emojis/emojiUpdateNotify.ts @@ -3,12 +3,12 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { differenceMap } from '#utils/common/comparators'; import { Colors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { GuildEmoji, MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, GuildEmoji, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ event: Events.GuildEmojiUpdate }) +@ApplyOptions({ event: Events.GuildEmojiUpdate }) export class UserListener extends Listener { public async run(previous: GuildEmoji, next: GuildEmoji) { const [channelId, t] = await readSettings(next.guild, (settings) => [ @@ -26,10 +26,10 @@ export class UserListener extends Listener { const changes: string[] = [...this.differenceEmoji(t, previous, next)]; if (changes.length === 0) return; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Yellow) .setThumbnail(next.url) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setDescription(changes.join('\n')) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.EmojiUpdate) }) .setTimestamp(); diff --git a/src/listeners/guilds/guildUpdateNotify.ts b/src/listeners/guilds/guildUpdateNotify.ts index e085204474b..b4695d1ba24 100644 --- a/src/listeners/guilds/guildUpdateNotify.ts +++ b/src/listeners/guilds/guildUpdateNotify.ts @@ -5,27 +5,26 @@ import { seconds } from '#utils/common'; import { differenceArray, differenceBitField } from '#utils/common/comparators'; import { Colors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; import { - DefaultMessageNotificationLevel, - ExplicitContentFilterLevel, - Guild, - GuildFeatures, - MessageEmbed, - MFALevel, - PremiumTier, - SystemChannelFlags, - TextChannel, - VerificationLevel + EmbedBuilder, + GuildMFALevel, + type Guild, + type GuildDefaultMessageNotifications, + type GuildExplicitContentFilter, + type GuildFeature, + type GuildPremiumTier, + type GuildVerificationLevel, + type SystemChannelFlagsBitField, + type TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; -type MessageNotifications = DefaultMessageNotificationLevel | number; -type ChannelFlags = Readonly; -type Features = readonly GuildFeatures[]; +type ChannelFlags = Readonly; +type Features = readonly `${GuildFeature}`[]; -@ApplyOptions({ event: Events.GuildUpdate }) +@ApplyOptions({ event: Events.GuildUpdate }) export class UserListener extends Listener { public async run(previous: Guild, next: Guild) { const [channelId, t] = await readSettings(next, (settings) => [ @@ -43,9 +42,9 @@ export class UserListener extends Listener { const changes: string[] = [...this.differenceGuild(t, previous, next)]; if (changes.length === 0) return; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Yellow) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setDescription(changes.join('\n')) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.ServerUpdate) }) .setTimestamp(); @@ -170,7 +169,11 @@ export class UserListener extends Listener { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdateBanner, { previous, next }); } - private displayDefaultMessageNotifications(t: TFunction, previous: MessageNotifications, next: MessageNotifications): string { + private displayDefaultMessageNotifications( + t: TFunction, + previous: GuildDefaultMessageNotifications, + next: GuildDefaultMessageNotifications + ): string { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdateDefaultMessageNotifications, { previous, next }); } @@ -186,7 +189,7 @@ export class UserListener extends Listener { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdateDiscoverySplash, { previous, next }); } - private displayExplicitContentFilter(t: TFunction, previous: ExplicitContentFilterLevel, next: ExplicitContentFilterLevel): string { + private displayExplicitContentFilter(t: TFunction, previous: GuildExplicitContentFilter, next: GuildExplicitContentFilter): string { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdateExplicitContentFilter, { previous, next }); } @@ -215,8 +218,12 @@ export class UserListener extends Listener { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdateMaximumMembers, { previous, next }); } - private displayMfaLevel(t: TFunction, next: MFALevel): string { - return t(next === 'ELEVATED' ? LanguageKeys.Events.Guilds.Logs.ServerUpdateMfaAdded : LanguageKeys.Events.Guilds.Logs.ServerUpdateMfaRemoved); + private displayMfaLevel(t: TFunction, next: GuildMFALevel): string { + return t( + next === GuildMFALevel.Elevated + ? LanguageKeys.Events.Guilds.Logs.ServerUpdateMfaAdded + : LanguageKeys.Events.Guilds.Logs.ServerUpdateMfaRemoved + ); } private displayName(t: TFunction, previous: string, next: string): string { @@ -239,7 +246,7 @@ export class UserListener extends Listener { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdatePremiumSubscriptionCount, { previous, next }); } - private displayPremiumTier(t: TFunction, previous: PremiumTier, next: PremiumTier): string { + private displayPremiumTier(t: TFunction, previous: GuildPremiumTier, next: GuildPremiumTier): string { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdatePremiumTier, { previous, next }); } @@ -287,7 +294,7 @@ export class UserListener extends Listener { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdateVanityUrl, { previous, next }); } - private displayVerificationLevel(t: TFunction, previous: VerificationLevel, next: VerificationLevel): string { + private displayVerificationLevel(t: TFunction, previous: GuildVerificationLevel, next: GuildVerificationLevel): string { return t(LanguageKeys.Events.Guilds.Logs.ServerUpdateVerificationLevel, { previous, next }); } diff --git a/src/listeners/guilds/members/guildMemberAdd.ts b/src/listeners/guilds/members/guildMemberAdd.ts index 4a6aa777e0e..df3076ec37d 100644 --- a/src/listeners/guilds/members/guildMemberAdd.ts +++ b/src/listeners/guilds/members/guildMemberAdd.ts @@ -6,9 +6,8 @@ import { Colors } from '#utils/constants'; import { getStickyRoles } from '#utils/functions'; import { getFullEmbedAuthor } from '#utils/util'; import { Listener } from '@sapphire/framework'; -import { GuildMember, MessageEmbed, Permissions } from 'discord.js'; - -const { FLAGS } = Permissions; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, GuildMember } from 'discord.js'; export class UserListener extends Listener { public async run(member: GuildMember) { @@ -17,7 +16,7 @@ export class UserListener extends Listener { } private async handleStickyRoles(member: GuildMember) { - if (!member.guild.members.me!.permissions.has(FLAGS.MANAGE_ROLES)) return false; + if (!member.guild.members.me!.permissions.has(PermissionFlagsBits.ManageRoles)) return false; const stickyRoles = await getStickyRoles(member).fetch(member.id); if (stickyRoles.length === 0) return false; @@ -36,7 +35,7 @@ export class UserListener extends Listener { // Handle log this.container.client.emit(Events.GuildMessageLog, member.guild, logChannelId, key, () => - new MessageEmbed() + new EmbedBuilder() .setColor(Colors.Amber) .setAuthor(getFullEmbedAuthor(member.user)) .setDescription( diff --git a/src/listeners/guilds/members/guildMemberUpdateNicknameNotify.ts b/src/listeners/guilds/members/guildMemberUpdateNicknameNotify.ts index e2e9f1647e4..60af13670d3 100644 --- a/src/listeners/guilds/members/guildMemberUpdateNicknameNotify.ts +++ b/src/listeners/guilds/members/guildMemberUpdateNicknameNotify.ts @@ -4,12 +4,12 @@ import { Events } from '#lib/types/Enums'; import { Colors } from '#utils/constants'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { GuildMember, MessageEmbed } from 'discord.js'; +import { EmbedBuilder, GuildMember } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ event: Events.GuildMemberUpdate }) +@ApplyOptions({ event: Events.GuildMemberUpdate }) export class UserListener extends Listener { public async run(previous: GuildMember, next: GuildMember) { const key = GuildSettings.Channels.Logs.MemberNickNameUpdate; @@ -22,7 +22,7 @@ export class UserListener extends Listener { const { user } = next; if (prevNickname !== nextNickname) { this.container.client.emit(Events.GuildMessageLog, next.guild, logChannelId, key, () => - new MessageEmbed() + new EmbedBuilder() .setColor(Colors.Yellow) .setAuthor(getFullEmbedAuthor(user)) .setDescription(this.getNameDescription(t, prevNickname, nextNickname)) diff --git a/src/listeners/guilds/members/guildMemberUpdateRolesNotify.ts b/src/listeners/guilds/members/guildMemberUpdateRolesNotify.ts index 026c98956b4..8812d9ecfba 100644 --- a/src/listeners/guilds/members/guildMemberUpdateRolesNotify.ts +++ b/src/listeners/guilds/members/guildMemberUpdateRolesNotify.ts @@ -4,12 +4,12 @@ import { Events } from '#lib/types/Enums'; import { Colors } from '#utils/constants'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { GuildMember, MessageEmbed } from 'discord.js'; +import { EmbedBuilder, GuildMember } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ event: Events.GuildMemberUpdate }) +@ApplyOptions({ event: Events.GuildMemberUpdate }) export class UserListener extends Listener { public async run(previous: GuildMember, next: GuildMember) { const key = GuildSettings.Channels.Logs.MemberRoleUpdate; @@ -39,7 +39,7 @@ export class UserListener extends Listener { // Set the Role change log this.container.client.emit(Events.GuildMessageLog, next.guild, logChannelId, key, () => - new MessageEmbed() + new EmbedBuilder() .setColor(Colors.Yellow) .setAuthor(getFullEmbedAuthor(user)) .setDescription(this.getRoleDescription(t, addedRoles, removedRoles) || t(LanguageKeys.Events.Guilds.Members.GuildMemberNoUpdate)) diff --git a/src/listeners/guilds/members/notMutedMemberAddInitialRole.ts b/src/listeners/guilds/members/notMutedMemberAddInitialRole.ts index edff8cb6596..bbef51c4515 100644 --- a/src/listeners/guilds/members/notMutedMemberAddInitialRole.ts +++ b/src/listeners/guilds/members/notMutedMemberAddInitialRole.ts @@ -1,10 +1,10 @@ import { GuildSettings, readSettings, writeSettings } from '#lib/database'; import { Events } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import type { GuildMember } from 'discord.js'; -@ApplyOptions({ event: Events.NotMutedMemberAdd }) +@ApplyOptions({ event: Events.NotMutedMemberAdd }) export class UserListener extends Listener { public async run(member: GuildMember) { const [initial, initialHumans, initialBots] = await readSettings(member, [ diff --git a/src/listeners/guilds/members/notMutedMemberAddNotify.ts b/src/listeners/guilds/members/notMutedMemberAddNotify.ts index cb62ad7e0d5..dc5cf1df93a 100644 --- a/src/listeners/guilds/members/notMutedMemberAddNotify.ts +++ b/src/listeners/guilds/members/notMutedMemberAddNotify.ts @@ -4,11 +4,11 @@ import { Events } from '#lib/types/Enums'; import { Colors } from '#utils/constants'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { GuildMember, MessageEmbed } from 'discord.js'; +import { EmbedBuilder, GuildMember } from 'discord.js'; -@ApplyOptions({ event: Events.NotMutedMemberAdd }) +@ApplyOptions({ event: Events.NotMutedMemberAdd }) export class UserListener extends Listener { public async run(member: GuildMember) { const key = GuildSettings.Channels.Logs.MemberAdd; @@ -16,7 +16,7 @@ export class UserListener extends Listener { if (isNullish(logChannelId)) return; this.container.client.emit(Events.GuildMessageLog, member.guild, logChannelId, key, () => - new MessageEmbed() + new EmbedBuilder() .setColor(Colors.Green) .setAuthor(getFullEmbedAuthor(member.user)) .setDescription( diff --git a/src/listeners/guilds/members/rawGuildMemberRemove.ts b/src/listeners/guilds/members/rawGuildMemberRemove.ts index 92db8b75496..2a018d1ec18 100644 --- a/src/listeners/guilds/members/rawGuildMemberRemove.ts +++ b/src/listeners/guilds/members/rawGuildMemberRemove.ts @@ -1,9 +1,9 @@ import { Events } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import { GatewayDispatchEvents, GatewayGuildMemberRemoveDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import { GatewayDispatchEvents, type GatewayGuildMemberRemoveDispatch } from 'discord-api-types/v10'; -@ApplyOptions({ event: GatewayDispatchEvents.GuildMemberRemove, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.GuildMemberRemove, emitter: 'ws' }) export class UserListener extends Listener { public run(data: GatewayGuildMemberRemoveDispatch['d']) { const guild = this.container.client.guilds.cache.get(data.guild_id); diff --git a/src/listeners/guilds/members/rawGuildMemberUpdate.ts b/src/listeners/guilds/members/rawGuildMemberUpdate.ts index f9c5c5a8b6a..1e4c9d55a29 100644 --- a/src/listeners/guilds/members/rawGuildMemberUpdate.ts +++ b/src/listeners/guilds/members/rawGuildMemberUpdate.ts @@ -2,19 +2,19 @@ import { GuildSettings, readSettings } from '#lib/database'; import { api } from '#lib/discord/Api'; import { floatPromise } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { AuditLogEvent, GatewayDispatchEvents, - GatewayGuildMemberUpdateDispatch, - RESTGetAPIAuditLogQuery, - RESTGetAPIAuditLogResult -} from 'discord-api-types/v9'; -import { Guild, Permissions } from 'discord.js'; + PermissionFlagsBits, + type GatewayGuildMemberUpdateDispatch, + type RESTGetAPIAuditLogResult +} from 'discord-api-types/v10'; +import { Guild, PermissionsBitField } from 'discord.js'; -@ApplyOptions({ event: GatewayDispatchEvents.GuildMemberUpdate, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.GuildMemberUpdate, emitter: 'ws' }) export class UserListener extends Listener { - private readonly requiredPermissions = new Permissions(Permissions.FLAGS.VIEW_AUDIT_LOG); + private readonly requiredPermissions = new PermissionsBitField(PermissionFlagsBits.ViewAuditLog); public run(data: GatewayGuildMemberUpdateDispatch['d']) { const guild = this.container.client.guilds.cache.get(data.guild_id); @@ -53,12 +53,9 @@ export class UserListener extends Listener { // If the user does not have multiple roles from any set cancel if (!hasMultipleRolesInOneSet) return; - const query: RESTGetAPIAuditLogQuery = { + const auditLogs = await api().guilds.getAuditLogs(guild.id, { limit: 10, action_type: AuditLogEvent.MemberRoleUpdate - }; - const auditLogs = await api().guilds(guild.id)['audit-logs'].get({ - query }); const updatedRoleId = this.getChange(auditLogs, data.user!.id); @@ -69,10 +66,7 @@ export class UserListener extends Listener { if (set.roles.includes(updatedRoleId)) memberRoles = memberRoles.filter((id) => !set.roles.includes(id) || id === updatedRoleId); } - await api() - .guilds(guild.id) - .members(data.user!.id) - .patch({ data: { roles: memberRoles }, reason: 'Automatic Role Group Modification' }); + await api().guilds.editMember(guild.id, data.user.id, { roles: memberRoles }, { reason: 'Automatic Role Set Modification' }); } private getChange(results: RESTGetAPIAuditLogResult, userId: string): string | null { diff --git a/src/listeners/guilds/members/rawMemberRemoveNotify.ts b/src/listeners/guilds/members/rawMemberRemoveNotify.ts index af2cae0bc6a..3fb8385917f 100644 --- a/src/listeners/guilds/members/rawMemberRemoveNotify.ts +++ b/src/listeners/guilds/members/rawMemberRemoveNotify.ts @@ -6,12 +6,12 @@ import { getModeration } from '#utils/functions'; import { TypeCodes } from '#utils/moderationConstants'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import type { GatewayGuildMemberRemoveDispatch } from 'discord-api-types/v9'; -import { Guild, GuildMember, MessageEmbed } from 'discord.js'; +import type { GatewayGuildMemberRemoveDispatch } from 'discord-api-types/v10'; +import { EmbedBuilder, Guild, GuildMember } from 'discord.js'; -@ApplyOptions({ event: Events.RawMemberRemove }) +@ApplyOptions({ event: Events.RawMemberRemove }) export class UserListener extends Listener { public async run(guild: Guild, member: GuildMember | null, { user }: GatewayGuildMemberRemoveDispatch['d']) { const key = GuildSettings.Channels.Logs.MemberRemove; @@ -30,7 +30,7 @@ export class UserListener extends Listener { const time = this.processJoinedTimestamp(member); this.container.client.emit(Events.GuildMessageLog, guild, logChannelId, key, () => - new MessageEmbed() + new EmbedBuilder() .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(user)) .setDescription( diff --git a/src/listeners/guilds/messages/guildUserMessageImageNotify.ts b/src/listeners/guilds/messages/guildUserMessageImageNotify.ts index a36efca8a36..3c1e042dd5a 100644 --- a/src/listeners/guilds/messages/guildUserMessageImageNotify.ts +++ b/src/listeners/guilds/messages/guildUserMessageImageNotify.ts @@ -6,9 +6,9 @@ import { Colors } from '#utils/constants'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { FetchResultTypes, fetch } from '@sapphire/fetch'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { isNullish, isNumber } from '@sapphire/utilities'; -import { MessageAttachment, MessageEmbed, MessageOptions, TextChannel } from 'discord.js'; +import { AttachmentBuilder, EmbedBuilder, TextChannel, type MessageCreateOptions } from 'discord.js'; import { extname } from 'node:path'; import { URL } from 'node:url'; @@ -17,7 +17,7 @@ const MAXIMUM_SIZE = 300; // 1024 * 1024 = 1 megabyte const MAXIMUM_LENGTH = 1024 * 1024; -@ApplyOptions({ event: Events.GuildUserMessage }) +@ApplyOptions({ event: Events.GuildUserMessage }) export class UserListener extends Listener { public async run(message: GuildMessage) { // If there are no attachments, do not post: @@ -64,8 +64,8 @@ export class UserListener extends Listener { const buffer = Buffer.from(await (await result.blob()).arrayBuffer()); const filename = `image${extname(url.pathname)}`; - this.container.client.emit(Events.GuildMessageLog, message.guild, logChannelId, key, (): MessageOptions => { - const embed = new MessageEmbed() + this.container.client.emit(Events.GuildMessageLog, message.guild, logChannelId, key, (): MessageCreateOptions => { + const embed = new EmbedBuilder() .setColor(Colors.Yellow) .setAuthor(getFullEmbedAuthor(message.author, message.url)) .setDescription(`[${t(LanguageKeys.Misc.JumpTo)}](${message.url})`) @@ -73,7 +73,7 @@ export class UserListener extends Listener { .setImage(`attachment://${filename}`) .setTimestamp(); - return { embeds: [embed], files: [new MessageAttachment(buffer, filename)] }; + return { embeds: [embed], files: [new AttachmentBuilder(buffer, { name: filename })] }; }); } catch (error) { this.container.logger.fatal(`ImageLogs[${error}] ${url}`); diff --git a/src/listeners/guilds/rawGuildCreateMemberFetch.ts b/src/listeners/guilds/rawGuildCreateMemberFetch.ts index 65411897f87..abcf9d6ffd3 100644 --- a/src/listeners/guilds/rawGuildCreateMemberFetch.ts +++ b/src/listeners/guilds/rawGuildCreateMemberFetch.ts @@ -1,8 +1,8 @@ import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import { GatewayDispatchEvents, GatewayGuildCreateDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import { GatewayDispatchEvents, type GatewayGuildCreateDispatch } from 'discord-api-types/v10'; -@ApplyOptions({ event: GatewayDispatchEvents.GuildCreate, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.GuildCreate, emitter: 'ws' }) export class UserListener extends Listener { public run(data: GatewayGuildCreateDispatch['d'], shardId: number) { this.container.client.guildMemberFetchQueue.add(shardId, data.id); diff --git a/src/listeners/guilds/rawGuildDelete.ts b/src/listeners/guilds/rawGuildDelete.ts index 5e8b16f5a06..b2ec7dfef7e 100644 --- a/src/listeners/guilds/rawGuildDelete.ts +++ b/src/listeners/guilds/rawGuildDelete.ts @@ -1,8 +1,8 @@ import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import { GatewayDispatchEvents, GatewayGuildDeleteDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import { GatewayDispatchEvents, type GatewayGuildDeleteDispatch } from 'discord-api-types/v10'; -@ApplyOptions({ event: GatewayDispatchEvents.GuildDelete, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.GuildDelete, emitter: 'ws' }) export class UserListener extends Listener { public run(data: GatewayGuildDeleteDispatch['d']) { if (data.unavailable) return; diff --git a/src/listeners/guilds/rawGuildDeleteMemberFetch.ts b/src/listeners/guilds/rawGuildDeleteMemberFetch.ts index 24d241a0054..883cc1be8a1 100644 --- a/src/listeners/guilds/rawGuildDeleteMemberFetch.ts +++ b/src/listeners/guilds/rawGuildDeleteMemberFetch.ts @@ -1,8 +1,8 @@ import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import { GatewayDispatchEvents, GatewayGuildDeleteDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import { GatewayDispatchEvents, type GatewayGuildDeleteDispatch } from 'discord-api-types/v10'; -@ApplyOptions({ event: GatewayDispatchEvents.GuildDelete, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.GuildDelete, emitter: 'ws' }) export class UserListener extends Listener { public run(data: GatewayGuildDeleteDispatch['d'], shardId: number) { this.container.client.guildMemberFetchQueue.remove(shardId, data.id); diff --git a/src/listeners/guilds/roles/roleCreateNotify.ts b/src/listeners/guilds/roles/roleCreateNotify.ts index 9f6ee412907..2bd4954afc4 100644 --- a/src/listeners/guilds/roles/roleCreateNotify.ts +++ b/src/listeners/guilds/roles/roleCreateNotify.ts @@ -3,12 +3,12 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; import { toPermissionsArray } from '#utils/bits'; import { Colors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { MessageEmbed, Role, TextChannel } from 'discord.js'; +import { EmbedBuilder, Role, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ event: Events.GuildRoleCreate }) +@ApplyOptions({ event: Events.GuildRoleCreate }) export class UserListener extends Listener { public async run(next: Role) { const [channelId, t] = await readSettings(next, (settings) => [settings[GuildSettings.Channels.Logs.RoleCreate], settings.getLanguage()]); @@ -21,9 +21,9 @@ export class UserListener extends Listener { } const changes: string[] = [...this.getRoleInformation(t, next)]; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Green) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setDescription(changes.join('\n')) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.RoleCreate) }) .setTimestamp(); diff --git a/src/listeners/guilds/roles/roleDeleteNotify.ts b/src/listeners/guilds/roles/roleDeleteNotify.ts index 1931a1eb2dd..cd650874687 100644 --- a/src/listeners/guilds/roles/roleDeleteNotify.ts +++ b/src/listeners/guilds/roles/roleDeleteNotify.ts @@ -2,11 +2,11 @@ import { GuildSettings, readSettings, writeSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { Colors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { MessageEmbed, Role, TextChannel } from 'discord.js'; +import { EmbedBuilder, Role, TextChannel } from 'discord.js'; -@ApplyOptions({ event: Events.GuildRoleDelete }) +@ApplyOptions({ event: Events.GuildRoleDelete }) export class UserListener extends Listener { public async run(role: Role) { const [channelId, t] = await readSettings(role, (settings) => [settings[GuildSettings.Channels.Logs.RoleDelete], settings.getLanguage()]); @@ -18,9 +18,9 @@ export class UserListener extends Listener { return; } - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Red) - .setAuthor({ name: `${role.name} (${role.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${role.name} (${role.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.RoleDelete) }) .setTimestamp(); await channel.send({ embeds: [embed] }); diff --git a/src/listeners/guilds/roles/roleUpdateNotify.ts b/src/listeners/guilds/roles/roleUpdateNotify.ts index 1ed22bd6e5f..6ca47b57667 100644 --- a/src/listeners/guilds/roles/roleUpdateNotify.ts +++ b/src/listeners/guilds/roles/roleUpdateNotify.ts @@ -4,12 +4,12 @@ import { toPermissionsArray } from '#utils/bits'; import { differenceBitField } from '#utils/common/comparators'; import { Colors } from '#utils/constants'; import { ApplyOptions } from '@sapphire/decorators'; -import { Events, Listener, ListenerOptions } from '@sapphire/framework'; +import { Events, Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; -import { MessageEmbed, Role, TextChannel } from 'discord.js'; +import { EmbedBuilder, Role, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ event: Events.GuildRoleUpdate }) +@ApplyOptions({ event: Events.GuildRoleUpdate }) export class UserListener extends Listener { public async run(previous: Role, next: Role) { const [channelId, t] = await readSettings(next, (settings) => [settings[GuildSettings.Channels.Logs.RoleUpdate], settings.getLanguage()]); @@ -24,9 +24,9 @@ export class UserListener extends Listener { const changes: string[] = [...this.differenceRole(t, previous, next)]; if (changes.length === 0) return; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(Colors.Yellow) - .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, format: 'png', dynamic: true }) ?? undefined }) + .setAuthor({ name: `${next.name} (${next.id})`, iconURL: channel.guild.iconURL({ size: 64, extension: 'png' }) ?? undefined }) .setDescription(changes.join('\n')) .setFooter({ text: t(LanguageKeys.Events.Guilds.Logs.RoleUpdate) }) .setTimestamp(); diff --git a/src/listeners/mentionSpamExceeded.ts b/src/listeners/mentionSpamExceeded.ts index d57606e7c1f..846d6f0d18d 100644 --- a/src/listeners/mentionSpamExceeded.ts +++ b/src/listeners/mentionSpamExceeded.ts @@ -19,7 +19,7 @@ export class UserListener extends Listener { const lock = moderation.createLock(); try { await message.guild.members - .ban(message.author.id, { days: 0, reason: t(LanguageKeys.Events.NoMentionSpam.Footer) }) + .ban(message.author.id, { deleteMessageSeconds: 0, reason: t(LanguageKeys.Events.NoMentionSpam.Footer) }) .catch((error) => this.container.client.emit(Events.Error, error)); await message.channel .send(t(LanguageKeys.Events.NoMentionSpam.Message, { userId: message.author.id, userTag: getTag(message.author) })) diff --git a/src/listeners/messages/guildMessageDeleteNotify.ts b/src/listeners/messages/guildMessageDeleteNotify.ts index 22a8cd47002..eb16bba88bb 100644 --- a/src/listeners/messages/guildMessageDeleteNotify.ts +++ b/src/listeners/messages/guildMessageDeleteNotify.ts @@ -6,11 +6,11 @@ import { Colors } from '#utils/constants'; import { getContent, getFullEmbedAuthor, getImage } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { isNsfwChannel } from '@sapphire/discord.js-utilities'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { cutText, isNullish } from '@sapphire/utilities'; -import { MessageEmbed } from 'discord.js'; +import { EmbedBuilder } from 'discord.js'; -@ApplyOptions({ event: Events.GuildMessageDelete }) +@ApplyOptions({ event: Events.GuildMessageDelete }) export class UserListener extends Listener { public async run(message: GuildMessage) { const key = GuildSettings.Channels.Logs[isNsfwChannel(message.channel) ? 'MessageDeleteNsfw' : 'MessageDelete']; @@ -28,7 +28,7 @@ export class UserListener extends Listener { if (ignoredAll.some((id) => id === message.channel.id || message.channel.parentId === id)) return; this.container.client.emit(Events.GuildMessageLog, message.guild, logChannelId, key, () => - new MessageEmbed() + new EmbedBuilder() .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(message.author, message.url)) .setDescription(cutText(getContent(message) || '', 1900)) diff --git a/src/listeners/messages/guildMessageDeleteRichDisplay.ts b/src/listeners/messages/guildMessageDeleteRichDisplay.ts index e234a21081a..5c782323c80 100644 --- a/src/listeners/messages/guildMessageDeleteRichDisplay.ts +++ b/src/listeners/messages/guildMessageDeleteRichDisplay.ts @@ -2,9 +2,9 @@ import { SkyraLazyPaginatedMessage, SkyraPaginatedMessage } from '#lib/structure import type { GuildMessage } from '#lib/types'; import { Events } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; -@ApplyOptions({ event: Events.GuildMessageDelete }) +@ApplyOptions({ event: Events.GuildMessageDelete }) export class UserListener extends Listener { public run(message: GuildMessage) { SkyraPaginatedMessage.messages.get(message.id)?.collector?.stop(); diff --git a/src/listeners/messages/guildMessageDeleteSnipe.ts b/src/listeners/messages/guildMessageDeleteSnipe.ts index a2b63e932cd..75f9451b8a3 100644 --- a/src/listeners/messages/guildMessageDeleteSnipe.ts +++ b/src/listeners/messages/guildMessageDeleteSnipe.ts @@ -2,9 +2,9 @@ import type { GuildMessage } from '#lib/types'; import { Events } from '#lib/types/Enums'; import { setSnipedMessage } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; -@ApplyOptions({ event: Events.GuildMessageDelete }) +@ApplyOptions({ event: Events.GuildMessageDelete }) export class UserListener extends Listener { public run(message: GuildMessage) { setSnipedMessage(message.channel, message); diff --git a/src/listeners/messages/guildUserMessageMediaOnly.ts b/src/listeners/messages/guildUserMessageMediaOnly.ts index 1c4ede75ecb..6ff134cfede 100644 --- a/src/listeners/messages/guildUserMessageMediaOnly.ts +++ b/src/listeners/messages/guildUserMessageMediaOnly.ts @@ -4,9 +4,9 @@ import { Events } from '#lib/types/Enums'; import { deleteMessage, isModerator } from '#utils/functions'; import { MEDIA_EXTENSION } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; -@ApplyOptions({ event: Events.GuildUserMessage }) +@ApplyOptions({ event: Events.GuildUserMessage }) export class UserListener extends Listener { public async run(message: GuildMessage) { const channels = await readSettings(message.guild, GuildSettings.Channels.MediaOnly); diff --git a/src/listeners/messages/messageDeleteBulkRemoveResponses.ts b/src/listeners/messages/messageDeleteBulkRemoveResponses.ts index 673edc89f4c..64ba2b6c701 100644 --- a/src/listeners/messages/messageDeleteBulkRemoveResponses.ts +++ b/src/listeners/messages/messageDeleteBulkRemoveResponses.ts @@ -3,14 +3,14 @@ import type { GuildMessage } from '#lib/types'; import { Events } from '#lib/types/Enums'; import { deleteMessage, getCommand } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { get } from '@sapphire/plugin-editable-commands'; import { hasAtLeastOneKeyInMap } from '@sapphire/utilities'; import type { Collection, Message, Snowflake } from 'discord.js'; type MessageCollection = Collection; -@ApplyOptions({ event: Events.MessageDeleteBulk }) +@ApplyOptions({ event: Events.MessageDeleteBulk }) export class UserListener extends Listener { public async run(messages: MessageCollection) { // If, for some reason, this was emitted with no messages, skip all: diff --git a/src/listeners/messages/messageDeleteRemoveResponses.ts b/src/listeners/messages/messageDeleteRemoveResponses.ts index f28c2447d7c..2d0d309ba6a 100644 --- a/src/listeners/messages/messageDeleteRemoveResponses.ts +++ b/src/listeners/messages/messageDeleteRemoveResponses.ts @@ -3,12 +3,12 @@ import type { GuildMessage } from '#lib/types'; import { Events } from '#lib/types/Enums'; import { deleteMessage, getCommand } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { get } from '@sapphire/plugin-editable-commands'; import { hasAtLeastOneKeyInMap } from '@sapphire/utilities'; import type { Message } from 'discord.js'; -@ApplyOptions({ event: Events.MessageDelete }) +@ApplyOptions({ event: Events.MessageDelete }) export class UserListener extends Listener { public async run(message: Message) { const response = get(message); diff --git a/src/listeners/messages/messageUpdateNotify.ts b/src/listeners/messages/messageUpdateNotify.ts index e986b9e7337..550f0994ddc 100644 --- a/src/listeners/messages/messageUpdateNotify.ts +++ b/src/listeners/messages/messageUpdateNotify.ts @@ -8,12 +8,12 @@ import { escapeMarkdown } from '#utils/External/escapeMarkdown'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { isNsfwChannel } from '@sapphire/discord.js-utilities'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { isNullish } from '@sapphire/utilities'; import { diffWordsWithSpace } from 'diff'; import type { Message } from 'discord.js'; -@ApplyOptions({ event: Events.MessageUpdate }) +@ApplyOptions({ event: Events.MessageUpdate }) export class UserListener extends Listener { public async run(old: Message, message: Message) { if (!isGuildMessage(message) || old.content === message.content || message.author.bot) return; diff --git a/src/listeners/messages/rawMessageDelete.ts b/src/listeners/messages/rawMessageDelete.ts index fbd678cc3b4..8c5524ce8c6 100644 --- a/src/listeners/messages/rawMessageDelete.ts +++ b/src/listeners/messages/rawMessageDelete.ts @@ -1,9 +1,9 @@ import { Events } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import { GatewayDispatchEvents, GatewayMessageDeleteDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import { GatewayDispatchEvents, type GatewayMessageDeleteDispatch } from 'discord-api-types/v10'; -@ApplyOptions({ event: GatewayDispatchEvents.MessageDelete, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.MessageDelete, emitter: 'ws' }) export class UserListener extends Listener { public run(data: GatewayMessageDeleteDispatch['d']): void { if (!data.guild_id) return; diff --git a/src/listeners/messages/rawMessageDeleteBulk.ts b/src/listeners/messages/rawMessageDeleteBulk.ts index 7c4eed5eece..4255df445e0 100644 --- a/src/listeners/messages/rawMessageDeleteBulk.ts +++ b/src/listeners/messages/rawMessageDeleteBulk.ts @@ -1,9 +1,9 @@ import { Events } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import { GatewayDispatchEvents, GatewayMessageDeleteBulkDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import { GatewayDispatchEvents, type GatewayMessageDeleteBulkDispatch } from 'discord-api-types/v10'; -@ApplyOptions({ event: GatewayDispatchEvents.MessageDeleteBulk, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.MessageDeleteBulk, emitter: 'ws' }) export class UserListener extends Listener { public run(data: GatewayMessageDeleteBulkDispatch['d']): void { if (!data.guild_id) return; diff --git a/src/listeners/messages/userMessageGuildHandler.ts b/src/listeners/messages/userMessageGuildHandler.ts index a1fc2fda8b1..4026f51f263 100644 --- a/src/listeners/messages/userMessageGuildHandler.ts +++ b/src/listeners/messages/userMessageGuildHandler.ts @@ -1,9 +1,9 @@ import { Events } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import type { Message } from 'discord.js'; -@ApplyOptions({ event: Events.UserMessage }) +@ApplyOptions({ event: Events.UserMessage }) export class UserListener extends Listener { public run(message: Message) { if (message.guild) this.container.client.emit(Events.GuildUserMessage, message); diff --git a/src/listeners/moderation/messages/guildUserMessageAttachmentsHandler.ts b/src/listeners/moderation/messages/guildUserMessageAttachmentsHandler.ts index 473e1ee9b3b..0ea3b44d624 100644 --- a/src/listeners/moderation/messages/guildUserMessageAttachmentsHandler.ts +++ b/src/listeners/moderation/messages/guildUserMessageAttachmentsHandler.ts @@ -6,7 +6,7 @@ import { Colors } from '#utils/constants'; import { deleteMessage, sendTemporaryMessage } from '#utils/functions'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; @ApplyOptions({ @@ -37,7 +37,7 @@ export class UserModerationMessageListener extends ModerationMessageListener { } protected onLogMessage(message: GuildMessage, t: TFunction) { - return new MessageEmbed() + return new EmbedBuilder() .setDescription(message.content) .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(message.author, message.url)) diff --git a/src/listeners/moderation/messages/guildUserMessageCapitalsHandler.ts b/src/listeners/moderation/messages/guildUserMessageCapitalsHandler.ts index d1077ee3616..1f4c58ec59f 100644 --- a/src/listeners/moderation/messages/guildUserMessageCapitalsHandler.ts +++ b/src/listeners/moderation/messages/guildUserMessageCapitalsHandler.ts @@ -9,7 +9,7 @@ import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; import { codeBlock, cutText } from '@sapphire/utilities'; import { getCode, isUpper } from '@skyra/char'; -import { MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; @ApplyOptions({ @@ -63,7 +63,7 @@ export class UserModerationMessageListener extends ModerationMessageListener { } protected onLogMessage(message: GuildMessage, t: TFunction) { - return new MessageEmbed() + return new EmbedBuilder() .setDescription(message.content) .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(message.author, message.url)) diff --git a/src/listeners/moderation/messages/guildUserMessageInvitesHandler.ts b/src/listeners/moderation/messages/guildUserMessageInvitesHandler.ts index 7ac84d1f582..9b4ff1bccfe 100644 --- a/src/listeners/moderation/messages/guildUserMessageInvitesHandler.ts +++ b/src/listeners/moderation/messages/guildUserMessageInvitesHandler.ts @@ -6,7 +6,7 @@ import { Colors } from '#utils/constants'; import { deleteMessage, sendTemporaryMessage } from '#utils/functions'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; const enum CodeType { @@ -64,7 +64,7 @@ export class UserModerationMessageListener extends ModerationMessageListener { } protected onLogMessage(message: GuildMessage, t: TFunction, links: readonly string[]) { - return new MessageEmbed() + return new EmbedBuilder() .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(message.author, message.url)) .setDescription(t(LanguageKeys.Events.Moderation.Messages.InviteFilterLog, { links, count: links.length })) diff --git a/src/listeners/moderation/messages/guildUserMessageLinksHandler.ts b/src/listeners/moderation/messages/guildUserMessageLinksHandler.ts index 3f2510df199..4e89bb0edef 100644 --- a/src/listeners/moderation/messages/guildUserMessageLinksHandler.ts +++ b/src/listeners/moderation/messages/guildUserMessageLinksHandler.ts @@ -7,7 +7,7 @@ import { deleteMessage, sendTemporaryMessage } from '#utils/functions'; import { urlRegex } from '#utils/Links/UrlRegex'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; @ApplyOptions({ @@ -52,7 +52,7 @@ export class UserModerationMessageListener extends ModerationMessageListener { } protected onLogMessage(message: GuildMessage, t: TFunction) { - return new MessageEmbed() + return new EmbedBuilder() .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(message.author, message.url)) .setFooter({ text: `#${(message.channel as TextChannel).name} | ${t(LanguageKeys.Events.Moderation.Messages.LinkFooter)}` }) diff --git a/src/listeners/moderation/messages/guildUserMessageMentionsHandler.ts b/src/listeners/moderation/messages/guildUserMessageMentionsHandler.ts index dbbf4283f05..e4e1636c2db 100644 --- a/src/listeners/moderation/messages/guildUserMessageMentionsHandler.ts +++ b/src/listeners/moderation/messages/guildUserMessageMentionsHandler.ts @@ -3,10 +3,10 @@ import type { GuildMessage } from '#lib/types'; import { Events } from '#lib/types/Enums'; import { isModerator } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { isNullishOrZero } from '@sapphire/utilities'; -@ApplyOptions({ event: Events.GuildUserMessage }) +@ApplyOptions({ event: Events.GuildUserMessage }) export class UserListener extends Listener { public async run(message: GuildMessage) { if (!isNullishOrZero(message.editedTimestamp)) return; diff --git a/src/listeners/moderation/messages/guildUserMessageMessagesHandler.ts b/src/listeners/moderation/messages/guildUserMessageMessagesHandler.ts index b8083edbd68..d3b93a820ba 100644 --- a/src/listeners/moderation/messages/guildUserMessageMessagesHandler.ts +++ b/src/listeners/moderation/messages/guildUserMessageMessagesHandler.ts @@ -6,7 +6,7 @@ import { Colors } from '#utils/constants'; import { deleteMessage, sendTemporaryMessage } from '#utils/functions'; import { getContent, getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; @ApplyOptions({ @@ -56,7 +56,7 @@ export class UserModerationMessageListener extends ModerationMessageListener { } protected onLogMessage(message: GuildMessage, t: TFunction) { - return new MessageEmbed() + return new EmbedBuilder() .setDescription(message.content) .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(message.author, message.url)) diff --git a/src/listeners/moderation/messages/guildUserMessageNewLinesHandler.ts b/src/listeners/moderation/messages/guildUserMessageNewLinesHandler.ts index 75a2763f58f..9e1add606c5 100644 --- a/src/listeners/moderation/messages/guildUserMessageNewLinesHandler.ts +++ b/src/listeners/moderation/messages/guildUserMessageNewLinesHandler.ts @@ -6,7 +6,7 @@ import { Colors } from '#utils/constants'; import { deleteMessage, sendTemporaryMessage } from '#utils/functions'; import { getContent, getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { MessageEmbed, TextChannel } from 'discord.js'; +import { EmbedBuilder, TextChannel } from 'discord.js'; import type { TFunction } from 'i18next'; const NEW_LINE = '\n'; @@ -47,7 +47,7 @@ export class UserModerationMessageListener extends ModerationMessageListener { } protected onLogMessage(message: GuildMessage, t: TFunction) { - return new MessageEmbed() + return new EmbedBuilder() .setDescription(message.content) .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(message.author, message.url)) diff --git a/src/listeners/moderation/moderationEntryAdd.ts b/src/listeners/moderation/moderationEntryAdd.ts index 5f62052246b..7a4fe302930 100644 --- a/src/listeners/moderation/moderationEntryAdd.ts +++ b/src/listeners/moderation/moderationEntryAdd.ts @@ -3,7 +3,7 @@ import { resolveOnErrorCodes } from '#utils/common'; import { SchemaKeys } from '#utils/moderationConstants'; import { canSendEmbeds } from '@sapphire/discord.js-utilities'; import { Listener } from '@sapphire/framework'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; +import { RESTJSONErrorCodes } from 'discord-api-types/v10'; export class UserListener extends Listener { public run(entry: ModerationEntity) { diff --git a/src/listeners/moderation/moderationEntryEdit.ts b/src/listeners/moderation/moderationEntryEdit.ts index 89db0e83a28..a6063baaaa3 100644 --- a/src/listeners/moderation/moderationEntryEdit.ts +++ b/src/listeners/moderation/moderationEntryEdit.ts @@ -1,10 +1,10 @@ import { GuildSettings, ModerationEntity, writeSettings } from '#lib/database'; import { resolveOnErrorCodes } from '#utils/common'; import { SchemaKeys } from '#utils/moderationConstants'; -import { canSendEmbeds, GuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; +import { canSendEmbeds, type GuildTextBasedChannelTypes } from '@sapphire/discord.js-utilities'; import { Listener } from '@sapphire/framework'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; -import type { Message, MessageEmbed } from 'discord.js'; +import { RESTJSONErrorCodes } from 'discord-api-types/v10'; +import type { Embed, Message } from 'discord.js'; export class UserListener extends Listener { public run(old: ModerationEntity, entry: ModerationEntity) { @@ -61,9 +61,8 @@ export class UserListener extends Listener { ); } - private validateModerationLogMessageEmbed(embed: MessageEmbed) { + private validateModerationLogMessageEmbed(embed: Embed) { return ( - embed.type === 'rich' && this.validateModerationLogMessageEmbedAuthor(embed.author) && this.validateModerationLogMessageEmbedDescription(embed.description) && this.validateModerationLogMessageEmbedColor(embed.color) && @@ -72,23 +71,23 @@ export class UserListener extends Listener { ); } - private validateModerationLogMessageEmbedAuthor(author: MessageEmbed['author']) { - return author !== null && typeof author.name === 'string' && /[^#]{2,32}#\d{4}/.test(author.name) && typeof author.iconURL === 'string'; + private validateModerationLogMessageEmbedAuthor(author: Embed['author']) { + return author !== null && typeof author.name === 'string' && /\(\d{17,19}\)^/.test(author.name) && typeof author.iconURL === 'string'; } - private validateModerationLogMessageEmbedDescription(description: MessageEmbed['description']) { + private validateModerationLogMessageEmbedDescription(description: Embed['description']) { return typeof description === 'string' && description.split('\n').length >= 3; } - private validateModerationLogMessageEmbedColor(color: MessageEmbed['color']) { + private validateModerationLogMessageEmbedColor(color: Embed['color']) { return typeof color === 'number'; } - private validateModerationLogMessageEmbedFooter(footer: MessageEmbed['footer']) { + private validateModerationLogMessageEmbedFooter(footer: Embed['footer']) { return footer !== null && typeof footer.text === 'string' && typeof footer.iconURL === 'string'; } - private validateModerationLogMessageEmbedTimestamp(timestamp: MessageEmbed['timestamp']) { + private validateModerationLogMessageEmbedTimestamp(timestamp: Embed['timestamp']) { return typeof timestamp === 'number'; } diff --git a/src/listeners/reactions/rawMessageReactionAdd.ts b/src/listeners/reactions/rawMessageReactionAdd.ts index 962526eaf3c..00a0509427e 100644 --- a/src/listeners/reactions/rawMessageReactionAdd.ts +++ b/src/listeners/reactions/rawMessageReactionAdd.ts @@ -3,11 +3,11 @@ import { getEmojiString } from '#utils/functions'; import type { LLRCData } from '#utils/LongLivingReactionCollector'; import { ApplyOptions } from '@sapphire/decorators'; import { canReadMessages, isGuildBasedChannel } from '@sapphire/discord.js-utilities'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import { GatewayDispatchEvents, GatewayMessageReactionAddDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import { GatewayDispatchEvents, type GatewayMessageReactionAddDispatch } from 'discord-api-types/v10'; import type { TextChannel } from 'discord.js'; -@ApplyOptions({ event: GatewayDispatchEvents.MessageReactionAdd, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.MessageReactionAdd, emitter: 'ws' }) export class UserListener extends Listener { public run(raw: GatewayMessageReactionAddDispatch['d']) { const channel = this.container.client.channels.cache.get(raw.channel_id) as TextChannel | undefined; diff --git a/src/listeners/reactions/rawMessageReactionRemove.ts b/src/listeners/reactions/rawMessageReactionRemove.ts index 7434969a83d..97cbcefc707 100644 --- a/src/listeners/reactions/rawMessageReactionRemove.ts +++ b/src/listeners/reactions/rawMessageReactionRemove.ts @@ -1,11 +1,11 @@ import { Events } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; import { canReadMessages, isGuildBasedChannel } from '@sapphire/discord.js-utilities'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import { GatewayDispatchEvents, GatewayMessageReactionRemoveDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import { GatewayDispatchEvents, type GatewayMessageReactionRemoveDispatch } from 'discord-api-types/v10'; import type { TextChannel } from 'discord.js'; -@ApplyOptions({ event: GatewayDispatchEvents.MessageReactionRemove, emitter: 'ws' }) +@ApplyOptions({ event: GatewayDispatchEvents.MessageReactionRemove, emitter: 'ws' }) export class UserListener extends Listener { public run(data: GatewayMessageReactionRemoveDispatch['d']) { const channel = this.container.client.channels.cache.get(data.channel_id) as TextChannel; diff --git a/src/listeners/reactions/rawReactionAddBlockList.ts b/src/listeners/reactions/rawReactionAddBlockList.ts index b4bef62a1a2..5594c6370b3 100644 --- a/src/listeners/reactions/rawReactionAddBlockList.ts +++ b/src/listeners/reactions/rawReactionAddBlockList.ts @@ -1,25 +1,25 @@ -import { GuildEntity, GuildSettings, readSettings } from '#lib/database'; +import { GuildSettings, readSettings, type GuildSettingsOfType } from '#lib/database'; import { api } from '#lib/discord/Api'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { HardPunishment, ModerationListener, SelfModeratorBitField } from '#lib/moderation'; +import { ModerationListener, SelfModeratorBitField, type HardPunishment } from '#lib/moderation'; import { Events } from '#lib/types/Enums'; import { floatPromise, seconds } from '#utils/common'; import { Colors } from '#utils/constants'; -import { deleteMessage, getEmojiReactionFormat, getEncodedTwemoji, getTwemojiUrl, SerializedEmoji } from '#utils/functions'; +import { deleteMessage, getEmojiReactionFormat, getEncodedTwemoji, getTwemojiUrl, type SerializedEmoji } from '#utils/functions'; import type { LLRCData } from '#utils/LongLivingReactionCollector'; import { getFullEmbedAuthor } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import type { ListenerOptions } from '@sapphire/framework'; -import { fetchT, sendLocalized } from '@sapphire/plugin-i18next'; -import { hasAtLeastOneKeyInMap, Nullish, PickByValue } from '@sapphire/utilities'; -import { GuildMember, MessageEmbed, Permissions } from 'discord.js'; +import { fetchT, resolveKey } from '@sapphire/plugin-i18next'; +import { hasAtLeastOneKeyInMap, type Nullish } from '@sapphire/utilities'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { EmbedBuilder, GuildMember } from 'discord.js'; type ArgumentType = [data: LLRCData, reaction: SerializedEmoji, channelId: string | Nullish, blockedReactions: string[]]; -@ApplyOptions({ event: Events.RawReactionAdd }) +@ApplyOptions({ event: Events.RawReactionAdd }) export class UserModerationEvent extends ModerationListener { - protected keyEnabled: PickByValue = GuildSettings.Selfmod.Reactions.Enabled; - protected softPunishmentPath: PickByValue = GuildSettings.Selfmod.Reactions.SoftAction; + protected keyEnabled: GuildSettingsOfType = GuildSettings.Selfmod.Reactions.Enabled; + protected softPunishmentPath: GuildSettingsOfType = GuildSettings.Selfmod.Reactions.SoftAction; protected hardPunishmentPath: HardPunishment = { action: GuildSettings.Selfmod.Reactions.HardAction, actionDuration: GuildSettings.Selfmod.Reactions.HardActionDuration, @@ -66,27 +66,21 @@ export class UserModerationEvent extends ModerationListener) { - floatPromise( - api() - .channels(data.channel.id) - .messages(data.messageId) - .reactions(getEmojiReactionFormat(emoji), data.userId) - .delete({ reason: '[MODERATION] Automatic Removal of Blocked Emoji.' }) - ); + floatPromise(api().channels.deleteUserMessageReaction(data.channel.id, data.messageId, getEmojiReactionFormat(emoji), data.userId)); } protected onAlert([data]: Readonly) { floatPromise( - sendLocalized(data.channel, { keys: LanguageKeys.Events.Reactions.Filter, formatOptions: { user: `<@${data.userId}>` } }).then( - (message) => deleteMessage(message, seconds(15)) - ) + resolveKey(data.guild, LanguageKeys.Events.Reactions.Filter, { user: `<@${data.userId}>` }) + .then((content) => data.channel.send(content)) + .then((message) => deleteMessage(message, seconds(15))) ); } protected async onLogMessage([data]: Readonly) { const user = await this.container.client.users.fetch(data.userId); const t = await fetchT(data.guild); - return new MessageEmbed() + return new EmbedBuilder() .setColor(Colors.Red) .setAuthor(getFullEmbedAuthor(user)) .setThumbnail( @@ -111,6 +105,6 @@ export class UserModerationEvent extends ModerationListener({ event: Events.RawReactionAdd }) +@ApplyOptions({ event: Events.RawReactionAdd }) export class UserListener extends Listener { private readonly kCountCache = new Collection(); private readonly kSyncCache = new Collection>(); - private kTimerSweeper: NodeJS.Timer | null = null; + private kTimerSweeper: NodeJS.Timeout | null = null; public async run(data: LLRCData, emoji: SerializedEmoji) { const key = GuildSettings.Channels.Logs.Reaction; @@ -50,7 +49,7 @@ export class UserListener extends Listener { if (user.bot) return; this.container.client.emit(Events.GuildMessageLog, data.guild, logChannelId, key, () => - new MessageEmbed() + new EmbedBuilder() .setColor(Colors.Green) .setAuthor(getFullEmbedAuthor(user)) .setThumbnail( @@ -72,7 +71,7 @@ export class UserListener extends Listener { ); } - public onUnload() { + public override onUnload() { super.onUnload(); if (this.kTimerSweeper) clearInterval(this.kTimerSweeper); } @@ -99,7 +98,7 @@ export class UserListener extends Listener { } private async fetchCount(data: LLRCData, emoji: SerializedEmoji, id: string) { - const users = (await api().channels(data.channel.id).messages(data.messageId).reactions(getEmojiReactionFormat(emoji)).get()) as APIUser[]; + const users = await api().channels.getMessageReactions(data.channel.id, data.messageId, getEmojiReactionFormat(emoji)); const count: InternalCacheEntry = { count: users.length, sweepAt: Date.now() + 120000 }; this.kCountCache.set(id, count); this.kSyncCache.delete(id); diff --git a/src/listeners/reactions/rawReactionAddRole.ts b/src/listeners/reactions/rawReactionAddRole.ts index 944d5f744b3..e3ad1a0036b 100644 --- a/src/listeners/reactions/rawReactionAddRole.ts +++ b/src/listeners/reactions/rawReactionAddRole.ts @@ -1,14 +1,14 @@ import { GuildSettings, readSettings } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { Events } from '#lib/types/Enums'; -import { resolveEmojiId, sendTemporaryMessage, SerializedEmoji } from '#utils/functions'; +import { resolveEmojiId, sendTemporaryMessage, type SerializedEmoji } from '#utils/functions'; import type { LLRCData } from '#utils/LongLivingReactionCollector'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { Listener } from '@sapphire/framework'; import { resolveKey } from '@sapphire/plugin-i18next'; import { DiscordAPIError } from 'discord.js'; -@ApplyOptions({ event: Events.RawReactionAdd }) +@ApplyOptions({ event: Events.RawReactionAdd }) export class UserListener extends Listener { public async run(parsed: LLRCData, emoji: SerializedEmoji) { const emojiId = resolveEmojiId(emoji); diff --git a/src/listeners/reactions/rawReactionRemoveRole.ts b/src/listeners/reactions/rawReactionRemoveRole.ts index 8a34eb1e66d..7ee44aace92 100644 --- a/src/listeners/reactions/rawReactionRemoveRole.ts +++ b/src/listeners/reactions/rawReactionRemoveRole.ts @@ -3,11 +3,11 @@ import { Events } from '#lib/types/Enums'; import { resolveEmojiId } from '#utils/functions'; import { ApplyOptions } from '@sapphire/decorators'; import { isGuildBasedChannel } from '@sapphire/discord.js-utilities'; -import { Listener, ListenerOptions } from '@sapphire/framework'; -import type { GatewayMessageReactionRemoveDispatch } from 'discord-api-types/v9'; +import { Listener } from '@sapphire/framework'; +import type { GatewayMessageReactionRemoveDispatch } from 'discord-api-types/v10'; import type { TextChannel } from 'discord.js'; -@ApplyOptions({ event: Events.RawReactionRemove }) +@ApplyOptions({ event: Events.RawReactionRemove }) export class UserListener extends Listener { public async run(channel: TextChannel, data: GatewayMessageReactionRemoveDispatch['d']) { // If the channel is not a text channel then stop processing diff --git a/src/listeners/ready.ts b/src/listeners/ready.ts index 9daaf6d39db..8b4bcab3ca1 100644 --- a/src/listeners/ready.ts +++ b/src/listeners/ready.ts @@ -1,12 +1,12 @@ import { Events, Schedules } from '#lib/types/Enums'; import { ApplyOptions } from '@sapphire/decorators'; -import { Listener, ListenerOptions, Piece, Store } from '@sapphire/framework'; +import { Listener, Piece, Store } from '@sapphire/framework'; import type { TFunction } from '@sapphire/plugin-i18next'; import { isNullish } from '@sapphire/utilities'; import { envParseBoolean } from '@skyra/env-utilities'; import { blue, gray, green, magenta, magentaBright, red, white, yellow } from 'colorette'; -@ApplyOptions({ once: true }) +@ApplyOptions({ once: true }) export class UserListener extends Listener { private readonly style = this.container.client.dev ? yellow : blue; @@ -113,10 +113,10 @@ ${line15}${client.dev ? ` ${pad}${blc('<')}${llc('/')}${blc('>')} ${llc('DEVELOP } private styleStore(store: Store) { - return gray(`├─ Loaded ${this.style(store.size.toString().padEnd(3, ' '))} ${store.name}.`); + return gray(`├─ Loaded ${this.style(store.size.toString().padEnd(2, ' '))} ${store.name}.`); } private styleLanguages(languages: Map) { - return gray(`└─ Loaded ${this.style(languages.size.toString().padEnd(3, ' '))} languages.`); + return gray(`└─ Loaded ${this.style(languages.size.toString().padEnd(2, ' '))} languages.`); } } diff --git a/src/listeners/twitch/twitchStreamOffline.ts b/src/listeners/twitch/twitchStreamOffline.ts index 9cea58e2423..625239d3685 100644 --- a/src/listeners/twitch/twitchStreamOffline.ts +++ b/src/listeners/twitch/twitchStreamOffline.ts @@ -1,17 +1,17 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { TwitchEventSubEvent, TwitchEventSubTypes } from '#lib/types'; +import { TwitchEventSubTypes, type TwitchEventSubEvent } from '#lib/types'; import { Events } from '#lib/types/Enums'; import { floatPromise } from '#utils/common'; import { extractDetailedMentions } from '#utils/util'; -import { time, TimestampStyles } from '@discordjs/builders'; +import { TimestampStyles, time } from '@discordjs/builders'; import { ApplyOptions } from '@sapphire/decorators'; -import { canSendMessages, TextBasedChannelTypes } from '@sapphire/discord.js-utilities'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { canSendMessages, type TextBasedChannelTypes } from '@sapphire/discord.js-utilities'; +import { Listener } from '@sapphire/framework'; import { fetchT } from '@sapphire/plugin-i18next'; import { isNullish, isNullishOrEmpty } from '@sapphire/utilities'; import type { TFunction } from 'i18next'; -@ApplyOptions({ +@ApplyOptions({ event: Events.TwitchStreamOffline }) export class UserListener extends Listener { diff --git a/src/listeners/twitch/twitchStreamOnline.ts b/src/listeners/twitch/twitchStreamOnline.ts index f4981f4d31d..2df091e31f2 100644 --- a/src/listeners/twitch/twitchStreamOnline.ts +++ b/src/listeners/twitch/twitchStreamOnline.ts @@ -1,19 +1,19 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; +import type { TwitchEventSubOnlineEvent, TwitchHelixStreamsResult, TwitchOnlineEmbedData } from '#lib/types'; import { TwitchEventSubTypes } from '#lib/types'; -import type { TwitchEventSubOnlineEvent, TwitchHelixStreamsResult, TwitchOnlineEmbedData } from '#lib/types/definitions/Twitch'; import { Events } from '#lib/types/Enums'; -import { floatPromise } from '#utils/common'; import { escapeMarkdown } from '#utils/External/escapeMarkdown'; +import { floatPromise } from '#utils/common'; import { extractDetailedMentions } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { canSendMessages, TextBasedChannelTypes } from '@sapphire/discord.js-utilities'; -import { Listener, ListenerOptions } from '@sapphire/framework'; +import { canSendMessages, type TextBasedChannelTypes } from '@sapphire/discord.js-utilities'; +import { Listener } from '@sapphire/framework'; import { fetchT } from '@sapphire/plugin-i18next'; import { isNullish } from '@sapphire/utilities'; -import { MessageEmbed } from 'discord.js'; +import { EmbedBuilder } from 'discord.js'; import type { TFunction } from 'i18next'; -@ApplyOptions({ +@ApplyOptions({ event: Events.TwitchStreamOnline }) export class UserListener extends Listener { @@ -62,7 +62,7 @@ export class UserListener extends Listener { const detailedMentions = extractDetailedMentions(guildSubscription.message); floatPromise( channel.send({ - content: guildSubscription.message || null, + content: guildSubscription.message || undefined, embeds: [this.buildEmbed(this.transformTextToObject(data, streamData), t)], allowedMentions: { parse: detailedMentions.parse, users: [...detailedMentions.users], roles: [...detailedMentions.roles] } }) @@ -88,7 +88,7 @@ export class UserListener extends Listener { } private buildEmbed(data: TwitchOnlineEmbedData, t: TFunction) { - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setTitle(data.title) .setURL(`https://twitch.tv/${data.userName}`) .setFooter({ text: t(LanguageKeys.Events.Twitch.OfflinePostfix) }) diff --git a/src/listeners/userUpdate.ts b/src/listeners/userUpdate.ts index be0575ac913..d6d1eec1816 100644 --- a/src/listeners/userUpdate.ts +++ b/src/listeners/userUpdate.ts @@ -6,7 +6,7 @@ import { filter, map } from '#utils/common'; import { Colors } from '#utils/constants'; import { getFullEmbedAuthor } from '#utils/util'; import { Listener } from '@sapphire/framework'; -import { Guild, MessageEmbed, User } from 'discord.js'; +import { EmbedBuilder, Guild, User } from 'discord.js'; import type { TFunction } from 'i18next'; export class UserListener extends Listener { @@ -49,7 +49,7 @@ export class UserListener extends Listener { } private buildEmbed(user: User, t: TFunction, description: string, footerKey: CustomGet) { - return new MessageEmbed() + return new EmbedBuilder() .setColor(Colors.Yellow) .setAuthor(getFullEmbedAuthor(user)) .setDescription(description) diff --git a/src/preconditions/BotOwner.ts b/src/preconditions/BotOwner.ts index 1d4996d8a24..b9706c163c8 100644 --- a/src/preconditions/BotOwner.ts +++ b/src/preconditions/BotOwner.ts @@ -1,9 +1,9 @@ import { OWNERS } from '#root/config'; -import { AsyncPreconditionResult, Precondition } from '@sapphire/framework'; +import { Precondition } from '@sapphire/framework'; import type { Message } from 'discord.js'; export class UserPrecondition extends Precondition { - public async run(message: Message): AsyncPreconditionResult { + public override messageRun(message: Message): Precondition.Result { return OWNERS.includes(message.author.id) ? this.ok() : this.error({ context: { silent: true } }); } } diff --git a/src/preconditions/Enabled.ts b/src/preconditions/Enabled.ts index 3242fc795ae..b1d60ee6a66 100644 --- a/src/preconditions/Enabled.ts +++ b/src/preconditions/Enabled.ts @@ -8,7 +8,7 @@ import type { Message } from 'discord.js'; @ApplyOptions({ position: 10 }) export class UserPrecondition extends Precondition { - public run(message: Message, command: Command, context: Precondition.Context): Precondition.Result { + public override messageRun(message: Message, command: Command, context: Precondition.Context): Precondition.Result { return message.guild ? this.runGuild(message as GuildMessage, command, context) : this.runDM(command, context); } diff --git a/src/routes/banners.ts b/src/routes/banners.ts deleted file mode 100644 index ea4af0e6f73..00000000000 --- a/src/routes/banners.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ratelimit } from '#lib/api/utils'; -import { seconds } from '#utils/common'; -import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, methods, Route, RouteOptions } from '@sapphire/plugin-api'; - -@ApplyOptions({ route: 'banners' }) -export class UserRoute extends Route { - @ratelimit(seconds(5), 2) - public async [methods.GET](_: ApiRequest, response: ApiResponse) { - const { banners } = this.container.db; - const entries = await banners.find(); - return response.json(entries); - } -} diff --git a/src/routes/commands.ts b/src/routes/commands.ts index 0b28b36adde..55443251c7e 100644 --- a/src/routes/commands.ts +++ b/src/routes/commands.ts @@ -3,10 +3,10 @@ import type { SkyraCommand } from '#lib/structures'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; import type { Command } from '@sapphire/framework'; -import { ApiRequest, ApiResponse, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; import type { TFunction } from 'i18next'; -@ApplyOptions({ route: 'commands' }) +@ApplyOptions({ route: 'commands' }) export class UserRoute extends Route { @ratelimit(seconds(2), 2) public [methods.GET](request: ApiRequest, response: ApiResponse) { @@ -25,7 +25,10 @@ export class UserRoute extends Route { return { category: command.category, description: t(command.description), - extendedHelp: t(command.detailedDescription, { replace: { prefix: process.env.CLIENT_PREFIX }, postProcess: 'helpUsagePostProcessor' }), + extendedHelp: t(command.detailedDescription, { + replace: { prefix: process.env.CLIENT_PREFIX }, + postProcess: 'helpUsagePostProcessor' + }) as string, guarded: command.guarded, name: command.name, permissionLevel: command.permissionLevel, diff --git a/src/routes/guilds/guild.ts b/src/routes/guilds/guild.ts index b15937a42aa..9ddf5eba8d0 100644 --- a/src/routes/guilds/guild.ts +++ b/src/routes/guilds/guild.ts @@ -3,9 +3,9 @@ import { authenticated, canManage, ratelimit } from '#lib/api/utils'; import { api } from '#lib/discord/Api'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, HttpCodes, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { HttpCodes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: 'guilds/:guild' }) +@ApplyOptions({ route: 'guilds/:guild' }) export class UserRoute extends Route { @authenticated() @ratelimit(seconds(5), 2, true) @@ -20,7 +20,7 @@ export class UserRoute extends Route { if (!(await canManage(guild, member))) return response.error(HttpCodes.Forbidden); - const emojis = await api().guilds(guildId).emojis.get(); + const emojis = await api().guilds.getEmojis(guildId); return response.json({ ...flattenGuild(guild), emojis }); } } diff --git a/src/routes/guilds/guild/channels.ts b/src/routes/guilds/guild/channels.ts index a48ace92141..e86230c14a0 100644 --- a/src/routes/guilds/guild/channels.ts +++ b/src/routes/guilds/guild/channels.ts @@ -2,9 +2,9 @@ import { flattenChannel } from '#lib/api/ApiTransformers'; import { authenticated, canManage, ratelimit } from '#lib/api/utils'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, HttpCodes, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { HttpCodes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: 'guilds/:guild/channels' }) +@ApplyOptions({ route: 'guilds/:guild/channels' }) export class UserRoute extends Route { @authenticated() @ratelimit(seconds(5), 2, true) diff --git a/src/routes/guilds/guild/channels/channel.ts b/src/routes/guilds/guild/channels/channel.ts index bb6c5280d37..5a645960808 100644 --- a/src/routes/guilds/guild/channels/channel.ts +++ b/src/routes/guilds/guild/channels/channel.ts @@ -2,9 +2,9 @@ import { flattenChannel } from '#lib/api/ApiTransformers'; import { authenticated, canManage, ratelimit } from '#lib/api/utils'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, HttpCodes, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { HttpCodes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: 'guilds/:guild/channels/:channel' }) +@ApplyOptions({ route: 'guilds/:guild/channels/:channel' }) export class UserRoute extends Route { @authenticated() @ratelimit(seconds(5), 2, true) diff --git a/src/routes/guilds/guild/members/member.ts b/src/routes/guilds/guild/members/member.ts index 81b7ae83677..295237aee6c 100644 --- a/src/routes/guilds/guild/members/member.ts +++ b/src/routes/guilds/guild/members/member.ts @@ -2,9 +2,9 @@ import { flattenMember } from '#lib/api/ApiTransformers'; import { authenticated, canManage, ratelimit } from '#lib/api/utils'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, HttpCodes, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { HttpCodes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: 'guilds/:guild/members/:member' }) +@ApplyOptions({ route: 'guilds/:guild/members/:member' }) export class UserRoute extends Route { @authenticated() @ratelimit(seconds(5), 2, true) diff --git a/src/routes/guilds/guild/roles.ts b/src/routes/guilds/guild/roles.ts index aecb94ad720..c05ac06f80e 100644 --- a/src/routes/guilds/guild/roles.ts +++ b/src/routes/guilds/guild/roles.ts @@ -2,9 +2,9 @@ import { flattenRole } from '#lib/api/ApiTransformers'; import { authenticated, canManage, ratelimit } from '#lib/api/utils'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, HttpCodes, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { HttpCodes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: 'guilds/:guild/roles' }) +@ApplyOptions({ route: 'guilds/:guild/roles' }) export class UserRoute extends Route { @authenticated() @ratelimit(seconds(5), 2, true) diff --git a/src/routes/guilds/guild/roles/role.ts b/src/routes/guilds/guild/roles/role.ts index 6282393dd25..5c41f7616ce 100644 --- a/src/routes/guilds/guild/roles/role.ts +++ b/src/routes/guilds/guild/roles/role.ts @@ -2,9 +2,9 @@ import { flattenRole } from '#lib/api/ApiTransformers'; import { authenticated, canManage, ratelimit } from '#lib/api/utils'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, HttpCodes, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { HttpCodes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: 'guilds/:guild/roles/:role' }) +@ApplyOptions({ route: 'guilds/:guild/roles/:role' }) export class UserRoute extends Route { @authenticated() @ratelimit(seconds(5), 2, true) diff --git a/src/routes/guilds/guild/settings.ts b/src/routes/guilds/guild/settings.ts index afd2b99722a..46102b87d58 100644 --- a/src/routes/guilds/guild/settings.ts +++ b/src/routes/guilds/guild/settings.ts @@ -1,12 +1,20 @@ import { authenticated, canManage, ratelimit } from '#lib/api/utils'; -import { configurableKeys, GuildEntity, isSchemaKey, readSettings, SerializerUpdateContext, writeSettings } from '#lib/database'; +import { + configurableKeys, + isSchemaKey, + readSettings, + writeSettings, + type GuildEntity, + type Serializer, + type SerializerUpdateContext +} from '#lib/database'; import { seconds } from '#utils/common'; import { cast } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, HttpCodes, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { HttpCodes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; import type { Guild } from 'discord.js'; -@ApplyOptions({ name: 'guildSettings', route: 'guilds/:guild/settings' }) +@ApplyOptions({ name: 'guildSettings', route: 'guilds/:guild/settings' }) export class UserRoute extends Route { private readonly kBlockList: string[] = ['commandUses']; @@ -70,7 +78,7 @@ export class UserRoute extends Route { // If null is passed, reset to default: if (value === null) return [entry.property, entry.default]; - const ctx = { ...context, entry }; + const ctx = { ...context, entry } as SerializerUpdateContext; const result = await (entry.array ? this.validateArray(value, ctx) : entry.serializer.isValid(value as any, ctx)); if (!result) throw 'The value is not valid.'; @@ -81,7 +89,7 @@ export class UserRoute extends Route { } } - private async validateArray(value: any, ctx: SerializerUpdateContext) { + private async validateArray(value: any, ctx: Serializer.UpdateContext) { if (!Array.isArray(value)) throw new Error('Expected an array.'); const { serializer } = ctx.entry; diff --git a/src/routes/languages.ts b/src/routes/languages.ts index 17ae24bfe05..a7fa050e429 100644 --- a/src/routes/languages.ts +++ b/src/routes/languages.ts @@ -1,9 +1,9 @@ import { ratelimit } from '#lib/api/utils'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: 'languages' }) +@ApplyOptions({ route: 'languages' }) export class UserRoute extends Route { @ratelimit(seconds(2), 2) public [methods.GET](_: ApiRequest, response: ApiResponse) { diff --git a/src/routes/main.ts b/src/routes/main.ts index e4c7ae8e3da..4834367e688 100644 --- a/src/routes/main.ts +++ b/src/routes/main.ts @@ -1,8 +1,8 @@ import { authenticated } from '#lib/api/utils'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: '' }) +@ApplyOptions({ route: '' }) export class UserRoute extends Route { public [methods.GET](_request: ApiRequest, response: ApiResponse) { response.json({ message: 'Hello World' }); diff --git a/src/routes/oauth/oauthUser.ts b/src/routes/oauth/oauthUser.ts index 549ce7ebaea..b6b8ac4f826 100644 --- a/src/routes/oauth/oauthUser.ts +++ b/src/routes/oauth/oauthUser.ts @@ -1,13 +1,13 @@ import { authenticated, ratelimit } from '#lib/api/utils'; import { minutes } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { fetch, FetchResultTypes } from '@sapphire/fetch'; -import { ApiRequest, ApiResponse, HttpCodes, methods, MimeTypes, Route, RouteOptions } from '@sapphire/plugin-api'; +import { FetchResultTypes, fetch } from '@sapphire/fetch'; +import { HttpCodes, MimeTypes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; import { Time } from '@sapphire/time-utilities'; -import { OAuth2Routes, RESTPostOAuth2AccessTokenResult } from 'discord-api-types/v9'; +import { OAuth2Routes, type RESTPostOAuth2AccessTokenResult } from 'discord-api-types/v10'; import { stringify } from 'node:querystring'; -@ApplyOptions({ route: 'oauth/user' }) +@ApplyOptions({ route: 'oauth/user' }) export class UserRoute extends Route { @authenticated() @ratelimit(minutes(5), 2, true) diff --git a/src/routes/twitch/twitchEventSubVerify.ts b/src/routes/twitch/twitchEventSubVerify.ts index 4f8ccd1820b..da9de9c9472 100644 --- a/src/routes/twitch/twitchEventSubVerify.ts +++ b/src/routes/twitch/twitchEventSubVerify.ts @@ -1,12 +1,12 @@ -import { TwitchEventSubTypes, TwitchEventSubVerificationMessage } from '#lib/types'; +import { TwitchEventSubTypes, type TwitchEventSubVerificationMessage } from '#lib/types'; import { TwitchStreamStatus } from '#lib/types/AnalyticsSchema'; import { Events } from '#lib/types/Enums'; import { cast } from '#utils/util'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; import { isObject } from '@sapphire/utilities'; -@ApplyOptions({ route: 'twitch/event_sub_verify' }) +@ApplyOptions({ route: 'twitch/event_sub_verify' }) export class UserRoute extends Route { private lastNotificationId: string | null = null; diff --git a/src/routes/users/user.ts b/src/routes/users/user.ts index f51c7971c90..25f48b36f23 100644 --- a/src/routes/users/user.ts +++ b/src/routes/users/user.ts @@ -1,10 +1,10 @@ -import { FlattenedGuild, flattenGuild, flattenUser } from '#lib/api/ApiTransformers'; +import { flattenGuild, flattenUser, type FlattenedGuild } from '#lib/api/ApiTransformers'; import { authenticated, ratelimit } from '#lib/api/utils'; import { seconds } from '#utils/common'; import { ApplyOptions } from '@sapphire/decorators'; -import { ApiRequest, ApiResponse, HttpCodes, methods, Route, RouteOptions } from '@sapphire/plugin-api'; +import { HttpCodes, Route, methods, type ApiRequest, type ApiResponse } from '@sapphire/plugin-api'; -@ApplyOptions({ route: 'users/@me' }) +@ApplyOptions({ route: 'users/@me' }) export class UserRoute extends Route { @authenticated() @ratelimit(seconds(5), 2, true) diff --git a/src/serializers/boolean.ts b/src/serializers/boolean.ts index c0837786002..72b0cb9cb48 100644 --- a/src/serializers/boolean.ts +++ b/src/serializers/boolean.ts @@ -1,4 +1,4 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { ApplyOptions } from '@sapphire/decorators'; import type { Awaitable } from '@sapphire/utilities'; @@ -15,7 +15,7 @@ export class UserSerializer extends Serializer { return typeof value === 'boolean'; } - public stringify(value: boolean, { t }: SerializerUpdateContext): string { + public override stringify(value: boolean, { t }: Serializer.UpdateContext): string { return t(value ? LanguageKeys.Arguments.BooleanEnabled : LanguageKeys.Arguments.BooleanDisabled); } } diff --git a/src/serializers/categoryortextchannel.ts b/src/serializers/categoryortextchannel.ts index 506d12eb5e3..452b3fe792e 100644 --- a/src/serializers/categoryortextchannel.ts +++ b/src/serializers/categoryortextchannel.ts @@ -1,27 +1,28 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { isCategoryChannel, isTextChannel } from '@sapphire/discord.js-utilities'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { - public async parse(args: Serializer.Args, { t, entry }: SerializerUpdateContext) { + public async parse(args: Serializer.Args, { t, entry }: Serializer.UpdateContext) { const result = await args.pickResult('guildChannel'); - if (!result.success) { - return this.errorFromArgument(args, result.error); + if (result.isErr()) { + return this.errorFromArgument(args, result.unwrapErr()); } - if (isTextChannel(result.value) || isCategoryChannel(result.value)) { - return this.ok(result.value.id); + const channel = result.unwrap(); + if (isTextChannel(channel) || isCategoryChannel(channel)) { + return this.ok(channel.id); } return this.error(t(LanguageKeys.Serializers.InvalidChannel, { name: entry.name })); } - public isValid(value: string, context: SerializerUpdateContext): Awaitable { + public isValid(value: string, context: Serializer.UpdateContext): Awaitable { return context.guild.channels.cache.has(value); } - public stringify(value: string, context: SerializerUpdateContext): string { + public override stringify(value: string, context: Serializer.UpdateContext): string { return context.guild.channels.cache.get(value)?.name ?? value; } } diff --git a/src/serializers/channel.ts b/src/serializers/channel.ts index f26bf4048ba..dbad08ce96e 100644 --- a/src/serializers/channel.ts +++ b/src/serializers/channel.ts @@ -1,19 +1,22 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { ApplyOptions } from '@sapphire/decorators'; import { isCategoryChannel, isGuildBasedChannelByGuildKey, isNewsChannel, isTextChannel, isVoiceChannel } from '@sapphire/discord.js-utilities'; -import { Awaitable, isNullish } from '@sapphire/utilities'; +import { isNullish, type Awaitable } from '@sapphire/utilities'; import type { Channel } from 'discord.js'; @ApplyOptions({ aliases: ['guildTextChannel', 'guildVoiceChannel', 'guildCategoryChannel'] }) export class UserSerializer extends Serializer { - public async parse(args: Serializer.Args, { entry }: SerializerUpdateContext) { + public async parse(args: Serializer.Args, { entry }: Serializer.UpdateContext) { const result = await args.pickResult(entry.type as 'guildTextChannel' | 'guildVoiceChannel' | 'guildCategoryChannel'); - return result.success ? this.ok(result.value.id) : this.errorFromArgument(args, result.error); + return result.match({ + ok: (value) => this.ok(value.id), + err: (error) => this.errorFromArgument(args, error) + }); } - public isValid(value: string, context: SerializerUpdateContext): Awaitable { + public isValid(value: string, context: Serializer.UpdateContext): Awaitable { const channel = context.guild.channels.cache.get(value); return !isNullish(channel) && this.isValidChannel(channel, context.entry.type); } @@ -23,7 +26,7 @@ export class UserSerializer extends Serializer { * @param value The data to stringify * @param guild The guild given for context in this call */ - public stringify(value: string, context: SerializerUpdateContext): string { + public override stringify(value: string, context: Serializer.UpdateContext): string { return context.guild.channels.cache.get(value)?.name ?? value; } diff --git a/src/serializers/command.ts b/src/serializers/command.ts index 3ed5ec6107b..6ff323b5fcc 100644 --- a/src/serializers/command.ts +++ b/src/serializers/command.ts @@ -1,20 +1,23 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { const result = await args.pickResult('commandName'); - return result.success ? this.ok(result.value.name) : this.errorFromArgument(args, result.error); + return result.match({ + ok: (value) => this.ok(value.name), + err: (error) => this.errorFromArgument(args, error) + }); } - public isValid(value: string, { t, entry }: SerializerUpdateContext): Awaitable { + public isValid(value: string, { t, entry }: Serializer.UpdateContext): Awaitable { const command = this.container.stores.get('commands').has(value); if (!command) throw t(LanguageKeys.Serializers.InvalidCommand, { name: entry.name }); return true; } - public stringify(value: string) { + public override stringify(value: string) { return (this.container.stores.get('commands').get(value) || { name: value }).name; } } diff --git a/src/serializers/commandautodelete.ts b/src/serializers/commandautodelete.ts index 1dfa6131b32..3073b8ecb30 100644 --- a/src/serializers/commandautodelete.ts +++ b/src/serializers/commandautodelete.ts @@ -1,4 +1,4 @@ -import { CommandAutoDelete, Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer, type CommandAutoDelete } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { seconds } from '#utils/common'; import type { Awaitable } from '@sapphire/utilities'; @@ -6,12 +6,12 @@ import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { const command = await args.pickResult('command'); - if (!command.success) return this.errorFromArgument(args, command.error); + if (command.isErr()) return this.errorFromArgument(args, command.unwrapErr()); const duration = await args.pickResult('timespan', { minimum: seconds(1) }); - if (!duration.success) return this.errorFromArgument(args, duration.error); + if (duration.isErr()) return this.errorFromArgument(args, duration.unwrapErr()); - return this.ok([command.value.name, duration.value] as const); + return this.ok([command.unwrap().name, duration.unwrap()] as const); } public isValid(value: CommandAutoDelete): Awaitable { @@ -24,11 +24,11 @@ export class UserSerializer extends Serializer { ); } - public stringify(value: CommandAutoDelete, { t }: SerializerUpdateContext): string { + public override stringify(value: CommandAutoDelete, { t }: Serializer.UpdateContext): string { return `[${value[0]} -> ${t(LanguageKeys.Globals.DurationValue, { value: value[1] })}]`; } - public equals(left: CommandAutoDelete, right: CommandAutoDelete): boolean { + public override equals(left: CommandAutoDelete, right: CommandAutoDelete): boolean { return left[0] === right[0]; } } diff --git a/src/serializers/commandmatch.ts b/src/serializers/commandmatch.ts index c89dd1c2ecf..a5216881a2c 100644 --- a/src/serializers/commandmatch.ts +++ b/src/serializers/commandmatch.ts @@ -1,20 +1,19 @@ -import { CommandMatcher, Serializer, SerializerUpdateContext } from '#lib/database'; +import { CommandMatcher, Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { - const result = await args.pickResult('commandMatch'); - return result.success ? this.ok(result.value) : this.errorFromArgument(args, result.error); + return this.result(args, await args.pickResult('commandMatch')); } - public isValid(value: string, { t, entry }: SerializerUpdateContext): Awaitable { + public isValid(value: string, { t, entry }: Serializer.UpdateContext): Awaitable { const command = CommandMatcher.resolve(value); if (!command) throw t(LanguageKeys.Serializers.InvalidCommand, { name: entry.name }); return true; } - public stringify(value: string) { + public override stringify(value: string) { return (this.container.stores.get('commands').get(value) || { name: value }).name; } } diff --git a/src/serializers/disabledcommandchannel.ts b/src/serializers/disabledcommandchannel.ts index e4988ee486d..d8800bcc2f5 100644 --- a/src/serializers/disabledcommandchannel.ts +++ b/src/serializers/disabledcommandchannel.ts @@ -1,4 +1,4 @@ -import { DisabledCommandChannel, Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer, type DisabledCommandChannel } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { isTextChannel } from '@sapphire/discord.js-utilities'; import type { Awaitable } from '@sapphire/utilities'; @@ -6,15 +6,15 @@ import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { const channel = await args.pickResult('guildTextChannel'); - if (!channel.success) return this.errorFromArgument(args, channel.error); + if (channel.isErr()) return this.errorFromArgument(args, channel.unwrapErr()); const commands = await args.repeatResult('command'); - if (!commands.success) return this.errorFromArgument(args, commands.error); + if (commands.isErr()) return this.errorFromArgument(args, commands.unwrapErr()); - return this.ok({ channel: channel.value.id, commands: commands.value.map((command) => command.name) }); + return this.ok({ channel: channel.unwrap().id, commands: commands.unwrap().map((command) => command.name) }); } - public isValid(value: DisabledCommandChannel, { t, entry, guild }: SerializerUpdateContext): Awaitable { + public isValid(value: DisabledCommandChannel, { t, entry, guild }: Serializer.UpdateContext): Awaitable { const channel = guild.channels.cache.get(value.channel); if (!channel) { throw new Error(t(LanguageKeys.Serializers.DisabledCommandChannels.ChannelDoesNotExist)); @@ -33,12 +33,12 @@ export class UserSerializer extends Serializer { return true; } - public stringify(value: DisabledCommandChannel, { t, guild }: SerializerUpdateContext): string { + public override stringify(value: DisabledCommandChannel, { t, guild }: Serializer.UpdateContext): string { const name = guild.channels.cache.get(value.channel)?.name ?? t(LanguageKeys.Serializers.UnknownChannel); return `[${name} -> ${value.commands.join(' | ')}]`; } - public equals(left: DisabledCommandChannel, right: DisabledCommandChannel): boolean { + public override equals(left: DisabledCommandChannel, right: DisabledCommandChannel): boolean { return left.channel === right.channel; } } diff --git a/src/serializers/emoji.ts b/src/serializers/emoji.ts index 6edb49ae628..cfcc99b759b 100644 --- a/src/serializers/emoji.ts +++ b/src/serializers/emoji.ts @@ -1,21 +1,23 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { getEmojiString, getEmojiTextFormat, isValidSerializedEmoji, SerializedEmoji } from '#utils/functions'; +import { getEmojiString, getEmojiTextFormat, isValidSerializedEmoji, type SerializedEmoji } from '#utils/functions'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { const result = await args.pickResult('emoji'); - if (!result.success) return this.errorFromArgument(args, result.error); - return this.ok(getEmojiString(result.value)); + return result.match({ + ok: (value) => this.ok(getEmojiString(value)), + err: (error) => this.errorFromArgument(args, error) + }); } - public isValid(value: SerializedEmoji, { t, entry }: SerializerUpdateContext): Awaitable { + public isValid(value: SerializedEmoji, { t, entry }: Serializer.UpdateContext): Awaitable { if (isValidSerializedEmoji(value)) return true; throw new Error(t(LanguageKeys.Serializers.InvalidEmoji, { name: entry.name })); } - public stringify(data: SerializedEmoji) { + public override stringify(data: SerializedEmoji) { return getEmojiTextFormat(data); } } diff --git a/src/serializers/guild.ts b/src/serializers/guild.ts index 09d2680ba89..e679547b8b7 100644 --- a/src/serializers/guild.ts +++ b/src/serializers/guild.ts @@ -1,4 +1,4 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { Awaitable } from '@sapphire/utilities'; @@ -7,7 +7,7 @@ export class UserSerializer extends Serializer { return this.result(args, await args.pickResult('snowflake')); } - public isValid(value: string, { t, entry }: SerializerUpdateContext): Awaitable { + public isValid(value: string, { t, entry }: Serializer.UpdateContext): Awaitable { const guild = this.container.client.guilds.cache.get(value); if (!guild) { throw t(LanguageKeys.Serializers.InvalidGuild, { name: entry.name }); @@ -16,7 +16,7 @@ export class UserSerializer extends Serializer { return true; } - public stringify(value: string) { + public override stringify(value: string) { return (this.container.client.guilds.cache.get(value) || { name: value }).name; } } diff --git a/src/serializers/invite.ts b/src/serializers/invite.ts index ae73cf2f614..e910d72a9ec 100644 --- a/src/serializers/invite.ts +++ b/src/serializers/invite.ts @@ -1,13 +1,16 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { - const invite = await args.pickResult('invite'); - return invite.success ? this.ok(invite.value.code) : this.errorFromArgument(args, invite.error); + const result = await args.pickResult('invite'); + return result.match({ + ok: (value) => this.ok(value.code), + err: (error) => this.errorFromArgument(args, error) + }); } - public async isValid(value: string, { t, entry }: SerializerUpdateContext): Promise { + public async isValid(value: string, { t, entry }: Serializer.UpdateContext): Promise { const invite = await this.container.client.invites.fetch(value); if (invite === null || !Reflect.has(invite, 'guildId')) { throw t(LanguageKeys.Serializers.InvalidInvite, { name: entry.name }); diff --git a/src/serializers/number.ts b/src/serializers/number.ts index 3b1c7d6046e..7f4b61412fa 100644 --- a/src/serializers/number.ts +++ b/src/serializers/number.ts @@ -1,4 +1,4 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { ApplyOptions } from '@sapphire/decorators'; import type { Awaitable } from '@sapphire/utilities'; @@ -7,11 +7,11 @@ import type { Awaitable } from '@sapphire/utilities'; aliases: ['integer', 'float'] }) export class UserSerializer extends Serializer { - public async parse(args: Serializer.Args, { entry }: SerializerUpdateContext) { + public async parse(args: Serializer.Args, { entry }: Serializer.UpdateContext) { return this.result(args, await args.pickResult(entry.type as 'integer' | 'number' | 'float')); } - public isValid(value: number, context: SerializerUpdateContext): Awaitable { + public isValid(value: number, context: Serializer.UpdateContext): Awaitable { switch (context.entry.type) { case 'integer': { if (typeof value === 'number' && Number.isInteger(value) && this.minOrMax(value, value, context)) return true; diff --git a/src/serializers/permissionnode.ts b/src/serializers/permissionnode.ts index ccc189c42fb..9761d58d356 100644 --- a/src/serializers/permissionnode.ts +++ b/src/serializers/permissionnode.ts @@ -1,4 +1,4 @@ -import { CommandMatcher, PermissionsNode, Serializer, SerializerUpdateContext } from '#lib/database'; +import { CommandMatcher, Serializer, type PermissionsNode } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { SkyraCommand } from '#lib/structures'; import { PermissionLevels } from '#lib/types/Enums'; @@ -7,11 +7,11 @@ import { isObject } from '@sapphire/utilities'; import type { GuildMember, Role } from 'discord.js'; export class UserSerializer extends Serializer { - public parse(_: Serializer.Args, { t }: SerializerUpdateContext) { + public parse(_: Serializer.Args, { t }: Serializer.UpdateContext) { return this.error(t(LanguageKeys.Serializers.Unsupported)); } - public async isValid(value: PermissionsNode, { t, entry, guild }: SerializerUpdateContext): Promise { + public async isValid(value: PermissionsNode, { t, entry, guild }: Serializer.UpdateContext): Promise { // Safe-guard checks against arbitrary data if (!isObject(value)) throw t(LanguageKeys.Serializers.PermissionNodeInvalid); if (Object.keys(value).length !== 3) throw t(LanguageKeys.Serializers.PermissionNodeInvalid); @@ -67,7 +67,7 @@ export class UserSerializer extends Serializer { return true; } - public stringify(value: PermissionsNode) { + public override stringify(value: PermissionsNode) { return `${value.id}(${value.allow.join(', ')} | ${value.deny.join(', ')})`; } diff --git a/src/serializers/reactionrole.ts b/src/serializers/reactionrole.ts index ca953a61023..918e112bf0e 100644 --- a/src/serializers/reactionrole.ts +++ b/src/serializers/reactionrole.ts @@ -1,14 +1,14 @@ -import { ReactionRole, Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer, type ReactionRole } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { getEmojiTextFormat, isValidSerializedEmoji } from '#utils/functions'; -import { Awaitable, isObject } from '@sapphire/utilities'; +import { isObject, type Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { - public parse(_: Serializer.Args, { t }: SerializerUpdateContext) { + public parse(_: Serializer.Args, { t }: Serializer.UpdateContext) { return this.error(t(LanguageKeys.Serializers.Unsupported)); } - public isValid(value: ReactionRole, { t }: SerializerUpdateContext): Awaitable { + public isValid(value: ReactionRole, { t }: Serializer.UpdateContext): Awaitable { if ( isObject(value) && Object.keys(value).length === 4 && @@ -23,7 +23,7 @@ export class UserSerializer extends Serializer { throw t(LanguageKeys.Serializers.ReactionRoleInvalid); } - public stringify(value: ReactionRole, { t, guild }: SerializerUpdateContext) { + public override stringify(value: ReactionRole, { t, guild }: Serializer.UpdateContext) { const emoji = getEmojiTextFormat(value.emoji); const role = guild.roles.cache.get(value.role)?.name ?? t(LanguageKeys.Serializers.UnknownRole); const url = `https://discord.com/channels/${guild.id}/${value.channel}/${value.message}`; diff --git a/src/serializers/role.ts b/src/serializers/role.ts index d1260267b3b..e8f5ada657c 100644 --- a/src/serializers/role.ts +++ b/src/serializers/role.ts @@ -1,19 +1,22 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { - const role = await args.pickResult('role'); - return role.success ? this.ok(role.value.id) : this.errorFromArgument(args, role.error); + const result = await args.pickResult('role'); + return result.match({ + ok: (value) => this.ok(value.id), + err: (error) => this.errorFromArgument(args, error) + }); } - public isValid(value: string, { t, entry, guild }: SerializerUpdateContext): Awaitable { + public isValid(value: string, { t, entry, guild }: Serializer.UpdateContext): Awaitable { if (guild.roles.cache.has(value)) return true; throw t(LanguageKeys.Serializers.InvalidRole, { name: entry.name }); } - public stringify(value: string, { guild }: SerializerUpdateContext) { + public override stringify(value: string, { guild }: Serializer.UpdateContext) { return guild.roles.cache.get(value)?.name ?? value; } } diff --git a/src/serializers/snowflake.ts b/src/serializers/snowflake.ts index 4b9b1e465b1..1fbf1fb78f9 100644 --- a/src/serializers/snowflake.ts +++ b/src/serializers/snowflake.ts @@ -1,4 +1,4 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { DiscordSnowflake } from '@sapphire/snowflake'; import type { Awaitable } from '@sapphire/utilities'; @@ -19,7 +19,7 @@ export class UserSerializer extends Serializer { return this.result(args, await args.pickResult('snowflake')); } - public isValid(value: string, { t, entry }: SerializerUpdateContext): Awaitable { + public isValid(value: string, { t, entry }: Serializer.UpdateContext): Awaitable { if (this.kRegExp.test(value)) { const snowflake = DiscordSnowflake.deconstruct(value); const timestamp = Number(snowflake.timestamp); diff --git a/src/serializers/stickyrole.ts b/src/serializers/stickyrole.ts index 1d204ca0e7a..1f4bdc2828f 100644 --- a/src/serializers/stickyrole.ts +++ b/src/serializers/stickyrole.ts @@ -1,13 +1,13 @@ -import { Serializer, SerializerUpdateContext, StickyRole } from '#lib/database'; +import { Serializer, type StickyRole } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Awaitable, isObject } from '@sapphire/utilities'; +import { isObject, type Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { - public parse(_: Serializer.Args, { t }: SerializerUpdateContext) { + public parse(_: Serializer.Args, { t }: Serializer.UpdateContext) { return this.error(t(LanguageKeys.Serializers.Unsupported)); } - public isValid(value: StickyRole, { t, guild }: SerializerUpdateContext): Awaitable { + public isValid(value: StickyRole, { t, guild }: Serializer.UpdateContext): Awaitable { if ( isObject(value) && Object.keys(value).length === 2 && @@ -20,7 +20,7 @@ export class UserSerializer extends Serializer { throw t(LanguageKeys.Serializers.StickyRoleInvalid); } - public stringify(value: StickyRole, { t, guild }: SerializerUpdateContext) { + public override stringify(value: StickyRole, { t, guild }: Serializer.UpdateContext) { const username = guild.client.users.cache.get(value.user)?.username ?? t(LanguageKeys.Serializers.UnknownUser); const roles = value.roles.map((role) => guild.roles.cache.get(role)?.name ?? t(LanguageKeys.Serializers.UnknownRole)); return `[${username} -> ${roles}]`; diff --git a/src/serializers/string.ts b/src/serializers/string.ts index 53671ed46b0..9c6de708b5a 100644 --- a/src/serializers/string.ts +++ b/src/serializers/string.ts @@ -1,12 +1,12 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { - public async parse(args: Serializer.Args, { entry }: SerializerUpdateContext) { + public async parse(args: Serializer.Args, { entry }: Serializer.UpdateContext) { return this.result(args, await args.restResult('string', { minimum: entry.minimum, maximum: entry.maximum })); } - public isValid(value: string, context: SerializerUpdateContext): Awaitable { - return this.minOrMax(value, value.length, context).success; + public isValid(value: string, context: Serializer.UpdateContext): Awaitable { + return this.minOrMax(value, value.length, context).isOk(); } } diff --git a/src/serializers/textchannel.ts b/src/serializers/textchannel.ts index 301e7dd0bf4..0ae285301ca 100644 --- a/src/serializers/textchannel.ts +++ b/src/serializers/textchannel.ts @@ -1,17 +1,20 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { const result = await args.pickResult('textOrNewsChannelName'); - return result.success ? this.ok(result.value.id) : this.errorFromArgument(args, result.error); + return result.match({ + ok: (value) => this.ok(value.id), + err: (error) => this.errorFromArgument(args, error) + }); } - public isValid(value: string, context: SerializerUpdateContext): Awaitable { + public isValid(value: string, context: Serializer.UpdateContext): Awaitable { return context.guild.channels.cache.has(value); } - public stringify(value: string, context: SerializerUpdateContext): string { + public override stringify(value: string, context: Serializer.UpdateContext): string { return context.guild.channels.cache.get(value)?.name ?? value; } } diff --git a/src/serializers/timespan.ts b/src/serializers/timespan.ts index a6cf278da6f..4768ef0df25 100644 --- a/src/serializers/timespan.ts +++ b/src/serializers/timespan.ts @@ -1,18 +1,18 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { - public async parse(args: Serializer.Args, { entry }: SerializerUpdateContext) { + public async parse(args: Serializer.Args, { entry }: Serializer.UpdateContext) { return this.result(args, await args.pickResult(entry.type as 'timespan', { minimum: entry.minimum, maximum: entry.maximum })); } - public isValid(value: number, context: SerializerUpdateContext): Awaitable { + public isValid(value: number, context: Serializer.UpdateContext): Awaitable { if (typeof value === 'number' && Number.isInteger(value) && this.minOrMax(value, value, context)) return true; throw context.t(LanguageKeys.Serializers.InvalidInt, { name: context.entry.name }); } - public stringify(data: number, { t }: SerializerUpdateContext): string { + public override stringify(data: number, { t }: Serializer.UpdateContext): string { return t(LanguageKeys.Globals.DurationValue, { value: data }); } } diff --git a/src/serializers/uniqueroleset.ts b/src/serializers/uniqueroleset.ts index 9e8c88e52e5..43910cbc133 100644 --- a/src/serializers/uniqueroleset.ts +++ b/src/serializers/uniqueroleset.ts @@ -1,19 +1,19 @@ -import { Serializer, SerializerUpdateContext, UniqueRoleSet } from '#lib/database'; +import { Serializer, type UniqueRoleSet } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { Awaitable, isObject } from '@sapphire/utilities'; +import { isObject, type Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { const name = await args.pickResult('string'); - if (!name.success) return this.errorFromArgument(args, name.error); + if (name.isErr()) return this.errorFromArgument(args, name.unwrapErr()); const roles = await args.repeatResult('role'); - if (!roles.success) return this.errorFromArgument(args, roles.error); + if (roles.isErr()) return this.errorFromArgument(args, roles.unwrapErr()); - return this.ok({ name: name.value, roles: roles.value.map((role) => role.id) }); + return this.ok({ name: name.unwrap(), roles: roles.unwrap().map((role) => role.id) }); } - public isValid(value: UniqueRoleSet, { t, guild }: SerializerUpdateContext): Awaitable { + public isValid(value: UniqueRoleSet, { t, guild }: Serializer.UpdateContext): Awaitable { if ( isObject(value) && Object.keys(value).length === 2 && @@ -26,7 +26,7 @@ export class UserSerializer extends Serializer { throw t(LanguageKeys.Serializers.UniqueRoleSetInvalid); } - public stringify(value: UniqueRoleSet, { t, entity: { guild } }: SerializerUpdateContext) { + public override stringify(value: UniqueRoleSet, { t, entity: { guild } }: Serializer.UpdateContext) { return `[${value.name} -> \`${value.roles .map((role) => guild.roles.cache.get(role)?.name ?? t(LanguageKeys.Serializers.UnknownRole)) .join('` | `')}\`]`; diff --git a/src/serializers/url.ts b/src/serializers/url.ts index 189ffdcd6c4..d87402a1206 100644 --- a/src/serializers/url.ts +++ b/src/serializers/url.ts @@ -1,11 +1,11 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { private readonly kProtocol = /^https?:\/\//; - public parse(args: Serializer.Args, { t, entry }: SerializerUpdateContext) { + public parse(args: Serializer.Args, { t, entry }: Serializer.UpdateContext) { const value = args.next(); try { const { hostname } = new URL(this.kProtocol.test(value) ? value : `https://${value}`); @@ -16,7 +16,7 @@ export class UserSerializer extends Serializer { } } - public isValid(value: string, { t, entry }: SerializerUpdateContext): Awaitable { + public isValid(value: string, { t, entry }: Serializer.UpdateContext): Awaitable { try { const { hostname } = new URL(this.kProtocol.test(value) ? value : `https://${value}`); return hostname.length <= 128; @@ -25,7 +25,7 @@ export class UserSerializer extends Serializer { } } - public validate(data: string, { entry, t }: SerializerUpdateContext) { + public validate(data: string, { entry, t }: Serializer.UpdateContext) { try { const { hostname } = new URL(this.kProtocol.test(data) ? data : `https://${data}`); if (hostname.length > 128) throw t(LanguageKeys.Serializers.MinMaxMaxInclusive, { name: entry.name, max: 128 }); @@ -35,7 +35,7 @@ export class UserSerializer extends Serializer { } } - public stringify(data: string) { + public override stringify(data: string) { return `https://${data}`; } } diff --git a/src/serializers/user.ts b/src/serializers/user.ts index 81b5fc4084c..aef1f7298ac 100644 --- a/src/serializers/user.ts +++ b/src/serializers/user.ts @@ -1,4 +1,4 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { getTag } from '#utils/util'; import { SnowflakeRegex } from '@sapphire/discord.js-utilities'; @@ -7,10 +7,13 @@ import { isNullish } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { const result = await args.pickResult('user'); - return result.success ? this.ok(result.value.id) : this.errorFromArgument(args, result.error); + return result.match({ + ok: (value) => this.ok(value.id), + err: (error) => this.errorFromArgument(args, error) + }); } - public async isValid(value: string, { t, entry }: SerializerUpdateContext): Promise { + public async isValid(value: string, { t, entry }: Serializer.UpdateContext): Promise { try { // If it's not a valid snowflake, throw if (!SnowflakeRegex.test(value)) throw undefined; @@ -23,7 +26,7 @@ export class UserSerializer extends Serializer { } } - public stringify(value: string) { + public override stringify(value: string) { const user = this.container.client.users.cache.get(value); return isNullish(user) ? value : getTag(user); } diff --git a/src/serializers/voicechannel.ts b/src/serializers/voicechannel.ts index e2d9ff3efcb..09238b7ef61 100644 --- a/src/serializers/voicechannel.ts +++ b/src/serializers/voicechannel.ts @@ -1,17 +1,20 @@ -import { Serializer, SerializerUpdateContext } from '#lib/database'; +import { Serializer } from '#lib/database'; import type { Awaitable } from '@sapphire/utilities'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args) { const result = await args.pickResult('guildVoiceChannel'); - return result.success ? this.ok(result.value.id) : this.errorFromArgument(args, result.error); + return result.match({ + ok: (value) => this.ok(value.id), + err: (error) => this.errorFromArgument(args, error) + }); } - public isValid(value: string, context: SerializerUpdateContext): Awaitable { + public isValid(value: string, context: Serializer.UpdateContext): Awaitable { return context.guild.channels.cache.has(value); } - public stringify(value: string, context: SerializerUpdateContext): string { + public override stringify(value: string, context: Serializer.UpdateContext): string { return context.guild.channels.cache.get(value)?.name ?? value; } } diff --git a/src/serializers/word.ts b/src/serializers/word.ts index 1f5507b730b..a8ad340ccc4 100644 --- a/src/serializers/word.ts +++ b/src/serializers/word.ts @@ -1,4 +1,4 @@ -import { GuildEntity, GuildSettings, Serializer, SerializerUpdateContext } from '#lib/database'; +import { GuildEntity, GuildSettings, Serializer, type SerializerUpdateContext } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { IncomingType, OutgoingType } from '#lib/moderation/workers'; import type { Awaitable } from '@sapphire/utilities'; @@ -7,16 +7,16 @@ import { remove as removeConfusables } from 'confusables'; export class UserSerializer extends Serializer { public async parse(args: Serializer.Args, { t, entry, entity }: SerializerUpdateContext) { const result = await args.restResult('string', { minimum: entry.minimum, maximum: entry.maximum }); - if (!result.success) return this.result(args, result); + if (result.isErr()) return this.result(args, result); - const word = removeConfusables(result.value.toLowerCase()); + const word = removeConfusables(result.unwrap().toLowerCase()); if (await this.hasWord(entity, word)) return this.error(t(LanguageKeys.Serializers.WordIncluded, { name: entry.name, value: word })); return this.ok(word); } public isValid(value: string, context: SerializerUpdateContext): Awaitable { const word = removeConfusables(value.toLowerCase()); - return value === word && this.minOrMax(value, value.length, context).success; + return value === word && this.minOrMax(value, value.length, context).isOk(); } private async hasWord(settings: GuildEntity, content: string) { diff --git a/src/tasks/moderation/moderationEndAddRole.ts b/src/tasks/moderation/moderationEndAddRole.ts index 5c648bc64e1..878cb25df10 100644 --- a/src/tasks/moderation/moderationEndAddRole.ts +++ b/src/tasks/moderation/moderationEndAddRole.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions, Role } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild, Role } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData<{ role: Role }>) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) return null; + if (!me.permissions.has(PermissionFlagsBits.ManageRoles)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unAddRole( diff --git a/src/tasks/moderation/moderationEndBan.ts b/src/tasks/moderation/moderationEndBan.ts index 1263a14ae11..f2b654ab090 100644 --- a/src/tasks/moderation/moderationEndBan.ts +++ b/src/tasks/moderation/moderationEndBan.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.BAN_MEMBERS)) return null; + if (!me.permissions.has(PermissionFlagsBits.BanMembers)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unBan( diff --git a/src/tasks/moderation/moderationEndMute.ts b/src/tasks/moderation/moderationEndMute.ts index b7bf789679b..cae6a61e61d 100644 --- a/src/tasks/moderation/moderationEndMute.ts +++ b/src/tasks/moderation/moderationEndMute.ts @@ -1,5 +1,5 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; import type { Guild } from 'discord.js'; diff --git a/src/tasks/moderation/moderationEndRemoveRole.ts b/src/tasks/moderation/moderationEndRemoveRole.ts index ec219e442e9..9fa38f4e323 100644 --- a/src/tasks/moderation/moderationEndRemoveRole.ts +++ b/src/tasks/moderation/moderationEndRemoveRole.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions, Role } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild, Role } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData<{ role: Role }>) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) return null; + if (!me.permissions.has(PermissionFlagsBits.ManageRoles)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unRemoveRole( diff --git a/src/tasks/moderation/moderationEndRestrictionAttachment.ts b/src/tasks/moderation/moderationEndRestrictionAttachment.ts index 467cb276a8c..c015312acdd 100644 --- a/src/tasks/moderation/moderationEndRestrictionAttachment.ts +++ b/src/tasks/moderation/moderationEndRestrictionAttachment.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) return null; + if (!me.permissions.has(PermissionFlagsBits.ManageRoles)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unRestrictAttachment( diff --git a/src/tasks/moderation/moderationEndRestrictionEmbed.ts b/src/tasks/moderation/moderationEndRestrictionEmbed.ts index 9ba4dc61d29..38085fdb88e 100644 --- a/src/tasks/moderation/moderationEndRestrictionEmbed.ts +++ b/src/tasks/moderation/moderationEndRestrictionEmbed.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) return null; + if (!me.permissions.has(PermissionFlagsBits.ManageRoles)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unRestrictEmbed( diff --git a/src/tasks/moderation/moderationEndRestrictionReaction.ts b/src/tasks/moderation/moderationEndRestrictionReaction.ts index 09736c20cd8..e78bfda0dd2 100644 --- a/src/tasks/moderation/moderationEndRestrictionReaction.ts +++ b/src/tasks/moderation/moderationEndRestrictionReaction.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) return null; + if (!me.permissions.has(PermissionFlagsBits.ManageRoles)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unRestrictReaction( diff --git a/src/tasks/moderation/moderationEndRestrictionVoice.ts b/src/tasks/moderation/moderationEndRestrictionVoice.ts index 3d61a426883..402de510091 100644 --- a/src/tasks/moderation/moderationEndRestrictionVoice.ts +++ b/src/tasks/moderation/moderationEndRestrictionVoice.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) return null; + if (!me.permissions.has(PermissionFlagsBits.ManageRoles)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unRestrictVoice( diff --git a/src/tasks/moderation/moderationEndSetNickname.ts b/src/tasks/moderation/moderationEndSetNickname.ts index c550bd63cd0..934c25c05f3 100644 --- a/src/tasks/moderation/moderationEndSetNickname.ts +++ b/src/tasks/moderation/moderationEndSetNickname.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData<{ oldName: string }>) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.MANAGE_NICKNAMES)) return null; + if (!me.permissions.has(PermissionFlagsBits.ManageNicknames)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unSetNickname( diff --git a/src/tasks/moderation/moderationEndVoiceMute.ts b/src/tasks/moderation/moderationEndVoiceMute.ts index 3ffb78dd904..9549f75fac5 100644 --- a/src/tasks/moderation/moderationEndVoiceMute.ts +++ b/src/tasks/moderation/moderationEndVoiceMute.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.MUTE_MEMBERS)) return null; + if (!me.permissions.has(PermissionFlagsBits.MuteMembers)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unVoiceMute( diff --git a/src/tasks/moderation/moderationEndWarning.ts b/src/tasks/moderation/moderationEndWarning.ts index e6c0a95102c..c812b3949d7 100644 --- a/src/tasks/moderation/moderationEndWarning.ts +++ b/src/tasks/moderation/moderationEndWarning.ts @@ -1,13 +1,14 @@ import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { ModerationData, ModerationTask } from '#lib/moderation'; +import { ModerationTask, type ModerationData } from '#lib/moderation'; import { getSecurity } from '#utils/functions'; import { fetchT } from '@sapphire/plugin-i18next'; -import { Guild, Permissions } from 'discord.js'; +import { PermissionFlagsBits } from 'discord-api-types/v10'; +import { Guild } from 'discord.js'; export class UserModerationTask extends ModerationTask { protected async handle(guild: Guild, data: ModerationData) { const me = guild.members.me ?? (await guild.members.fetch(this.container.client.id!)); - if (!me.permissions.has(Permissions.FLAGS.BAN_MEMBERS)) return null; + if (!me.permissions.has(PermissionFlagsBits.BanMembers)) return null; const t = await fetchT(guild); await getSecurity(guild).actions.unWarning( diff --git a/src/tasks/poststats.ts b/src/tasks/poststats.ts index 3365769f6e9..f55fb3e3e06 100644 --- a/src/tasks/poststats.ts +++ b/src/tasks/poststats.ts @@ -1,9 +1,9 @@ import { ResponseType, Task, type PartialResponseValue } from '#lib/database'; import { Events } from '#lib/types/Enums'; -import { fetch, FetchResultTypes, QueryError } from '@sapphire/fetch'; +import { FetchResultTypes, QueryError, fetch } from '@sapphire/fetch'; import { MimeTypes } from '@sapphire/plugin-api'; import { blueBright, green, red } from 'colorette'; -import { Constants } from 'discord.js'; +import { Status } from 'discord.js'; const header = blueBright('[POST STATS ]'); @@ -21,7 +21,7 @@ export class UserTask extends Task { const { client, logger } = this.container; // If the websocket isn't ready, delay the execution by 30 seconds: - if (client.ws.status !== Constants.Status.READY) { + if (client.ws.status !== Status.Ready) { return { type: ResponseType.Delay, value: 30000 }; } diff --git a/src/tasks/reminder.ts b/src/tasks/reminder.ts index 96432e6ee4d..2b1bac6d256 100644 --- a/src/tasks/reminder.ts +++ b/src/tasks/reminder.ts @@ -1,8 +1,8 @@ import { ResponseType, Task, type PartialResponseValue } from '#lib/database'; import { LanguageKeys } from '#lib/i18n/languageKeys'; import { resolveOnErrorCodes } from '#utils/common'; -import { time, TimestampStyles } from '@discordjs/builders'; -import { RESTJSONErrorCodes } from 'discord-api-types/v9'; +import { TimestampStyles, time } from '@discordjs/builders'; +import { RESTJSONErrorCodes } from 'discord-api-types/v10'; import i18next from 'i18next'; export class UserTask extends Task { diff --git a/src/tsconfig.json b/src/tsconfig.json index 710ad25c220..df0313b6767 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -6,9 +6,25 @@ "rootDir": ".", "baseUrl": ".", "paths": { - "#utils/*": ["lib/util/*"], + "#lib/database": ["lib/database/index.js"], + "#lib/database/entities": ["lib/database/entities/index.js"], + "#lib/database/keys": ["lib/database/keys/index.js"], + "#lib/database/settings": ["lib/database/settings/index.js"], + "#lib/discord": ["lib/discord/index.js"], + "#lib/moderation": ["lib/moderation/index.js"], + "#lib/moderation/managers": ["lib/moderation/managers/index.js"], + "#lib/moderation/workers": ["lib/moderation/workers/index.js"], + "#lib/structures": ["lib/structures/index.js"], + "#lib/structures/managers": ["lib/structures/managers/index.js"], + "#lib/structures/color": ["lib/structures/color/index.js"], + "#lib/setup": ["lib/setup/index.js"], + "#lib/types": ["lib/types/index.js"], + "#lib/i18n/languageKeys": ["lib/i18n/languageKeys/index.js"], "#lib/*": ["lib/*"], - "#languages": ["languages/index"], + "#languages": ["languages/index.js"], + "#utils/common": ["lib/util/common/index.js"], + "#utils/functions": ["lib/util/functions/index.js"], + "#utils/*": ["lib/util/*"], "#root/*": ["*"] }, "composite": true diff --git a/tests/lib/TriviaManager.test.ts b/tests/lib/TriviaManager.test.ts deleted file mode 100644 index afd68833aaf..00000000000 --- a/tests/lib/TriviaManager.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { CATEGORIES, getQuestion, QuestionDifficulty, QuestionType } from '#lib/games/TriviaManager'; -import nock from 'nock'; - -describe('TriviaManager', () => { - // eslint-disable-next-line @typescript-eslint/init-declarations - let nockScope: nock.Scope; - - beforeEach(() => { - nockScope = nock('https://opentdb.com') - .persist() - .get('/api.php') - .query({ amount: '1', category: '9', difficulty: 'easy', type: 'boolean' }) - .reply(200, { - response_code: 0, - results: [ - { - category: 'General Knowledge', - type: 'boolean', - difficulty: 'easy', - question: 'You can legally drink alcohol while driving in Mississippi.', - correct_answer: 'True', - incorrect_answers: ['False'] - } - ] - }); - }); - - afterAll(() => { - nockScope.persist(false); - nock.restore(); - }); - - test('getQuestion', async () => { - const data = await getQuestion(CATEGORIES.general, QuestionDifficulty.Easy, QuestionType.Boolean); - expect(data.category).toBe('General Knowledge'); - expect(data.difficulty).toBe(QuestionDifficulty.Easy); - expect(data.type).toBe(QuestionType.Boolean); - expect(data.question).toBe('You can legally drink alcohol while driving in Mississippi.'); - expect(data.correct_answer).toBe('True'); - expect(data.incorrect_answers).toStrictEqual(['False']); - }); -}); diff --git a/tests/lib/bits.test.ts b/tests/lib/bits.test.ts index b0576658e14..55b0cae69a7 100644 --- a/tests/lib/bits.test.ts +++ b/tests/lib/bits.test.ts @@ -1,20 +1,11 @@ -import { channelFlags, channelOffset, permissionsFlags, permissionsOffset, toChannelsArray, toPermissionsArray } from '#utils/bits'; -import { GuildSystemChannelFlags, PermissionFlagsBits } from 'discord-api-types/v9'; -import { Permissions, SystemChannelFlags } from 'discord.js'; +import { toChannelsArray, toPermissionsArray } from '#utils/bits'; +import { GuildSystemChannelFlags, PermissionFlagsBits } from 'discord-api-types/v10'; describe('Bits', () => { describe('Permissions', () => { - test('GIVEN permissionsFlags.size THEN returns 44', () => { - expect(permissionsFlags.size).toBe(44); - }); - - test('GIVEN permissionsOffset THEN returns 47', () => { - expect(Number(permissionsOffset)).toBe(47); - }); - test('GIVEN various permissions THEN returns an array of their names', () => { const value = PermissionFlagsBits.AddReactions | PermissionFlagsBits.Connect | PermissionFlagsBits.ManageRoles; - expect(toPermissionsArray(value)).toStrictEqual(['ADD_REACTIONS', 'CONNECT', 'MANAGE_ROLES']); + expect(toPermissionsArray(value)).toStrictEqual(['AddReactions', 'Connect', 'ManageRoles']); }); test('GIVEN all permissions THEN returns an array with all the names', () => { @@ -49,7 +40,7 @@ describe('Bits', () => { PermissionFlagsBits.ManageNicknames | PermissionFlagsBits.ManageRoles | PermissionFlagsBits.ManageWebhooks | - PermissionFlagsBits.ManageEmojisAndStickers | + PermissionFlagsBits.ManageGuildExpressions | PermissionFlagsBits.UseApplicationCommands | PermissionFlagsBits.RequestToSpeak | PermissionFlagsBits.ManageEvents | @@ -60,70 +51,63 @@ describe('Bits', () => { PermissionFlagsBits.SendMessagesInThreads | PermissionFlagsBits.UseEmbeddedActivities | PermissionFlagsBits.ModerateMembers | - Permissions.FLAGS.VIEW_CREATOR_MONETIZATION_ANALYTICS | - Permissions.FLAGS.USE_SOUNDBOARD | - Permissions.FLAGS.SEND_VOICE_MESSAGES; + PermissionFlagsBits.ViewCreatorMonetizationAnalytics | + PermissionFlagsBits.UseSoundboard | + PermissionFlagsBits.SendVoiceMessages; expect(toPermissionsArray(value)).toStrictEqual([ - 'CREATE_INSTANT_INVITE', - 'KICK_MEMBERS', - 'BAN_MEMBERS', - 'ADMINISTRATOR', - 'MANAGE_CHANNELS', - 'MANAGE_GUILD', - 'ADD_REACTIONS', - 'VIEW_AUDIT_LOG', - 'PRIORITY_SPEAKER', - 'STREAM', - 'VIEW_CHANNEL', - 'SEND_MESSAGES', - 'SEND_TTS_MESSAGES', - 'MANAGE_MESSAGES', - 'EMBED_LINKS', - 'ATTACH_FILES', - 'READ_MESSAGE_HISTORY', - 'MENTION_EVERYONE', - 'USE_EXTERNAL_EMOJIS', - 'VIEW_GUILD_INSIGHTS', - 'CONNECT', - 'SPEAK', - 'MUTE_MEMBERS', - 'DEAFEN_MEMBERS', - 'MOVE_MEMBERS', - 'USE_VAD', - 'CHANGE_NICKNAME', - 'MANAGE_NICKNAMES', - 'MANAGE_ROLES', - 'MANAGE_WEBHOOKS', - 'MANAGE_EMOJIS_AND_STICKERS', - 'USE_APPLICATION_COMMANDS', - 'REQUEST_TO_SPEAK', - 'MANAGE_EVENTS', - 'MANAGE_THREADS', - 'CREATE_PUBLIC_THREADS', - 'CREATE_PRIVATE_THREADS', - 'USE_EXTERNAL_STICKERS', - 'SEND_MESSAGES_IN_THREADS', - 'START_EMBEDDED_ACTIVITIES', - 'MODERATE_MEMBERS', - 'VIEW_CREATOR_MONETIZATION_ANALYTICS', - 'USE_SOUNDBOARD', - 'SEND_VOICE_MESSAGES' + 'CreateInstantInvite', + 'KickMembers', + 'BanMembers', + 'Administrator', + 'ManageChannels', + 'ManageGuild', + 'AddReactions', + 'ViewAuditLog', + 'PrioritySpeaker', + 'Stream', + 'ViewChannel', + 'SendMessages', + 'SendTTSMessages', + 'ManageMessages', + 'EmbedLinks', + 'AttachFiles', + 'ReadMessageHistory', + 'MentionEveryone', + 'UseExternalEmojis', + 'ViewGuildInsights', + 'Connect', + 'Speak', + 'MuteMembers', + 'DeafenMembers', + 'MoveMembers', + 'UseVAD', + 'ChangeNickname', + 'ManageNicknames', + 'ManageRoles', + 'ManageWebhooks', + 'ManageEmojisAndStickers', + 'ManageGuildExpressions', + 'UseApplicationCommands', + 'RequestToSpeak', + 'ManageEvents', + 'ManageThreads', + 'CreatePublicThreads', + 'CreatePrivateThreads', + 'UseExternalStickers', + 'SendMessagesInThreads', + 'UseEmbeddedActivities', + 'ModerateMembers', + 'ViewCreatorMonetizationAnalytics', + 'UseSoundboard', + 'SendVoiceMessages' ]); }); }); describe('Channel', () => { - test('GIVEN channelFlags.size THEN returns 6', () => { - expect(channelFlags.size).toBe(6); - }); - - test('GIVEN channelOffset THEN returns 6', () => { - expect(channelOffset).toBe(6); - }); - test('GIVEN various flags THEN returns an array of their flags', () => { const value = GuildSystemChannelFlags.SuppressJoinNotifications | GuildSystemChannelFlags.SuppressPremiumSubscriptions; - expect(toChannelsArray(value)).toStrictEqual(['SUPPRESS_JOIN_NOTIFICATIONS', 'SUPPRESS_PREMIUM_SUBSCRIPTIONS']); + expect(toChannelsArray(value)).toStrictEqual(['SuppressJoinNotifications', 'SuppressPremiumSubscriptions']); }); test('GIVEN all flags THEN returns an array with all the flags', () => { @@ -132,15 +116,15 @@ describe('Bits', () => { GuildSystemChannelFlags.SuppressJoinNotificationReplies | GuildSystemChannelFlags.SuppressPremiumSubscriptions | GuildSystemChannelFlags.SuppressGuildReminderNotifications | - SystemChannelFlags.FLAGS.SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS | - SystemChannelFlags.FLAGS.SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES; + GuildSystemChannelFlags.SuppressRoleSubscriptionPurchaseNotifications | + GuildSystemChannelFlags.SuppressRoleSubscriptionPurchaseNotificationReplies; expect(toChannelsArray(value)).toStrictEqual([ - 'SUPPRESS_JOIN_NOTIFICATIONS', - 'SUPPRESS_PREMIUM_SUBSCRIPTIONS', - 'SUPPRESS_GUILD_REMINDER_NOTIFICATIONS', - 'SUPPRESS_JOIN_NOTIFICATION_REPLIES', - 'SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATIONS', - 'SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES' + 'SuppressJoinNotifications', + 'SuppressPremiumSubscriptions', + 'SuppressGuildReminderNotifications', + 'SuppressJoinNotificationReplies', + 'SuppressRoleSubscriptionPurchaseNotifications', + 'SuppressRoleSubscriptionPurchaseNotificationReplies' ]); }); }); diff --git a/tests/lib/database/settings/structures/PermissionNodeManager.test.ts b/tests/lib/database/settings/structures/PermissionNodeManager.test.ts index e1c5ef57eb2..873e8832ae9 100644 --- a/tests/lib/database/settings/structures/PermissionNodeManager.test.ts +++ b/tests/lib/database/settings/structures/PermissionNodeManager.test.ts @@ -19,7 +19,7 @@ describe('PermissionNodeManager', () => { return entity.permissionNodes['sorted']; } - describe('run', () => { + describe.skip('run', () => { // TODO: Test with no nodes // TODO: Test with non-applicable nodes // TODO: Test with user nodes @@ -105,20 +105,20 @@ describe('PermissionNodeManager', () => { }); }); - describe('remove', () => { - describe('user', () => { + describe.skip('remove', () => { + describe.skip('user', () => { // TODO: Test with no node // TODO: Test with only one command (auto-reset) // TODO: Test with two or more commands }); - describe('member', () => { + describe.skip('member', () => { // TODO: Test with no node // TODO: Test with only one command (auto-reset) // TODO: Test with two or more commands }); - describe('role', () => { + describe.skip('role', () => { // TODO: Test with no node // TODO: Test with only one command (auto-reset) // TODO: Test with two or more commands diff --git a/tests/lib/formatters.test.ts b/tests/lib/formatters.test.ts index e4307944161..229245b7c00 100644 --- a/tests/lib/formatters.test.ts +++ b/tests/lib/formatters.test.ts @@ -2,7 +2,7 @@ import type { GuildMessage } from '#lib/types'; import { client } from '#mocks/MockInstances'; import { formatMessage } from '#utils/formatters'; import { container } from '@sapphire/framework'; -import { APIMessage, EmbedType } from 'discord-api-types/v9'; +import { type APIMessage, EmbedType, MessageFlags } from 'discord-api-types/v10'; import { Message } from 'discord.js'; describe('formatters', () => { @@ -21,7 +21,8 @@ describe('formatters', () => { avatar: '51227d2976cc66b9c1add6b911eda5e9', discriminator: '7023', public_flags: 65536, - bot: true + bot: true, + global_name: null }, attachments: [], embeds: [], @@ -32,7 +33,7 @@ describe('formatters', () => { tts: false, timestamp: '2021-03-26T22:29:51.675000+00:00', edited_timestamp: '2021-03-26T22:29:56.581000+00:00', - flags: 0 + flags: MessageFlags.Ephemeral }; return Reflect.construct(Message, [client, { ...messageData, ...data }]) as GuildMessage; @@ -260,7 +261,7 @@ describe('formatters', () => { expect(formatMessage(t(), message)).toBe( join( '[3/26/21, 10:29:51 PM] Skyra#7023 [BOT]', // - '🖼️ [https://media.discordapp.net/attachments/758186338217492503/825157377090912296/birdflip2.gif]' + '> 📎 https://media.discordapp.net/attachments/758186338217492503/825157377090912296/birdflip2.gif' ) ); }); @@ -302,7 +303,7 @@ describe('formatters', () => { expect(formatMessage(t(), message)).toBe( join( '[3/26/21, 10:29:51 PM] Skyra#7023 [BOT]', // - '📹 [https://www.youtube.com/watch?v=5dqixBi8TPU] (YouTube).' + '🔖 [https://www.youtube.com/watch?v=5dqixBi8TPU] (YouTube).' ) ); }); diff --git a/tests/lib/moderation/workers/WorkerHandler.test.ts b/tests/lib/moderation/workers/WorkerHandler.test.ts index 4866e5d0323..fe19da6c688 100644 --- a/tests/lib/moderation/workers/WorkerHandler.test.ts +++ b/tests/lib/moderation/workers/WorkerHandler.test.ts @@ -1,5 +1,13 @@ /* eslint-disable @typescript-eslint/dot-notation */ -import { IncomingRunRegExpPayload, IncomingType, NoId, OutgoingPayload, OutgoingType, TimeoutError, WorkerHandler } from '#lib/moderation/workers'; +import { + IncomingType, + OutgoingType, + TimeoutError, + WorkerHandler, + type IncomingRunRegExpPayload, + type NoId, + type OutgoingPayload +} from '#lib/moderation/workers'; describe('WorkerHandler', () => { let handler = new WorkerHandler(); @@ -26,9 +34,9 @@ describe('WorkerHandler', () => { expect(handler['response']['timer']).toBeNull(); expect(handler['response']['handler']).toBeNull(); - const handleOnline = jest.spyOn(handler, 'handleOnline' as any); - const handleExit = jest.spyOn(handler, 'handleExit' as any); - const terminate = jest.spyOn(handler['worker'], 'terminate'); + const handleOnline = vi.spyOn(handler, 'handleOnline' as any); + const handleExit = vi.spyOn(handler, 'handleExit' as any); + const terminate = vi.spyOn(handler['worker'], 'terminate'); await expect(handler.start()).resolves.toBeUndefined(); @@ -57,7 +65,7 @@ describe('WorkerHandler', () => { test('GIVEN matching RunRegExp payload THEN resolves with a RegExpMatch payload', async () => { await handler.start(); - const handleMessage = jest.spyOn(handler, 'handleMessage' as any); + const handleMessage = vi.spyOn(handler, 'handleMessage' as any); const regExp = /hello/g; const given: NoId = { type: IncomingType.RunRegExp, regExp, content: 'hello world!' }; @@ -75,7 +83,7 @@ describe('WorkerHandler', () => { test('GIVEN non-matching RunRegExp payload THEN resolves with a RegExpMatch payload', async () => { await handler.start(); - const handleMessage = jest.spyOn(handler, 'handleMessage' as any); + const handleMessage = vi.spyOn(handler, 'handleMessage' as any); const regExp = /hello/g; const given: NoId = { type: IncomingType.RunRegExp, regExp, content: 'nope' }; @@ -91,12 +99,12 @@ describe('WorkerHandler', () => { test('GIVEN ReDoS payload THEN rejects with a TimeoutError', async () => { await handler.start(); - const handleMessage = jest.spyOn(handler, 'handleMessage' as any); - const restart = jest.spyOn(handler, 'restart' as any); - const destroy = jest.spyOn(handler, 'destroy' as any); - const terminate = jest.spyOn(handler['worker'], 'terminate'); - const spawn = jest.spyOn(handler, 'spawn' as any); - const start = jest.spyOn(handler, 'start' as any); + const handleMessage = vi.spyOn(handler, 'handleMessage' as any); + const restart = vi.spyOn(handler, 'restart'); + const destroy = vi.spyOn(handler, 'destroy'); + const terminate = vi.spyOn(handler['worker'], 'terminate'); + const spawn = vi.spyOn(handler, 'spawn'); + const start = vi.spyOn(handler, 'start'); const regExp = /([a-z]+)+$/; const given: NoId = { type: IncomingType.RunRegExp, regExp, content: `${'a'.repeat(100)}!` }; diff --git a/tests/lib/moderation/workers/WorkerManager.test.ts b/tests/lib/moderation/workers/WorkerManager.test.ts index b204e5a2b1f..5b480551d53 100644 --- a/tests/lib/moderation/workers/WorkerManager.test.ts +++ b/tests/lib/moderation/workers/WorkerManager.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/dot-notation */ -import { IncomingRunRegExpPayload, IncomingType, NoId, OutgoingPayload, OutgoingType, WorkerManager } from '#lib/moderation/workers'; +import { IncomingType, OutgoingType, WorkerManager, type IncomingRunRegExpPayload, type NoId, type OutgoingPayload } from '#lib/moderation/workers'; describe('WorkerManager', () => { let handler = new WorkerManager(2); @@ -17,11 +17,11 @@ describe('WorkerManager', () => { test('GIVEN new instance THEN has initial data', async () => { expect(handler.workers.length).toBe(2); - const start0 = jest.spyOn(handler.workers[0], 'start' as any); - const start1 = jest.spyOn(handler.workers[1], 'start' as any); + const start0 = vi.spyOn(handler.workers[0], 'start'); + const start1 = vi.spyOn(handler.workers[1], 'start'); - const destroy0 = jest.spyOn(handler.workers[0], 'destroy' as any); - const destroy1 = jest.spyOn(handler.workers[1], 'destroy' as any); + const destroy0 = vi.spyOn(handler.workers[0], 'destroy'); + const destroy1 = vi.spyOn(handler.workers[1], 'destroy'); await expect(handler.start()).resolves.toBeUndefined(); @@ -45,7 +45,7 @@ describe('WorkerManager', () => { test('GIVEN data to process WHEN both workers are idle THEN the command runs in the first worker', async () => { await handler.start(); - const getIdealWorker = jest.spyOn(handler, 'getIdealWorker' as any); + const getIdealWorker = vi.spyOn(handler, 'getIdealWorker' as any); const given: NoId = { type: IncomingType.RunRegExp, regExp, content: 'hello world!' }; const expected: OutgoingPayload = { @@ -63,7 +63,7 @@ describe('WorkerManager', () => { test('GIVEN data to process WHEN the first worker is busy THEN the command runs in the second worker', async () => { await handler.start(); - const getIdealWorker = jest.spyOn(handler, 'getIdealWorker' as any); + const getIdealWorker = vi.spyOn(handler, 'getIdealWorker' as any); const given0: NoId = { type: IncomingType.RunRegExp, regExp, content: 'hello world!' }; const expected0: OutgoingPayload = { @@ -91,9 +91,9 @@ describe('WorkerManager', () => { test('GIVEN a lot data to process THEN both workers get to work', async () => { await handler.start(); - const getIdealWorker = jest.spyOn(handler, 'getIdealWorker' as any); - const send0 = jest.spyOn(handler.workers[0], 'send'); - const send1 = jest.spyOn(handler.workers[1], 'send'); + const getIdealWorker = vi.spyOn(handler, 'getIdealWorker' as any); + const send0 = vi.spyOn(handler.workers[0], 'send'); + const send1 = vi.spyOn(handler.workers[1], 'send'); const given0: NoId = { type: IncomingType.RunRegExp, regExp, content: 'hello world!' }; const expected0 = OutgoingType.RegExpMatch; diff --git a/tests/lib/moderation/workers/WorkerResponseHandler.test.ts b/tests/lib/moderation/workers/WorkerResponseHandler.test.ts index 8328c35b4c6..622b2b0ca97 100644 --- a/tests/lib/moderation/workers/WorkerResponseHandler.test.ts +++ b/tests/lib/moderation/workers/WorkerResponseHandler.test.ts @@ -18,8 +18,8 @@ describe('WorkerHandler', () => { const promise = handler.define(id); expect(handler['handler']).not.toBeNull(); - const resolve = jest.spyOn(handler['handler']!, 'resolve'); - const reject = jest.spyOn(handler['handler']!, 'reject'); + const resolve = vi.spyOn(handler['handler']!, 'resolve'); + const reject = vi.spyOn(handler['handler']!, 'reject'); handler.resolve(id, data); expect(resolve).toBeCalledTimes(1); @@ -37,8 +37,8 @@ describe('WorkerHandler', () => { const promise = handler.define(id); expect(handler['handler']).not.toBeNull(); - const resolve = jest.spyOn(handler['handler']!, 'resolve'); - const reject = jest.spyOn(handler['handler']!, 'reject'); + const resolve = vi.spyOn(handler['handler']!, 'resolve'); + const reject = vi.spyOn(handler['handler']!, 'reject'); handler.resolve(id + 1, data); expect(resolve).not.toBeCalled(); @@ -60,8 +60,8 @@ describe('WorkerHandler', () => { const promise = handler.define(id); expect(handler['handler']).not.toBeNull(); - const resolve = jest.spyOn(handler['handler']!, 'resolve'); - const reject = jest.spyOn(handler['handler']!, 'reject'); + const resolve = vi.spyOn(handler['handler']!, 'resolve'); + const reject = vi.spyOn(handler['handler']!, 'reject'); handler.reject(id, error); expect(resolve).not.toBeCalled(); @@ -79,8 +79,8 @@ describe('WorkerHandler', () => { const promise = handler.define(id); expect(handler['handler']).not.toBeNull(); - const resolve = jest.spyOn(handler['handler']!, 'resolve'); - const reject = jest.spyOn(handler['handler']!, 'reject'); + const resolve = vi.spyOn(handler['handler']!, 'resolve'); + const reject = vi.spyOn(handler['handler']!, 'reject'); handler.reject(id + 1, error); expect(resolve).not.toBeCalled(); @@ -96,7 +96,7 @@ describe('WorkerHandler', () => { test('GIVEN 5ms timeout WHEN there is no timeout and no pending task THEN returns false and does not clear timeout', () => { const handler = new WorkerResponseHandler(); - const clearTimeout = jest.spyOn(handler, 'clearTimeout' as any); + const clearTimeout = vi.spyOn(handler, 'clearTimeout' as any); expect(handler.timeout(5)).toBe(false); expect(handler['timer']).toBeNull(); @@ -106,7 +106,7 @@ describe('WorkerHandler', () => { test('GIVEN timeout WHEN there is no timeout but has a pending task THEN returns true and does clear timeout', async () => { const handler = new WorkerResponseHandler(); - const clearTimeout = jest.spyOn(handler, 'clearTimeout' as any); + const clearTimeout = vi.spyOn(handler, 'clearTimeout' as any); const id = 1; const promise = handler.define(id); @@ -128,7 +128,7 @@ describe('WorkerHandler', () => { test('GIVEN timeout WHEN there was a timeout and a pending task THEN returns true and does clear timeout', async () => { const handler = new WorkerResponseHandler(); - const clearTimeout = jest.spyOn(handler, 'clearTimeout' as any); + const clearTimeout = vi.spyOn(handler, 'clearTimeout' as any); const id = 1; const promise = handler.define(id); @@ -149,7 +149,7 @@ describe('WorkerHandler', () => { test('GIVEN no timeout WHEN there was no pending task nor timeout THEN returns false', () => { const handler = new WorkerResponseHandler(); - const clearTimeout = jest.spyOn(handler, 'clearTimeout' as any); + const clearTimeout = vi.spyOn(handler, 'clearTimeout' as any); expect(handler.timeout(null)).toBe(false); expect(handler['timer']).toBeNull(); diff --git a/tests/lib/util.test.ts b/tests/lib/util.test.ts index b0361ae4711..b4cd9a3eaab 100644 --- a/tests/lib/util.test.ts +++ b/tests/lib/util.test.ts @@ -1,10 +1,9 @@ -import { createUser } from '#mocks/MockInstances'; +import { createEmbed, createUser } from '#mocks/MockInstances'; import * as utils from '#utils/util'; import { Collection } from '@discordjs/collection'; import type { DeepPartial } from '@sapphire/utilities'; -import type { APIAttachment } from 'discord-api-types/v9'; -import { Message, MessageAttachment, MessageEmbed } from 'discord.js'; -import { mockRandom, resetMockRandom } from 'jest-mock-random'; +import type { APIAttachment } from 'discord-api-types/v10'; +import { Attachment, Embed, Message } from 'discord.js'; describe('Utils', () => { describe('IMAGE_EXTENSION', () => { @@ -174,7 +173,7 @@ describe('Utils', () => { expect( utils.getContent({ content: '', - embeds: [new MessageEmbed().setDescription('Hey there!')] + embeds: [createEmbed({ description: 'Hey there!' })] } as unknown as Message) ).toEqual('Hey there!'); }); @@ -183,7 +182,7 @@ describe('Utils', () => { expect( utils.getContent({ content: '', - embeds: [new MessageEmbed().addField('Name', 'Value')] + embeds: [createEmbed({ fields: [{ name: 'Name', value: 'Value' }] })] } as unknown as Message) ).toEqual('Value'); }); @@ -192,7 +191,7 @@ describe('Utils', () => { expect( utils.getContent({ content: '', - embeds: [new MessageEmbed()] + embeds: [createEmbed({})] } as unknown as Message) ).toEqual(null); }); @@ -205,25 +204,25 @@ describe('Utils', () => { hm: 'b0227f7dce067d2f83880cd01f59a5856885af9204940f8c666dd81f257796c6' }).toString(); - function createAttachment(data: APIAttachment): MessageAttachment { - return new MessageAttachment(data.url, data.filename, data); + function createAttachment(data: APIAttachment): Attachment { + return Reflect.construct(Attachment, [data]); } - function createAttachments(attachment?: MessageAttachment | undefined) { - const collection = new Collection(); + function createAttachments(attachment?: Attachment | undefined) { + const collection = new Collection(); if (attachment) collection.set(attachment.id, attachment); return collection; } - function createEmbed(name: 'image' | 'thumbnail'): MessageEmbed { - return new MessageEmbed({ + function makeEmbed(name: 'image' | 'thumbnail'): Embed { + return createEmbed({ [name]: { url: `https://cdn.discordapp.com/attachments/222222222222222222/222222222222222222/image.png?${_Query}&`, proxy_url: `https://media.discordapp.net/attachments/222222222222222222/222222222222222222/image.png?${_Query}&`, width: 32, height: 32 } - } as const); + }); } function getImage(message: DeepPartial) { @@ -256,7 +255,7 @@ describe('Utils', () => { size: 4 } as const); - const embeds: MessageEmbed[] = embed === null ? [] : [createEmbed(embed)]; + const embeds: Embed[] = embed === null ? [] : [makeEmbed(embed)]; const ExpectedEmbedImageURL = embed === null ? null : embeds[0][embed]!.proxyURL; const ExpectedReturn = embed === null ? 'null' : `embed ${embed} URL`; test.each` @@ -341,11 +340,11 @@ describe('Utils', () => { describe('pickRandom', () => { beforeAll(() => { // Mock out random so the result is predictable - jest.spyOn(global.Math, 'random').mockReturnValue(0.123456789); + vi.spyOn(Math, 'random').mockReturnValue(0.123456789); }); afterAll(() => { - (global.Math.random as any).mockRestore(); + (Math.random as any).mockRestore(); }); test('GIVEN simple picker THEN picks first value', () => { @@ -365,9 +364,9 @@ describe('Utils', () => { describe('random', () => { test('GIVEN 2 calls to random THEN returns floored mocked values', () => { - mockRandom(0.6); + const spy = vi.spyOn(Math, 'random').mockReturnValue(0.6); expect(utils.random(50)).toEqual(30); - resetMockRandom(); + spy.mockRestore(); }); }); diff --git a/tests/lib/util/common/comparators.test.ts b/tests/lib/util/common/comparators.test.ts index f146189632b..82aa64dd3b0 100644 --- a/tests/lib/util/common/comparators.test.ts +++ b/tests/lib/util/common/comparators.test.ts @@ -3,8 +3,8 @@ import { andMix, orMix } from '#utils/common'; describe('util common comparators', () => { describe('andMix', () => { test('GIVEN two callbacks AND passing value THEN passes test', () => { - const a = jest.fn((v: number) => v > 0); - const b = jest.fn((v: number) => v < 1); + const a = vi.fn((v: number) => v > 0); + const b = vi.fn((v: number) => v < 1); const mix = andMix(a, b); expect(a.mock.calls.length).toBe(0); @@ -19,8 +19,8 @@ describe('util common comparators', () => { }); test('GIVEN two callbacks AND a value failing the second THEN fails test', () => { - const a = jest.fn((v: number) => v > 0); - const b = jest.fn((v: number) => v < 1); + const a = vi.fn((v: number) => v > 0); + const b = vi.fn((v: number) => v < 1); const mix = andMix(a, b); expect(a.mock.calls.length).toBe(0); @@ -35,8 +35,8 @@ describe('util common comparators', () => { }); test('GIVEN two callbacks AND a value failing the first THEN fails test and short-circuits the second', () => { - const a = jest.fn((v: number) => v > 0); - const b = jest.fn((v: number) => v < 1); + const a = vi.fn((v: number) => v > 0); + const b = vi.fn((v: number) => v < 1); const mix = andMix(a, b); expect(a.mock.calls.length).toBe(0); @@ -52,8 +52,8 @@ describe('util common comparators', () => { describe('orMix', () => { test('GIVEN two callbacks AND passing value THEN passes test', () => { - const a = jest.fn((v: number) => v > 0); - const b = jest.fn((v: number) => v < 1); + const a = vi.fn((v: number) => v > 0); + const b = vi.fn((v: number) => v < 1); const mix = orMix(a, b); expect(a.mock.calls.length).toBe(0); @@ -67,8 +67,8 @@ describe('util common comparators', () => { }); test('GIVEN two callbacks AND a value passing the first THEN passes test and short-circuits the second', () => { - const a = jest.fn((v: number) => v > 0); - const b = jest.fn((v: number) => v < 1); + const a = vi.fn((v: number) => v > 0); + const b = vi.fn((v: number) => v < 1); const mix = orMix(a, b); expect(a.mock.calls.length).toBe(0); @@ -82,8 +82,8 @@ describe('util common comparators', () => { }); test('GIVEN two callbacks AND a value passing the second THEN passes test', () => { - const a = jest.fn((v: number) => v > 0); - const b = jest.fn((v: number) => v < 1); + const a = vi.fn((v: number) => v > 0); + const b = vi.fn((v: number) => v < 1); const mix = orMix(a, b); expect(a.mock.calls.length).toBe(0); @@ -98,8 +98,8 @@ describe('util common comparators', () => { }); test('GIVEN two callbacks AND a value failing both THEN fails test and short-circuits the second', () => { - const a = jest.fn((v: number) => v < 0); - const b = jest.fn((v: number) => v > 1); + const a = vi.fn((v: number) => v < 0); + const b = vi.fn((v: number) => v > 1); const mix = orMix(a, b); expect(a.mock.calls.length).toBe(0); diff --git a/tests/lib/util/constants.test.ts b/tests/lib/util/constants.test.ts index 7ae31a2b2e2..e8eb37fe591 100644 --- a/tests/lib/util/constants.test.ts +++ b/tests/lib/util/constants.test.ts @@ -3,12 +3,10 @@ import * as utilConstants from '#utils/constants'; describe('Util Constants', () => { describe('helpUsagePostProcessor', () => { test('GIVEN value matching key THEN returns empty string', () => { - // @ts-expect-error i18next is weird and its types are different from what we actually see in usage expect(utilConstants.helpUsagePostProcessor.process('yarnExtended.extendedHelp', ['yarnExtended.extendedHelp'], {}, '')).toEqual(''); }); test('GIVEN value not matching key THEN returns value', () => { - // @ts-expect-error i18next is weird and its types are different from what we actually see in usage expect(utilConstants.helpUsagePostProcessor.process('This is so much help', ['yarnExtended.extendedHelp'], {}, '')).toEqual( 'This is so much help' ); diff --git a/tests/lib/util/formatters.test.ts b/tests/lib/util/formatters.test.ts index f4d236f32f0..91c0ffebcf3 100644 --- a/tests/lib/util/formatters.test.ts +++ b/tests/lib/util/formatters.test.ts @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/dot-notation */ import * as utilFormatters from '#utils/formatters'; -import type { MessageAttachment } from 'discord.js'; +import type { Attachment } from 'discord.js'; describe('utilFormatters', () => { describe('formatAttachment', () => { test('GIVEN attachment THEN formats into string', () => { - expect(utilFormatters.formatAttachment({ name: 'file.png', url: 'file://file.png' } as unknown as MessageAttachment)).toEqual( + expect(utilFormatters.formatAttachment({ name: 'file.png', url: 'file://file.png' } as unknown as Attachment)).toEqual( '📂 [file.png: file://file.png]' ); }); diff --git a/tests/lib/util/functions/emojis/getEmojiObject.test.ts b/tests/lib/util/functions/emojis/getEmojiObject.test.ts index 9a391416ff5..48251e7f326 100644 --- a/tests/lib/util/functions/emojis/getEmojiObject.test.ts +++ b/tests/lib/util/functions/emojis/getEmojiObject.test.ts @@ -6,7 +6,7 @@ import { serializedStaticSkyra, staticSkyra } from '#mocks/constants'; -import { EmojiObject, getEmojiObject } from '#utils/functions'; +import { getEmojiObject, type EmojiObject } from '#utils/functions'; describe('getEmojiObject', () => { test(`GIVEN decoded twemoji THEN returns emoji as name; id as null`, () => { diff --git a/tests/mocks/MockInstances.ts b/tests/mocks/MockInstances.ts index c1a4c4ac314..27fcac3abd1 100644 --- a/tests/mocks/MockInstances.ts +++ b/tests/mocks/MockInstances.ts @@ -3,26 +3,34 @@ import { SkyraCommand } from '#lib/structures'; import { CLIENT_OPTIONS } from '#root/config'; import { SapphireClient } from '@sapphire/framework'; import { - APIChannel, - APIGuild, - APIGuildMember, - APIRole, - APIUser, ChannelType, GuildFeature, + GuildMemberFlags, GuildNSFWLevel, - GuildSystemChannelFlags -} from 'discord-api-types/v9'; -import { Guild, GuildMember, Role, TextChannel, User } from 'discord.js'; + GuildSystemChannelFlags, + RoleFlags, + type APIChannel, + type APIGuild, + type APIGuildMember, + type APIRole, + type APIUser, + type APIEmbed +} from 'discord-api-types/v10'; +import { Embed, Guild, GuildMember, Role, TextChannel, User } from 'discord.js'; import { resolve } from 'node:path'; export const client = new SapphireClient(CLIENT_OPTIONS); +export function createEmbed(data: APIEmbed) { + return Reflect.construct(Embed, [data]); +} + export const userData: APIUser = { id: '266624760782258186', username: 'Skyra', discriminator: '7023', - avatar: '09b52e547fa797c47c7877cd10eb6ba8' + avatar: '09b52e547fa797c47c7877cd10eb6ba8', + global_name: null }; export function createUser(data: Partial = {}) { @@ -36,7 +44,8 @@ export const guildMemberData: APIGuildMember = { nick: null, roles: [], premium_since: null, - joined_at: '2019-02-03T21:57:10.354Z' + joined_at: '2019-02-03T21:57:10.354Z', + flags: GuildMemberFlags.DidRejoin }; export function createGuildMember(data: Partial = {}, g: Guild = guild) { @@ -55,7 +64,8 @@ export const roleData: APIRole = { position: 0, permissions: '104189505', managed: false, - mentionable: false + mentionable: false, + flags: RoleFlags.InPrompt }; export function createRole(data: Partial = {}, g: Guild = guild) { @@ -80,7 +90,7 @@ export const guildData: APIGuild = { features: [ GuildFeature.News, GuildFeature.AnimatedIcon, - GuildFeature.Commerce, + GuildFeature.Discoverable, GuildFeature.WelcomeScreenEnabled, GuildFeature.InviteSplash, GuildFeature.Community @@ -102,6 +112,7 @@ export const guildData: APIGuild = { splash: null, hub_type: null, stickers: [], + safety_alerts_channel_id: null, system_channel_flags: GuildSystemChannelFlags.SuppressJoinNotifications, system_channel_id: '254360814063058944', vanity_url_code: null, @@ -133,7 +144,7 @@ export const textChannelData: APIChannel = { }; export function createTextChannel(data: Partial = {}, g: Guild = guild) { - const c = Reflect.construct(TextChannel, [guild, { ...textChannelData, ...data }]) as TextChannel; + const c = Reflect.construct(TextChannel, [guild, { ...textChannelData, ...data }, client]) as TextChannel; g.channels.cache.set(c.id, c); g.client.channels.cache.set(c.id, c); return c; @@ -147,7 +158,11 @@ function addCommand(command: SkyraCommand) { for (const alias of command.aliases) commands.aliases.set(alias, command); } -class Command extends SkyraCommand {} +class Command extends SkyraCommand { + public override messageRun(): unknown { + throw new Error('Method not implemented.'); + } +} addCommand( new Command( { diff --git a/tests/tsconfig.json b/tests/tsconfig.json index b49316b7aa4..76557823e8a 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,9 +1,9 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { + "rootDir": ".", "noEmit": true, - "incremental": false, - "baseUrl": ".", + "types": ["vitest/globals"], "paths": { "#utils/*": ["../src/lib/util/*"], "#lib/*": ["../src/lib/*"], @@ -12,7 +12,10 @@ "#root/*": ["../src/*"] } }, - "include": [".", "../src/**/*"], - "exclude": ["../dist/**/*"], - "references": [{ "path": "../src" }] + "include": [".", "../src"], + "references": [{ "path": "../src" }], + "ts-node": { + "esm": true, + "typeCheck": false + } } diff --git a/tests/jest.setup.ts b/tests/vitest.setup.ts similarity index 100% rename from tests/jest.setup.ts rename to tests/vitest.setup.ts diff --git a/tsconfig.base.json b/tsconfig.base.json index 0d38bbc8244..b58e9937bf1 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,5 +1,5 @@ { - "extends": "@sapphire/ts-config", + "extends": ["@sapphire/ts-config", "@sapphire/ts-config/extra-strict", "@sapphire/ts-config/decorators", "@sapphire/ts-config/verbatim"], "compilerOptions": { "target": "ESNext", "removeComments": true diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index dc864cade07..df39fa6ffc9 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -4,5 +4,5 @@ "allowJs": true, "checkJs": true }, - "include": ["src", "tests", "scripts", "ormconfig.js", "babel.config.js", "jest.config.mjs"] + "include": ["src", "tests", "scripts", "ormconfig.js", "vitest.config.ts"] } diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 00000000000..105a9ee4ddb --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,93 @@ +import { resolve } from 'node:path'; +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + resolve: { + alias: [ + { + find: '#lib', + replacement: '#lib', + customResolver(source) { + if (source === '#lib/database') return resolve('src/lib/database/index.ts'); + if (source === '#lib/database/entities') return resolve('src/lib/database/entities/index.ts'); + if (source === '#lib/database/keys') return resolve('src/lib/database/keys/index.ts'); + if (source === '#lib/database/settings') return resolve('src/lib/database/settings/index.ts'); + if (source === '#lib/discord') return resolve('src/lib/discord/index.ts'); + if (source === '#lib/moderation') return resolve('src/lib/moderation/index.ts'); + if (source === '#lib/moderation/managers') return resolve('src/lib/moderation/managers/index.ts'); + if (source === '#lib/moderation/workers') return resolve('src/lib/moderation/workers/index.ts'); + if (source === '#lib/structures') return resolve('src/lib/structures/index.ts'); + if (source === '#lib/structures/managers') return resolve('src/lib/structures/managers/index.ts'); + if (source === '#lib/structures/color') return resolve('src/lib/structures/color/index.ts'); + if (source === '#lib/setup') return resolve('src/lib/setup/index.ts'); + if (source === '#lib/types') return resolve('src/lib/types/index.ts'); + if (source === '#lib/i18n/languageKeys') return resolve('src/lib/i18n/languageKeys/index.ts'); + return source.replace('#lib', resolve('src/lib')); + } + }, + { find: /^#root\/(.*)/, replacement: resolve('src/$1.ts') }, + { find: '#languages', replacement: resolve('src/languages/index.ts') }, + { + find: '#utils', + replacement: '#utils', + customResolver(source) { + if (source === '#utils/common') return resolve('src/lib/util/common/index.ts'); + if (source === '#utils/functions') return resolve('src/lib/util/functions/index.ts'); + return source.replace('#utils', resolve('src/lib/util')); + } + }, + { find: /^#mocks\/(.*)/, replacement: resolve('tests/mocks/$1.ts') } + ] + }, + test: { + setupFiles: ['./tests/vitest.setup.ts'], + globals: true, + coverage: { + reporter: ['text', 'lcov', 'clover'], + include: ['src/lib/**'], + exclude: [ + 'src/lib/api', + 'src/lib/database/entities', + 'src/lib/database/index.ts', + 'src/lib/database/migrations', + 'src/lib/database/repositories', + 'src/lib/database/settings', + 'src/lib/database/utils', + 'src/lib/discord', + 'src/lib/env', + 'src/lib/extensions', + 'src/lib/games/base', + 'src/lib/games/connect-four', + 'src/lib/games/HungerGamesUsage.ts', + 'src/lib/games/Slotmachine.ts', + 'src/lib/games/tic-tac-toe', + 'src/lib/games/WheelOfFortune.ts', + 'src/lib/i18n/structures/Augments.d.ts', + 'src/lib/moderation', + 'src/lib/setup/PaginatedMessage.ts', + 'src/lib/SkyraClient.ts', + 'src/lib/structures', + 'src/lib/types', + 'src/lib/util/APIs', + 'src/lib/util/Color.ts', + 'src/lib/util/decorators.ts', + 'src/lib/util/External', + 'src/lib/util/Leaderboard.ts', + 'src/lib/util/Links', + 'src/lib/util/LongLivingReactionCollector.ts', + 'src/lib/util/Models', + 'src/lib/util/Notifications', + 'src/lib/util/Parsers', + 'src/lib/util/PreciseTimeout.ts', + 'src/lib/util/PromptList.ts', + 'src/lib/util/Security/GuildSecurity.ts', + 'src/lib/util/Security/ModerationActions.ts', + 'src/lib/util/Timers.ts', + 'src/lib/weather' + ] + } + }, + esbuild: { + target: 'es2022' + } +}); diff --git a/yarn.lock b/yarn.lock index f27cc6b5625..2c66b24d0c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,9 +5,9 @@ __metadata: version: 6 cacheKey: 8 -"0x@npm:^5.5.0": - version: 5.5.0 - resolution: "0x@npm:5.5.0" +"0x@npm:^5.7.0": + version: 5.7.0 + resolution: "0x@npm:5.7.0" dependencies: ajv: ^8.8.2 browserify: ^17.0.0 @@ -39,7 +39,7 @@ __metadata: which: ^2.0.2 bin: 0x: cmd.js - checksum: 140e1c6e591b02deafc67af4504e85285e5d4430c26fb0c057db665cc5e10f891c2abe07be0fb66ba35ad44ab840f6b611bfa04bd82e60c80d957d6b730f16c4 + checksum: 05e229a656e2680a6daa1cfc53f5244cece0c4149de8ce93e6b5a487d452722ff364a6faf0e09ac12af28737398809760febb353d2609ed9ecff25706b24b42c languageName: node linkType: hard @@ -50,26 +50,17 @@ __metadata: languageName: node linkType: hard -"@ampproject/remapping@npm:^2.2.0": - version: 2.2.0 - resolution: "@ampproject/remapping@npm:2.2.0" +"@ampproject/remapping@npm:^2.2.1": + version: 2.2.1 + resolution: "@ampproject/remapping@npm:2.2.1" dependencies: - "@jridgewell/gen-mapping": ^0.1.0 + "@jridgewell/gen-mapping": ^0.3.0 "@jridgewell/trace-mapping": ^0.3.9 - checksum: d74d170d06468913921d72430259424b7e4c826b5a7d39ff839a29d547efb97dc577caa8ba3fb5cf023624e9af9d09651afc3d4112a45e2050328abc9b3a2292 - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/code-frame@npm:7.22.5" - dependencies: - "@babel/highlight": ^7.22.5 - checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6 + checksum: 03c04fd526acc64a1f4df22651186f3e5ef0a9d6d6530ce4482ec9841269cf7a11dbb8af79237c282d721c5312024ff17529cd72cc4768c11e999b58e2302079 languageName: node linkType: hard -"@babel/code-frame@npm:^7.22.13": +"@babel/code-frame@npm:^7.0.0": version: 7.22.13 resolution: "@babel/code-frame@npm:7.22.13" dependencies: @@ -79,2194 +70,961 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.22.5, @babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/compat-data@npm:7.22.9" - checksum: bed77d9044ce948b4327b30dd0de0779fa9f3a7ed1f2d31638714ed00229fa71fc4d1617ae0eb1fad419338d3658d0e9a5a083297451e09e73e078d0347ff808 +"@babel/helper-validator-identifier@npm:^7.22.20": + version: 7.22.20 + resolution: "@babel/helper-validator-identifier@npm:7.22.20" + checksum: 136412784d9428266bcdd4d91c32bcf9ff0e8d25534a9d94b044f77fe76bc50f941a90319b05aafd1ec04f7d127cd57a179a3716009ff7f3412ef835ada95bdc languageName: node linkType: hard -"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/core@npm:7.22.9" +"@babel/highlight@npm:^7.22.13": + version: 7.22.20 + resolution: "@babel/highlight@npm:7.22.20" dependencies: - "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.22.5 - "@babel/generator": ^7.22.9 - "@babel/helper-compilation-targets": ^7.22.9 - "@babel/helper-module-transforms": ^7.22.9 - "@babel/helpers": ^7.22.6 - "@babel/parser": ^7.22.7 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.8 - "@babel/types": ^7.22.5 - convert-source-map: ^1.7.0 - debug: ^4.1.0 - gensync: ^1.0.0-beta.2 - json5: ^2.2.2 - semver: ^6.3.1 - checksum: 7bf069aeceb417902c4efdaefab1f7b94adb7dea694a9aed1bda2edf4135348a080820529b1a300c6f8605740a00ca00c19b2d5e74b5dd489d99d8c11d5e56d1 + "@babel/helper-validator-identifier": ^7.22.20 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + checksum: 84bd034dca309a5e680083cd827a766780ca63cef37308404f17653d32366ea76262bd2364b2d38776232f2d01b649f26721417d507e8b4b6da3e4e739f6d134 languageName: node linkType: hard -"@babel/generator@npm:^7.22.9, @babel/generator@npm:^7.7.2": - version: 7.22.9 - resolution: "@babel/generator@npm:7.22.9" +"@babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.22.5": + version: 7.23.2 + resolution: "@babel/runtime@npm:7.23.2" dependencies: - "@babel/types": ^7.22.5 - "@jridgewell/gen-mapping": ^0.3.2 - "@jridgewell/trace-mapping": ^0.3.17 - jsesc: ^2.5.1 - checksum: 7c9d2c58b8d5ac5e047421a6ab03ec2ff5d9a5ff2c2212130a0055e063ac349e0b19d435537d6886c999771aef394832e4f54cd9fc810100a7f23d982f6af06b + regenerator-runtime: ^0.14.0 + checksum: 6c4df4839ec75ca10175f636d6362f91df8a3137f86b38f6cd3a4c90668a0fe8e9281d320958f4fbd43b394988958585a17c3aab2a4ea6bf7316b22916a371fb languageName: node linkType: hard -"@babel/generator@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/generator@npm:7.23.0" - dependencies: - "@babel/types": ^7.23.0 - "@jridgewell/gen-mapping": ^0.3.2 - "@jridgewell/trace-mapping": ^0.3.17 - jsesc: ^2.5.1 - checksum: 8efe24adad34300f1f8ea2add420b28171a646edc70f2a1b3e1683842f23b8b7ffa7e35ef0119294e1901f45bfea5b3dc70abe1f10a1917ccdfb41bed69be5f1 +"@bcoe/v8-coverage@npm:^0.2.3": + version: 0.2.3 + resolution: "@bcoe/v8-coverage@npm:0.2.3" + checksum: 850f9305536d0f2bd13e9e0881cb5f02e4f93fad1189f7b2d4bebf694e3206924eadee1068130d43c11b750efcc9405f88a8e42ef098b6d75239c0f047de1a27 languageName: node linkType: hard -"@babel/helper-annotate-as-pure@npm:^7.18.6, @babel/helper-annotate-as-pure@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-annotate-as-pure@npm:7.22.5" +"@commitlint/cli@npm:^18.2.0": + version: 18.2.0 + resolution: "@commitlint/cli@npm:18.2.0" dependencies: - "@babel/types": ^7.22.5 - checksum: 53da330f1835c46f26b7bf4da31f7a496dee9fd8696cca12366b94ba19d97421ce519a74a837f687749318f94d1a37f8d1abcbf35e8ed22c32d16373b2f6198d + "@commitlint/format": ^18.1.0 + "@commitlint/lint": ^18.1.0 + "@commitlint/load": ^18.2.0 + "@commitlint/read": ^18.1.0 + "@commitlint/types": ^18.1.0 + execa: ^5.0.0 + lodash.isfunction: ^3.0.9 + resolve-from: 5.0.0 + resolve-global: 1.0.0 + yargs: ^17.0.0 + bin: + commitlint: cli.js + checksum: 0bb2ec1fa0474e22162bfee896f97db13ec1e1dae29885f9ce25cdffb583984f2013c3b7930c8404ffccb1570b60580a0549943e5e93f1e2ddb14f2c5fbd8f74 languageName: node linkType: hard -"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.22.5" +"@commitlint/config-conventional@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/config-conventional@npm:18.1.0" dependencies: - "@babel/types": ^7.22.5 - checksum: d753acac62399fc6dd354cf1b9441bde0c331c2fe792a4c14904c5e5eafc3cac79478f6aa038e8a51c1148b0af6710a2e619855e4b5d54497ac972eaffed5884 + conventional-changelog-conventionalcommits: ^7.0.2 + checksum: 1cbb05b52f8e288c977e08453b8add7c3d2802b2c9ec3cbb65cca38ea5e6ebe56a276c0eb5bc81b0d1630ca839ce106b71428f31d6db796860bc63c317250bba languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.22.5, @babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/helper-compilation-targets@npm:7.22.9" +"@commitlint/config-validator@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/config-validator@npm:18.1.0" dependencies: - "@babel/compat-data": ^7.22.9 - "@babel/helper-validator-option": ^7.22.5 - browserslist: ^4.21.9 - lru-cache: ^5.1.1 - semver: ^6.3.1 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: ea0006c6a93759025f4a35a25228ae260538c9f15023e8aac2a6d45ca68aef4cf86cfc429b19af9a402cbdd54d5de74ad3fbcf6baa7e48184dc079f1a791e178 + "@commitlint/types": ^18.1.0 + ajv: ^8.11.0 + checksum: 3ceb6e8a21467989b79bceaca6ff2c02a5f23df0d27cc2c2fc4fbbd3346e503963aefa32635ea2b2d63fd3860c193dd6dd070b1427dd968ecbea98616385aa57 languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.22.5, @babel/helper-create-class-features-plugin@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/helper-create-class-features-plugin@npm:7.22.6" +"@commitlint/ensure@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/ensure@npm:18.1.0" dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.5 - "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.5 - "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.6 - "@nicolo-ribaudo/semver-v6": ^6.3.3 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10412e8a509a607cde6137288d3f12b1f91acd374e29e6dd6a277b67217e9f4c932a0acd89eeda837c8432916df775a8af6321aeb8d8b131ccdbf7688208dda1 + "@commitlint/types": ^18.1.0 + lodash.camelcase: ^4.3.0 + lodash.kebabcase: ^4.1.1 + lodash.snakecase: ^4.1.1 + lodash.startcase: ^4.4.0 + lodash.upperfirst: ^4.3.1 + checksum: 3d181d44f87924b46d65e0f8663ef0465c8c9ad7690b85acba843398fca06110f5ea33f3da336ada1c1f7cad4c66b7568e391c78e00669704ea07f8900b7c74b languageName: node linkType: hard -"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-create-regexp-features-plugin@npm:7.22.5" - dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - regexpu-core: ^5.3.1 - semver: ^6.3.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 94932145beeb1f91856be25fea8de30b4b81b63fbc7c5a207ed97a5ddc34cd1e9b04041ed28bd24ec09cdcfbb62e8d66f820e4fe864672afe0aa2f357c784e11 +"@commitlint/execute-rule@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/execute-rule@npm:18.1.0" + checksum: c0040df75eddbcef6583f88906ab348f988c1a4073b9c34b12212af31903331d9db8c96fe305c05052f652ebbbf34b79cc6d868e61ec36c92f248139efb29cf0 languageName: node linkType: hard -"@babel/helper-define-polyfill-provider@npm:^0.4.1": - version: 0.4.1 - resolution: "@babel/helper-define-polyfill-provider@npm:0.4.1" +"@commitlint/format@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/format@npm:18.1.0" dependencies: - "@babel/helper-compilation-targets": ^7.22.6 - "@babel/helper-plugin-utils": ^7.22.5 - debug: ^4.1.1 - lodash.debounce: ^4.0.8 - resolve: ^1.14.2 - peerDependencies: - "@babel/core": ^7.4.0-0 - checksum: 712b440cdd343ac7c4617225f91b0a9db5a7b1c96356b720e011af64ad6c4da9c66889f8d2962a0a2ae2e4ccb6a9b4a210c4a3c8c8ff103846b3d93b61bc6634 - languageName: node - linkType: hard - -"@babel/helper-environment-visitor@npm:^7.22.20": - version: 7.22.20 - resolution: "@babel/helper-environment-visitor@npm:7.22.20" - checksum: d80ee98ff66f41e233f36ca1921774c37e88a803b2f7dca3db7c057a5fea0473804db9fb6729e5dbfd07f4bed722d60f7852035c2c739382e84c335661590b69 + "@commitlint/types": ^18.1.0 + chalk: ^4.1.0 + checksum: ad631b7ab2c6a5f7d443a16406709066325be8449b75792c9f7d3e96e64a9a58bc098fcf630935d57b59055ab6dc9aa056b033af0a9102e4b08a446d5d8a8af0 languageName: node linkType: hard -"@babel/helper-environment-visitor@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-environment-visitor@npm:7.22.5" - checksum: 248532077d732a34cd0844eb7b078ff917c3a8ec81a7f133593f71a860a582f05b60f818dc5049c2212e5baa12289c27889a4b81d56ef409b4863db49646c4b1 +"@commitlint/is-ignored@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/is-ignored@npm:18.1.0" + dependencies: + "@commitlint/types": ^18.1.0 + semver: 7.5.4 + checksum: 650c4e68330b2c59ebe4747114af8a3895fa3e01ae00dade008a12e7dfe3413f6a04d3f0859f6354a401ba7c2a84a6a87588d3e8f0be99d9e7db6526d5cc257d languageName: node linkType: hard -"@babel/helper-function-name@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-function-name@npm:7.22.5" +"@commitlint/lint@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/lint@npm:18.1.0" dependencies: - "@babel/template": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: 6b1f6ce1b1f4e513bf2c8385a557ea0dd7fa37971b9002ad19268ca4384bbe90c09681fe4c076013f33deabc63a53b341ed91e792de741b4b35e01c00238177a + "@commitlint/is-ignored": ^18.1.0 + "@commitlint/parse": ^18.1.0 + "@commitlint/rules": ^18.1.0 + "@commitlint/types": ^18.1.0 + checksum: 79dfa041c8741053fdf0f6125c61731e3fa09cdfef9141a772a6320bfba347a8e8b0b02e67e063ca54da0dfaa44c4defab9f566dfc0f0bba498404a37cef01ce languageName: node linkType: hard -"@babel/helper-function-name@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/helper-function-name@npm:7.23.0" +"@commitlint/load@npm:>6.1.1, @commitlint/load@npm:^18.2.0": + version: 18.2.0 + resolution: "@commitlint/load@npm:18.2.0" dependencies: - "@babel/template": ^7.22.15 - "@babel/types": ^7.23.0 - checksum: e44542257b2d4634a1f979244eb2a4ad8e6d75eb6761b4cfceb56b562f7db150d134bc538c8e6adca3783e3bc31be949071527aa8e3aab7867d1ad2d84a26e10 + "@commitlint/config-validator": ^18.1.0 + "@commitlint/execute-rule": ^18.1.0 + "@commitlint/resolve-extends": ^18.1.0 + "@commitlint/types": ^18.1.0 + "@types/node": ^18.11.9 + chalk: ^4.1.0 + cosmiconfig: ^8.0.0 + cosmiconfig-typescript-loader: ^5.0.0 + lodash.isplainobject: ^4.0.6 + lodash.merge: ^4.6.2 + lodash.uniq: ^4.5.0 + resolve-from: ^5.0.0 + checksum: df624f81e9a69c2cd0bd8b32e52abd47200fafe13552e5cb79edee71edbe971bf4b4c75e1931e329a555da5e9dd96d6863d1703308b18331464d9996027ed398 languageName: node linkType: hard -"@babel/helper-hoist-variables@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-hoist-variables@npm:7.22.5" - dependencies: - "@babel/types": ^7.22.5 - checksum: 394ca191b4ac908a76e7c50ab52102669efe3a1c277033e49467913c7ed6f7c64d7eacbeabf3bed39ea1f41731e22993f763b1edce0f74ff8563fd1f380d92cc +"@commitlint/message@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/message@npm:18.1.0" + checksum: b002d38a00467153090b784c77f8dc26060754acc62b0cfee1b205762c9eacb624f9d2c7a9ab9e53b16a6839339672dfba3763c31f72d51ee0134099427b1350 languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-member-expression-to-functions@npm:7.22.5" +"@commitlint/parse@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/parse@npm:18.1.0" dependencies: - "@babel/types": ^7.22.5 - checksum: 4bd5791529c280c00743e8bdc669ef0d4cd1620d6e3d35e0d42b862f8262bc2364973e5968007f960780344c539a4b9cf92ab41f5b4f94560a9620f536de2a39 + "@commitlint/types": ^18.1.0 + conventional-changelog-angular: ^6.0.0 + conventional-commits-parser: ^5.0.0 + checksum: 35feae6b9bc29dc068f1e8e78000225b2f99aa598ab52395f841d926380dc95611839a15df1ecf2cfbd9c1e2a7d85deb3be845f7ecdd8f520a3487d2289781b7 languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-module-imports@npm:7.22.5" +"@commitlint/read@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/read@npm:18.1.0" dependencies: - "@babel/types": ^7.22.5 - checksum: 9ac2b0404fa38b80bdf2653fbeaf8e8a43ccb41bd505f9741d820ed95d3c4e037c62a1bcdcb6c9527d7798d2e595924c4d025daed73283badc180ada2c9c49ad + "@commitlint/top-level": ^18.1.0 + "@commitlint/types": ^18.1.0 + fs-extra: ^11.0.0 + git-raw-commits: ^2.0.11 + minimist: ^1.2.6 + checksum: 3169febebe94f7d5453ab7461cdc3374d794c5c8e94525c95181d877d44526abbb053d1e991eae63b9bf1c3dd9cace0e91a01ed1088577c03aa4e4f90a442eb5 languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.22.5, @babel/helper-module-transforms@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/helper-module-transforms@npm:7.22.9" +"@commitlint/resolve-extends@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/resolve-extends@npm:18.1.0" dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-module-imports": ^7.22.5 - "@babel/helper-simple-access": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/helper-validator-identifier": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 2751f77660518cf4ff027514d6f4794f04598c6393be7b04b8e46c6e21606e11c19f3f57ab6129a9c21bacdf8b3ffe3af87bb401d972f34af2d0ffde02ac3001 + "@commitlint/config-validator": ^18.1.0 + "@commitlint/types": ^18.1.0 + import-fresh: ^3.0.0 + lodash.mergewith: ^4.6.2 + resolve-from: ^5.0.0 + resolve-global: ^1.0.0 + checksum: 41ef9a38c59e505cee4c14ce21e7ca27af3e68e209890fa83673c1fc8393a7a708cf486dd6c72af97cd23392e6a5d47b363e1a3545c44ed7f366f78e26b6bfa1 languageName: node linkType: hard -"@babel/helper-optimise-call-expression@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-optimise-call-expression@npm:7.22.5" +"@commitlint/rules@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/rules@npm:18.1.0" dependencies: - "@babel/types": ^7.22.5 - checksum: c70ef6cc6b6ed32eeeec4482127e8be5451d0e5282d5495d5d569d39eb04d7f1d66ec99b327f45d1d5842a9ad8c22d48567e93fc502003a47de78d122e355f7c + "@commitlint/ensure": ^18.1.0 + "@commitlint/message": ^18.1.0 + "@commitlint/to-lines": ^18.1.0 + "@commitlint/types": ^18.1.0 + execa: ^5.0.0 + checksum: c4e5ce76bc304dbf3ce0c0c4ab15eacd6596671a02e4b4c37e0d8c6ab2ca8163589ec4dedff0b013a336df0b4af7996f83d090b5aad936e2fa01b9df4711da3b languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.19.0, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": - version: 7.22.5 - resolution: "@babel/helper-plugin-utils@npm:7.22.5" - checksum: c0fc7227076b6041acd2f0e818145d2e8c41968cc52fb5ca70eed48e21b8fe6dd88a0a91cbddf4951e33647336eb5ae184747ca706817ca3bef5e9e905151ff5 +"@commitlint/to-lines@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/to-lines@npm:18.1.0" + checksum: 90da051ce2e6f3478b053e26f612de48454c0a73a8d9ec15df2cc0431e83c2572d6179c4a4c5b07bceccfb3018aab4897058196642769812238aa79ab3273999 languageName: node linkType: hard -"@babel/helper-remap-async-to-generator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-remap-async-to-generator@npm:7.22.5" +"@commitlint/top-level@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/top-level@npm:18.1.0" dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-wrap-function": ^7.22.5 - "@babel/types": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 1e51dcff1c22e97ea3d22034b77788048eb6d8c6860325bd7a1046b7a7135730cefd93b5c96fd9839d76031095d5ffb6f0cd6ee90a5d69a4c7de980d7f4623d9 + find-up: ^5.0.0 + checksum: 62729536fdf602f07613df194b7adfb76ee68624fd504bc05cb0d2e1eab3c099926f18987f29e79b1bbc2bd75b385f565fe867487f024a15d67ad090a9023b78 languageName: node linkType: hard -"@babel/helper-replace-supers@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-replace-supers@npm:7.22.5" +"@commitlint/types@npm:^18.1.0": + version: 18.1.0 + resolution: "@commitlint/types@npm:18.1.0" dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.5 - "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: af29deff6c6dc3fa2d1a517390716aa3f4d329855e8689f1d5c3cb07c1b898e614a5e175f1826bb58e9ff1480e6552885a71a9a0ba5161787aaafa2c79b216cc + chalk: ^4.1.0 + checksum: 50501399dd2e280e06d9b6605a9b9b09a01977a662fc30c57fa70ac84a679f74cdcc7d8d3204937423be94707208983f5fcc43e4d488bbea25d4a2cdc80f3e82 languageName: node linkType: hard -"@babel/helper-simple-access@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-simple-access@npm:7.22.5" +"@cspotcode/source-map-support@npm:^0.8.0": + version: 0.8.1 + resolution: "@cspotcode/source-map-support@npm:0.8.1" dependencies: - "@babel/types": ^7.22.5 - checksum: fe9686714caf7d70aedb46c3cce090f8b915b206e09225f1e4dbc416786c2fdbbee40b38b23c268b7ccef749dd2db35f255338fb4f2444429874d900dede5ad2 + "@jridgewell/trace-mapping": 0.3.9 + checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa languageName: node linkType: hard -"@babel/helper-skip-transparent-expression-wrappers@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.22.5" +"@discordjs/builders@npm:^1.6.5": + version: 1.6.5 + resolution: "@discordjs/builders@npm:1.6.5" dependencies: - "@babel/types": ^7.22.5 - checksum: 1012ef2295eb12dc073f2b9edf3425661e9b8432a3387e62a8bc27c42963f1f216ab3124228015c748770b2257b4f1fda882ca8fa34c0bf485e929ae5bc45244 + "@discordjs/formatters": ^0.3.2 + "@discordjs/util": ^1.0.1 + "@sapphire/shapeshift": ^3.9.2 + discord-api-types: 0.37.50 + fast-deep-equal: ^3.1.3 + ts-mixer: ^6.0.3 + tslib: ^2.6.1 + checksum: 9c5c4d483a79a7c2f73d661433365f2996ae3bc74f95b70a2a31a26b582b7327d45217a78dfe8e304737661731690ef6e34ade7575f63fe8ab61d70ca53b2279 languageName: node linkType: hard -"@babel/helper-split-export-declaration@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/helper-split-export-declaration@npm:7.22.6" - dependencies: - "@babel/types": ^7.22.5 - checksum: e141cace583b19d9195f9c2b8e17a3ae913b7ee9b8120246d0f9ca349ca6f03cb2c001fd5ec57488c544347c0bb584afec66c936511e447fd20a360e591ac921 +"@discordjs/collection@npm:^1.5.1, @discordjs/collection@npm:^1.5.3": + version: 1.5.3 + resolution: "@discordjs/collection@npm:1.5.3" + checksum: fefed19bea0f69053d195f9d9dc8af07ca5d8c9b1064581e0aa14bda2b70e632b93c164d5ef3e4910f5442369612ff4eec8d52a700aec562510c19b223f67023 languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-string-parser@npm:7.22.5" - checksum: 836851ca5ec813077bbb303acc992d75a360267aa3b5de7134d220411c852a6f17de7c0d0b8c8dcc0f567f67874c00f4528672b2a4f1bc978a3ada64c8c78467 +"@discordjs/core@npm:^1.0.1": + version: 1.0.1 + resolution: "@discordjs/core@npm:1.0.1" + dependencies: + "@discordjs/rest": ^2.0.1 + "@discordjs/util": ^1.0.1 + "@discordjs/ws": ^1.0.1 + "@sapphire/snowflake": ^3.5.1 + "@vladfrangu/async_event_emitter": ^2.2.2 + discord-api-types: 0.37.50 + checksum: 896d9abb2157bb46ca3c8a1b0b7be22e40df8d04645ae7374eac987609a2668a52bb165932706483bc3f79518c785466e176add512c370dbf7258d80effa1c2b languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.22.20": - version: 7.22.20 - resolution: "@babel/helper-validator-identifier@npm:7.22.20" - checksum: 136412784d9428266bcdd4d91c32bcf9ff0e8d25534a9d94b044f77fe76bc50f941a90319b05aafd1ec04f7d127cd57a179a3716009ff7f3412ef835ada95bdc +"@discordjs/formatters@npm:^0.3.2": + version: 0.3.2 + resolution: "@discordjs/formatters@npm:0.3.2" + dependencies: + discord-api-types: 0.37.50 + checksum: 653c88595fc6c25c1beedcd88b05a3f1241fef69844cc96e45f2cd34fea9ff07892c7f3b57edb4008ad59f7e62bca1b7b35400c6200b07ed42eef7189672d509 languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-validator-identifier@npm:7.22.5" - checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea +"@discordjs/rest@npm:^2.0.1": + version: 2.0.1 + resolution: "@discordjs/rest@npm:2.0.1" + dependencies: + "@discordjs/collection": ^1.5.3 + "@discordjs/util": ^1.0.1 + "@sapphire/async-queue": ^1.5.0 + "@sapphire/snowflake": ^3.5.1 + "@vladfrangu/async_event_emitter": ^2.2.2 + discord-api-types: 0.37.50 + magic-bytes.js: ^1.0.15 + tslib: ^2.6.1 + undici: 5.22.1 + checksum: 36e33489293956e6356e68d69857c2ea910aa376be8c530d6aa640f5887d119d2c0abb736b427353bbdad92c534917fd38adb3a8529c87bdd010c75017ae6b27 languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.21.0, @babel/helper-validator-option@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-validator-option@npm:7.22.5" - checksum: bbeca8a85ee86990215c0424997438b388b8d642d69b9f86c375a174d3cdeb270efafd1ff128bc7a1d370923d13b6e45829ba8581c027620e83e3a80c5c414b3 +"@discordjs/util@npm:^1.0.1": + version: 1.0.1 + resolution: "@discordjs/util@npm:1.0.1" + checksum: b55d5284cd8306b0e77a303c41fa99dcc650babaf9ef2f02ea38b1f8ecc7218a7694128714343379dbf6b2a402a0851e00862c0d974ad07b8e980722f5139d73 languageName: node linkType: hard -"@babel/helper-wrap-function@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-wrap-function@npm:7.22.5" +"@discordjs/ws@npm:^1.0.1": + version: 1.0.1 + resolution: "@discordjs/ws@npm:1.0.1" dependencies: - "@babel/helper-function-name": ^7.22.5 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: a4ba2d7577ad3ce92fadaa341ffce3b0e4b389808099b07c80847f9be0852f4b42344612bc1b3d1b796ffb75be56d5957c5c56a1734f6aee5ccbb7cd9ab12691 + "@discordjs/collection": ^1.5.3 + "@discordjs/rest": ^2.0.1 + "@discordjs/util": ^1.0.1 + "@sapphire/async-queue": ^1.5.0 + "@types/ws": ^8.5.5 + "@vladfrangu/async_event_emitter": ^2.2.2 + discord-api-types: 0.37.50 + tslib: ^2.6.1 + ws: ^8.13.0 + checksum: d34f17646606dbac82989c3aa3fddd1e2a23da532b96f1fc130a0ddb6735079523f09a70b560b315f3e6634b6336accc48680539e4c62cf34826d79c6304778a languageName: node linkType: hard -"@babel/helpers@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/helpers@npm:7.22.6" - dependencies: - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.6 - "@babel/types": ^7.22.5 - checksum: 5c1f33241fe7bf7709868c2105134a0a86dca26a0fbd508af10a89312b1f77ca38ebae43e50be3b208613c5eacca1559618af4ca236f0abc55d294800faeff30 +"@esbuild/android-arm64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/android-arm64@npm:0.18.20" + conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@babel/highlight@npm:^7.22.13": - version: 7.22.20 - resolution: "@babel/highlight@npm:7.22.20" - dependencies: - "@babel/helper-validator-identifier": ^7.22.20 - chalk: ^2.4.2 - js-tokens: ^4.0.0 - checksum: 84bd034dca309a5e680083cd827a766780ca63cef37308404f17653d32366ea76262bd2364b2d38776232f2d01b649f26721417d507e8b4b6da3e4e739f6d134 +"@esbuild/android-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/android-arm64@npm:0.19.5" + conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@babel/highlight@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/highlight@npm:7.22.5" - dependencies: - "@babel/helper-validator-identifier": ^7.22.5 - chalk: ^2.0.0 - js-tokens: ^4.0.0 - checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4 +"@esbuild/android-arm@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/android-arm@npm:0.18.20" + conditions: os=android & cpu=arm languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.22.7": - version: 7.22.7 - resolution: "@babel/parser@npm:7.22.7" - bin: - parser: ./bin/babel-parser.js - checksum: 02209ddbd445831ee8bf966fdf7c29d189ed4b14343a68eb2479d940e7e3846340d7cc6bd654a5f3d87d19dc84f49f50a58cf9363bee249dc5409ff3ba3dab54 +"@esbuild/android-arm@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/android-arm@npm:0.19.5" + conditions: os=android & cpu=arm languageName: node linkType: hard -"@babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/parser@npm:7.23.0" - bin: - parser: ./bin/babel-parser.js - checksum: 453fdf8b9e2c2b7d7b02139e0ce003d1af21947bbc03eb350fb248ee335c9b85e4ab41697ddbdd97079698de825a265e45a0846bb2ed47a2c7c1df833f42a354 +"@esbuild/android-x64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/android-x64@npm:0.18.20" + conditions: os=android & cpu=x64 languageName: node linkType: hard -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 1e353a060fb2cd8f1256d28cd768f16fb02513f905b9b6d656fb0242c96c341a196fa188b27c2701506a6e27515359fbcc1a5ca7fa8b9b530cf88fbd137baefc +"@esbuild/android-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/android-x64@npm:0.19.5" + conditions: os=android & cpu=x64 languageName: node linkType: hard -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/plugin-transform-optional-chaining": ^7.22.5 - peerDependencies: - "@babel/core": ^7.13.0 - checksum: 16e7a5f3bf2f2ac0ca032a70bf0ebd7e886d84dbb712b55c0643c04c495f0f221fbcbca14b5f8f8027fa6c87a3dafae0934022ad2b409384af6c5c356495b7bd +"@esbuild/darwin-arm64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/darwin-arm64@npm:0.18.20" + conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@babel/plugin-proposal-class-properties@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/plugin-proposal-class-properties@npm:7.18.6" - dependencies: - "@babel/helper-create-class-features-plugin": ^7.18.6 - "@babel/helper-plugin-utils": ^7.18.6 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 49a78a2773ec0db56e915d9797e44fd079ab8a9b2e1716e0df07c92532f2c65d76aeda9543883916b8e0ff13606afeffa67c5b93d05b607bc87653ad18a91422 +"@esbuild/darwin-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/darwin-arm64@npm:0.19.5" + conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@babel/plugin-proposal-decorators@npm:^7.22.7": - version: 7.22.7 - resolution: "@babel/plugin-proposal-decorators@npm:7.22.7" - dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.6 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/plugin-syntax-decorators": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: d9d6f7cc8b3f1450963d3f26909af025836189b81e43c48ad455db5db2319beaf4ad2fda5aa12a1afcf856de11ecd5ee6894a9e906e8de8ee445c79102b50d26 +"@esbuild/darwin-x64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/darwin-x64@npm:0.18.20" + conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2": - version: 7.21.0-placeholder-for-preset-env.2 - resolution: "@babel/plugin-proposal-private-property-in-object@npm:7.21.0-placeholder-for-preset-env.2" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: d97745d098b835d55033ff3a7fb2b895b9c5295b08a5759e4f20df325aa385a3e0bc9bd5ad8f2ec554a44d4e6525acfc257b8c5848a1345cb40f26a30e277e91 +"@esbuild/darwin-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/darwin-x64@npm:0.19.5" + conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@babel/plugin-proposal-unicode-property-regex@npm:^7.4.4": - version: 7.18.6 - resolution: "@babel/plugin-proposal-unicode-property-regex@npm:7.18.6" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.18.6 - "@babel/helper-plugin-utils": ^7.18.6 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: a8575ecb7ff24bf6c6e94808d5c84bb5a0c6dd7892b54f09f4646711ba0ee1e1668032b3c43e3e1dfec2c5716c302e851ac756c1645e15882d73df6ad21ae951 +"@esbuild/freebsd-arm64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/freebsd-arm64@npm:0.18.20" + conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@babel/plugin-syntax-async-generators@npm:^7.8.4": - version: 7.8.4 - resolution: "@babel/plugin-syntax-async-generators@npm:7.8.4" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 7ed1c1d9b9e5b64ef028ea5e755c0be2d4e5e4e3d6cf7df757b9a8c4cfa4193d268176d0f1f7fbecdda6fe722885c7fda681f480f3741d8a2d26854736f05367 +"@esbuild/freebsd-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/freebsd-arm64@npm:0.19.5" + conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@babel/plugin-syntax-bigint@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-bigint@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3a10849d83e47aec50f367a9e56a6b22d662ddce643334b087f9828f4c3dd73bdc5909aaeabe123fed78515767f9ca43498a0e621c438d1cd2802d7fae3c9648 +"@esbuild/freebsd-x64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/freebsd-x64@npm:0.18.20" + conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@babel/plugin-syntax-class-properties@npm:^7.12.13, @babel/plugin-syntax-class-properties@npm:^7.8.3": - version: 7.12.13 - resolution: "@babel/plugin-syntax-class-properties@npm:7.12.13" - dependencies: - "@babel/helper-plugin-utils": ^7.12.13 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 24f34b196d6342f28d4bad303612d7ff566ab0a013ce89e775d98d6f832969462e7235f3e7eaf17678a533d4be0ba45d3ae34ab4e5a9dcbda5d98d49e5efa2fc +"@esbuild/freebsd-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/freebsd-x64@npm:0.19.5" + conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@babel/plugin-syntax-class-static-block@npm:^7.14.5": - version: 7.14.5 - resolution: "@babel/plugin-syntax-class-static-block@npm:7.14.5" - dependencies: - "@babel/helper-plugin-utils": ^7.14.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3e80814b5b6d4fe17826093918680a351c2d34398a914ce6e55d8083d72a9bdde4fbaf6a2dcea0e23a03de26dc2917ae3efd603d27099e2b98380345703bf948 +"@esbuild/linux-arm64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-arm64@npm:0.18.20" + conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@babel/plugin-syntax-decorators@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-decorators@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 643c75a3b603320c499a0542ca97b5cced81e99de02ae9cbfca1a1ec6d938467546a65023b13df742e1b2f94ffe352ddfe908d14b9303fae7514ed9325886a97 +"@esbuild/linux-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-arm64@npm:0.19.5" + conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@babel/plugin-syntax-dynamic-import@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-dynamic-import@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: ce307af83cf433d4ec42932329fad25fa73138ab39c7436882ea28742e1c0066626d224e0ad2988724c82644e41601cef607b36194f695cb78a1fcdc959637bd +"@esbuild/linux-arm@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-arm@npm:0.18.20" + conditions: os=linux & cpu=arm languageName: node linkType: hard -"@babel/plugin-syntax-export-namespace-from@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-export-namespace-from@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 85740478be5b0de185228e7814451d74ab8ce0a26fcca7613955262a26e99e8e15e9da58f60c754b84515d4c679b590dbd3f2148f0f58025f4ae706f1c5a5d4a +"@esbuild/linux-arm@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-arm@npm:0.19.5" + conditions: os=linux & cpu=arm languageName: node linkType: hard -"@babel/plugin-syntax-import-assertions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-import-assertions@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 2b8b5572db04a7bef1e6cd20debf447e4eef7cb012616f5eceb8fa3e23ce469b8f76ee74fd6d1e158ba17a8f58b0aec579d092fb67c5a30e83ccfbc5754916c1 +"@esbuild/linux-ia32@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-ia32@npm:0.18.20" + conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@babel/plugin-syntax-import-attributes@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-import-attributes@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 197b3c5ea2a9649347f033342cb222ab47f4645633695205c0250c6bf2af29e643753b8bb24a2db39948bef08e7c540babfd365591eb57fc110cb30b425ffc47 +"@esbuild/linux-ia32@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-ia32@npm:0.19.5" + conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@babel/plugin-syntax-import-meta@npm:^7.10.4, @babel/plugin-syntax-import-meta@npm:^7.8.3": - version: 7.10.4 - resolution: "@babel/plugin-syntax-import-meta@npm:7.10.4" - dependencies: - "@babel/helper-plugin-utils": ^7.10.4 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 166ac1125d10b9c0c430e4156249a13858c0366d38844883d75d27389621ebe651115cb2ceb6dc011534d5055719fa1727b59f39e1ab3ca97820eef3dcab5b9b +"@esbuild/linux-loong64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-loong64@npm:0.18.20" + conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@babel/plugin-syntax-json-strings@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-json-strings@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: bf5aea1f3188c9a507e16efe030efb996853ca3cadd6512c51db7233cc58f3ac89ff8c6bdfb01d30843b161cfe7d321e1bf28da82f7ab8d7e6bc5464666f354a +"@esbuild/linux-loong64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-loong64@npm:0.19.5" + conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.21.4, @babel/plugin-syntax-jsx@npm:^7.7.2": - version: 7.21.4 - resolution: "@babel/plugin-syntax-jsx@npm:7.21.4" - dependencies: - "@babel/helper-plugin-utils": ^7.20.2 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: bb7309402a1d4e155f32aa0cf216e1fa8324d6c4cfd248b03280028a015a10e46b6efd6565f515f8913918a3602b39255999c06046f7d4b8a5106be2165d724a +"@esbuild/linux-mips64el@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-mips64el@npm:0.18.20" + conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@babel/plugin-syntax-logical-assignment-operators@npm:^7.10.4, @babel/plugin-syntax-logical-assignment-operators@npm:^7.8.3": - version: 7.10.4 - resolution: "@babel/plugin-syntax-logical-assignment-operators@npm:7.10.4" - dependencies: - "@babel/helper-plugin-utils": ^7.10.4 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: aff33577037e34e515911255cdbb1fd39efee33658aa00b8a5fd3a4b903585112d037cce1cc9e4632f0487dc554486106b79ccd5ea63a2e00df4363f6d4ff886 +"@esbuild/linux-mips64el@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-mips64el@npm:0.19.5" + conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@babel/plugin-syntax-nullish-coalescing-operator@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-nullish-coalescing-operator@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 87aca4918916020d1fedba54c0e232de408df2644a425d153be368313fdde40d96088feed6c4e5ab72aac89be5d07fef2ddf329a15109c5eb65df006bf2580d1 +"@esbuild/linux-ppc64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-ppc64@npm:0.18.20" + conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@babel/plugin-syntax-numeric-separator@npm:^7.10.4, @babel/plugin-syntax-numeric-separator@npm:^7.8.3": - version: 7.10.4 - resolution: "@babel/plugin-syntax-numeric-separator@npm:7.10.4" - dependencies: - "@babel/helper-plugin-utils": ^7.10.4 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 01ec5547bd0497f76cc903ff4d6b02abc8c05f301c88d2622b6d834e33a5651aa7c7a3d80d8d57656a4588f7276eba357f6b7e006482f5b564b7a6488de493a1 +"@esbuild/linux-ppc64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-ppc64@npm:0.19.5" + conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@babel/plugin-syntax-object-rest-spread@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-object-rest-spread@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: fddcf581a57f77e80eb6b981b10658421bc321ba5f0a5b754118c6a92a5448f12a0c336f77b8abf734841e102e5126d69110a306eadb03ca3e1547cab31f5cbf +"@esbuild/linux-riscv64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-riscv64@npm:0.18.20" + conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@babel/plugin-syntax-optional-catch-binding@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-optional-catch-binding@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 910d90e72bc90ea1ce698e89c1027fed8845212d5ab588e35ef91f13b93143845f94e2539d831dc8d8ededc14ec02f04f7bd6a8179edd43a326c784e7ed7f0b9 +"@esbuild/linux-riscv64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-riscv64@npm:0.19.5" + conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@babel/plugin-syntax-optional-chaining@npm:^7.8.3": - version: 7.8.3 - resolution: "@babel/plugin-syntax-optional-chaining@npm:7.8.3" - dependencies: - "@babel/helper-plugin-utils": ^7.8.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: eef94d53a1453361553c1f98b68d17782861a04a392840341bc91780838dd4e695209c783631cf0de14c635758beafb6a3a65399846ffa4386bff90639347f30 +"@esbuild/linux-s390x@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-s390x@npm:0.18.20" + conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@babel/plugin-syntax-private-property-in-object@npm:^7.14.5": - version: 7.14.5 - resolution: "@babel/plugin-syntax-private-property-in-object@npm:7.14.5" - dependencies: - "@babel/helper-plugin-utils": ^7.14.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: b317174783e6e96029b743ccff2a67d63d38756876e7e5d0ba53a322e38d9ca452c13354a57de1ad476b4c066dbae699e0ca157441da611117a47af88985ecda +"@esbuild/linux-s390x@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-s390x@npm:0.19.5" + conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@babel/plugin-syntax-top-level-await@npm:^7.14.5, @babel/plugin-syntax-top-level-await@npm:^7.8.3": - version: 7.14.5 - resolution: "@babel/plugin-syntax-top-level-await@npm:7.14.5" - dependencies: - "@babel/helper-plugin-utils": ^7.14.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: bbd1a56b095be7820029b209677b194db9b1d26691fe999856462e66b25b281f031f3dfd91b1619e9dcf95bebe336211833b854d0fb8780d618e35667c2d0d7e +"@esbuild/linux-x64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/linux-x64@npm:0.18.20" + conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.20.0, @babel/plugin-syntax-typescript@npm:^7.3.3, @babel/plugin-syntax-typescript@npm:^7.7.2": - version: 7.20.0 - resolution: "@babel/plugin-syntax-typescript@npm:7.20.0" - dependencies: - "@babel/helper-plugin-utils": ^7.19.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 6189c0b5c32ba3c9a80a42338bd50719d783b20ef29b853d4f03929e971913d3cefd80184e924ae98ad6db09080be8fe6f1ffde9a6db8972523234f0274d36f7 +"@esbuild/linux-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-x64@npm:0.19.5" + conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@babel/plugin-syntax-unicode-sets-regex@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/plugin-syntax-unicode-sets-regex@npm:7.18.6" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.18.6 - "@babel/helper-plugin-utils": ^7.18.6 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: a651d700fe63ff0ddfd7186f4ebc24447ca734f114433139e3c027bc94a900d013cf1ef2e2db8430425ba542e39ae160c3b05f06b59fd4656273a3df97679e9c +"@esbuild/netbsd-x64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/netbsd-x64@npm:0.18.20" + conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@babel/plugin-transform-arrow-functions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-arrow-functions@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 35abb6c57062802c7ce8bd96b2ef2883e3124370c688bbd67609f7d2453802fb73944df8808f893b6c67de978eb2bcf87bbfe325e46d6f39b5fcb09ece11d01a +"@esbuild/netbsd-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/netbsd-x64@npm:0.19.5" + conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@babel/plugin-transform-async-generator-functions@npm:^7.22.7": - version: 7.22.7 - resolution: "@babel/plugin-transform-async-generator-functions@npm:7.22.7" - dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-remap-async-to-generator": ^7.22.5 - "@babel/plugin-syntax-async-generators": ^7.8.4 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 57cd2cce3fb696dadf00e88f168683df69e900b92dadeae07429243c43bc21d5ccdc0c2db61cf5c37bd0fbd893fc455466bef6babe4aa5b79d9cb8ba89f40ae7 +"@esbuild/openbsd-x64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/openbsd-x64@npm:0.18.20" + conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@babel/plugin-transform-async-to-generator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-async-to-generator@npm:7.22.5" - dependencies: - "@babel/helper-module-imports": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-remap-async-to-generator": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: b95f23f99dcb379a9f0a1c2a3bbea3f8dc0e1b16dc1ac8b484fe378370169290a7a63d520959a9ba1232837cf74a80e23f6facbe14fd42a3cda6d3c2d7168e62 +"@esbuild/openbsd-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/openbsd-x64@npm:0.19.5" + conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@babel/plugin-transform-block-scoped-functions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 416b1341858e8ca4e524dee66044735956ced5f478b2c3b9bc11ec2285b0c25d7dbb96d79887169eb938084c95d0a89338c8b2fe70d473bd9dc92e5d9db1732c +"@esbuild/sunos-x64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/sunos-x64@npm:0.18.20" + conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-block-scoping@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 26987002cfe6e24544e60fa35f07052b6557f590c1a1cc5cf35d6dc341d7fea163c1222a2d70d5d2692f0b9860d942fd3ba979848b2995d4debffa387b9b19ae +"@esbuild/sunos-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/sunos-x64@npm:0.19.5" + conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@babel/plugin-transform-class-properties@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-class-properties@npm:7.22.5" - dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: b830152dfc2ff2f647f0abe76e6251babdfbef54d18c4b2c73a6bf76b1a00050a5d998dac80dc901a48514e95604324943a9dd39317073fe0928b559e0e0c579 +"@esbuild/win32-arm64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/win32-arm64@npm:0.18.20" + conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@babel/plugin-transform-class-static-block@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-class-static-block@npm:7.22.5" - dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-class-static-block": ^7.14.5 - peerDependencies: - "@babel/core": ^7.12.0 - checksum: bc48b92dbaf625a14f2bf62382384eef01e0515802426841636ae9146e27395d068c7a8a45e9e15699491b0a01d990f38f179cbc9dc89274a393f85648772f12 +"@esbuild/win32-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/win32-arm64@npm:0.19.5" + conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/plugin-transform-classes@npm:7.22.6" - dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-compilation-targets": ^7.22.6 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 - "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.6 - globals: ^11.1.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 8380e855c01033dbc7460d9acfbc1fc37c880350fa798c2de8c594ef818ade0e4c96173ec72f05f2a4549d8d37135e18cb62548352d51557b45a0fb4388d2f3f +"@esbuild/win32-ia32@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/win32-ia32@npm:0.18.20" + conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@babel/plugin-transform-computed-properties@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-computed-properties@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/template": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: c2a77a0f94ec71efbc569109ec14ea2aa925b333289272ced8b33c6108bdbb02caf01830ffc7e49486b62dec51911924d13f3a76f1149f40daace1898009e131 +"@esbuild/win32-ia32@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/win32-ia32@npm:0.19.5" + conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@babel/plugin-transform-destructuring@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-destructuring@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 76f6ea2aee1fcfa1c3791eb7a5b89703c6472650b993e8666fff0f1d6e9d737a84134edf89f63c92297f3e75064c1263219463b02dd9bc7434b6e5b9935e3f20 +"@esbuild/win32-x64@npm:0.18.20": + version: 0.18.20 + resolution: "@esbuild/win32-x64@npm:0.18.20" + conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@babel/plugin-transform-dotall-regex@npm:^7.22.5, @babel/plugin-transform-dotall-regex@npm:^7.4.4": - version: 7.22.5 - resolution: "@babel/plugin-transform-dotall-regex@npm:7.22.5" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 409b658d11e3082c8f69e9cdef2d96e4d6d11256f005772425fb230cc48fd05945edbfbcb709dab293a1a2f01f9c8a5bb7b4131e632b23264039d9f95864b453 +"@esbuild/win32-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/win32-x64@npm:0.19.5" + conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@babel/plugin-transform-duplicate-keys@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-duplicate-keys@npm:7.22.5" +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": + version: 4.4.0 + resolution: "@eslint-community/eslint-utils@npm:4.4.0" dependencies: - "@babel/helper-plugin-utils": ^7.22.5 + eslint-visitor-keys: ^3.3.0 peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: bb1280fbabaab6fab2ede585df34900712698210a3bd413f4df5bae6d8c24be36b496c92722ae676a7a67d060a4624f4d6c23b923485f906bfba8773c69f55b4 + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + checksum: cdfe3ae42b4f572cbfb46d20edafe6f36fc5fb52bf2d90875c58aefe226892b9677fef60820e2832caf864a326fe4fc225714c46e8389ccca04d5f9288aabd22 languageName: node linkType: hard -"@babel/plugin-transform-dynamic-import@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-dynamic-import@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-dynamic-import": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 186a6d59f36eb3c5824739fc9c22ed0f4ca68e001662aa3a302634346a8b785cb9579b23b0c158f4570604d697d19598ca09b58c60a7fa2894da1163c4eb1907 +"@eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": + version: 4.10.0 + resolution: "@eslint-community/regexpp@npm:4.10.0" + checksum: 2a6e345429ea8382aaaf3a61f865cae16ed44d31ca917910033c02dc00d505d939f10b81e079fa14d43b51499c640138e153b7e40743c4c094d9df97d4e56f7b languageName: node linkType: hard -"@babel/plugin-transform-exponentiation-operator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.22.5" +"@eslint/eslintrc@npm:^2.1.3": + version: 2.1.3 + resolution: "@eslint/eslintrc@npm:2.1.3" dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: f2d660c1b1d51ad5fec1cd5ad426a52187204068c4158f8c4aa977b31535c61b66898d532603eef21c15756827be8277f724c869b888d560f26d7fe848bb5eae + ajv: ^6.12.4 + debug: ^4.3.2 + espree: ^9.6.0 + globals: ^13.19.0 + ignore: ^5.2.0 + import-fresh: ^3.2.1 + js-yaml: ^4.1.0 + minimatch: ^3.1.2 + strip-json-comments: ^3.1.1 + checksum: 5c6c3878192fe0ddffa9aff08b4e2f3bcc8f1c10d6449b7295a5f58b662019896deabfc19890455ffd7e60a5bd28d25d0eaefb2f78b2d230aae3879af92b89e5 languageName: node linkType: hard -"@babel/plugin-transform-export-namespace-from@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-export-namespace-from@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-export-namespace-from": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3d197b788758044983c96b9c49bed4b456055f35a388521a405968db0f6e2ffb6fd59110e3931f4dcc5e126ae9e5e00e154a0afb47a7ea359d8d0dea79f480d7 +"@eslint/js@npm:8.53.0": + version: 8.53.0 + resolution: "@eslint/js@npm:8.53.0" + checksum: e0d5cfb0000aaee237c8e6d6d6e366faa60b1ef7f928ce17778373aa44d3b886368f6d5e1f97f913f0f16801aad016db8b8df78418c9d18825c15590328028af languageName: node linkType: hard -"@babel/plugin-transform-for-of@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-for-of@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: d7b8d4db010bce7273674caa95c4e6abd909362866ce297e86a2ecaa9ae636e05d525415811db9b3c942155df7f3651d19b91dd6c41f142f7308a97c7cb06023 +"@fastify/busboy@npm:^2.0.0": + version: 2.0.0 + resolution: "@fastify/busboy@npm:2.0.0" + checksum: 41879937ce1dee6421ef9cd4da53239830617e1f0bb7a0e843940772cd72827205d05e518af6adabe6e1ea19301285fff432b9d11bad01a531e698bea95c781b languageName: node linkType: hard -"@babel/plugin-transform-function-name@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-function-name@npm:7.22.5" +"@humanwhocodes/config-array@npm:^0.11.13": + version: 0.11.13 + resolution: "@humanwhocodes/config-array@npm:0.11.13" dependencies: - "@babel/helper-compilation-targets": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: cff3b876357999cb8ae30e439c3ec6b0491a53b0aa6f722920a4675a6dd5b53af97a833051df4b34791fe5b3dd326ccf769d5c8e45b322aa50ee11a660b17845 + "@humanwhocodes/object-schema": ^2.0.1 + debug: ^4.1.1 + minimatch: ^3.0.5 + checksum: f8ea57b0d7ed7f2d64cd3944654976829d9da91c04d9c860e18804729a33f7681f78166ef4c761850b8c324d362f7d53f14c5c44907a6b38b32c703ff85e4805 languageName: node linkType: hard -"@babel/plugin-transform-json-strings@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-json-strings@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-json-strings": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 4e00b902487a670b6c8948f33f9108133fd745cf9d1478aca515fb460b9b2f12e137988ebc1663630fb82070a870aed8b0c1aa4d007a841c18004619798f255c +"@humanwhocodes/module-importer@npm:^1.0.1": + version: 1.0.1 + resolution: "@humanwhocodes/module-importer@npm:1.0.1" + checksum: 0fd22007db8034a2cdf2c764b140d37d9020bbfce8a49d3ec5c05290e77d4b0263b1b972b752df8c89e5eaa94073408f2b7d977aed131faf6cf396ebb5d7fb61 languageName: node linkType: hard -"@babel/plugin-transform-literals@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-literals@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: ec37cc2ffb32667af935ab32fe28f00920ec8a1eb999aa6dc6602f2bebd8ba205a558aeedcdccdebf334381d5c57106c61f52332045730393e73410892a9735b +"@humanwhocodes/object-schema@npm:^2.0.1": + version: 2.0.1 + resolution: "@humanwhocodes/object-schema@npm:2.0.1" + checksum: 24929487b1ed48795d2f08346a0116cc5ee4634848bce64161fb947109352c562310fd159fc64dda0e8b853307f5794605191a9547f7341158559ca3c8262a45 languageName: node linkType: hard -"@babel/plugin-transform-logical-assignment-operators@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-logical-assignment-operators": ^7.10.4 +"@influxdata/influxdb-client-apis@npm:^1.33.2": + version: 1.33.2 + resolution: "@influxdata/influxdb-client-apis@npm:1.33.2" peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 18748e953c08f64885f18c224eac58df10a13eac4d845d16b5d9b6276907da7ca2530dfebe6ed41cdc5f8a75d9db3e36d8eb54ddce7cd0364af1cab09b435302 + "@influxdata/influxdb-client": "*" + checksum: 1d9b97c626c681662413dce643a7d41deec1abe1a964669927c535e159b8201ebf7e0be7171bb552ebefb7bf63ef7ad90d221022a58c0128c1f99273ed4d5d41 languageName: node linkType: hard -"@babel/plugin-transform-member-expression-literals@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-member-expression-literals@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: ec4b0e07915ddd4fda0142fd104ee61015c208608a84cfa13643a95d18760b1dc1ceb6c6e0548898b8c49e5959a994e46367260176dbabc4467f729b21868504 +"@influxdata/influxdb-client@npm:^1.33.2": + version: 1.33.2 + resolution: "@influxdata/influxdb-client@npm:1.33.2" + checksum: f3f054ddc180adfe114cbcc51ac1b9eb22daca4aecf678778fccf5241398fbda87e8d1a405ae5d73b293e2ef3d26e73789e245287bf29050d4bb9437b5a1990c languageName: node linkType: hard -"@babel/plugin-transform-modules-amd@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-amd@npm:7.22.5" +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" dependencies: - "@babel/helper-module-transforms": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 7da4c4ebbbcf7d182abb59b2046b22d86eee340caf8a22a39ef6a727da2d8acfec1f714fcdcd5054110b280e4934f735e80a6848d192b6834c5d4459a014f04d + string-width: ^5.1.2 + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: ^7.0.1 + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: ^8.1.0 + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.21.2, @babel/plugin-transform-modules-commonjs@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.22.5" - dependencies: - "@babel/helper-module-transforms": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-simple-access": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 2067aca8f6454d54ffcce69b02c457cfa61428e11372f6a1d99ff4fcfbb55c396ed2ca6ca886bf06c852e38c1a205b8095921b2364fd0243f3e66bc1dda61caa +"@istanbuljs/schema@npm:^0.1.2": + version: 0.1.3 + resolution: "@istanbuljs/schema@npm:0.1.3" + checksum: 5282759d961d61350f33d9118d16bcaed914ebf8061a52f4fa474b2cb08720c9c81d165e13b82f2e5a8a212cc5af482f0c6fc1ac27b9e067e5394c9a6ed186c9 languageName: node linkType: hard -"@babel/plugin-transform-modules-systemjs@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.22.5" +"@jest/schemas@npm:^29.6.3": + version: 29.6.3 + resolution: "@jest/schemas@npm:29.6.3" dependencies: - "@babel/helper-hoist-variables": ^7.22.5 - "@babel/helper-module-transforms": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 04f4178589543396b3c24330a67a59c5e69af5e96119c9adda730c0f20122deaff54671ebbc72ad2df6495a5db8a758bd96942de95fba7ad427de9c80b1b38c8 + "@sinclair/typebox": ^0.27.8 + checksum: 910040425f0fc93cd13e68c750b7885590b8839066dfa0cd78e7def07bbb708ad869381f725945d66f2284de5663bbecf63e8fdd856e2ae6e261ba30b1687e93 languageName: node linkType: hard -"@babel/plugin-transform-modules-umd@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-umd@npm:7.22.5" +"@jridgewell/gen-mapping@npm:^0.3.0": + version: 0.3.3 + resolution: "@jridgewell/gen-mapping@npm:0.3.3" dependencies: - "@babel/helper-module-transforms": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 46622834c54c551b231963b867adbc80854881b3e516ff29984a8da989bd81665bd70e8cba6710345248e97166689310f544aee1a5773e262845a8f1b3e5b8b4 + "@jridgewell/set-array": ^1.0.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.9 + checksum: 4a74944bd31f22354fc01c3da32e83c19e519e3bbadafa114f6da4522ea77dd0c2842607e923a591d60a76699d819a2fbb6f3552e277efdb9b58b081390b60ab languageName: node linkType: hard -"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.22.5" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 3ee564ddee620c035b928fdc942c5d17e9c4b98329b76f9cefac65c111135d925eb94ed324064cd7556d4f5123beec79abea1d4b97d1c8a2a5c748887a2eb623 +"@jridgewell/resolve-uri@npm:^3.0.3, @jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.1 + resolution: "@jridgewell/resolve-uri@npm:3.1.1" + checksum: f5b441fe7900eab4f9155b3b93f9800a916257f4e8563afbcd3b5a5337b55e52bd8ae6735453b1b745457d9f6cdb16d74cd6220bbdd98cf153239e13f6cbb653 languageName: node linkType: hard -"@babel/plugin-transform-new-target@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-new-target@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 6b72112773487a881a1d6ffa680afde08bad699252020e86122180ee7a88854d5da3f15d9bca3331cf2e025df045604494a8208a2e63b486266b07c14e2ffbf3 +"@jridgewell/set-array@npm:^1.0.1": + version: 1.1.2 + resolution: "@jridgewell/set-array@npm:1.1.2" + checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e languageName: node linkType: hard -"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: e6a059169d257fc61322d0708edae423072449b7c33de396261e68dee582aec5396789a1c22bce84e5bd88a169623c2e750b513fc222930979e6accd52a44bf2 +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": + version: 1.4.15 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" + checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 languageName: node linkType: hard -"@babel/plugin-transform-numeric-separator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-numeric-separator@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-numeric-separator": ^7.10.4 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 9e7837d4eae04f211ebaa034fe5003d2927b6bf6d5b9dc09f2b1183c01482cdde5a75b8bd5c7ff195c2abc7b923339eb0b2a9d27cb78359d38248a3b2c2367c4 - languageName: node - linkType: hard - -"@babel/plugin-transform-object-rest-spread@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-object-rest-spread@npm:7.22.5" - dependencies: - "@babel/compat-data": ^7.22.5 - "@babel/helper-compilation-targets": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-transform-parameters": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3b5e091f0dc67108f2e41ed5a97e15bbe4381a19d9a7eea80b71c7de1d8169fd28784e1e41a3d2ad12709ab212e58fc481282a5bb65d591fae7b443048de3330 - languageName: node - linkType: hard - -"@babel/plugin-transform-object-super@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-object-super@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: b71887877d74cb64dbccb5c0324fa67e31171e6a5311991f626650e44a4083e5436a1eaa89da78c0474fb095d4ec322d63ee778b202d33aa2e4194e1ed8e62d7 - languageName: node - linkType: hard - -"@babel/plugin-transform-optional-catch-binding@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: b0e8b4233ff06b5c9d285257f49c5bd441f883189b24282e6200f9ebdf5db29aeeebbffae57fbbcd5df9f4387b3e66e5d322aaae5652a78e89685ddbae46bbd1 - languageName: node - linkType: hard - -"@babel/plugin-transform-optional-chaining@npm:^7.22.5, @babel/plugin-transform-optional-chaining@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/plugin-transform-optional-chaining@npm:7.22.6" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/plugin-syntax-optional-chaining": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 9713f7920ed04090c149fc5ec024dd1638e8b97aa4ae3753b93072d84103b8de380afb96d6cf03e53b285420db4f705f3ac13149c6fd54f322b61dc19e33c54f - languageName: node - linkType: hard - -"@babel/plugin-transform-parameters@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-parameters@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: b44f89cf97daf23903776ba27c2ab13b439d80d8c8a95be5c476ab65023b1e0c0e94c28d3745f3b60a58edc4e590fa0cd4287a0293e51401ca7d29a2ddb13b8e - languageName: node - linkType: hard - -"@babel/plugin-transform-private-methods@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-private-methods@npm:7.22.5" - dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 321479b4fcb6d3b3ef622ab22fd24001e43d46e680e8e41324c033d5810c84646e470f81b44cbcbef5c22e99030784f7cac92f1829974da7a47a60a7139082c3 - languageName: node - linkType: hard - -"@babel/plugin-transform-private-property-in-object@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-private-property-in-object@npm:7.22.5" - dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-create-class-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-private-property-in-object": ^7.14.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 9ac019fb2772f3af6278a7f4b8b14b0663accb3fd123d87142ceb2fbc57fd1afa07c945d1329029b026b9ee122096ef71a3f34f257a9e04cf4245b87298c38b4 - languageName: node - linkType: hard - -"@babel/plugin-transform-property-literals@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-property-literals@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 796176a3176106f77fcb8cd04eb34a8475ce82d6d03a88db089531b8f0453a2fb8b0c6ec9a52c27948bc0ea478becec449893741fc546dfc3930ab927e3f9f2e - languageName: node - linkType: hard - -"@babel/plugin-transform-regenerator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-regenerator@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - regenerator-transform: ^0.15.1 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: f7c5ca5151321963df777cc02725d10d1ccc3b3b8323da0423aecd9ac6144cbdd2274af5281a5580db2fc2f8b234e318517b5d76b85669118906533a559f2b6a - languageName: node - linkType: hard - -"@babel/plugin-transform-reserved-words@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-reserved-words@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3ffd7dbc425fe8132bfec118b9817572799cab1473113a635d25ab606c1f5a2341a636c04cf6b22df3813320365ed5a965b5eeb3192320a10e4cc2c137bd8bfc - languageName: node - linkType: hard - -"@babel/plugin-transform-shorthand-properties@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-shorthand-properties@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: a5ac902c56ea8effa99f681340ee61bac21094588f7aef0bc01dff98246651702e677552fa6d10e548c4ac22a3ffad047dd2f8c8f0540b68316c2c203e56818b - languageName: node - linkType: hard - -"@babel/plugin-transform-spread@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-spread@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 5587f0deb60b3dfc9b274e269031cc45ec75facccf1933ea2ea71ced9fd3ce98ed91bb36d6cd26817c14474b90ed998c5078415f0eab531caf301496ce24c95c - languageName: node - linkType: hard - -"@babel/plugin-transform-sticky-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-sticky-regex@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 63b2c575e3e7f96c32d52ed45ee098fb7d354b35c2223b8c8e76840b32cc529ee0c0ceb5742fd082e56e91e3d82842a367ce177e82b05039af3d602c9627a729 - languageName: node - linkType: hard - -"@babel/plugin-transform-template-literals@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-template-literals@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 27e9bb030654cb425381c69754be4abe6a7c75b45cd7f962cd8d604b841b2f0fb7b024f2efc1c25cc53f5b16d79d5e8cfc47cacbdaa983895b3aeefa3e7e24ff - languageName: node - linkType: hard - -"@babel/plugin-transform-typeof-symbol@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-typeof-symbol@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 82a53a63ffc3010b689ca9a54e5f53b2718b9f4b4a9818f36f9b7dba234f38a01876680553d2716a645a61920b5e6e4aaf8d4a0064add379b27ca0b403049512 - languageName: node - linkType: hard - -"@babel/plugin-transform-typescript@npm:^7.21.3": - version: 7.21.3 - resolution: "@babel/plugin-transform-typescript@npm:7.21.3" - dependencies: - "@babel/helper-annotate-as-pure": ^7.18.6 - "@babel/helper-create-class-features-plugin": ^7.21.0 - "@babel/helper-plugin-utils": ^7.20.2 - "@babel/plugin-syntax-typescript": ^7.20.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: c16fd577bf43f633deb76fca2a8527d8ae25968c8efdf327c1955472c3e0257e62992473d1ad7f9ee95379ce2404699af405ea03346055adadd3478ad0ecd117 - languageName: node - linkType: hard - -"@babel/plugin-transform-unicode-escapes@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-unicode-escapes@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: da5e85ab3bb33a75cbf6181bfd236b208dc934702fd304db127232f17b4e0f42c6d3f238de8589470b4190906967eea8ca27adf3ae9d8ee4de2a2eae906ed186 - languageName: node - linkType: hard - -"@babel/plugin-transform-unicode-property-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.22.5" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 2495e5f663cb388e3d888b4ba3df419ac436a5012144ac170b622ddfc221f9ea9bdba839fa2bc0185cb776b578030666406452ec7791cbf0e7a3d4c88ae9574c - languageName: node - linkType: hard - -"@babel/plugin-transform-unicode-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-unicode-regex@npm:7.22.5" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 6b5d1404c8c623b0ec9bd436c00d885a17d6a34f3f2597996343ddb9d94f6379705b21582dfd4cec2c47fd34068872e74ab6b9580116c0566b3f9447e2a7fa06 - languageName: node - linkType: hard - -"@babel/plugin-transform-unicode-sets-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.22.5" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: c042070f980b139547f8b0179efbc049ac5930abec7fc26ed7a41d89a048d8ab17d362200e204b6f71c3c20d6991a0e74415e1a412a49adc8131c2a40c04822e - languageName: node - linkType: hard - -"@babel/preset-env@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/preset-env@npm:7.22.9" - dependencies: - "@babel/compat-data": ^7.22.9 - "@babel/helper-compilation-targets": ^7.22.9 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-option": ^7.22.5 - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.22.5 - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.22.5 - "@babel/plugin-proposal-private-property-in-object": 7.21.0-placeholder-for-preset-env.2 - "@babel/plugin-syntax-async-generators": ^7.8.4 - "@babel/plugin-syntax-class-properties": ^7.12.13 - "@babel/plugin-syntax-class-static-block": ^7.14.5 - "@babel/plugin-syntax-dynamic-import": ^7.8.3 - "@babel/plugin-syntax-export-namespace-from": ^7.8.3 - "@babel/plugin-syntax-import-assertions": ^7.22.5 - "@babel/plugin-syntax-import-attributes": ^7.22.5 - "@babel/plugin-syntax-import-meta": ^7.10.4 - "@babel/plugin-syntax-json-strings": ^7.8.3 - "@babel/plugin-syntax-logical-assignment-operators": ^7.10.4 - "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 - "@babel/plugin-syntax-numeric-separator": ^7.10.4 - "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 - "@babel/plugin-syntax-optional-chaining": ^7.8.3 - "@babel/plugin-syntax-private-property-in-object": ^7.14.5 - "@babel/plugin-syntax-top-level-await": ^7.14.5 - "@babel/plugin-syntax-unicode-sets-regex": ^7.18.6 - "@babel/plugin-transform-arrow-functions": ^7.22.5 - "@babel/plugin-transform-async-generator-functions": ^7.22.7 - "@babel/plugin-transform-async-to-generator": ^7.22.5 - "@babel/plugin-transform-block-scoped-functions": ^7.22.5 - "@babel/plugin-transform-block-scoping": ^7.22.5 - "@babel/plugin-transform-class-properties": ^7.22.5 - "@babel/plugin-transform-class-static-block": ^7.22.5 - "@babel/plugin-transform-classes": ^7.22.6 - "@babel/plugin-transform-computed-properties": ^7.22.5 - "@babel/plugin-transform-destructuring": ^7.22.5 - "@babel/plugin-transform-dotall-regex": ^7.22.5 - "@babel/plugin-transform-duplicate-keys": ^7.22.5 - "@babel/plugin-transform-dynamic-import": ^7.22.5 - "@babel/plugin-transform-exponentiation-operator": ^7.22.5 - "@babel/plugin-transform-export-namespace-from": ^7.22.5 - "@babel/plugin-transform-for-of": ^7.22.5 - "@babel/plugin-transform-function-name": ^7.22.5 - "@babel/plugin-transform-json-strings": ^7.22.5 - "@babel/plugin-transform-literals": ^7.22.5 - "@babel/plugin-transform-logical-assignment-operators": ^7.22.5 - "@babel/plugin-transform-member-expression-literals": ^7.22.5 - "@babel/plugin-transform-modules-amd": ^7.22.5 - "@babel/plugin-transform-modules-commonjs": ^7.22.5 - "@babel/plugin-transform-modules-systemjs": ^7.22.5 - "@babel/plugin-transform-modules-umd": ^7.22.5 - "@babel/plugin-transform-named-capturing-groups-regex": ^7.22.5 - "@babel/plugin-transform-new-target": ^7.22.5 - "@babel/plugin-transform-nullish-coalescing-operator": ^7.22.5 - "@babel/plugin-transform-numeric-separator": ^7.22.5 - "@babel/plugin-transform-object-rest-spread": ^7.22.5 - "@babel/plugin-transform-object-super": ^7.22.5 - "@babel/plugin-transform-optional-catch-binding": ^7.22.5 - "@babel/plugin-transform-optional-chaining": ^7.22.6 - "@babel/plugin-transform-parameters": ^7.22.5 - "@babel/plugin-transform-private-methods": ^7.22.5 - "@babel/plugin-transform-private-property-in-object": ^7.22.5 - "@babel/plugin-transform-property-literals": ^7.22.5 - "@babel/plugin-transform-regenerator": ^7.22.5 - "@babel/plugin-transform-reserved-words": ^7.22.5 - "@babel/plugin-transform-shorthand-properties": ^7.22.5 - "@babel/plugin-transform-spread": ^7.22.5 - "@babel/plugin-transform-sticky-regex": ^7.22.5 - "@babel/plugin-transform-template-literals": ^7.22.5 - "@babel/plugin-transform-typeof-symbol": ^7.22.5 - "@babel/plugin-transform-unicode-escapes": ^7.22.5 - "@babel/plugin-transform-unicode-property-regex": ^7.22.5 - "@babel/plugin-transform-unicode-regex": ^7.22.5 - "@babel/plugin-transform-unicode-sets-regex": ^7.22.5 - "@babel/preset-modules": ^0.1.5 - "@babel/types": ^7.22.5 - babel-plugin-polyfill-corejs2: ^0.4.4 - babel-plugin-polyfill-corejs3: ^0.8.2 - babel-plugin-polyfill-regenerator: ^0.5.1 - core-js-compat: ^3.31.0 - semver: ^6.3.1 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 6caa2897bbda30c6932aed0a03827deb1337c57108050c9f97dc9a857e1533c7125b168b6d70b9d191965bf05f9f233f0ad20303080505dff7ce39740aaa759d - languageName: node - linkType: hard - -"@babel/preset-modules@npm:^0.1.5": - version: 0.1.5 - resolution: "@babel/preset-modules@npm:0.1.5" - dependencies: - "@babel/helper-plugin-utils": ^7.0.0 - "@babel/plugin-proposal-unicode-property-regex": ^7.4.4 - "@babel/plugin-transform-dotall-regex": ^7.4.4 - "@babel/types": ^7.4.4 - esutils: ^2.0.2 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 8430e0e9e9d520b53e22e8c4c6a5a080a12b63af6eabe559c2310b187bd62ae113f3da82ba33e9d1d0f3230930ca702843aae9dd226dec51f7d7114dc1f51c10 - languageName: node - linkType: hard - -"@babel/preset-typescript@npm:^7.21.4": - version: 7.21.4 - resolution: "@babel/preset-typescript@npm:7.21.4" - dependencies: - "@babel/helper-plugin-utils": ^7.20.2 - "@babel/helper-validator-option": ^7.21.0 - "@babel/plugin-syntax-jsx": ^7.21.4 - "@babel/plugin-transform-modules-commonjs": ^7.21.2 - "@babel/plugin-transform-typescript": ^7.21.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 83b2f2bf7be3a970acd212177525f58bbb1f2e042b675a47d021a675ae27cf00b6b6babfaf3ae5c980592c9ed1b0712e5197796b691905d25c99f9006478ea06 - languageName: node - linkType: hard - -"@babel/regjsgen@npm:^0.8.0": - version: 0.8.0 - resolution: "@babel/regjsgen@npm:0.8.0" - checksum: 89c338fee774770e5a487382170711014d49a68eb281e74f2b5eac88f38300a4ad545516a7786a8dd5702e9cf009c94c2f582d200f077ac5decd74c56b973730 - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.8.4": - version: 7.21.0 - resolution: "@babel/runtime@npm:7.21.0" - dependencies: - regenerator-runtime: ^0.13.11 - checksum: 7b33e25bfa9e0e1b9e8828bb61b2d32bdd46b41b07ba7cb43319ad08efc6fda8eb89445193e67d6541814627df0ca59122c0ea795e412b99c5183a0540d338ab - languageName: node - linkType: hard - -"@babel/template@npm:^7.22.15": - version: 7.22.15 - resolution: "@babel/template@npm:7.22.15" - dependencies: - "@babel/code-frame": ^7.22.13 - "@babel/parser": ^7.22.15 - "@babel/types": ^7.22.15 - checksum: 1f3e7dcd6c44f5904c184b3f7fe280394b191f2fed819919ffa1e529c259d5b197da8981b6ca491c235aee8dbad4a50b7e31304aa531271cb823a4a24a0dd8fd - languageName: node - linkType: hard - -"@babel/template@npm:^7.22.5, @babel/template@npm:^7.3.3": - version: 7.22.5 - resolution: "@babel/template@npm:7.22.5" - dependencies: - "@babel/code-frame": ^7.22.5 - "@babel/parser": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: c5746410164039aca61829cdb42e9a55410f43cace6f51ca443313f3d0bdfa9a5a330d0b0df73dc17ef885c72104234ae05efede37c1cc8a72dc9f93425977a3 - languageName: node - linkType: hard - -"@babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.22.5, @babel/traverse@npm:^7.22.6, @babel/traverse@npm:^7.22.8": - version: 7.23.2 - resolution: "@babel/traverse@npm:7.23.2" - dependencies: - "@babel/code-frame": ^7.22.13 - "@babel/generator": ^7.23.0 - "@babel/helper-environment-visitor": ^7.22.20 - "@babel/helper-function-name": ^7.23.0 - "@babel/helper-hoist-variables": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/parser": ^7.23.0 - "@babel/types": ^7.23.0 - debug: ^4.1.0 - globals: ^11.1.0 - checksum: 26a1eea0dde41ab99dde8b9773a013a0dc50324e5110a049f5d634e721ff08afffd54940b3974a20308d7952085ac769689369e9127dea655f868c0f6e1ab35d - languageName: node - linkType: hard - -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": - version: 7.22.5 - resolution: "@babel/types@npm:7.22.5" - dependencies: - "@babel/helper-string-parser": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.5 - to-fast-properties: ^2.0.0 - checksum: c13a9c1dc7d2d1a241a2f8363540cb9af1d66e978e8984b400a20c4f38ba38ca29f06e26a0f2d49a70bad9e57615dac09c35accfddf1bb90d23cd3e0a0bab892 - languageName: node - linkType: hard - -"@babel/types@npm:^7.22.15, @babel/types@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/types@npm:7.23.0" - dependencies: - "@babel/helper-string-parser": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.20 - to-fast-properties: ^2.0.0 - checksum: 215fe04bd7feef79eeb4d33374b39909ce9cad1611c4135a4f7fdf41fe3280594105af6d7094354751514625ea92d0875aba355f53e86a92600f290e77b0e604 - languageName: node - linkType: hard - -"@bcoe/v8-coverage@npm:^0.2.3": - version: 0.2.3 - resolution: "@bcoe/v8-coverage@npm:0.2.3" - checksum: 850f9305536d0f2bd13e9e0881cb5f02e4f93fad1189f7b2d4bebf694e3206924eadee1068130d43c11b750efcc9405f88a8e42ef098b6d75239c0f047de1a27 - languageName: node - linkType: hard - -"@commitlint/cli@npm:^17.6.6": - version: 17.6.6 - resolution: "@commitlint/cli@npm:17.6.6" - dependencies: - "@commitlint/format": ^17.4.4 - "@commitlint/lint": ^17.6.6 - "@commitlint/load": ^17.5.0 - "@commitlint/read": ^17.5.1 - "@commitlint/types": ^17.4.4 - execa: ^5.0.0 - lodash.isfunction: ^3.0.9 - resolve-from: 5.0.0 - resolve-global: 1.0.0 - yargs: ^17.0.0 - bin: - commitlint: cli.js - checksum: 91c2d06bc181cb286634d963e28c71739642a94252dcf2bcd800dd3ac1d8708d8ccd195aa513a65df00fcde281a128ed763ac51f640771a11140930c5f259df8 - languageName: node - linkType: hard - -"@commitlint/config-conventional@npm:^17.6.6": - version: 17.6.6 - resolution: "@commitlint/config-conventional@npm:17.6.6" - dependencies: - conventional-changelog-conventionalcommits: ^5.0.0 - checksum: 0f649a2cbe684aa18555cb0027c21f58d74216dbe0a850be041af50f1db04e447b7d90995bee54c61059d735b398de61ac7ecbfd312d14480aac3a3f8c62dd66 - languageName: node - linkType: hard - -"@commitlint/config-validator@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/config-validator@npm:17.4.4" - dependencies: - "@commitlint/types": ^17.4.4 - ajv: ^8.11.0 - checksum: 71ee818608ed5c74832cdd63531c0f61b21758fba9f8b876205485ece4f047c9582bc3f323a20a5de700e3451296614d15448437270a82194eff7d71317b47ff - languageName: node - linkType: hard - -"@commitlint/ensure@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/ensure@npm:17.4.4" - dependencies: - "@commitlint/types": ^17.4.4 - lodash.camelcase: ^4.3.0 - lodash.kebabcase: ^4.1.1 - lodash.snakecase: ^4.1.1 - lodash.startcase: ^4.4.0 - lodash.upperfirst: ^4.3.1 - checksum: c21c189f22d8d3265e93256d101b72ef7cbdf8660438081799b9a4a8bd47d33133f250bbed858ab9bcc0d249d1c95ac58eddd9e5b46314d64ff049d0479d0d71 - languageName: node - linkType: hard - -"@commitlint/execute-rule@npm:^17.4.0": - version: 17.4.0 - resolution: "@commitlint/execute-rule@npm:17.4.0" - checksum: 17d8e56ab00bd45fdecb0ed33186d2020ce261250d6a516204b6509610b75af8c930e7226b1111af3de298db32a7e4d0ba2c9cc7ed67db5ba5159eeed634f067 - languageName: node - linkType: hard - -"@commitlint/format@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/format@npm:17.4.4" - dependencies: - "@commitlint/types": ^17.4.4 - chalk: ^4.1.0 - checksum: 832d9641129f2da8d32389b4a47db59d41eb1adfab742723972cad64b833c4af9e253f96757b27664fedae61644dd4c01d21f775773b45b604bd7f93b23a27d2 - languageName: node - linkType: hard - -"@commitlint/is-ignored@npm:^17.6.6": - version: 17.6.6 - resolution: "@commitlint/is-ignored@npm:17.6.6" - dependencies: - "@commitlint/types": ^17.4.4 - semver: 7.5.2 - checksum: ff5f8816765b3f2e9f16de32b1166dd099ab23793212bf4092203441fe3d9f282c80ed96cca5cd42b0ea96d899f8989bdaa6604a3f02bf4bd36b8c7c123968df - languageName: node - linkType: hard - -"@commitlint/lint@npm:^17.6.6": - version: 17.6.6 - resolution: "@commitlint/lint@npm:17.6.6" - dependencies: - "@commitlint/is-ignored": ^17.6.6 - "@commitlint/parse": ^17.6.5 - "@commitlint/rules": ^17.6.5 - "@commitlint/types": ^17.4.4 - checksum: 8601cbfe037edd4aff38cf3929444e748499558dfb01a12f1e6067fb4496926711936cbd389cf792f5e3ea6b6900c6967ca5b56dc0555d75c71340ceddc6d076 - languageName: node - linkType: hard - -"@commitlint/load@npm:>6.1.1, @commitlint/load@npm:^17.5.0": - version: 17.5.0 - resolution: "@commitlint/load@npm:17.5.0" - dependencies: - "@commitlint/config-validator": ^17.4.4 - "@commitlint/execute-rule": ^17.4.0 - "@commitlint/resolve-extends": ^17.4.4 - "@commitlint/types": ^17.4.4 - "@types/node": "*" - chalk: ^4.1.0 - cosmiconfig: ^8.0.0 - cosmiconfig-typescript-loader: ^4.0.0 - lodash.isplainobject: ^4.0.6 - lodash.merge: ^4.6.2 - lodash.uniq: ^4.5.0 - resolve-from: ^5.0.0 - ts-node: ^10.8.1 - typescript: ^4.6.4 || ^5.0.0 - checksum: c039114b0ad67bb9d8b05ec635d847bd5ab760528f0fb203411f433585bdab5472f4f5c7856dfc417cf64c05576f54c1afc4997a813f529304e0156bfc1d6cc8 - languageName: node - linkType: hard - -"@commitlint/message@npm:^17.4.2": - version: 17.4.2 - resolution: "@commitlint/message@npm:17.4.2" - checksum: 55b6cfeb57f7c9f913e18821aa4d972a6b6faa78c62741390996151f99554396f6df68ccfee86c163d24d8c27a4dbbcb50ef03c2972ab0a7a21d89daa2f9a519 - languageName: node - linkType: hard - -"@commitlint/parse@npm:^17.6.5": - version: 17.6.5 - resolution: "@commitlint/parse@npm:17.6.5" - dependencies: - "@commitlint/types": ^17.4.4 - conventional-changelog-angular: ^5.0.11 - conventional-commits-parser: ^3.2.2 - checksum: 579dd7b25d2b5a73817318259f4ce1191657fad8736047bcd84e2709bbe9bcb7458cbe66b6dc785e372c1c73a4563050027b94746ad0df16a89d90960a685517 - languageName: node - linkType: hard - -"@commitlint/read@npm:^17.5.1": - version: 17.5.1 - resolution: "@commitlint/read@npm:17.5.1" - dependencies: - "@commitlint/top-level": ^17.4.0 - "@commitlint/types": ^17.4.4 - fs-extra: ^11.0.0 - git-raw-commits: ^2.0.11 - minimist: ^1.2.6 - checksum: 62ee4f7a47b22a8571ae313bca36b418805a248f4986557f38f06317c44b6d18072889f95e7bc22bbb33a2f2b08236f74596ff28e3dbd0894249477a9df367c3 - languageName: node - linkType: hard - -"@commitlint/resolve-extends@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/resolve-extends@npm:17.4.4" - dependencies: - "@commitlint/config-validator": ^17.4.4 - "@commitlint/types": ^17.4.4 - import-fresh: ^3.0.0 - lodash.mergewith: ^4.6.2 - resolve-from: ^5.0.0 - resolve-global: ^1.0.0 - checksum: d7bf1ff1ad3db8750421b252d79cf7b96cf07d72cad8cc3f73c1363a8e68c0afde611d38ae6f213bbb54e3248160c6b9425578f3d0f8f790e84aea811d748b3e - languageName: node - linkType: hard - -"@commitlint/rules@npm:^17.6.5": - version: 17.6.5 - resolution: "@commitlint/rules@npm:17.6.5" - dependencies: - "@commitlint/ensure": ^17.4.4 - "@commitlint/message": ^17.4.2 - "@commitlint/to-lines": ^17.4.0 - "@commitlint/types": ^17.4.4 - execa: ^5.0.0 - checksum: 7f62c594153df5daf15bf66254f8abd72f14f3f0e7bac91d0fc8229c357616a9d852b2dd050a15b3de83366a732a3363ec405d453d48b81cbaeccdd7013cb59f - languageName: node - linkType: hard - -"@commitlint/to-lines@npm:^17.4.0": - version: 17.4.0 - resolution: "@commitlint/to-lines@npm:17.4.0" - checksum: 841f90f606238e145ab4ba02940662d511fc04fe553619900152a8542170fe664031b95d820ffaeb8864d4851344278e662ef29637d763fc19fd828e0f8d139b - languageName: node - linkType: hard - -"@commitlint/top-level@npm:^17.4.0": - version: 17.4.0 - resolution: "@commitlint/top-level@npm:17.4.0" - dependencies: - find-up: ^5.0.0 - checksum: 14cd77e982d2dd7989718dafdbf7a2168a5fb387005e0686c2dfa9ffc36bb9a749e5d80a151884459e4d8c88564339688dca26e9c711abe043beeb3f30c3dfd6 - languageName: node - linkType: hard - -"@commitlint/types@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/types@npm:17.4.4" - dependencies: - chalk: ^4.1.0 - checksum: 03c52429052d161710896d198000196bd2e60be0fd71459b22133dd83dee43e8d05ea8ee703c8369823bc40f77a54881b80d8aa4368ac52aea7f30fb234b73d2 - languageName: node - linkType: hard - -"@cspotcode/source-map-support@npm:^0.8.0": - version: 0.8.1 - resolution: "@cspotcode/source-map-support@npm:0.8.1" - dependencies: - "@jridgewell/trace-mapping": 0.3.9 - checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa - languageName: node - linkType: hard - -"@discordjs/builders@npm:^0.15.0": - version: 0.15.0 - resolution: "@discordjs/builders@npm:0.15.0" - dependencies: - "@sapphire/shapeshift": ^3.1.0 - "@sindresorhus/is": ^4.6.0 - discord-api-types: ^0.33.3 - fast-deep-equal: ^3.1.3 - ts-mixer: ^6.0.1 - tslib: ^2.4.0 - checksum: 1a8a4ffe048243ebb9fbbc76a113e4994c68904a5b3d256a6b10c0123f1d0fb58b45809d134ba993293fb2190c9f3506663ddfb5068a86ec6b9c53b5db61f6a6 - languageName: node - linkType: hard - -"@discordjs/builders@npm:^0.16.0": - version: 0.16.0 - resolution: "@discordjs/builders@npm:0.16.0" - dependencies: - "@sapphire/shapeshift": ^3.5.1 - discord-api-types: ^0.36.2 - fast-deep-equal: ^3.1.3 - ts-mixer: ^6.0.1 - tslib: ^2.4.0 - checksum: bf7ab00924bf84678c139b32c3b6bda16d62f190a1674ebaa4ec8767c7105890b1375716296037306661e138fe1c09c535b3141a047b7fceafaa92937a76cb8b - languageName: node - linkType: hard - -"@discordjs/collection@npm:^0.7.0": - version: 0.7.0 - resolution: "@discordjs/collection@npm:0.7.0" - checksum: 141aa35a5433bacba3617b533557b4948388c7b59cdaecee51ccd721c1b9242e50d95bdef53ee2491535a017095f5072ace3c3e9e594193f67a1c5a8a4b7db93 - languageName: node - linkType: hard - -"@discordjs/collection@npm:^1.2.0, @discordjs/collection@npm:^1.5.1": - version: 1.5.1 - resolution: "@discordjs/collection@npm:1.5.1" - checksum: 98cc9cff3c7e6f919097b7ffc96f0a13eba2a90265d187b4db5f8cc09b550efd3d9fc952a21d92a08baf7d9e06d0bfa0467e8d0dbccb2d2f8eb0ee124b8b38d4 - languageName: node - linkType: hard - -"@eslint-community/eslint-utils@npm:^4.2.0": - version: 4.2.0 - resolution: "@eslint-community/eslint-utils@npm:4.2.0" - dependencies: - eslint-visitor-keys: ^3.3.0 - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: 82fdd1cc2a5d169def0e665ec790580ef708e7df9c91f20006595dc90e3bd42ec31c8976a2eeccd336286301a72e937c0ddf3ab4b7377d7014997c36333a7d22 - languageName: node - linkType: hard - -"@eslint-community/regexpp@npm:^4.4.0": - version: 4.4.0 - resolution: "@eslint-community/regexpp@npm:4.4.0" - checksum: 2d127af0c752b80e8a782eacfe996a86925d21de92da3ffc6f9e615e701145e44a62e26bdd88bfac2cd76779c39ba8d9875a91046ec5e7e5f23cb647c247ea6a - languageName: node - linkType: hard - -"@eslint/eslintrc@npm:^2.1.0": - version: 2.1.0 - resolution: "@eslint/eslintrc@npm:2.1.0" - dependencies: - ajv: ^6.12.4 - debug: ^4.3.2 - espree: ^9.6.0 - globals: ^13.19.0 - ignore: ^5.2.0 - import-fresh: ^3.2.1 - js-yaml: ^4.1.0 - minimatch: ^3.1.2 - strip-json-comments: ^3.1.1 - checksum: d5ed0adbe23f6571d8c9bb0ca6edf7618dc6aed4046aa56df7139f65ae7b578874e0d9c796df784c25bda648ceb754b6320277d828c8b004876d7443b8dc018c - languageName: node - linkType: hard - -"@eslint/js@npm:8.44.0": - version: 8.44.0 - resolution: "@eslint/js@npm:8.44.0" - checksum: fc539583226a28f5677356e9f00d2789c34253f076643d2e32888250e509a4e13aafe0880cb2425139051de0f3a48d25bfc5afa96b7304f203b706c17340e3cf - languageName: node - linkType: hard - -"@gar/promisify@npm:^1.1.3": - version: 1.1.3 - resolution: "@gar/promisify@npm:1.1.3" - checksum: 4059f790e2d07bf3c3ff3e0fec0daa8144fe35c1f6e0111c9921bd32106adaa97a4ab096ad7dab1e28ee6a9060083c4d1a4ada42a7f5f3f7a96b8812e2b757c1 - languageName: node - linkType: hard - -"@humanwhocodes/config-array@npm:^0.11.10": - version: 0.11.10 - resolution: "@humanwhocodes/config-array@npm:0.11.10" - dependencies: - "@humanwhocodes/object-schema": ^1.2.1 - debug: ^4.1.1 - minimatch: ^3.0.5 - checksum: 1b1302e2403d0e35bc43e66d67a2b36b0ad1119efc704b5faff68c41f791a052355b010fb2d27ef022670f550de24cd6d08d5ecf0821c16326b7dcd0ee5d5d8a - languageName: node - linkType: hard - -"@humanwhocodes/module-importer@npm:^1.0.1": - version: 1.0.1 - resolution: "@humanwhocodes/module-importer@npm:1.0.1" - checksum: 0fd22007db8034a2cdf2c764b140d37d9020bbfce8a49d3ec5c05290e77d4b0263b1b972b752df8c89e5eaa94073408f2b7d977aed131faf6cf396ebb5d7fb61 - languageName: node - linkType: hard - -"@humanwhocodes/object-schema@npm:^1.2.1": - version: 1.2.1 - resolution: "@humanwhocodes/object-schema@npm:1.2.1" - checksum: a824a1ec31591231e4bad5787641f59e9633827d0a2eaae131a288d33c9ef0290bd16fda8da6f7c0fcb014147865d12118df10db57f27f41e20da92369fcb3f1 - languageName: node - linkType: hard - -"@influxdata/influxdb-client-apis@npm:^1.33.2": - version: 1.33.2 - resolution: "@influxdata/influxdb-client-apis@npm:1.33.2" - peerDependencies: - "@influxdata/influxdb-client": "*" - checksum: 1d9b97c626c681662413dce643a7d41deec1abe1a964669927c535e159b8201ebf7e0be7171bb552ebefb7bf63ef7ad90d221022a58c0128c1f99273ed4d5d41 - languageName: node - linkType: hard - -"@influxdata/influxdb-client@npm:^1.33.2": - version: 1.33.2 - resolution: "@influxdata/influxdb-client@npm:1.33.2" - checksum: f3f054ddc180adfe114cbcc51ac1b9eb22daca4aecf678778fccf5241398fbda87e8d1a405ae5d73b293e2ef3d26e73789e245287bf29050d4bb9437b5a1990c - languageName: node - linkType: hard - -"@istanbuljs/load-nyc-config@npm:^1.0.0": - version: 1.1.0 - resolution: "@istanbuljs/load-nyc-config@npm:1.1.0" - dependencies: - camelcase: ^5.3.1 - find-up: ^4.1.0 - get-package-type: ^0.1.0 - js-yaml: ^3.13.1 - resolve-from: ^5.0.0 - checksum: d578da5e2e804d5c93228450a1380e1a3c691de4953acc162f387b717258512a3e07b83510a936d9fab03eac90817473917e24f5d16297af3867f59328d58568 - languageName: node - linkType: hard - -"@istanbuljs/schema@npm:^0.1.2": - version: 0.1.3 - resolution: "@istanbuljs/schema@npm:0.1.3" - checksum: 5282759d961d61350f33d9118d16bcaed914ebf8061a52f4fa474b2cb08720c9c81d165e13b82f2e5a8a212cc5af482f0c6fc1ac27b9e067e5394c9a6ed186c9 - languageName: node - linkType: hard - -"@jest/console@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/console@npm:29.6.1" - dependencies: - "@jest/types": ^29.6.1 - "@types/node": "*" - chalk: ^4.0.0 - jest-message-util: ^29.6.1 - jest-util: ^29.6.1 - slash: ^3.0.0 - checksum: d0ab23a00947bfb4bff8c0a7e5a7afd16519de16dde3fe7e77b9f13e794c6df7043ecf7fcdde66ac0d2b5fb3262e9cab3d92eaf61f89a12d3b8e3602e06a9902 - languageName: node - linkType: hard - -"@jest/core@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/core@npm:29.6.1" - dependencies: - "@jest/console": ^29.6.1 - "@jest/reporters": ^29.6.1 - "@jest/test-result": ^29.6.1 - "@jest/transform": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/node": "*" - ansi-escapes: ^4.2.1 - chalk: ^4.0.0 - ci-info: ^3.2.0 - exit: ^0.1.2 - graceful-fs: ^4.2.9 - jest-changed-files: ^29.5.0 - jest-config: ^29.6.1 - jest-haste-map: ^29.6.1 - jest-message-util: ^29.6.1 - jest-regex-util: ^29.4.3 - jest-resolve: ^29.6.1 - jest-resolve-dependencies: ^29.6.1 - jest-runner: ^29.6.1 - jest-runtime: ^29.6.1 - jest-snapshot: ^29.6.1 - jest-util: ^29.6.1 - jest-validate: ^29.6.1 - jest-watcher: ^29.6.1 - micromatch: ^4.0.4 - pretty-format: ^29.6.1 - slash: ^3.0.0 - strip-ansi: ^6.0.0 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: 736dcc90c6c58dd9e1d2da122103b851187719ce3b3d4167689c63e68252632cd817712955b52ddaa648eba9c6f98f86cd58677325f0db4185f76899c64d7dac - languageName: node - linkType: hard - -"@jest/environment@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/environment@npm:29.6.1" - dependencies: - "@jest/fake-timers": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/node": "*" - jest-mock: ^29.6.1 - checksum: fb671f91f27e7aa1ba04983ef87a83f0794a597aba0a57d08cbb1fcb484c2aedc2201e99f85fafe27aec9be78af6f2d1d7e6ea88267938992a1d0f9d4615f5b2 - languageName: node - linkType: hard - -"@jest/expect-utils@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/expect-utils@npm:29.6.1" - dependencies: - jest-get-type: ^29.4.3 - checksum: 037ee017eca62f7b45e1465fb5c6f9e92d5709a9ac716b8bff0bd294240a54de734e8f968fb69309cc4aef6c83b9552d5a821f3b18371af394bf04783859d706 - languageName: node - linkType: hard - -"@jest/expect@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/expect@npm:29.6.1" - dependencies: - expect: ^29.6.1 - jest-snapshot: ^29.6.1 - checksum: 5c56977b3cc8489744d97d9dc2dcb196c1dfecc83a058a7ef0fd4f63d68cf120a23d27669272d1e1b184fb4337b85e4ac1fc7f886e3988fdf243d42d73973eac - languageName: node - linkType: hard - -"@jest/fake-timers@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/fake-timers@npm:29.6.1" - dependencies: - "@jest/types": ^29.6.1 - "@sinonjs/fake-timers": ^10.0.2 - "@types/node": "*" - jest-message-util: ^29.6.1 - jest-mock: ^29.6.1 - jest-util: ^29.6.1 - checksum: 86991276944b7d6c2ada3703a272517f5f8f2f4e2af1fe26065f6db1dac4dc6299729a88c46bcb781dcc1b20504c1d4bbd8119fd8a0838ac81a9a4b5d2c8e429 - languageName: node - linkType: hard - -"@jest/globals@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/globals@npm:29.6.1" +"@jridgewell/trace-mapping@npm:0.3.9": + version: 0.3.9 + resolution: "@jridgewell/trace-mapping@npm:0.3.9" dependencies: - "@jest/environment": ^29.6.1 - "@jest/expect": ^29.6.1 - "@jest/types": ^29.6.1 - jest-mock: ^29.6.1 - checksum: fcca0b970a8b4894a1cdff0f500a86b45609e72c0a4319875e9504237b839df1a46c44d2f1362c6d87fdc7a05928edcc4b5a3751c9e6648dd70a761cdab64c94 + "@jridgewell/resolve-uri": ^3.0.3 + "@jridgewell/sourcemap-codec": ^1.4.10 + checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef languageName: node linkType: hard -"@jest/reporters@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/reporters@npm:29.6.1" +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.20 + resolution: "@jridgewell/trace-mapping@npm:0.3.20" dependencies: - "@bcoe/v8-coverage": ^0.2.3 - "@jest/console": ^29.6.1 - "@jest/test-result": ^29.6.1 - "@jest/transform": ^29.6.1 - "@jest/types": ^29.6.1 - "@jridgewell/trace-mapping": ^0.3.18 - "@types/node": "*" - chalk: ^4.0.0 - collect-v8-coverage: ^1.0.0 - exit: ^0.1.2 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - istanbul-lib-coverage: ^3.0.0 - istanbul-lib-instrument: ^5.1.0 - istanbul-lib-report: ^3.0.0 - istanbul-lib-source-maps: ^4.0.0 - istanbul-reports: ^3.1.3 - jest-message-util: ^29.6.1 - jest-util: ^29.6.1 - jest-worker: ^29.6.1 - slash: ^3.0.0 - string-length: ^4.0.1 - strip-ansi: ^6.0.0 - v8-to-istanbul: ^9.0.1 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - checksum: b7dae415f3f6342b4db2671261bbee29af20a829f42135316c3dd548b9ef85290c9bb64a0e3aec4a55486596be1257ac8216a0f8d9794acd43f8b8fb686fc7e3 + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: cd1a7353135f385909468ff0cf20bdd37e59f2ee49a13a966dedf921943e222082c583ade2b579ff6cd0d8faafcb5461f253e1bf2a9f48fec439211fdbe788f5 languageName: node linkType: hard -"@jest/schemas@npm:^29.6.0": - version: 29.6.0 - resolution: "@jest/schemas@npm:29.6.0" +"@nodelib/fs.scandir@npm:2.1.5": + version: 2.1.5 + resolution: "@nodelib/fs.scandir@npm:2.1.5" dependencies: - "@sinclair/typebox": ^0.27.8 - checksum: c00511c69cf89138a7d974404d3a5060af375b5a52b9c87215d91873129b382ca11c1ff25bd6d605951404bb381ddce5f8091004a61e76457da35db1f5c51365 + "@nodelib/fs.stat": 2.0.5 + run-parallel: ^1.1.9 + checksum: a970d595bd23c66c880e0ef1817791432dbb7acbb8d44b7e7d0e7a22f4521260d4a83f7f9fd61d44fda4610105577f8f58a60718105fb38352baed612fd79e59 languageName: node linkType: hard -"@jest/source-map@npm:^29.6.0": - version: 29.6.0 - resolution: "@jest/source-map@npm:29.6.0" - dependencies: - "@jridgewell/trace-mapping": ^0.3.18 - callsites: ^3.0.0 - graceful-fs: ^4.2.9 - checksum: 9c6c40387410bb70b2fae8124287fc28f6bdd1b2d7f24348e8611e1bb638b404518228a4ce64a582365b589c536ae8e7ebab0126cef59a87874b71061d19783b +"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": + version: 2.0.5 + resolution: "@nodelib/fs.stat@npm:2.0.5" + checksum: 012480b5ca9d97bff9261571dbbec7bbc6033f69cc92908bc1ecfad0792361a5a1994bc48674b9ef76419d056a03efadfce5a6cf6dbc0a36559571a7a483f6f0 languageName: node linkType: hard -"@jest/test-result@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/test-result@npm:29.6.1" +"@nodelib/fs.walk@npm:^1.2.3, @nodelib/fs.walk@npm:^1.2.8": + version: 1.2.8 + resolution: "@nodelib/fs.walk@npm:1.2.8" dependencies: - "@jest/console": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/istanbul-lib-coverage": ^2.0.0 - collect-v8-coverage: ^1.0.0 - checksum: 9397a3a3410c5df564e79297b1be4fe33807a6157a017a1f74b54a6ef14de1530f12b922299e822e66a82c53269da16661772bffde3d883a78c5eefd2cd6d1cc + "@nodelib/fs.scandir": 2.1.5 + fastq: ^1.6.0 + checksum: 190c643f156d8f8f277bf2a6078af1ffde1fd43f498f187c2db24d35b4b4b5785c02c7dc52e356497b9a1b65b13edc996de08de0b961c32844364da02986dc53 languageName: node linkType: hard -"@jest/test-sequencer@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/test-sequencer@npm:29.6.1" +"@npmcli/agent@npm:^2.0.0": + version: 2.2.0 + resolution: "@npmcli/agent@npm:2.2.0" dependencies: - "@jest/test-result": ^29.6.1 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.6.1 - slash: ^3.0.0 - checksum: f3437178b5dca0401ed2e990d8b69161442351856d56f5725e009a487f5232b51039f8829673884b9bea61c861120d08a53a36432f4a4b8aab38915a68f7000d + agent-base: ^7.1.0 + http-proxy-agent: ^7.0.0 + https-proxy-agent: ^7.0.1 + lru-cache: ^10.0.1 + socks-proxy-agent: ^8.0.1 + checksum: 3b25312edbdfaa4089af28e2d423b6f19838b945e47765b0c8174c1395c79d43c3ad6d23cb364b43f59fd3acb02c93e3b493f72ddbe3dfea04c86843a7311fc4 languageName: node linkType: hard -"@jest/transform@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/transform@npm:29.6.1" +"@npmcli/fs@npm:^3.1.0": + version: 3.1.0 + resolution: "@npmcli/fs@npm:3.1.0" dependencies: - "@babel/core": ^7.11.6 - "@jest/types": ^29.6.1 - "@jridgewell/trace-mapping": ^0.3.18 - babel-plugin-istanbul: ^6.1.1 - chalk: ^4.0.0 - convert-source-map: ^2.0.0 - fast-json-stable-stringify: ^2.1.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.6.1 - jest-regex-util: ^29.4.3 - jest-util: ^29.6.1 - micromatch: ^4.0.4 - pirates: ^4.0.4 - slash: ^3.0.0 - write-file-atomic: ^4.0.2 - checksum: 1635cd66e4b3dbba0689ecefabc6137301756c9c12d1d23e25124dd0dd9b4a6a38653d51e825e90f74faa022152ac1eaf200591fb50417aa7e1f7d1d1c2bc11d + semver: ^7.3.5 + checksum: a50a6818de5fc557d0b0e6f50ec780a7a02ab8ad07e5ac8b16bf519e0ad60a144ac64f97d05c443c3367235d337182e1d012bbac0eb8dbae8dc7b40b193efd0e languageName: node linkType: hard -"@jest/types@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/types@npm:29.6.1" - dependencies: - "@jest/schemas": ^29.6.0 - "@types/istanbul-lib-coverage": ^2.0.0 - "@types/istanbul-reports": ^3.0.0 - "@types/node": "*" - "@types/yargs": ^17.0.8 - chalk: ^4.0.0 - checksum: 89fc1ccf71a84fe0da643e0675b1cfe6a6f19ea72e935b2ab1dbdb56ec547e94433fb59b3536d3832a6e156c077865b7176fe9dae707dab9c3d2f9405ba6233c +"@pkgjs/parseargs@npm:^0.11.0": + version: 0.11.0 + resolution: "@pkgjs/parseargs@npm:0.11.0" + checksum: 6ad6a00fc4f2f2cfc6bff76fb1d88b8ee20bc0601e18ebb01b6d4be583733a860239a521a7fbca73b612e66705078809483549d2b18f370eb346c5155c8e4a0f languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.1.0": - version: 0.1.1 - resolution: "@jridgewell/gen-mapping@npm:0.1.1" +"@pkgr/utils@npm:^2.3.1": + version: 2.4.2 + resolution: "@pkgr/utils@npm:2.4.2" dependencies: - "@jridgewell/set-array": ^1.0.0 - "@jridgewell/sourcemap-codec": ^1.4.10 - checksum: 3bcc21fe786de6ffbf35c399a174faab05eb23ce6a03e8769569de28abbf4facc2db36a9ddb0150545ae23a8d35a7cf7237b2aa9e9356a7c626fb4698287d5cc + cross-spawn: ^7.0.3 + fast-glob: ^3.3.0 + is-glob: ^4.0.3 + open: ^9.1.0 + picocolors: ^1.0.0 + tslib: ^2.6.0 + checksum: 24e04c121269317d259614cd32beea3af38277151c4002df5883c4be920b8e3490bb897748e844f9d46bf68230f86dabd4e8f093773130e7e60529a769a132fc languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.2": - version: 0.3.2 - resolution: "@jridgewell/gen-mapping@npm:0.3.2" - dependencies: - "@jridgewell/set-array": ^1.0.1 - "@jridgewell/sourcemap-codec": ^1.4.10 - "@jridgewell/trace-mapping": ^0.3.9 - checksum: 1832707a1c476afebe4d0fbbd4b9434fdb51a4c3e009ab1e9938648e21b7a97049fa6009393bdf05cab7504108413441df26d8a3c12193996e65493a4efb6882 +"@rollup/rollup-android-arm-eabi@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.3.0" + conditions: os=android & cpu=arm languageName: node linkType: hard -"@jridgewell/resolve-uri@npm:3.1.0, @jridgewell/resolve-uri@npm:^3.0.3": - version: 3.1.0 - resolution: "@jridgewell/resolve-uri@npm:3.1.0" - checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 +"@rollup/rollup-android-arm64@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-android-arm64@npm:4.3.0" + conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@jridgewell/set-array@npm:^1.0.0, @jridgewell/set-array@npm:^1.0.1": - version: 1.1.2 - resolution: "@jridgewell/set-array@npm:1.1.2" - checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e +"@rollup/rollup-darwin-arm64@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.3.0" + conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.10": - version: 1.4.14 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" - checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 +"@rollup/rollup-darwin-x64@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.3.0" + conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:0.3.9": - version: 0.3.9 - resolution: "@jridgewell/trace-mapping@npm:0.3.9" - dependencies: - "@jridgewell/resolve-uri": ^3.0.3 - "@jridgewell/sourcemap-codec": ^1.4.10 - checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef +"@rollup/rollup-linux-arm-gnueabihf@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.3.0" + conditions: os=linux & cpu=arm languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.18 - resolution: "@jridgewell/trace-mapping@npm:0.3.18" - dependencies: - "@jridgewell/resolve-uri": 3.1.0 - "@jridgewell/sourcemap-codec": 1.4.14 - checksum: 0572669f855260808c16fe8f78f5f1b4356463b11d3f2c7c0b5580c8ba1cbf4ae53efe9f627595830856e57dbac2325ac17eb0c3dd0ec42102e6f227cc289c02 +"@rollup/rollup-linux-arm64-gnu@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.3.0" + conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@nicolo-ribaudo/semver-v6@npm:^6.3.3": - version: 6.3.3 - resolution: "@nicolo-ribaudo/semver-v6@npm:6.3.3" - bin: - semver: bin/semver.js - checksum: 8290855b1591477d2298364541fda64fafd4acc110b387067a71c9b05f4105c0a4ac079857ae9cd107c42ee884e8724a406b5116f069575e02d7ab87a35a5272 +"@rollup/rollup-linux-arm64-musl@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.3.0" + conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@nodelib/fs.scandir@npm:2.1.5": - version: 2.1.5 - resolution: "@nodelib/fs.scandir@npm:2.1.5" - dependencies: - "@nodelib/fs.stat": 2.0.5 - run-parallel: ^1.1.9 - checksum: a970d595bd23c66c880e0ef1817791432dbb7acbb8d44b7e7d0e7a22f4521260d4a83f7f9fd61d44fda4610105577f8f58a60718105fb38352baed612fd79e59 +"@rollup/rollup-linux-x64-gnu@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.3.0" + conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": - version: 2.0.5 - resolution: "@nodelib/fs.stat@npm:2.0.5" - checksum: 012480b5ca9d97bff9261571dbbec7bbc6033f69cc92908bc1ecfad0792361a5a1994bc48674b9ef76419d056a03efadfce5a6cf6dbc0a36559571a7a483f6f0 +"@rollup/rollup-linux-x64-musl@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.3.0" + conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@nodelib/fs.walk@npm:^1.2.3, @nodelib/fs.walk@npm:^1.2.8": - version: 1.2.8 - resolution: "@nodelib/fs.walk@npm:1.2.8" - dependencies: - "@nodelib/fs.scandir": 2.1.5 - fastq: ^1.6.0 - checksum: 190c643f156d8f8f277bf2a6078af1ffde1fd43f498f187c2db24d35b4b4b5785c02c7dc52e356497b9a1b65b13edc996de08de0b961c32844364da02986dc53 +"@rollup/rollup-win32-arm64-msvc@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.3.0" + conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@npmcli/fs@npm:^2.1.0": - version: 2.1.2 - resolution: "@npmcli/fs@npm:2.1.2" - dependencies: - "@gar/promisify": ^1.1.3 - semver: ^7.3.5 - checksum: 405074965e72d4c9d728931b64d2d38e6ea12066d4fad651ac253d175e413c06fe4350970c783db0d749181da8fe49c42d3880bd1cbc12cd68e3a7964d820225 +"@rollup/rollup-win32-ia32-msvc@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.3.0" + conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@npmcli/move-file@npm:^2.0.0": - version: 2.0.1 - resolution: "@npmcli/move-file@npm:2.0.1" - dependencies: - mkdirp: ^1.0.4 - rimraf: ^3.0.2 - checksum: 52dc02259d98da517fae4cb3a0a3850227bdae4939dda1980b788a7670636ca2b4a01b58df03dd5f65c1e3cb70c50fa8ce5762b582b3f499ec30ee5ce1fd9380 +"@rollup/rollup-win32-x64-msvc@npm:4.3.0": + version: 4.3.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.3.0" + conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -2277,54 +1035,49 @@ __metadata: languageName: node linkType: hard -"@sapphire/cron@npm:^1.1.0": - version: 1.1.0 - resolution: "@sapphire/cron@npm:1.1.0" - dependencies: - "@sapphire/utilities": ^3.11.0 - checksum: 71bc8b91dd42c93fa3b11c66bff31133105389a1b3a2cf5d3f02294c6bba14163b70ea69165e2be6a83ec5a036d630eb7fa1a856dd5ee6829315f71291f8ee83 +"@sapphire/bitfield@npm:^1.2.0": + version: 1.2.0 + resolution: "@sapphire/bitfield@npm:1.2.0" + checksum: c0f6bac13970ff588fa0f16a397c7a33c3ab927bccc0b0589ed1934787b67bf91ba784f26dd125f55978a13a09e38b31ff50074248034456964f9416bfee022a languageName: node linkType: hard -"@sapphire/decorators@npm:^4.3.8": - version: 4.3.8 - resolution: "@sapphire/decorators@npm:4.3.8" +"@sapphire/cron@npm:^1.1.1": + version: 1.1.1 + resolution: "@sapphire/cron@npm:1.1.1" dependencies: - tslib: ^2.4.0 - checksum: 1642d102959fe81313c30a180d4bbbdc8ace51c6fb41710e03c5ec971b889aa0e845660c4bdaae4a2f16611bfefd09966c30e6d46fe39c59a0deaaa493f3a54d + "@sapphire/utilities": ^3.13.0 + checksum: 060895735d3f1ab78a90700d0ee0a602186854b462820c326295b6a7cad65649c0486bbc978a82259c631817d7dfc72814e9ea7d3e7071cd122cba1207530811 languageName: node linkType: hard -"@sapphire/discord-utilities@npm:^2.11.2, @sapphire/discord-utilities@npm:^2.11.5": - version: 2.12.0 - resolution: "@sapphire/discord-utilities@npm:2.12.0" +"@sapphire/decorators@npm:^6.0.2": + version: 6.0.2 + resolution: "@sapphire/decorators@npm:6.0.2" dependencies: - discord-api-types: ^0.36.3 - checksum: a699d8cca46033a0eafa42dc44651f1e72ccb2a5eb8e94710dbe4b7f154aed0d7729c7eba515bcdfe1592a0b0c8181f2712a43939188a44603b940e877fa81a7 + tslib: ^2.6.0 + checksum: b24f33ee14c2014efec9b29ef947e59adc66001e6e4e5f6601063d4e4c86dd0a30bd8eb2c5b67a6231473e76018db1120f416cc94d650280b21462dfe8ca0a02 languageName: node linkType: hard -"@sapphire/discord.js-utilities@npm:4.12.0": - version: 4.12.0 - resolution: "@sapphire/discord.js-utilities@npm:4.12.0" +"@sapphire/discord-utilities@npm:^3.1.1": + version: 3.1.1 + resolution: "@sapphire/discord-utilities@npm:3.1.1" dependencies: - "@sapphire/discord-utilities": ^2.11.5 - "@sapphire/time-utilities": ^1.7.5 - "@sapphire/utilities": ^3.9.0 - tslib: ^2.4.0 - checksum: 7f71f9205993be15fee97c9128997304cfadc3d5b420885e2588f3ec2c0653fcdda29138d277ec6f13950ecc8ac01fa904c94cf2414e355bb05edcd5fe9b54c9 + discord-api-types: ^0.37.55 + checksum: 423c9cd541d2dbdbcaa18d7793ae40d557808c348d7fea1c6963b249bb647df3b99ac3fb24024820c8e84ae4300560d927cd7a3cefbf22fa0f0dfd49f5764ee8 languageName: node linkType: hard -"@sapphire/discord.js-utilities@patch:@sapphire/discord.js-utilities@npm%3A4.12.0#./.yarn/patches/@sapphire-discord.js-utilities-npm-4.12.0-cff496cdca.patch::locator=skyra%40workspace%3A.": - version: 4.12.0 - resolution: "@sapphire/discord.js-utilities@patch:@sapphire/discord.js-utilities@npm%3A4.12.0#./.yarn/patches/@sapphire-discord.js-utilities-npm-4.12.0-cff496cdca.patch::version=4.12.0&hash=bde76c&locator=skyra%40workspace%3A." +"@sapphire/discord.js-utilities@npm:7.0.2, @sapphire/discord.js-utilities@npm:^7.0.2": + version: 7.0.2 + resolution: "@sapphire/discord.js-utilities@npm:7.0.2" dependencies: - "@sapphire/discord-utilities": ^2.11.5 - "@sapphire/time-utilities": ^1.7.5 - "@sapphire/utilities": ^3.9.0 - tslib: ^2.4.0 - checksum: 10dd516a94e5f1a80a4af7aab6f2cdbceb69f00aa3f56eeb230095a41b376e97d9435e7ff6670afc064b68a6ec142e57db4a910785e707c8a8b9c7776bee06dc + "@sapphire/discord-utilities": ^3.1.1 + "@sapphire/duration": ^1.1.0 + "@sapphire/utilities": ^3.13.0 + tslib: ^2.6.2 + checksum: 55da08a85cb8113baa19f0b308df521495f9effa478c04b72dc41afa66dcbfff1250171113e7a64c4c847903d63a3de99cdcca467829f79be2f16ca66d0b2980 languageName: node linkType: hard @@ -2335,18 +1088,18 @@ __metadata: languageName: node linkType: hard -"@sapphire/eslint-config@npm:^4.4.3": - version: 4.4.3 - resolution: "@sapphire/eslint-config@npm:4.4.3" +"@sapphire/eslint-config@npm:^5.0.2": + version: 5.0.2 + resolution: "@sapphire/eslint-config@npm:5.0.2" dependencies: - "@typescript-eslint/eslint-plugin": ^5.61.0 - "@typescript-eslint/parser": ^5.61.0 - eslint: ^8.44.0 - eslint-config-prettier: ^8.8.0 - eslint-plugin-prettier: ^4.2.1 - prettier: ^2.8.8 - typescript: ^5.1.6 - checksum: 37fc27ae1fc56865afea15f53d8f6558178b196f412e10bba69ec0cb43602b4af39b2b907053757ee9c6d6f059e9d8261820a526ce2843f8b481af9566d76f9f + "@typescript-eslint/eslint-plugin": ^6.5.0 + "@typescript-eslint/parser": ^6.5.0 + eslint: ^8.48.0 + eslint-config-prettier: ^9.0.0 + eslint-plugin-prettier: ^5.0.0 + prettier: ^3.0.2 + typescript: ^5.2.2 + checksum: 34b4e2fc33cea2a589752702b605fed01c430992e4a6efaa5c1e55bee3c0f56415e8fc60e13757e78eac6d68f00fc026edcfd00c6531f2d2f939c8049ecb35f7 languageName: node linkType: hard @@ -2359,129 +1112,126 @@ __metadata: languageName: node linkType: hard -"@sapphire/framework@npm:2.5.1": - version: 2.5.1 - resolution: "@sapphire/framework@npm:2.5.1" - dependencies: - "@discordjs/builders": ^0.15.0 - "@sapphire/discord-utilities": ^2.11.2 - "@sapphire/discord.js-utilities": ^4.11.2 - "@sapphire/pieces": ^3.3.4 - "@sapphire/ratelimits": ^2.4.4 - "@sapphire/utilities": ^3.6.2 - lexure: ^0.17.0 - tslib: ^2.4.0 - checksum: 3ee022433eaae8922093feee782d788ce9751836011b685881635090cf72770a9fc0b5b32e9750e1b1901bb987a54ee96c3e71734d91833c2bfcfcaa57416470 +"@sapphire/framework@npm:4.7.2": + version: 4.7.2 + resolution: "@sapphire/framework@npm:4.7.2" + dependencies: + "@discordjs/builders": ^1.6.5 + "@sapphire/discord-utilities": ^3.1.1 + "@sapphire/discord.js-utilities": ^7.0.2 + "@sapphire/lexure": ^1.1.5 + "@sapphire/pieces": ^3.7.0 + "@sapphire/ratelimits": ^2.4.7 + "@sapphire/result": ^2.6.4 + "@sapphire/stopwatch": ^1.5.0 + "@sapphire/utilities": ^3.13.0 + checksum: 4f988bed4bc5acd772ba48d13ee4372dd006bf6001e60e1f185da47b57e419df07a4435505ace7b429069db73dfb0756103632453524d396978ffaa98abf8ed3 languageName: node linkType: hard -"@sapphire/framework@patch:@sapphire/framework@npm%3A2.5.1#./.yarn/patches/@sapphire-framework-npm-2.5.1-e9e3e6d600.patch::locator=skyra%40workspace%3A.": - version: 2.5.1 - resolution: "@sapphire/framework@patch:@sapphire/framework@npm%3A2.5.1#./.yarn/patches/@sapphire-framework-npm-2.5.1-e9e3e6d600.patch::version=2.5.1&hash=283bb0&locator=skyra%40workspace%3A." - dependencies: - "@discordjs/builders": ^0.15.0 - "@sapphire/discord-utilities": ^2.11.2 - "@sapphire/discord.js-utilities": ^4.11.2 - "@sapphire/pieces": ^3.3.4 - "@sapphire/ratelimits": ^2.4.4 - "@sapphire/utilities": ^3.6.2 - lexure: ^0.17.0 - tslib: ^2.4.0 - checksum: e08dc26693781bdb2426f4b3b80abd024dac52eb2b7bfed4495f78153645fcfc0f046b30bd109a814e30d3fc5e849249ca4033eeb7fd743d06234a567b791cf9 +"@sapphire/lexure@npm:^1.1.5": + version: 1.1.5 + resolution: "@sapphire/lexure@npm:1.1.5" + dependencies: + "@sapphire/result": ^2.6.4 + checksum: 8a17dc6224c1d10f9570b40226dbc12230920d31b1a59fddabdb246fb8e7daefd3842537ff27be9d96030899d49afe29ffb50eb7842b713184e69b4c142fca47 languageName: node linkType: hard -"@sapphire/pieces@npm:^3.3.4": - version: 3.6.0 - resolution: "@sapphire/pieces@npm:3.6.0" +"@sapphire/pieces@npm:^3.7.0": + version: 3.7.0 + resolution: "@sapphire/pieces@npm:3.7.0" dependencies: - "@discordjs/collection": ^1.2.0 - "@sapphire/utilities": ^3.11.0 - tslib: ^2.4.0 - checksum: ef93f1cd4cf3983cab43d45415590a4cbd32c01cbfde78b8eb230035637250e90fd9a7fa96377a719ef6ddde364d27f87c027d9cbebef82a93ca800ab21201b9 + "@discordjs/collection": ^1.5.1 + "@sapphire/utilities": ^3.13.0 + tslib: ^2.6.0 + checksum: d2187527766c892604b6e49a1d487b58e59b3053ae37b65662705d918d1822e6a818fa6df7eea44a46e9960c4f411abe5e132d4874c445df56ed3211d950d300 languageName: node linkType: hard -"@sapphire/plugin-api@npm:^3.2.4": - version: 3.2.4 - resolution: "@sapphire/plugin-api@npm:3.2.4" +"@sapphire/plugin-api@npm:^5.1.2": + version: 5.1.2 + resolution: "@sapphire/plugin-api@npm:5.1.2" dependencies: - "@types/node-fetch": 2.6.2 - "@types/psl": ^1.1.0 - "@types/ws": ^8.5.3 - node-fetch: 2.6.7 - psl: ^1.9.0 - tslib: ^2.4.0 - checksum: ef1589396fc82909cd356ac29cbb6e9b52db152bf22dc72c66d2a21a0b74d9b92cfcb27d42ad1c2487c00cd21af94a82a13f9b13bb51bd24cb651637168cf0cd + "@types/ws": ^8.5.8 + tldts: ^6.0.17 + tslib: ^2.6.2 + undici: ^5.26.5 + checksum: 3e4836e3cb9ecaf290ff00fcd8337f41763d3db0a6e0ed531a698d47abdd5b8c8728246d8e7ae01570f2439be80468098439a71eb9f7c437816c75932f6f0ec9 languageName: node linkType: hard -"@sapphire/plugin-editable-commands@npm:^1.2.2": - version: 1.2.2 - resolution: "@sapphire/plugin-editable-commands@npm:1.2.2" +"@sapphire/plugin-editable-commands@npm:^3.0.3": + version: 3.0.3 + resolution: "@sapphire/plugin-editable-commands@npm:3.0.3" dependencies: - "@skyra/editable-commands": ^2.1.3 - tslib: ^2.4.0 - checksum: b294d6587a9d04233233b8f4350e0ea21acc8cbe558ef792beffad26d7605a2a90bd2c1d4c422bbcafe7d1dcb4786bc701d92e24f7ccd1184cf0f1a566e2e35b + "@skyra/editable-commands": ^3.0.1 + checksum: c4b6953df71447eb74f4b2e36709f04897e63798ac4bab6237da210dfe59b5cdbfd8f5eb31ca83367c2de69957b49a83d1a663de06825a534bcd039788456019 languageName: node linkType: hard -"@sapphire/plugin-i18next@npm:^2.5.4": - version: 2.5.4 - resolution: "@sapphire/plugin-i18next@npm:2.5.4" +"@sapphire/plugin-i18next@npm:^6.0.1": + version: 6.0.1 + resolution: "@sapphire/plugin-i18next@npm:6.0.1" dependencies: - "@sapphire/utilities": ^3.7.0 - "@skyra/i18next-backend": ^1.0.1 + "@sapphire/utilities": ^3.13.0 + "@skyra/i18next-backend": ^2.0.4 chokidar: ^3.5.3 - i18next: ^21.8.13 - tslib: ^2.4.0 - checksum: 79f470ba126f88e19eaac9db8604bcd9b9f0b895d101dedcd2911c88e40c075a27bbad2eff7cd78ada3f2e3fae44dcde06bddd36fd55b8dd7040fd181d66640a + i18next: ^23.5.1 + checksum: 82c482cb6ad26c5bf1b5dae00c27f1026a73a091b7a7349afa573e2283f35cbbeae519fb7c9988a67d52b8c4efbfa14326b0151f89ca29c5e9e7b0e9a2880d9b languageName: node linkType: hard -"@sapphire/plugin-logger@npm:^2.2.3": - version: 2.2.3 - resolution: "@sapphire/plugin-logger@npm:2.2.3" +"@sapphire/plugin-logger@npm:^3.0.6": + version: 3.0.6 + resolution: "@sapphire/plugin-logger@npm:3.0.6" dependencies: - "@sapphire/time-utilities": ^1.7.4 - colorette: ^2.0.19 - tslib: ^2.4.0 - checksum: 90d4fdffccae8ab777601a322d0e32aba7ae415837298f176122620600f2b48a8235f746dfd292fdf9f2af1229f576e736870b394e368a3ed7e91791fddaacca + "@sapphire/timestamp": ^1.0.1 + colorette: ^2.0.20 + checksum: 18bb5726a52595aaae7bcd07ec367d5c7ba78fc9eb38c45f84427f67efd2c8066c64f06a67af483489d0dd6866cb7b75a16ad37ceee10d76b30c47fe117fb351 languageName: node linkType: hard -"@sapphire/plugin-subcommands@npm:^2.2.2": - version: 2.2.2 - resolution: "@sapphire/plugin-subcommands@npm:2.2.2" +"@sapphire/plugin-subcommands@npm:^5.0.0": + version: 5.0.0 + resolution: "@sapphire/plugin-subcommands@npm:5.0.0" dependencies: - tslib: ^2.4.0 - checksum: 358709f53d16ab52dbdb3f9d069c30a08bc78662e7726502baeaafbc76ecf57ad56d67a75e245563ed28be7ee8b18896a0e10a2d6100e6f959addb2cca2e7c91 + "@sapphire/utilities": ^3.13.0 + tslib: ^2.6.2 + checksum: 2c1455a44ce0f71ace38d12e987ee375a403e58de3862e9c0a1064b219bdfa3794d797fc1f0e07a31fdb84a2d6febec6b08788ba82019462cb7f13b24e68f9e0 languageName: node linkType: hard -"@sapphire/prettier-config@npm:^1.4.5": - version: 1.4.5 - resolution: "@sapphire/prettier-config@npm:1.4.5" +"@sapphire/prettier-config@npm:^2.0.0": + version: 2.0.0 + resolution: "@sapphire/prettier-config@npm:2.0.0" dependencies: - prettier: ^2.8.2 - checksum: 241dfda0e73d1cb62d97fc946530041f1515a077572e4fd2da9f0bef80b97fbd8828ad6d36f6c98561b217acce185d111175eb3c889907e2591daf778e800274 + prettier: ^3.0.0 + checksum: 5e7aa2f3c29587d8bd409d66e75ffa5ff6d6b98df6bdfb82dedb6d43b6134a5ba764d95dfc6b252b92bb4a56f125b22b83737449ee8dbf1d2ff41b0f1b6e87f7 + languageName: node + linkType: hard + +"@sapphire/ratelimits@npm:^2.4.7": + version: 2.4.7 + resolution: "@sapphire/ratelimits@npm:2.4.7" + checksum: e5e52ab8d3219678761ec0fe051b05711d85e29692f8048077bc443d71ed7df1be4e1dc9b2f5f11816ea15b389706ea6789e2ba1055f4c8adccd00711bb0d29d languageName: node linkType: hard -"@sapphire/ratelimits@npm:^2.4.4, @sapphire/ratelimits@npm:^2.4.6": - version: 2.4.6 - resolution: "@sapphire/ratelimits@npm:2.4.6" - checksum: cbec157ea8dc660a8dd045f2d57100289c5eb1ecd9e9bac786b9703cbd9dcea1d39b7d1ea1ca03dac9e266285ddf1767f50195dc7bf88a7cbd5bf25fcca3174f +"@sapphire/result@npm:^2.6.4": + version: 2.6.4 + resolution: "@sapphire/result@npm:2.6.4" + checksum: 37d8af05544bf6fcb9b10cf4aa4d60ab0f0798c4e302f4e401f63b1347602b89b10cbbf6fe789681dc2060ad15c3093c96f86dfbee6ac463dba060cb731d7208 languageName: node linkType: hard -"@sapphire/shapeshift@npm:^3.1.0, @sapphire/shapeshift@npm:^3.5.1": - version: 3.8.1 - resolution: "@sapphire/shapeshift@npm:3.8.1" +"@sapphire/shapeshift@npm:^3.9.2": + version: 3.9.3 + resolution: "@sapphire/shapeshift@npm:3.9.3" dependencies: fast-deep-equal: ^3.1.3 lodash: ^4.17.21 - checksum: 2a5954c76ee9a91506ae269141ffd2d71e05891c7f1618d0acbf3670312f0b473e356f9c3dafe484d8dc89282d7554f1fd7d720a2a3b0e921fb4e969d09513ee + checksum: f93ab924566dc20a066776128eeb3693b97a1576a359b61d396835541f2bf8ecb3f482ff406cc038a3a4bc266d5f9b9f9e1c733ddbf1cce2c97c729ce047b5e6 languageName: node linkType: hard @@ -2501,15 +1251,15 @@ __metadata: languageName: node linkType: hard -"@sapphire/time-utilities@npm:^1.7.4, @sapphire/time-utilities@npm:^1.7.5, @sapphire/time-utilities@npm:^1.7.9": - version: 1.7.9 - resolution: "@sapphire/time-utilities@npm:1.7.9" +"@sapphire/time-utilities@npm:^1.7.10": + version: 1.7.10 + resolution: "@sapphire/time-utilities@npm:1.7.10" dependencies: - "@sapphire/cron": ^1.1.0 + "@sapphire/cron": ^1.1.1 "@sapphire/duration": ^1.1.0 "@sapphire/timer-manager": ^1.0.0 "@sapphire/timestamp": ^1.0.1 - checksum: 73df8eda681407722f4fcc8dfa7e05f159cfba92b65430eb15e3335fb31e18449581b51224548b0a40703aa1db6678153cf8664b7e53da1f2c68afe522d89441 + checksum: 8b027c27fbc8426b6c9fca92a90b5c85db6070619a4c6f80a0bdfbf07587a967583345f0873a3ccb6ad5722d1bdd1dcf2438d2d74a735858c64fc8587c47d696 languageName: node linkType: hard @@ -2527,100 +1277,93 @@ __metadata: languageName: node linkType: hard -"@sapphire/ts-config@npm:^3.3.4": - version: 3.3.4 - resolution: "@sapphire/ts-config@npm:3.3.4" +"@sapphire/ts-config@npm:^5.0.0": + version: 5.0.0 + resolution: "@sapphire/ts-config@npm:5.0.0" dependencies: - tslib: ^2.3.1 - typescript: ^4.6.3 - checksum: c26dee331e17dd1762caa499ca6f1d1ee22fe781a5486575ead625c399678fbf3b33cf963a4f48aad04df5d515a4b3d2f80a03272d2413894d96f799d5f5ca87 + tslib: ^2.6.2 + typescript: ^5.2.2 + checksum: 5295e70762ec4e710c44d62c0706debb3d651d994b40c55586bfa93e7fae34c4f4f63d047b4fe3e66c4f545ad696485c904e79d2ed4e9ea45c89a0bf305ca945 languageName: node linkType: hard -"@sapphire/utilities@npm:^3.11.0, @sapphire/utilities@npm:^3.12.0, @sapphire/utilities@npm:^3.6.2, @sapphire/utilities@npm:^3.7.0, @sapphire/utilities@npm:^3.9.0": - version: 3.12.0 - resolution: "@sapphire/utilities@npm:3.12.0" - checksum: 002f15263f157fdbb0603c233a43a5660cd3b45a4f3fddaa9d7066d187eec23f473ee42c8d071b0e3dec4e22b08bed337fb7eb336a02b59743a78ebc8922004e +"@sapphire/utilities@npm:^3.13.0": + version: 3.13.0 + resolution: "@sapphire/utilities@npm:3.13.0" + checksum: c2f901c104459e01a24af71871294b700ff188925cf050558880486de6564792df2b7549796dd9fd6f309c12af7d4e2b2d2f4069ec9d4c27d9c3998eca3ac9a9 languageName: node linkType: hard -"@sentry-internal/tracing@npm:7.58.1": - version: 7.58.1 - resolution: "@sentry-internal/tracing@npm:7.58.1" +"@sentry-internal/tracing@npm:7.79.0": + version: 7.79.0 + resolution: "@sentry-internal/tracing@npm:7.79.0" dependencies: - "@sentry/core": 7.58.1 - "@sentry/types": 7.58.1 - "@sentry/utils": 7.58.1 - tslib: ^2.4.1 || ^1.9.3 - checksum: dd9b67cda7eb42659fec948a7f229cc52cc00e46e7f0dc1e6b916284db0d879f697f4ddbc817259de31a59c744e0475556692a0bb2cbe0a1978fa68fbd2517c5 + "@sentry/core": 7.79.0 + "@sentry/types": 7.79.0 + "@sentry/utils": 7.79.0 + checksum: 3598935354428621caaf47d144de18e44a6e05de897b26cee3acf7fbd1b68cf439242b2714ee6f7c638bbccece2b87587e7999b095ee1278e58d7cfb58b44c77 languageName: node linkType: hard -"@sentry/core@npm:7.58.1": - version: 7.58.1 - resolution: "@sentry/core@npm:7.58.1" +"@sentry/core@npm:7.79.0": + version: 7.79.0 + resolution: "@sentry/core@npm:7.79.0" dependencies: - "@sentry/types": 7.58.1 - "@sentry/utils": 7.58.1 - tslib: ^2.4.1 || ^1.9.3 - checksum: 1008d4b8e3a8f2e508f7bc41c474736fc6be3a3fe803a2e5054ea192a69d2e1fa44d435428bd92b3274aac2a0bd2f5bd78e1e10ee78aa1586eaebc95d03960f6 + "@sentry/types": 7.79.0 + "@sentry/utils": 7.79.0 + checksum: 807ac5154088c1e134b7452224badbb82385d7d473df11991f4f307778ff4ea2cffd1c51e1cedaef135035b5ab892d6b421a8925ed5094b87df1957f4bc8fc57 languageName: node linkType: hard -"@sentry/hub@npm:^7.58.1": - version: 7.58.1 - resolution: "@sentry/hub@npm:7.58.1" +"@sentry/hub@npm:^7.79.0": + version: 7.79.0 + resolution: "@sentry/hub@npm:7.79.0" dependencies: - "@sentry/core": 7.58.1 - "@sentry/types": 7.58.1 - "@sentry/utils": 7.58.1 - tslib: ^2.4.1 || ^1.9.3 - checksum: a4692841167e2114353fb790677b2eca244dabf3206e0de036e10c10c1bdf27a23b6629a769747488628eb4a2bbbf3a45e9f7c2def8dce56aef420d69fac3b49 + "@sentry/core": 7.79.0 + "@sentry/types": 7.79.0 + "@sentry/utils": 7.79.0 + checksum: 22b292e8802ef535a42d22b755535fbcd028b82baa6c13a57d6cbc98c7454e4b5fd04f1023f9fc41b74b561236b3abf040cbc1f93d1ebb779e3fa1b043f52aaa languageName: node linkType: hard -"@sentry/integrations@npm:^7.58.1": - version: 7.58.1 - resolution: "@sentry/integrations@npm:7.58.1" +"@sentry/integrations@npm:^7.79.0": + version: 7.79.0 + resolution: "@sentry/integrations@npm:7.79.0" dependencies: - "@sentry/types": 7.58.1 - "@sentry/utils": 7.58.1 + "@sentry/core": 7.79.0 + "@sentry/types": 7.79.0 + "@sentry/utils": 7.79.0 localforage: ^1.8.1 - tslib: ^2.4.1 || ^1.9.3 - checksum: f6247be3c87387ab61eaf7aa1b1df07c784b692dab975f85354eeb24df85fc0be32a80bdc9e563638928f945197f085318a34cf48a62ef7c7d6a9730a0ed6f89 + checksum: b8e47d193b102caca25e9c8d903651d6824b069efd8c0fce2d3cda7201fa7397cbc31fbc6af427ec984f631c44a581d3ebd9dc3bcc9c75812a4d56214ea38420 languageName: node linkType: hard -"@sentry/node@npm:^7.58.1": - version: 7.58.1 - resolution: "@sentry/node@npm:7.58.1" +"@sentry/node@npm:^7.79.0": + version: 7.79.0 + resolution: "@sentry/node@npm:7.79.0" dependencies: - "@sentry-internal/tracing": 7.58.1 - "@sentry/core": 7.58.1 - "@sentry/types": 7.58.1 - "@sentry/utils": 7.58.1 - cookie: ^0.4.1 + "@sentry-internal/tracing": 7.79.0 + "@sentry/core": 7.79.0 + "@sentry/types": 7.79.0 + "@sentry/utils": 7.79.0 https-proxy-agent: ^5.0.0 - lru_map: ^0.3.3 - tslib: ^2.4.1 || ^1.9.3 - checksum: b2bf358f02de721ee132d1dcf59bb7001bfd2771e8ff5c7a6196a2fd19bb45213b08ab8d42d7ff42333c54d240a872104b7713995cd6f70089fdf7fa1cb496d1 + checksum: 5aeb98b46df32c93d49196a14f190860db57cf6db53864102ea5efda422f50256248413d62a2ff20fb25c784f24afcc6799247761802ea3049e89d9f88c9e999 languageName: node linkType: hard -"@sentry/types@npm:7.58.1": - version: 7.58.1 - resolution: "@sentry/types@npm:7.58.1" - checksum: 29874507bb0e348c35eedbb0169f7b6bfb84fbc131b8d1c4eeb368f1b67da39dc8cabd319a7068c0b7fdfa2447b6f243d9316ab08a361ae5c321daefff8fddeb +"@sentry/types@npm:7.79.0": + version: 7.79.0 + resolution: "@sentry/types@npm:7.79.0" + checksum: a68ff2af32e8ff29ac132b609b101093a121597dd6a5a24a02065e36f0e99a35d79f37a8ba4945f3b313927a01dfe3fdf8182729af306171dbe1e3c01e8911f9 languageName: node linkType: hard -"@sentry/utils@npm:7.58.1": - version: 7.58.1 - resolution: "@sentry/utils@npm:7.58.1" +"@sentry/utils@npm:7.79.0": + version: 7.79.0 + resolution: "@sentry/utils@npm:7.79.0" dependencies: - "@sentry/types": 7.58.1 - tslib: ^2.4.1 || ^1.9.3 - checksum: e2435a3ca2c240691ce23661754b2afa37a76b5cfd6287a6e36089fadfca859aefaa5d88afbd27b1c85b3d6ba1e73e988dd0a4bb2665dd25416b79e4c7112333 + "@sentry/types": 7.79.0 + checksum: e91dfa4cd836fca680c0c3153542a728e6a2fe287aa5816688c1a6cf1c18b213868f60587af6a9089677d69d1b0914f6cf6e8a3636ad45ca91f84747894bf028 languageName: node linkType: hard @@ -2631,31 +1374,6 @@ __metadata: languageName: node linkType: hard -"@sindresorhus/is@npm:^4.6.0": - version: 4.6.0 - resolution: "@sindresorhus/is@npm:4.6.0" - checksum: 83839f13da2c29d55c97abc3bc2c55b250d33a0447554997a85c539e058e57b8da092da396e252b11ec24a0279a0bed1f537fa26302209327060643e327f81d2 - languageName: node - linkType: hard - -"@sinonjs/commons@npm:^2.0.0": - version: 2.0.0 - resolution: "@sinonjs/commons@npm:2.0.0" - dependencies: - type-detect: 4.0.8 - checksum: 5023ba17edf2b85ed58262313b8e9b59e23c6860681a9af0200f239fe939e2b79736d04a260e8270ddd57196851dde3ba754d7230be5c5234e777ae2ca8af137 - languageName: node - linkType: hard - -"@sinonjs/fake-timers@npm:^10.0.2": - version: 10.0.2 - resolution: "@sinonjs/fake-timers@npm:10.0.2" - dependencies: - "@sinonjs/commons": ^2.0.0 - checksum: c62aa98e7cefda8dedc101ce227abc888dc46b8ff9706c5f0a8dfd9c3ada97d0a5611384738d9ba0b26b59f99c2ba24efece8e779bb08329e9e87358fa309824 - languageName: node - linkType: hard - "@skyra/ai@npm:^1.2.0": version: 1.2.0 resolution: "@skyra/ai@npm:1.2.0" @@ -2675,10 +1393,10 @@ __metadata: languageName: node linkType: hard -"@skyra/editable-commands@npm:^2.1.3": - version: 2.1.4 - resolution: "@skyra/editable-commands@npm:2.1.4" - checksum: 865c11201c1778543f64dc81e114efae3096bf50653e6301ee576d5d9f2d6623fb3387e39fe06e74ec1b655dd033184d850e5735ea74d54bce169743cc6ab7b3 +"@skyra/editable-commands@npm:^3.0.1": + version: 3.0.1 + resolution: "@skyra/editable-commands@npm:3.0.1" + checksum: a945fa47d6f5df20396edc268ede830a79fcedb3f3fe57e91cca94e4d0a26af5e4e6f3c673e2eb3b2d182ae6c6acefcd3074df8e072dc647981d1dccda10ade8 languageName: node linkType: hard @@ -2692,12 +1410,12 @@ __metadata: languageName: node linkType: hard -"@skyra/i18next-backend@npm:^1.0.1": - version: 1.1.0 - resolution: "@skyra/i18next-backend@npm:1.1.0" +"@skyra/i18next-backend@npm:^2.0.4": + version: 2.0.4 + resolution: "@skyra/i18next-backend@npm:2.0.4" dependencies: - tslib: ^2.4.0 - checksum: 1e89ac67b672e70fc16731da127c46d913222feae12208f621524cff67000c4d530673b11f6797d05f821a0c8705073a3d93eed6ccf865c55235ecbc917b0f1b + tslib: ^2.6.2 + checksum: ce139a4f66639ae04a21a21bbc7fea7a86b1f656e773d6e2f6f93f8314b48916f7ef54686ee69bce56c46ec78a88a2a63aa65ffc03ef4a3d14339576911225f5 languageName: node linkType: hard @@ -2708,390 +1426,364 @@ __metadata: languageName: node linkType: hard -"@sqltools/formatter@npm:1.2.2": - version: 1.2.2 - resolution: "@sqltools/formatter@npm:1.2.2" - checksum: 9c355f0961f93deea6540960b9ef031bd37cd5a92e3e236da05ea860cd408bf5ba039505150143202a59ca9ebf471ee607d1be4c24378320911a98bb0394fd46 - languageName: node - linkType: hard - -"@tootallnate/once@npm:2": - version: 2.0.0 - resolution: "@tootallnate/once@npm:2.0.0" - checksum: ad87447820dd3f24825d2d947ebc03072b20a42bfc96cbafec16bff8bbda6c1a81fcb0be56d5b21968560c5359a0af4038a68ba150c3e1694fe4c109a063bed8 - languageName: node - linkType: hard - -"@tsconfig/node10@npm:^1.0.7": - version: 1.0.9 - resolution: "@tsconfig/node10@npm:1.0.9" - checksum: a33ae4dc2a621c0678ac8ac4bceb8e512ae75dac65417a2ad9b022d9b5411e863c4c198b6ba9ef659e14b9fb609bbec680841a2e84c1172df7a5ffcf076539df - languageName: node - linkType: hard - -"@tsconfig/node12@npm:^1.0.7": - version: 1.0.11 - resolution: "@tsconfig/node12@npm:1.0.11" - checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a - languageName: node - linkType: hard - -"@tsconfig/node14@npm:^1.0.0": - version: 1.0.3 - resolution: "@tsconfig/node14@npm:1.0.3" - checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d - languageName: node - linkType: hard - -"@tsconfig/node16@npm:^1.0.2": - version: 1.0.3 - resolution: "@tsconfig/node16@npm:1.0.3" - checksum: 3a8b657dd047495b7ad23437d6afd20297ce90380ff0bdee93fc7d39a900dbd8d9e26e53ff6b465e7967ce2adf0b218782590ce9013285121e6a5928fbd6819f - languageName: node - linkType: hard - -"@types/babel__core@npm:^7.1.14": - version: 7.20.0 - resolution: "@types/babel__core@npm:7.20.0" - dependencies: - "@babel/parser": ^7.20.7 - "@babel/types": ^7.20.7 - "@types/babel__generator": "*" - "@types/babel__template": "*" - "@types/babel__traverse": "*" - checksum: 49b601a0a7637f1f387442c8156bd086cfd10ff4b82b0e1994e73a6396643b5435366fb33d6b604eade8467cca594ef97adcbc412aede90bb112ebe88d0ad6df - languageName: node - linkType: hard - -"@types/babel__generator@npm:*": - version: 7.6.4 - resolution: "@types/babel__generator@npm:7.6.4" - dependencies: - "@babel/types": ^7.0.0 - checksum: 20effbbb5f8a3a0211e95959d06ae70c097fb6191011b73b38fe86deebefad8e09ee014605e0fd3cdaedc73d158be555866810e9166e1f09e4cfd880b874dcb0 - languageName: node - linkType: hard - -"@types/babel__template@npm:*": - version: 7.4.1 - resolution: "@types/babel__template@npm:7.4.1" - dependencies: - "@babel/parser": ^7.1.0 - "@babel/types": ^7.0.0 - checksum: 649fe8b42c2876be1fd28c6ed9b276f78152d5904ec290b6c861d9ef324206e0a5c242e8305c421ac52ecf6358fa7e32ab7a692f55370484825c1df29b1596ee - languageName: node - linkType: hard - -"@types/babel__traverse@npm:*, @types/babel__traverse@npm:^7.0.6": - version: 7.18.3 - resolution: "@types/babel__traverse@npm:7.18.3" - dependencies: - "@babel/types": ^7.3.0 - checksum: d20953338b2f012ab7750932ece0a78e7d1645b0a6ff42d49be90f55e9998085da1374a9786a7da252df89555c6586695ba4d1d4b4e88ab2b9f306bcd35e00d3 - languageName: node - linkType: hard - -"@types/backoff@npm:^2.5.2": - version: 2.5.2 - resolution: "@types/backoff@npm:2.5.2" - dependencies: - "@types/node": "*" - checksum: a22b727b3540d28535fb9fefb0ece82ae2c325a16f7ab2736650a93294e74fec77d33562f2b363f8fcb3c6c1d8f8654d7d7a57f319e5b173e3c7d16819d8d235 - languageName: node - linkType: hard - -"@types/diff@npm:^5.0.3": - version: 5.0.3 - resolution: "@types/diff@npm:5.0.3" - checksum: d8a7d4de12f1aba0bd0c17b0b0d1e45c83824d3d6cc65763fbad371cd8315361a7e16fbae3f260a83bfdf30cebe1c876b42cec4518698055bc430fb09db1cbc8 +"@sqltools/formatter@npm:^1.2.5": + version: 1.2.5 + resolution: "@sqltools/formatter@npm:1.2.5" + checksum: 9b8354e715467d660daa5afe044860b5686bbb1a5cb67a60866b932effafbf5e8b429f19a8ae67cd412065a4f067161f227e182f3664a0245339d5eb1e26e355 languageName: node linkType: hard -"@types/graceful-fs@npm:^4.1.3": - version: 4.1.6 - resolution: "@types/graceful-fs@npm:4.1.6" - dependencies: - "@types/node": "*" - checksum: c3070ccdc9ca0f40df747bced1c96c71a61992d6f7c767e8fd24bb6a3c2de26e8b84135ede000b7e79db530a23e7e88dcd9db60eee6395d0f4ce1dae91369dd4 +"@tsconfig/node10@npm:^1.0.7": + version: 1.0.9 + resolution: "@tsconfig/node10@npm:1.0.9" + checksum: a33ae4dc2a621c0678ac8ac4bceb8e512ae75dac65417a2ad9b022d9b5411e863c4c198b6ba9ef659e14b9fb609bbec680841a2e84c1172df7a5ffcf076539df languageName: node linkType: hard -"@types/he@npm:^1.2.0": - version: 1.2.0 - resolution: "@types/he@npm:1.2.0" - checksum: 0110608efe61a8fb710c5a344485d70dab48116e9529d10a3175985ad7a118a2547ffd708349681f3ecdbcd6ae91e63c674b73ed0e4bd2c9a57ca793f538c852 +"@tsconfig/node12@npm:^1.0.7": + version: 1.0.11 + resolution: "@tsconfig/node12@npm:1.0.11" + checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a languageName: node linkType: hard -"@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0, @types/istanbul-lib-coverage@npm:^2.0.1": - version: 2.0.4 - resolution: "@types/istanbul-lib-coverage@npm:2.0.4" - checksum: a25d7589ee65c94d31464c16b72a9dc81dfa0bea9d3e105ae03882d616e2a0712a9c101a599ec482d297c3591e16336962878cb3eb1a0a62d5b76d277a890ce7 +"@tsconfig/node14@npm:^1.0.0": + version: 1.0.3 + resolution: "@tsconfig/node14@npm:1.0.3" + checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d languageName: node linkType: hard -"@types/istanbul-lib-report@npm:*": - version: 3.0.0 - resolution: "@types/istanbul-lib-report@npm:3.0.0" - dependencies: - "@types/istanbul-lib-coverage": "*" - checksum: 656398b62dc288e1b5226f8880af98087233cdb90100655c989a09f3052b5775bf98ba58a16c5ae642fb66c61aba402e07a9f2bff1d1569e3b306026c59f3f36 +"@tsconfig/node16@npm:^1.0.2": + version: 1.0.4 + resolution: "@tsconfig/node16@npm:1.0.4" + checksum: 202319785901f942a6e1e476b872d421baec20cf09f4b266a1854060efbf78cde16a4d256e8bc949d31e6cd9a90f1e8ef8fb06af96a65e98338a2b6b0de0a0ff languageName: node linkType: hard -"@types/istanbul-reports@npm:^3.0.0": - version: 3.0.1 - resolution: "@types/istanbul-reports@npm:3.0.1" +"@types/backoff@npm:^2.5.5": + version: 2.5.5 + resolution: "@types/backoff@npm:2.5.5" dependencies: - "@types/istanbul-lib-report": "*" - checksum: f1ad54bc68f37f60b30c7915886b92f86b847033e597f9b34f2415acdbe5ed742fa559a0a40050d74cdba3b6a63c342cac1f3a64dba5b68b66a6941f4abd7903 + "@types/node": "*" + checksum: e2f1128bc1739172881c158f2ee8b35d69ba36656879af53b5a84b7bd888fd484879f9497b8087b0f1a46426e8297c77e0ff400380e9e784d2db35bdc7dec7f2 languageName: node linkType: hard -"@types/jest@npm:^29.5.3": - version: 29.5.3 - resolution: "@types/jest@npm:29.5.3" +"@types/chai-subset@npm:^1.3.3": + version: 1.3.5 + resolution: "@types/chai-subset@npm:1.3.5" dependencies: - expect: ^29.0.0 - pretty-format: ^29.0.0 - checksum: e36bb92e0b9e5ea7d6f8832baa42f087fc1697f6cd30ec309a07ea4c268e06ec460f1f0cfd2581daf5eff5763475190ec1ad8ac6520c49ccfe4f5c0a48bfa676 + "@types/chai": "*" + checksum: 715c46d3e90f87482c2769389d560456bb257b225716ff44c275c231bdb62c8a30629f355f412bac0ecab07ebc036c1806d9ed9dde9792254f8ef4f07f76033b languageName: node linkType: hard -"@types/json-schema@npm:^7.0.9": - version: 7.0.11 - resolution: "@types/json-schema@npm:7.0.11" - checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d +"@types/chai@npm:*, @types/chai@npm:^4.3.5": + version: 4.3.10 + resolution: "@types/chai@npm:4.3.10" + checksum: cb9ebe31f5da2d72c4b9362ec4efb33497355372270163c0290f6b9c389934ff178dac933be6b2911a125f15972c0379603736ea83ad10bfca933b6aaf6c0c5b languageName: node linkType: hard -"@types/minimist@npm:^1.2.0": - version: 1.2.2 - resolution: "@types/minimist@npm:1.2.2" - checksum: b8da83c66eb4aac0440e64674b19564d9d86c80ae273144db9681e5eeff66f238ade9515f5006ffbfa955ceff8b89ad2bd8ec577d7caee74ba101431fb07045d +"@types/diff@npm:^5.0.8": + version: 5.0.8 + resolution: "@types/diff@npm:5.0.8" + checksum: 729c74c408905cb88ae7a8245e8c1d03359f2c01168beee4d90304af1cdf99462e4a1f2c49b3a64e27623baae3ea7a5a8f883b1db5a3ec075770700a14ad0904 languageName: node linkType: hard -"@types/node-fetch@npm:2.6.2": - version: 2.6.2 - resolution: "@types/node-fetch@npm:2.6.2" - dependencies: - "@types/node": "*" - form-data: ^3.0.0 - checksum: 6f73b1470000d303d25a6fb92875ea837a216656cb7474f66cdd67bb014aa81a5a11e7ac9c21fe19bee9ecb2ef87c1962bceeaec31386119d1ac86e4c30ad7a6 +"@types/he@npm:^1.2.3": + version: 1.2.3 + resolution: "@types/he@npm:1.2.3" + checksum: e77851c73dd7b9902d92fe0118a26246a7f3676a3a1c6eb1408305187ef73b57c22550b1435946b983267f961d935554d5d0e1b458416932552f31e763e1aa41 languageName: node linkType: hard -"@types/node-fetch@npm:^2.6.3": - version: 2.6.3 - resolution: "@types/node-fetch@npm:2.6.3" - dependencies: - "@types/node": "*" - form-data: ^3.0.0 - checksum: b68cda58e91535a42dd5337932443c37f8e198ca1e8deeb95bd92a64a9a84d92071867b91c5eb84ee8e13f33d45a70549fe2bc11dd070a894dd561909f4d39f5 +"@types/istanbul-lib-coverage@npm:^2.0.1": + version: 2.0.6 + resolution: "@types/istanbul-lib-coverage@npm:2.0.6" + checksum: 3feac423fd3e5449485afac999dcfcb3d44a37c830af898b689fadc65d26526460bedb889db278e0d4d815a670331796494d073a10ee6e3a6526301fe7415778 languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^18.16.19": - version: 18.16.19 - resolution: "@types/node@npm:18.16.19" - checksum: 63c31f09616508aa7135380a4c79470a897b75f9ff3a70eb069e534dfabdec3f32fb0f9df5939127f1086614d980ddea0fa5e8cc29a49103c4f74cd687618aaf +"@types/json-schema@npm:^7.0.12": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 97ed0cb44d4070aecea772b7b2e2ed971e10c81ec87dd4ecc160322ffa55ff330dace1793489540e3e318d90942064bb697cc0f8989391797792d919737b3b98 languageName: node linkType: hard -"@types/normalize-package-data@npm:^2.4.0": - version: 2.4.1 - resolution: "@types/normalize-package-data@npm:2.4.1" - checksum: e87bccbf11f95035c89a132b52b79ce69a1e3652fe55962363063c9c0dae0fe2477ebc585e03a9652adc6f381d24ba5589cc5e51849df4ced3d3e004a7d40ed5 +"@types/minimist@npm:^1.2.0": + version: 1.2.5 + resolution: "@types/minimist@npm:1.2.5" + checksum: 477047b606005058ab0263c4f58097136268007f320003c348794f74adedc3166ffc47c80ec3e94687787f2ab7f4e72c468223946e79892cf0fd9e25e9970a90 languageName: node linkType: hard -"@types/pg@npm:^8.10.2": - version: 8.10.2 - resolution: "@types/pg@npm:8.10.2" +"@types/node@npm:*, @types/node@npm:^20.9.0": + version: 20.9.0 + resolution: "@types/node@npm:20.9.0" dependencies: - "@types/node": "*" - pg-protocol: "*" - pg-types: ^4.0.1 - checksum: 49da89f64cec1bd12a3fbc0c72b17d685c2fee579726a529f62fcab395dbc5696d80455073409947a577164b3c53a90181a331e4a5d9357679f724d4ce37f4b9 - languageName: node - linkType: hard - -"@types/prettier@npm:^2.1.5": - version: 2.7.2 - resolution: "@types/prettier@npm:2.7.2" - checksum: b47d76a5252265f8d25dd2fe2a5a61dc43ba0e6a96ffdd00c594cb4fd74c1982c2e346497e3472805d97915407a09423804cc2110a0b8e1b22cffcab246479b7 - languageName: node - linkType: hard - -"@types/psl@npm:^1.1.0": - version: 1.1.0 - resolution: "@types/psl@npm:1.1.0" - checksum: 648a4a40827fb101a05616b9c448b04d40c467db9f09e08099274759fd5e032e7d276013296679765c7d7359f43f0479094c1d8b6a56a8f9445b84b5a9af1263 + undici-types: ~5.26.4 + checksum: bfd927da6bff8a32051fa44bb47ca32a56d2c8bc8ba0170770f181cc1fa3c0b05863c9b930f0ba8604a48d5eb0d319166601709ca53bf2deae0025d8b6c6b8a3 languageName: node linkType: hard -"@types/semver@npm:^7.3.12": - version: 7.3.13 - resolution: "@types/semver@npm:7.3.13" - checksum: 00c0724d54757c2f4bc60b5032fe91cda6410e48689633d5f35ece8a0a66445e3e57fa1d6e07eb780f792e82ac542948ec4d0b76eb3484297b79bd18b8cf1cb0 +"@types/node@npm:^18.11.9": + version: 18.18.9 + resolution: "@types/node@npm:18.18.9" + dependencies: + undici-types: ~5.26.4 + checksum: 629ce20357586144031cb43d601617eef45e59460dea6b1e123f708e6885664f44d54f65e5b72b2614af5b8613f3652ced832649c0b991accbc6a85139befa51 languageName: node linkType: hard -"@types/stack-utils@npm:^2.0.0": - version: 2.0.1 - resolution: "@types/stack-utils@npm:2.0.1" - checksum: 205fdbe3326b7046d7eaf5e494d8084f2659086a266f3f9cf00bccc549c8e36e407f88168ad4383c8b07099957ad669f75f2532ed4bc70be2b037330f7bae019 +"@types/normalize-package-data@npm:^2.4.0": + version: 2.4.4 + resolution: "@types/normalize-package-data@npm:2.4.4" + checksum: 65dff72b543997b7be8b0265eca7ace0e34b75c3e5fee31de11179d08fa7124a7a5587265d53d0409532ecb7f7fba662c2012807963e1f9b059653ec2c83ee05 languageName: node linkType: hard -"@types/ws@npm:^8.5.3, @types/ws@npm:^8.5.4, @types/ws@npm:^8.5.5": - version: 8.5.5 - resolution: "@types/ws@npm:8.5.5" +"@types/pg@npm:^8.10.9": + version: 8.10.9 + resolution: "@types/pg@npm:8.10.9" dependencies: "@types/node": "*" - checksum: d00bf8070e6938e3ccf933010921c6ce78ac3606696ce37a393b27a9a603f7bd93ea64f3c5fa295a2f743575ba9c9a9fdb904af0f5fe2229bf2adf0630386e4a + pg-protocol: "*" + pg-types: ^4.0.1 + checksum: c0c750af1f0945fe31c2793931da33bf596476ec8b52babfdb20f61006570c1c6c7f62f2dedd0cb9aefd2cddab238f2ed279337d3b2aa734ddd1ee8958e2355e languageName: node linkType: hard -"@types/yargs-parser@npm:*": - version: 21.0.0 - resolution: "@types/yargs-parser@npm:21.0.0" - checksum: b2f4c8d12ac18a567440379909127cf2cec393daffb73f246d0a25df36ea983b93b7e9e824251f959e9f928cbc7c1aab6728d0a0ff15d6145f66cec2be67d9a2 +"@types/semver@npm:^7.5.0": + version: 7.5.5 + resolution: "@types/semver@npm:7.5.5" + checksum: 533e6c93d1262d65f449423d94a445f7f3db0672e7429f21b6a1636d6051dbab3a2989ddcda9b79c69bb37830931d09fc958a65305a891357f5cea3257c297f5 languageName: node linkType: hard -"@types/yargs@npm:^17.0.8": - version: 17.0.22 - resolution: "@types/yargs@npm:17.0.22" +"@types/ws@npm:^8.5.5, @types/ws@npm:^8.5.8, @types/ws@npm:^8.5.9": + version: 8.5.9 + resolution: "@types/ws@npm:8.5.9" dependencies: - "@types/yargs-parser": "*" - checksum: 0773523fda71bafdc52f13f5970039e535a353665a60ba9261149a5c9c2b908242e6e77fbb7a8c06931ec78ce889d64d09673c68ba23eb5f5742d5385d0d1982 + "@types/node": "*" + checksum: 83f436b731d2cdc49a45ced31a0a65cdd2e39c24d7b882776c26efa190dad6553e266d624c7a7089f36ad3ed471e02e729f3219282c80689b435f665df4a2b0b languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.58.0, @typescript-eslint/eslint-plugin@npm:^5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.61.0" +"@typescript-eslint/eslint-plugin@npm:^6.10.0, @typescript-eslint/eslint-plugin@npm:^6.5.0": + version: 6.10.0 + resolution: "@typescript-eslint/eslint-plugin@npm:6.10.0" dependencies: - "@eslint-community/regexpp": ^4.4.0 - "@typescript-eslint/scope-manager": 5.61.0 - "@typescript-eslint/type-utils": 5.61.0 - "@typescript-eslint/utils": 5.61.0 + "@eslint-community/regexpp": ^4.5.1 + "@typescript-eslint/scope-manager": 6.10.0 + "@typescript-eslint/type-utils": 6.10.0 + "@typescript-eslint/utils": 6.10.0 + "@typescript-eslint/visitor-keys": 6.10.0 debug: ^4.3.4 graphemer: ^1.4.0 - ignore: ^5.2.0 - natural-compare-lite: ^1.4.0 - semver: ^7.3.7 - tsutils: ^3.21.0 + ignore: ^5.2.4 + natural-compare: ^1.4.0 + semver: ^7.5.4 + ts-api-utils: ^1.0.1 peerDependencies: - "@typescript-eslint/parser": ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + "@typescript-eslint/parser": ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: d9e891fb43ccb75322fc40d58d02479f98bd3c962db71075438868b13f579643d714a24b5477a827be7ca2e7e9f6058c406241b6696a6395c6fcbd6de76e015c + checksum: eaf1f66ae1915426dad8d229c8cb80d2b320572a30c3fbc57d560d40edc2d17d004101a2fcbe331bc458df19a00f8b705f2442ee02e028bb595f4e9f9152e99d languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.58.0, @typescript-eslint/parser@npm:^5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/parser@npm:5.61.0" +"@typescript-eslint/parser@npm:^6.10.0, @typescript-eslint/parser@npm:^6.5.0": + version: 6.10.0 + resolution: "@typescript-eslint/parser@npm:6.10.0" dependencies: - "@typescript-eslint/scope-manager": 5.61.0 - "@typescript-eslint/types": 5.61.0 - "@typescript-eslint/typescript-estree": 5.61.0 + "@typescript-eslint/scope-manager": 6.10.0 + "@typescript-eslint/types": 6.10.0 + "@typescript-eslint/typescript-estree": 6.10.0 + "@typescript-eslint/visitor-keys": 6.10.0 debug: ^4.3.4 peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 2422bca03ecc6830700aaa739ec46b8e9ab6c0a47a67f140dc6b62a42a8b98997e73bce52c6a010b8a9b461211c46ba865d5b7f680a7823cf5c245d3b61f7fd5 + checksum: c4b140932d639b3f3eac892497aa700bcc9101ef268285020757dc9bee670d122de107e936320af99a5c06569e4eb93bccf87f14a9970ceab708c432e748423a languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/scope-manager@npm:5.61.0" +"@typescript-eslint/scope-manager@npm:6.10.0": + version: 6.10.0 + resolution: "@typescript-eslint/scope-manager@npm:6.10.0" dependencies: - "@typescript-eslint/types": 5.61.0 - "@typescript-eslint/visitor-keys": 5.61.0 - checksum: 6dfbb42c4b7d796ae3c395398bdfd2e5a4ae8aaf1448381278ecc39a1d1045af2cb452da5a00519d265bc1a5997523de22d5021acb4dbe1648502fe61512d3c6 + "@typescript-eslint/types": 6.10.0 + "@typescript-eslint/visitor-keys": 6.10.0 + checksum: c9b9483082ae853f10b888cf04d4a14f666ac55e749bfdb7b7f726fc51127a6340b5e2f50d93f134a8854ddcc41f7b116b214753251a8b033d0d84c600439c54 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/type-utils@npm:5.61.0" +"@typescript-eslint/type-utils@npm:6.10.0": + version: 6.10.0 + resolution: "@typescript-eslint/type-utils@npm:6.10.0" dependencies: - "@typescript-eslint/typescript-estree": 5.61.0 - "@typescript-eslint/utils": 5.61.0 + "@typescript-eslint/typescript-estree": 6.10.0 + "@typescript-eslint/utils": 6.10.0 debug: ^4.3.4 - tsutils: ^3.21.0 + ts-api-utils: ^1.0.1 peerDependencies: - eslint: "*" + eslint: ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: f0203fd48c6218f004dd73a9a71ba4cf97f015d0f13a7b3c821a3ba7ec814839bae270a1db589184ca7091fe54815a3171d1993e8a25200bf33e131bd6e855d4 + checksum: cfe9520cf0c0f50b115d2591acb2abf99ffe5789b3536268ca65b624c8498812d91f187e80c41bea7cf2cebad9c38f69ef27440f872a20fb53c59856d8f5df38 languageName: node linkType: hard -"@typescript-eslint/types@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/types@npm:5.61.0" - checksum: d311ca2141f6bcb5f0f8f97ddbc218c9911e0735aaa30f0f2e64d518fb33568410754e1b04bf157175f8783504f8ec62a7ab53a66a18507f43edb1e21fe69e90 +"@typescript-eslint/types@npm:6.10.0": + version: 6.10.0 + resolution: "@typescript-eslint/types@npm:6.10.0" + checksum: e63a9e05eb3d736d02a09131627d5cb89394bf0d9d6b46fb4b620be902d89d73554720be65acbc194787bff9ffcd518c9a6cf88fd63e418232b4181e8d8438df languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.61.0" +"@typescript-eslint/typescript-estree@npm:6.10.0": + version: 6.10.0 + resolution: "@typescript-eslint/typescript-estree@npm:6.10.0" dependencies: - "@typescript-eslint/types": 5.61.0 - "@typescript-eslint/visitor-keys": 5.61.0 + "@typescript-eslint/types": 6.10.0 + "@typescript-eslint/visitor-keys": 6.10.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 - semver: ^7.3.7 - tsutils: ^3.21.0 + semver: ^7.5.4 + ts-api-utils: ^1.0.1 peerDependenciesMeta: typescript: optional: true - checksum: efe25a1b2774939c02cb9b388cf72efa672811f1c39a87ddd617937f63c2320551ce459ba69c6d022e33322594d40b9f2d2c6bc9937387718adc40dc5e57ea8e + checksum: 15bd8d9239a557071d6b03e7aa854b769fcc2dbdff587ed94be7ee8060dabdb05bcae4251df22432f625f82087e7f6986e9aab04f7eea35af694d4edd76a21af languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/utils@npm:5.61.0" +"@typescript-eslint/utils@npm:6.10.0": + version: 6.10.0 + resolution: "@typescript-eslint/utils@npm:6.10.0" dependencies: - "@eslint-community/eslint-utils": ^4.2.0 - "@types/json-schema": ^7.0.9 - "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.61.0 - "@typescript-eslint/types": 5.61.0 - "@typescript-eslint/typescript-estree": 5.61.0 - eslint-scope: ^5.1.1 - semver: ^7.3.7 + "@eslint-community/eslint-utils": ^4.4.0 + "@types/json-schema": ^7.0.12 + "@types/semver": ^7.5.0 + "@typescript-eslint/scope-manager": 6.10.0 + "@typescript-eslint/types": 6.10.0 + "@typescript-eslint/typescript-estree": 6.10.0 + semver: ^7.5.4 peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 24efc1964e6c92db96fe0d9a390550e4f27e8f353e51a9b46bda03e6692ea5d40f398d539235a4ff0894e9e45dfcfb51df953ade2ae9d17a1421449625ce6f5a + eslint: ^7.0.0 || ^8.0.0 + checksum: b6bd4d68623fb8d616ae63a88f2954258411a0cc113029fba801d1e74b4c0319fdfbcac0070527afe5cc38c012c8718e4faecd1603000924d7b89e8fefc3f24d languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.61.0" +"@typescript-eslint/visitor-keys@npm:6.10.0": + version: 6.10.0 + resolution: "@typescript-eslint/visitor-keys@npm:6.10.0" dependencies: - "@typescript-eslint/types": 5.61.0 - eslint-visitor-keys: ^3.3.0 - checksum: a8d589f61ddfc380787218da4d347e8f9aef0f82f4a93f1daee46786bda889a90961c7ec1b470db5e3261438a728fdfd956f5bda6ee2de22c4be2d2152d6e270 + "@typescript-eslint/types": 6.10.0 + eslint-visitor-keys: ^3.4.1 + checksum: 9640bfae41e6109ffba31e68b1720382de0538d021261e2fc9e514c83c703084393c0818ca77ed26b950273e45e593371120281e8d4bbd09cb8c2d46c9fe4f03 + languageName: node + linkType: hard + +"@ungap/structured-clone@npm:^1.2.0": + version: 1.2.0 + resolution: "@ungap/structured-clone@npm:1.2.0" + checksum: 4f656b7b4672f2ce6e272f2427d8b0824ed11546a601d8d5412b9d7704e83db38a8d9f402ecdf2b9063fc164af842ad0ec4a55819f621ed7e7ea4d1efcc74524 + languageName: node + linkType: hard + +"@vitest/coverage-v8@npm:^0.34.6": + version: 0.34.6 + resolution: "@vitest/coverage-v8@npm:0.34.6" + dependencies: + "@ampproject/remapping": ^2.2.1 + "@bcoe/v8-coverage": ^0.2.3 + istanbul-lib-coverage: ^3.2.0 + istanbul-lib-report: ^3.0.1 + istanbul-lib-source-maps: ^4.0.1 + istanbul-reports: ^3.1.5 + magic-string: ^0.30.1 + picocolors: ^1.0.0 + std-env: ^3.3.3 + test-exclude: ^6.0.0 + v8-to-istanbul: ^9.1.0 + peerDependencies: + vitest: ">=0.32.0 <1" + checksum: d5fe7685151bdf500278a42cde3a12afdea77b2de0d7eb069fe89e7a6010efbb9bc7cb86a2b27f00f6689d526abdc99b3fa9d97ac2bb3a0f78cd86d6d954910e + languageName: node + linkType: hard + +"@vitest/expect@npm:0.34.6": + version: 0.34.6 + resolution: "@vitest/expect@npm:0.34.6" + dependencies: + "@vitest/spy": 0.34.6 + "@vitest/utils": 0.34.6 + chai: ^4.3.10 + checksum: 37a526f4af7e73fc56b71ba1139d6d93ff1972315d0e0691de967179298d2ad086e8803d2b28defe0e97a1326d808cd886e4b802d1691d8894cb234e35ed5185 + languageName: node + linkType: hard + +"@vitest/runner@npm:0.34.6": + version: 0.34.6 + resolution: "@vitest/runner@npm:0.34.6" + dependencies: + "@vitest/utils": 0.34.6 + p-limit: ^4.0.0 + pathe: ^1.1.1 + checksum: 0357f0a11f4e1e170099f9125e379bbe8049a59faa7b34b919b3e5ee8927f30824c2b3ebb814b6a77c75ec35a30bf9adb8ec2b5e051525b4edd0d17be15725cc + languageName: node + linkType: hard + +"@vitest/snapshot@npm:0.34.6": + version: 0.34.6 + resolution: "@vitest/snapshot@npm:0.34.6" + dependencies: + magic-string: ^0.30.1 + pathe: ^1.1.1 + pretty-format: ^29.5.0 + checksum: c2f164b23741cdf10f449575a0f9996cf385675d0f76d2eb696f53b614743811f2fbefdc5eb0fd3f9544ccfbb566d57a5c50a70595167458579d56429b09151f + languageName: node + linkType: hard + +"@vitest/spy@npm:0.34.6": + version: 0.34.6 + resolution: "@vitest/spy@npm:0.34.6" + dependencies: + tinyspy: ^2.1.1 + checksum: b05e5906f2f489a3234a0380a21cb48635915aa7f28eac92a595e78e9ceefb95340311635e39684b32fff20f9c58fdc33488eeddee39a660cd94c9c6bc2febf7 + languageName: node + linkType: hard + +"@vitest/utils@npm:0.34.6": + version: 0.34.6 + resolution: "@vitest/utils@npm:0.34.6" + dependencies: + diff-sequences: ^29.4.3 + loupe: ^2.3.6 + pretty-format: ^29.5.0 + checksum: acf716af2bab66037e49bd6d3e8bae40b605b9bff515d4926c46d6f8cc2366decfac5a1756ea55029968e71fba1da1f992764c3a57c9b46eccce3f6db7197bd6 + languageName: node + linkType: hard + +"@vladfrangu/async_event_emitter@npm:^2.2.2": + version: 2.2.2 + resolution: "@vladfrangu/async_event_emitter@npm:2.2.2" + checksum: ed948294fea1a2dc8b8f307f4061bf65e2043a946132f288702f0572a806ebe3123b8c7e522e70d2abbd3616f5d67027c9e59df9ef80b0195f7502a848a426ba languageName: node linkType: hard -"JSONStream@npm:^1.0.3, JSONStream@npm:^1.0.4": +"JSONStream@npm:^1.0.3, JSONStream@npm:^1.3.5": version: 1.3.5 resolution: "JSONStream@npm:1.3.5" dependencies: @@ -3103,10 +1795,10 @@ __metadata: languageName: node linkType: hard -"abbrev@npm:^1.0.0": - version: 1.1.1 - resolution: "abbrev@npm:1.1.1" - checksum: a4a97ec07d7ea112c517036882b2ac22f3109b7b19077dc656316d07d308438aac28e4d9746dc4d84bf6b1e75b4a7b0a5f3cb30592419f128ca9a8cee3bcfa17 +"abbrev@npm:^2.0.0": + version: 2.0.0 + resolution: "abbrev@npm:2.0.0" + checksum: 0e994ad2aa6575f94670d8a2149afe94465de9cedaaaac364e7fb43a40c3691c980ff74899f682f4ca58fa96b4cbd7421a015d3a6defe43a442117d7821a2f36 languageName: node linkType: hard @@ -3137,10 +1829,10 @@ __metadata: languageName: node linkType: hard -"acorn-walk@npm:^8.1.1": - version: 8.2.0 - resolution: "acorn-walk@npm:8.2.0" - checksum: 1715e76c01dd7b2d4ca472f9c58968516a4899378a63ad5b6c2d668bba8da21a71976c14ec5f5b75f887b6317c4ae0b897ab141c831d741dc76024d8745f1ad1 +"acorn-walk@npm:^8.1.1, acorn-walk@npm:^8.2.0": + version: 8.3.0 + resolution: "acorn-walk@npm:8.3.0" + checksum: 15ea56ab6529135be05e7d018f935ca80a572355dd3f6d3cd717e36df3346e0f635a93ae781b1c7942607693e2e5f3ef81af5c6fc697bbadcc377ebda7b7f5f6 languageName: node linkType: hard @@ -3153,16 +1845,16 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.4.1, acorn@npm:^8.9.0": - version: 8.9.0 - resolution: "acorn@npm:8.9.0" +"acorn@npm:^8.10.0, acorn@npm:^8.4.1, acorn@npm:^8.9.0": + version: 8.11.2 + resolution: "acorn@npm:8.11.2" bin: acorn: bin/acorn - checksum: 25dfb94952386ecfb847e61934de04a4e7c2dc21c2e700fc4e2ef27ce78cb717700c4c4f279cd630bb4774948633c3859fc16063ec8573bda4568e0a312e6744 + checksum: 818450408684da89423e3daae24e4dc9b68692db8ab49ea4569c7c5abb7a3f23669438bf129cc81dfdada95e1c9b944ee1bfca2c57a05a4dc73834a612fbf6a7 languageName: node linkType: hard -"agent-base@npm:6, agent-base@npm:^6.0.2": +"agent-base@npm:6": version: 6.0.2 resolution: "agent-base@npm:6.0.2" dependencies: @@ -3171,14 +1863,12 @@ __metadata: languageName: node linkType: hard -"agentkeepalive@npm:^4.2.1": - version: 4.2.1 - resolution: "agentkeepalive@npm:4.2.1" +"agent-base@npm:^7.0.2, agent-base@npm:^7.1.0": + version: 7.1.0 + resolution: "agent-base@npm:7.1.0" dependencies: - debug: ^4.1.0 - depd: ^1.1.2 - humanize-ms: ^1.2.1 - checksum: 39cb49ed8cf217fd6da058a92828a0a84e0b74c35550f82ee0a10e1ee403c4b78ade7948be2279b188b7a7303f5d396ea2738b134731e464bf28de00a4f72a18 + debug: ^4.3.4 + checksum: f7828f991470a0cc22cb579c86a18cbae83d8a3cbed39992ab34fc7217c4d126017f1c74d0ab66be87f71455318a8ea3e757d6a37881b8d0f2a2c6aa55e5418f languageName: node linkType: hard @@ -3192,7 +1882,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.10.0, ajv@npm:^6.12.4": +"ajv@npm:^6.12.4": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -3216,7 +1906,7 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.0": +"ansi-escapes@npm:^4.2.1": version: 4.3.2 resolution: "ansi-escapes@npm:4.3.2" dependencies: @@ -3225,6 +1915,15 @@ __metadata: languageName: node linkType: hard +"ansi-escapes@npm:^5.0.0": + version: 5.0.0 + resolution: "ansi-escapes@npm:5.0.0" + dependencies: + type-fest: ^1.0.2 + checksum: d4b5eb8207df38367945f5dd2ef41e08c28edc192dc766ef18af6b53736682f49d8bfcfa4e4d6ecbc2e2f97c258fda084fb29a9e43b69170b71090f771afccac + languageName: node + linkType: hard + "ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" @@ -3264,7 +1963,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^6.0.0": +"ansi-styles@npm:^6.0.0, ansi-styles@npm:^6.1.0": version: 6.2.1 resolution: "ansi-styles@npm:6.2.1" checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 @@ -3278,7 +1977,7 @@ __metadata: languageName: node linkType: hard -"anymatch@npm:^3.0.3, anymatch@npm:~3.1.2": +"anymatch@npm:~3.1.2": version: 3.1.3 resolution: "anymatch@npm:3.1.3" dependencies: @@ -3288,30 +1987,13 @@ __metadata: languageName: node linkType: hard -"app-root-path@npm:^3.0.0": +"app-root-path@npm:^3.1.0": version: 3.1.0 resolution: "app-root-path@npm:3.1.0" checksum: e3db3957aee197143a0f6c75e39fe89b19e7244f28b4f2944f7276a9c526d2a7ab2d115b4b2d70a51a65a9a3ca17506690e5b36f75a068a7e5a13f8c092389ba languageName: node linkType: hard -"aproba@npm:^1.0.3 || ^2.0.0": - version: 2.0.0 - resolution: "aproba@npm:2.0.0" - checksum: 5615cadcfb45289eea63f8afd064ab656006361020e1735112e346593856f87435e02d8dcc7ff0d11928bc7d425f27bc7c2a84f6c0b35ab0ff659c814c138a24 - languageName: node - linkType: hard - -"are-we-there-yet@npm:^3.0.0": - version: 3.0.1 - resolution: "are-we-there-yet@npm:3.0.1" - dependencies: - delegates: ^1.0.0 - readable-stream: ^3.6.0 - checksum: 52590c24860fa7173bedeb69a4c05fb573473e860197f618b9a28432ee4379049336727ae3a1f9c4cb083114601c1140cee578376164d0e651217a9843f9fe83 - languageName: node - linkType: hard - "arg@npm:^4.1.0": version: 4.1.3 resolution: "arg@npm:4.1.3" @@ -3319,15 +2001,6 @@ __metadata: languageName: node linkType: hard -"argparse@npm:^1.0.7": - version: 1.0.10 - resolution: "argparse@npm:1.0.10" - dependencies: - sprintf-js: ~1.0.2 - checksum: 7ca6e45583a28de7258e39e13d81e925cfa25d7d4aacbf806a382d3c02fcb13403a07fb8aeef949f10a7cfe4a62da0e2e807b348a5980554cc28ee573ef95945 - languageName: node - linkType: hard - "argparse@npm:^2.0.1": version: 2.0.1 resolution: "argparse@npm:2.0.1" @@ -3369,19 +2042,19 @@ __metadata: linkType: hard "assert@npm:^1.4.0": - version: 1.5.0 - resolution: "assert@npm:1.5.0" + version: 1.5.1 + resolution: "assert@npm:1.5.1" dependencies: - object-assign: ^4.1.1 - util: 0.10.3 - checksum: 9be48435f726029ae7020c5888a3566bf4d617687aab280827f2e4029644b6515a9519ea10d018b342147c02faf73d9e9419e780e8937b3786ee4945a0ca71e5 + object.assign: ^4.1.4 + util: ^0.10.4 + checksum: bfc539da97545f9b2989395d6b85be40b70649ce57464f3cc6e61f4975fb097ba0689c386f95bdb4c3ab867931e40a565c9e193ae3c02263a8e92acb17c9dc93 languageName: node linkType: hard -"astral-regex@npm:^2.0.0": - version: 2.0.0 - resolution: "astral-regex@npm:2.0.0" - checksum: 876231688c66400473ba505731df37ea436e574dd524520294cc3bbc54ea40334865e01fa0d074d74d036ee874ee7e62f486ea38bc421ee8e6a871c06f011766 +"assertion-error@npm:^1.1.0": + version: 1.1.0 + resolution: "assertion-error@npm:1.1.0" + checksum: fd9429d3a3d4fd61782eb3962ae76b6d08aa7383123fca0596020013b3ebd6647891a85b05ce821c47d1471ed1271f00b0545cf6a4326cf2fc91efcc3b0fbecf languageName: node linkType: hard @@ -3392,13 +2065,6 @@ __metadata: languageName: node linkType: hard -"asynckit@npm:^0.4.0": - version: 0.4.0 - resolution: "asynckit@npm:0.4.0" - checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be - languageName: node - linkType: hard - "at-least-node@npm:^1.0.0": version: 1.0.0 resolution: "at-least-node@npm:1.0.0" @@ -3413,131 +2079,6 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^29.6.1": - version: 29.6.1 - resolution: "babel-jest@npm:29.6.1" - dependencies: - "@jest/transform": ^29.6.1 - "@types/babel__core": ^7.1.14 - babel-plugin-istanbul: ^6.1.1 - babel-preset-jest: ^29.5.0 - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - slash: ^3.0.0 - peerDependencies: - "@babel/core": ^7.8.0 - checksum: bc46cfba468edde91f34a8292501d4448a39fab72d80d7d95f4349feb114fa21becb01def007d6166de7933ab9633bf5b5e1b72ba6ffeaa991f7abf014a2f61d - languageName: node - linkType: hard - -"babel-plugin-const-enum@npm:^1.2.0": - version: 1.2.0 - resolution: "babel-plugin-const-enum@npm:1.2.0" - dependencies: - "@babel/helper-plugin-utils": ^7.0.0 - "@babel/plugin-syntax-typescript": ^7.3.3 - "@babel/traverse": ^7.16.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: fc840a71f6717a01b63853b8bc67f75c591ebacfd0d8739c68de02da5d6e48ea38086040427d553726c0e103d2e0ee8b4207827ef26b281247f671f868f78aae - languageName: node - linkType: hard - -"babel-plugin-istanbul@npm:^6.1.1": - version: 6.1.1 - resolution: "babel-plugin-istanbul@npm:6.1.1" - dependencies: - "@babel/helper-plugin-utils": ^7.0.0 - "@istanbuljs/load-nyc-config": ^1.0.0 - "@istanbuljs/schema": ^0.1.2 - istanbul-lib-instrument: ^5.0.4 - test-exclude: ^6.0.0 - checksum: cb4fd95738219f232f0aece1116628cccff16db891713c4ccb501cddbbf9272951a5df81f2f2658dfdf4b3e7b236a9d5cbcf04d5d8c07dd5077297339598061a - languageName: node - linkType: hard - -"babel-plugin-jest-hoist@npm:^29.5.0": - version: 29.5.0 - resolution: "babel-plugin-jest-hoist@npm:29.5.0" - dependencies: - "@babel/template": ^7.3.3 - "@babel/types": ^7.3.3 - "@types/babel__core": ^7.1.14 - "@types/babel__traverse": ^7.0.6 - checksum: 099b5254073b6bc985b6d2d045ad26fb8ed30ff8ae6404c4fe8ee7cd0e98a820f69e3dfb871c7c65aae0f4b65af77046244c07bb92d49ef9005c90eedf681539 - languageName: node - linkType: hard - -"babel-plugin-polyfill-corejs2@npm:^0.4.4": - version: 0.4.4 - resolution: "babel-plugin-polyfill-corejs2@npm:0.4.4" - dependencies: - "@babel/compat-data": ^7.22.6 - "@babel/helper-define-polyfill-provider": ^0.4.1 - "@nicolo-ribaudo/semver-v6": ^6.3.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 0273f3d74ccbf78086a3b14bb11b1fb94933830f51c576a24229d75b3b91c8b357c3a381d4ab3146abf9b052fa4c33ec9368dd010ada9ee355e1d03ff64e1ff0 - languageName: node - linkType: hard - -"babel-plugin-polyfill-corejs3@npm:^0.8.2": - version: 0.8.2 - resolution: "babel-plugin-polyfill-corejs3@npm:0.8.2" - dependencies: - "@babel/helper-define-polyfill-provider": ^0.4.1 - core-js-compat: ^3.31.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 0bc3e9e0114eba18f4fea8a9ff5a6016cae73b74cb091290c3f75fd7b9e34e712ee26f95b52d796f283970d7c6256fb01196e3608e8db03f620e3389d56d37c6 - languageName: node - linkType: hard - -"babel-plugin-polyfill-regenerator@npm:^0.5.1": - version: 0.5.1 - resolution: "babel-plugin-polyfill-regenerator@npm:0.5.1" - dependencies: - "@babel/helper-define-polyfill-provider": ^0.4.1 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 85a56d28b34586fbe482225fb6a9592fc793a459c5eea987a3427fb723c7aa2f76916348a9fc5e9ca48754ebf6086cfbb9226f4cd0cf9c6257f94553622562ed - languageName: node - linkType: hard - -"babel-preset-current-node-syntax@npm:^1.0.0": - version: 1.0.1 - resolution: "babel-preset-current-node-syntax@npm:1.0.1" - dependencies: - "@babel/plugin-syntax-async-generators": ^7.8.4 - "@babel/plugin-syntax-bigint": ^7.8.3 - "@babel/plugin-syntax-class-properties": ^7.8.3 - "@babel/plugin-syntax-import-meta": ^7.8.3 - "@babel/plugin-syntax-json-strings": ^7.8.3 - "@babel/plugin-syntax-logical-assignment-operators": ^7.8.3 - "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 - "@babel/plugin-syntax-numeric-separator": ^7.8.3 - "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 - "@babel/plugin-syntax-optional-chaining": ^7.8.3 - "@babel/plugin-syntax-top-level-await": ^7.8.3 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: d118c2742498c5492c095bc8541f4076b253e705b5f1ad9a2e7d302d81a84866f0070346662355c8e25fc02caa28dc2da8d69bcd67794a0d60c4d6fab6913cc8 - languageName: node - linkType: hard - -"babel-preset-jest@npm:^29.5.0": - version: 29.5.0 - resolution: "babel-preset-jest@npm:29.5.0" - dependencies: - babel-plugin-jest-hoist: ^29.5.0 - babel-preset-current-node-syntax: ^1.0.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 5566ca2762766c9319b4973d018d2fa08c0fcf6415c72cc54f4c8e7199e851ea8f5e6c6730f03ed7ed44fc8beefa959dd15911f2647dee47c615ff4faeddb1ad - languageName: node - linkType: hard - "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -3552,6 +2093,13 @@ __metadata: languageName: node linkType: hard +"big-integer@npm:^1.6.44": + version: 1.6.51 + resolution: "big-integer@npm:1.6.51" + checksum: 3d444173d1b2e20747e2c175568bedeebd8315b0637ea95d75fd27830d3b8e8ba36c6af40374f36bdaea7b5de376dcada1b07587cb2a79a928fccdb6e6e3c518 + languageName: node + linkType: hard + "binary-extensions@npm:^2.0.0": version: 2.2.0 resolution: "binary-extensions@npm:2.2.0" @@ -3593,6 +2141,15 @@ __metadata: languageName: node linkType: hard +"bplist-parser@npm:^0.2.0": + version: 0.2.0 + resolution: "bplist-parser@npm:0.2.0" + dependencies: + big-integer: ^1.6.44 + checksum: d5339dd16afc51de6c88f88f58a45b72ed6a06aa31f5557d09877575f220b7c1d3fbe375da0b62e6a10d4b8ed80523567e351f24014f5bc886ad523758142cdd + languageName: node + linkType: hard + "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -3791,29 +2348,6 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.21.9": - version: 4.21.9 - resolution: "browserslist@npm:4.21.9" - dependencies: - caniuse-lite: ^1.0.30001503 - electron-to-chromium: ^1.4.431 - node-releases: ^2.0.12 - update-browserslist-db: ^1.0.11 - bin: - browserslist: cli.js - checksum: 80d3820584e211484ad1b1a5cfdeca1dd00442f47be87e117e1dda34b628c87e18b81ae7986fa5977b3e6a03154f6d13cd763baa6b8bf5dd9dd19f4926603698 - languageName: node - linkType: hard - -"bser@npm:2.1.1": - version: 2.1.1 - resolution: "bser@npm:2.1.1" - dependencies: - node-int64: ^0.4.0 - checksum: 9ba4dc58ce86300c862bffc3ae91f00b2a03b01ee07f3564beeeaf82aa243b8b03ba53f123b0b842c190d4399b94697970c8e7cf7b1ea44b61aa28c3526a4449 - languageName: node - linkType: hard - "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -3845,6 +2379,16 @@ __metadata: languageName: node linkType: hard +"buffer@npm:^6.0.3": + version: 6.0.3 + resolution: "buffer@npm:6.0.3" + dependencies: + base64-js: ^1.3.1 + ieee754: ^1.2.1 + checksum: 5ad23293d9a731e4318e420025800b42bf0d264004c0286c8cc010af7a270c7a0f6522e84f54b9ad65cbd6db20b8badbfd8d2ebf4f80fa03dab093b89e68c3f9 + languageName: node + linkType: hard + "buffer@npm:~5.2.1": version: 5.2.1 resolution: "buffer@npm:5.2.1" @@ -3855,13 +2399,13 @@ __metadata: languageName: node linkType: hard -"bufferutil@npm:^4.0.7": - version: 4.0.7 - resolution: "bufferutil@npm:4.0.7" +"bufferutil@npm:^4.0.8": + version: 4.0.8 + resolution: "bufferutil@npm:4.0.8" dependencies: node-gyp: latest node-gyp-build: ^4.3.0 - checksum: f75aa87e3d1b99b87a95f60a855e63f70af07b57fb8443e75a2ddfef2e47788d130fdd46e3a78fd7e0c10176082b26dfbed970c5b8632e1cc299cafa0e93ce45 + checksum: 7e9a46f1867dca72fda350966eb468eca77f4d623407b0650913fadf73d5750d883147d6e5e21c56f9d3b0bdc35d5474e80a600b9f31ec781315b4d2469ef087 languageName: node linkType: hard @@ -3872,29 +2416,48 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^16.1.0": - version: 16.1.3 - resolution: "cacache@npm:16.1.3" +"bundle-name@npm:^3.0.0": + version: 3.0.0 + resolution: "bundle-name@npm:3.0.0" dependencies: - "@npmcli/fs": ^2.1.0 - "@npmcli/move-file": ^2.0.0 - chownr: ^2.0.0 - fs-minipass: ^2.1.0 - glob: ^8.0.1 - infer-owner: ^1.0.4 - lru-cache: ^7.7.1 - minipass: ^3.1.6 + run-applescript: ^5.0.0 + checksum: edf2b1fbe6096ed32e7566947ace2ea937ee427391744d7510a2880c4b9a5b3543d3f6c551236a29e5c87d3195f8e2912516290e638c15bcbede7b37cc375615 + languageName: node + linkType: hard + +"busboy@npm:^1.6.0": + version: 1.6.0 + resolution: "busboy@npm:1.6.0" + dependencies: + streamsearch: ^1.1.0 + checksum: 32801e2c0164e12106bf236291a00795c3c4e4b709ae02132883fe8478ba2ae23743b11c5735a0aae8afe65ac4b6ca4568b91f0d9fed1fdbc32ede824a73746e + languageName: node + linkType: hard + +"cac@npm:^6.7.14": + version: 6.7.14 + resolution: "cac@npm:6.7.14" + checksum: 45a2496a9443abbe7f52a49b22fbe51b1905eff46e03fd5e6c98e3f85077be3f8949685a1849b1a9cd2bc3e5567dfebcf64f01ce01847baf918f1b37c839791a + languageName: node + linkType: hard + +"cacache@npm:^18.0.0": + version: 18.0.0 + resolution: "cacache@npm:18.0.0" + dependencies: + "@npmcli/fs": ^3.1.0 + fs-minipass: ^3.0.0 + glob: ^10.2.2 + lru-cache: ^10.0.1 + minipass: ^7.0.3 minipass-collect: ^1.0.2 minipass-flush: ^1.0.5 minipass-pipeline: ^1.2.4 - mkdirp: ^1.0.4 p-map: ^4.0.0 - promise-inflight: ^1.0.1 - rimraf: ^3.0.2 - ssri: ^9.0.0 + ssri: ^10.0.0 tar: ^6.1.11 - unique-filename: ^2.0.0 - checksum: d91409e6e57d7d9a3a25e5dcc589c84e75b178ae8ea7de05cbf6b783f77a5fae938f6e8fda6f5257ed70000be27a681e1e44829251bfffe4c10216002f8f14e6 + unique-filename: ^3.0.0 + checksum: 2cd6bf15551abd4165acb3a4d1ef0593b3aa2fd6853ae16b5bb62199c2faecf27d36555a9545c0e07dd03347ec052e782923bdcece724a24611986aafb53e152 languageName: node linkType: hard @@ -3912,13 +2475,14 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.2": - version: 1.0.2 - resolution: "call-bind@npm:1.0.2" +"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2, call-bind@npm:^1.0.4": + version: 1.0.5 + resolution: "call-bind@npm:1.0.5" dependencies: - function-bind: ^1.1.1 - get-intrinsic: ^1.0.2 - checksum: f8e31de9d19988a4b80f3e704788c4a2d6b6f3d17cfec4f57dc29ced450c53a49270dc66bf0fbd693329ee948dd33e6c90a329519aef17474a4d961e8d6426b0 + function-bind: ^1.1.2 + get-intrinsic: ^1.2.1 + set-function-length: ^1.1.1 + checksum: 449e83ecbd4ba48e7eaac5af26fea3b50f8f6072202c2dd7c5a6e7a6308f2421abe5e13a3bbd55221087f76320c5e09f25a8fdad1bab2b77c68ae74d92234ea5 languageName: node linkType: hard @@ -3957,28 +2521,29 @@ __metadata: languageName: node linkType: hard -"camelcase@npm:^6.2.0": - version: 6.3.0 - resolution: "camelcase@npm:6.3.0" - checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001503": - version: 1.0.30001513 - resolution: "caniuse-lite@npm:1.0.30001513" - checksum: 7d783f4f40584e7bdeda3f3abc23ffff21f14c37e1fadf1a6b3d2e299727fe9d5a61096101d9d4e4174f881d4ff4c62204fc41f3bc950f4da1b0edfdea025fa4 +"chai@npm:^4.3.10": + version: 4.3.10 + resolution: "chai@npm:4.3.10" + dependencies: + assertion-error: ^1.1.0 + check-error: ^1.0.3 + deep-eql: ^4.1.3 + get-func-name: ^2.0.2 + loupe: ^2.3.6 + pathval: ^1.1.1 + type-detect: ^4.0.8 + checksum: 536668c60a0d985a0fbd94418028e388d243a925d7c5e858c7443e334753511614a3b6a124bac9ca077dfc4c37acc367d62f8c294960f440749536dc181dfc6d languageName: node linkType: hard -"chalk@npm:5.2.0": - version: 5.2.0 - resolution: "chalk@npm:5.2.0" - checksum: 03d8060277de6cf2fd567dc25fcf770593eb5bb85f460ce443e49255a30ff1242edd0c90a06a03803b0466ff0687a939b41db1757bec987113e83de89a003caa +"chalk@npm:5.3.0": + version: 5.3.0 + resolution: "chalk@npm:5.3.0" + checksum: 623922e077b7d1e9dedaea6f8b9e9352921f8ae3afe739132e0e00c275971bdd331268183b2628cf4ab1727c45ea1f28d7e24ac23ce1db1eb653c414ca8a5a80 languageName: node linkType: hard -"chalk@npm:^1.1.1, chalk@npm:^1.1.3": +"chalk@npm:^1.1.3": version: 1.1.3 resolution: "chalk@npm:1.1.3" dependencies: @@ -3991,7 +2556,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^2.0.0, chalk@npm:^2.4.1, chalk@npm:^2.4.2": +"chalk@npm:^2.4.1, chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -4002,7 +2567,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1": +"chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -4012,13 +2577,6 @@ __metadata: languageName: node linkType: hard -"char-regex@npm:^1.0.2": - version: 1.0.2 - resolution: "char-regex@npm:1.0.2" - checksum: b563e4b6039b15213114626621e7a3d12f31008bdce20f9c741d69987f62aeaace7ec30f6018890ad77b2e9b4d95324c9f5acfca58a9441e3b1dcdd1e2525d17 - languageName: node - linkType: hard - "chardet@npm:^0.7.0": version: 0.7.0 resolution: "chardet@npm:0.7.0" @@ -4026,6 +2584,15 @@ __metadata: languageName: node linkType: hard +"check-error@npm:^1.0.3": + version: 1.0.3 + resolution: "check-error@npm:1.0.3" + dependencies: + get-func-name: ^2.0.2 + checksum: e2131025cf059b21080f4813e55b3c480419256914601750b0fee3bd9b2b8315b531e551ef12560419b8b6d92a3636511322752b1ce905703239e7cc451b6399 + languageName: node + linkType: hard + "chokidar@npm:^3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -4052,13 +2619,6 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^3.2.0": - version: 3.8.0 - resolution: "ci-info@npm:3.8.0" - checksum: d0a4d3160497cae54294974a7246202244fff031b0a6ea20dd57b10ec510aa17399c41a1b0982142c105f3255aff2173e5c0dd7302ee1b2f28ba3debda375098 - languageName: node - linkType: hard - "cipher-base@npm:^1.0.0, cipher-base@npm:^1.0.1, cipher-base@npm:^1.0.3": version: 1.0.4 resolution: "cipher-base@npm:1.0.4" @@ -4069,13 +2629,6 @@ __metadata: languageName: node linkType: hard -"cjs-module-lexer@npm:^1.0.0": - version: 1.2.2 - resolution: "cjs-module-lexer@npm:1.2.2" - checksum: 977f3f042bd4f08e368c890d91eecfbc4f91da0bc009a3c557bc4dfbf32022ad1141244ac1178d44de70fc9f3dea7add7cd9a658a34b9fae98a55d8f92331ce5 - languageName: node - linkType: hard - "clean-stack@npm:^2.0.0": version: 2.2.0 resolution: "clean-stack@npm:2.2.0" @@ -4092,7 +2645,16 @@ __metadata: languageName: node linkType: hard -"cli-highlight@npm:^2.1.4": +"cli-cursor@npm:^4.0.0": + version: 4.0.0 + resolution: "cli-cursor@npm:4.0.0" + dependencies: + restore-cursor: ^4.0.0 + checksum: ab3f3ea2076e2176a1da29f9d64f72ec3efad51c0960898b56c8a17671365c26e67b735920530eaf7328d61f8bd41c27f46b9cf6e4e10fe2fa44b5e8c0e392cc + languageName: node + linkType: hard + +"cli-highlight@npm:^2.1.11": version: 2.1.11 resolution: "cli-highlight@npm:2.1.11" dependencies: @@ -4109,19 +2671,9 @@ __metadata: linkType: hard "cli-spinners@npm:^2.5.0": - version: 2.7.0 - resolution: "cli-spinners@npm:2.7.0" - checksum: a9afaf73f58d1f951fb23742f503631b3cf513f43f4c7acb1b640100eb76bfa16efbcd1994d149ffc6603a6d75dd3d4a516a76f125f90dce437de9b16fd0ee6f - languageName: node - linkType: hard - -"cli-truncate@npm:^2.1.0": - version: 2.1.0 - resolution: "cli-truncate@npm:2.1.0" - dependencies: - slice-ansi: ^3.0.0 - string-width: ^4.2.0 - checksum: bf1e4e6195392dc718bf9cd71f317b6300dc4a9191d052f31046b8773230ece4fa09458813bf0e3455a5e68c0690d2ea2c197d14a8b85a7b5e01c97f4b5feb5d + version: 2.9.1 + resolution: "cli-spinners@npm:2.9.1" + checksum: 1780618be58309c469205bc315db697934bac68bce78cd5dfd46248e507a533172d623c7348ecfd904734f597ce0a4e5538684843d2cfb7af485d4466699940c languageName: node linkType: hard @@ -4171,13 +2723,6 @@ __metadata: languageName: node linkType: hard -"co@npm:^4.6.0": - version: 4.6.0 - resolution: "co@npm:4.6.0" - checksum: 5210d9223010eb95b29df06a91116f2cf7c8e0748a9013ed853b53f362ea0e822f1e5bb054fb3cefc645239a4cf966af1f6133a3b43f40d591f3b68ed6cf0510 - languageName: node - linkType: hard - "code-point-at@npm:^1.0.0": version: 1.1.0 resolution: "code-point-at@npm:1.1.0" @@ -4185,13 +2730,6 @@ __metadata: languageName: node linkType: hard -"collect-v8-coverage@npm:^1.0.0": - version: 1.0.1 - resolution: "collect-v8-coverage@npm:1.0.1" - checksum: 4efe0a1fccd517b65478a2364b33dadd0a43fc92a56f59aaece9b6186fe5177b2de471253587de7c91516f07c7268c2f6770b6cbcffc0e0ece353b766ec87e55 - languageName: node - linkType: hard - "color-convert@npm:^1.9.0": version: 1.9.3 resolution: "color-convert@npm:1.9.3" @@ -4224,16 +2762,7 @@ __metadata: languageName: node linkType: hard -"color-support@npm:^1.1.3": - version: 1.1.3 - resolution: "color-support@npm:1.1.3" - bin: - color-support: bin.js - checksum: 9b7356817670b9a13a26ca5af1c21615463b500783b739b7634a0c2047c16cef4b2865d7576875c31c3cddf9dd621fa19285e628f20198b233a5cfdda6d0793b - languageName: node - linkType: hard - -"colorette@npm:^2.0.19, colorette@npm:^2.0.20": +"colorette@npm:^2.0.20": version: 2.0.20 resolution: "colorette@npm:2.0.20" checksum: 0c016fea2b91b733eb9f4bcdb580018f52c0bc0979443dad930e5037a968237ac53d9beb98e218d2e9235834f8eebce7f8e080422d6194e957454255bde71d3d @@ -4252,19 +2781,10 @@ __metadata: languageName: node linkType: hard -"combined-stream@npm:^1.0.8": - version: 1.0.8 - resolution: "combined-stream@npm:1.0.8" - dependencies: - delayed-stream: ~1.0.0 - checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c - languageName: node - linkType: hard - -"commander@npm:^10.0.0": - version: 10.0.0 - resolution: "commander@npm:10.0.0" - checksum: 9f6495651f878213005ac744dd87a85fa3d9f2b8b90d1c19d0866d666bda7f735adfd7c2f10dfff345782e2f80ea258f98bb4efcef58e4e502f25f883940acfd +"commander@npm:11.1.0": + version: 11.1.0 + resolution: "commander@npm:11.1.0" + checksum: fd1a8557c6b5b622c89ecdfde703242ab7db3b628ea5d1755784c79b8e7cb0d74d65b4a262289b533359cd58e1bfc0bf50245dfbcd2954682a6f367c828b79ef languageName: node linkType: hard @@ -4349,13 +2869,6 @@ __metadata: languageName: node linkType: hard -"console-control-strings@npm:^1.1.0": - version: 1.1.0 - resolution: "console-control-strings@npm:1.1.0" - checksum: 8755d76787f94e6cf79ce4666f0c5519906d7f5b02d4b884cf41e11dcd759ed69c57da0670afd9236d229a46e0f9cf519db0cd829c6dca820bb5a5c3def584ed - languageName: node - linkType: hard - "constants-browserify@npm:~1.0.0": version: 1.0.0 resolution: "constants-browserify@npm:1.0.0" @@ -4363,24 +2876,21 @@ __metadata: languageName: node linkType: hard -"conventional-changelog-angular@npm:^5.0.11": - version: 5.0.13 - resolution: "conventional-changelog-angular@npm:5.0.13" +"conventional-changelog-angular@npm:^6.0.0": + version: 6.0.0 + resolution: "conventional-changelog-angular@npm:6.0.0" dependencies: compare-func: ^2.0.0 - q: ^1.5.1 - checksum: 6ed4972fce25a50f9f038c749cc9db501363131b0fb2efc1fccecba14e4b1c80651d0d758d4c350a609f32010c66fa343eefd49c02e79e911884be28f53f3f90 + checksum: ddc59ead53a45b817d83208200967f5340866782b8362d5e2e34105fdfa3d3a31585ebbdec7750bdb9de53da869f847e8ca96634a9801f51e27ecf4e7ffe2bad languageName: node linkType: hard -"conventional-changelog-conventionalcommits@npm:^5.0.0": - version: 5.0.0 - resolution: "conventional-changelog-conventionalcommits@npm:5.0.0" +"conventional-changelog-conventionalcommits@npm:^7.0.2": + version: 7.0.2 + resolution: "conventional-changelog-conventionalcommits@npm:7.0.2" dependencies: compare-func: ^2.0.0 - lodash: ^4.17.15 - q: ^1.5.1 - checksum: b67d12e4e0fdde5baa32c3d77af472de38646a18657b26f5543eecce041a318103092fbfcef247e2319a16957c9ac78c6ea78acc11a5db6acf74be79a28c561f + checksum: e17ac5970ae09d6e9b0c3a7edaed075b836c0c09c34c514589cbe06554f46ed525067fa8150a8467cc03b1cf9af2073e7ecf48790d4f5ea399921b1cbe313711 languageName: node linkType: hard @@ -4391,23 +2901,21 @@ __metadata: languageName: node linkType: hard -"conventional-commits-parser@npm:^3.2.2": - version: 3.2.4 - resolution: "conventional-commits-parser@npm:3.2.4" +"conventional-commits-parser@npm:^5.0.0": + version: 5.0.0 + resolution: "conventional-commits-parser@npm:5.0.0" dependencies: - JSONStream: ^1.0.4 - is-text-path: ^1.0.1 - lodash: ^4.17.15 - meow: ^8.0.0 - split2: ^3.0.0 - through2: ^4.0.0 + JSONStream: ^1.3.5 + is-text-path: ^2.0.0 + meow: ^12.0.1 + split2: ^4.0.0 bin: - conventional-commits-parser: cli.js - checksum: 1627ff203bc9586d89e47a7fe63acecf339aba74903b9114e23d28094f79d4e2d6389bf146ae561461dcba8fc42e7bc228165d2b173f15756c43f1d32bc50bfd + conventional-commits-parser: cli.mjs + checksum: bb92a0bfe41802330d2d14ddb0f912fd65dd355f1aa294e708f4891aac95c580919a70580b9f26563c24c3335baaed2ce003104394a8fa5ba61eeb3889e45df0 languageName: node linkType: hard -"convert-source-map@npm:^1.5.1, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": +"convert-source-map@npm:^1.5.1": version: 1.9.0 resolution: "convert-source-map@npm:1.9.0" checksum: dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 @@ -4428,22 +2936,6 @@ __metadata: languageName: node linkType: hard -"cookie@npm:^0.4.1": - version: 0.4.2 - resolution: "cookie@npm:0.4.2" - checksum: a00833c998bedf8e787b4c342defe5fa419abd96b32f4464f718b91022586b8f1bafbddd499288e75c037642493c83083da426c6a9080d309e3bd90fd11baa9b - languageName: node - linkType: hard - -"core-js-compat@npm:^3.31.0": - version: 3.31.1 - resolution: "core-js-compat@npm:3.31.1" - dependencies: - browserslist: ^4.21.9 - checksum: 9a16d6992621f4e099169297381a28d5712cdef7df1fa85352a7c285a5885d5d7a117ec2eae9ad715ed88c7cc774787a22cdb8aceababf6775fbc8b0cbeccdb7 - languageName: node - linkType: hard - "core-util-is@npm:~1.0.0": version: 1.0.3 resolution: "core-util-is@npm:1.0.3" @@ -4451,27 +2943,33 @@ __metadata: languageName: node linkType: hard -"cosmiconfig-typescript-loader@npm:^4.0.0": - version: 4.3.0 - resolution: "cosmiconfig-typescript-loader@npm:4.3.0" +"cosmiconfig-typescript-loader@npm:^5.0.0": + version: 5.0.0 + resolution: "cosmiconfig-typescript-loader@npm:5.0.0" + dependencies: + jiti: ^1.19.1 peerDependencies: "@types/node": "*" - cosmiconfig: ">=7" - ts-node: ">=10" - typescript: ">=3" - checksum: ea61dfd8e112cf2bb18df0ef89280bd3ae3dd5b997b4a9fc22bbabdc02513aadfbc6d4e15e922b6a9a5d987e9dad42286fa38caf77a9b8dcdbe7d4ce1c9db4fb + cosmiconfig: ">=8.2" + typescript: ">=4" + checksum: 7b614313f2cc2ecbe17270de570a511aa7c974bf14a749d7ed4f4d0f4a9ed02ee7ae87d710e294204abb00bb6bb0cca53795208bb1435815d143b43c6626ec74 languageName: node linkType: hard "cosmiconfig@npm:^8.0.0": - version: 8.1.0 - resolution: "cosmiconfig@npm:8.1.0" + version: 8.3.6 + resolution: "cosmiconfig@npm:8.3.6" dependencies: - import-fresh: ^3.2.1 + import-fresh: ^3.3.0 js-yaml: ^4.1.0 - parse-json: ^5.0.0 + parse-json: ^5.2.0 path-type: ^4.0.0 - checksum: 78a1846acc4935ab4d928e3f768ee2ad2fddbec96377935462749206568423ff4757140ac7f2ccd1f547f86309b8448c04b26588848b5a1520f2e9741cdeecf0 + peerDependencies: + typescript: ">=4.9.5" + peerDependenciesMeta: + typescript: + optional: true + checksum: dc339ebea427898c9e03bf01b56ba7afbac07fc7d2a2d5a15d6e9c14de98275a9565da949375aee1809591c152c0a3877bb86dbeaf74d5bd5aaa79955ad9e7a0 languageName: node linkType: hard @@ -4520,15 +3018,15 @@ __metadata: linkType: hard "cross-fetch@npm:^3.1.5": - version: 3.1.5 - resolution: "cross-fetch@npm:3.1.5" + version: 3.1.8 + resolution: "cross-fetch@npm:3.1.8" dependencies: - node-fetch: 2.6.7 - checksum: f6b8c6ee3ef993ace6277fd789c71b6acf1b504fd5f5c7128df4ef2f125a429e29cd62dc8c127523f04a5f2fa4771ed80e3f3d9695617f441425045f505cf3bb + node-fetch: ^2.6.12 + checksum: 78f993fa099eaaa041122ab037fe9503ecbbcb9daef234d1d2e0b9230a983f64d645d088c464e21a247b825a08dc444a6e7064adfa93536d3a9454b4745b3632 languageName: node linkType: hard -"cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" dependencies: @@ -4758,6 +3256,15 @@ __metadata: languageName: node linkType: hard +"date-fns@npm:^2.29.3": + version: 2.30.0 + resolution: "date-fns@npm:2.30.0" + dependencies: + "@babel/runtime": ^7.21.0 + checksum: f7be01523282e9bb06c0cd2693d34f245247a29098527d4420628966a2d9aad154bd0e90a6b1cf66d37adcb769cd108cf8a7bd49d76db0fb119af5cdd13644f4 + languageName: node + linkType: hard + "debounce@npm:^1.2.0": version: 1.2.1 resolution: "debounce@npm:1.2.1" @@ -4765,7 +3272,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:4.3.4, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -4794,13 +3301,22 @@ __metadata: languageName: node linkType: hard -"dedent@npm:0.7.0, dedent@npm:^0.7.0": +"dedent@npm:0.7.0": version: 0.7.0 resolution: "dedent@npm:0.7.0" checksum: 87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 languageName: node linkType: hard +"deep-eql@npm:^4.1.3": + version: 4.1.3 + resolution: "deep-eql@npm:4.1.3" + dependencies: + type-detect: ^4.0.0 + checksum: 7f6d30cb41c713973dc07eaadded848b2ab0b835e518a88b91bea72f34e08c4c71d167a722a6f302d3a6108f05afd8e6d7650689a84d5d29ec7fe6220420397f + languageName: node + linkType: hard + "deep-is@npm:^0.1.3": version: 0.1.4 resolution: "deep-is@npm:0.1.4" @@ -4808,10 +3324,25 @@ __metadata: languageName: node linkType: hard -"deepmerge@npm:^4.2.2": - version: 4.3.0 - resolution: "deepmerge@npm:4.3.0" - checksum: c7980eb5c5be040b371f1df0d566473875cfabed9f672ccc177b81ba8eee5686ce2478de2f1d0076391621cbe729e5eacda397179a59ef0f68901849647db126 +"default-browser-id@npm:^3.0.0": + version: 3.0.0 + resolution: "default-browser-id@npm:3.0.0" + dependencies: + bplist-parser: ^0.2.0 + untildify: ^4.0.0 + checksum: 279c7ad492542e5556336b6c254a4eaf31b2c63a5433265655ae6e47301197b6cfb15c595a6fdc6463b2ff8e1a1a1ed3cba56038a60e1527ba4ab1628c6b9941 + languageName: node + linkType: hard + +"default-browser@npm:^4.0.0": + version: 4.0.0 + resolution: "default-browser@npm:4.0.0" + dependencies: + bundle-name: ^3.0.0 + default-browser-id: ^3.0.0 + execa: ^7.1.1 + titleize: ^3.0.0 + checksum: 40c5af984799042b140300be5639c9742599bda76dc9eba5ac9ad5943c83dd36cebc4471eafcfddf8e0ec817166d5ba89d56f08e66a126c7c7908a179cead1a7 languageName: node linkType: hard @@ -4824,31 +3355,39 @@ __metadata: languageName: node linkType: hard -"defined@npm:^1.0.0": - version: 1.0.1 - resolution: "defined@npm:1.0.1" - checksum: b1a852300bdb57f297289b55eafdd0c517afaa3ec8190e78fce91b9d8d0c0369d4505ecbdacfd3d98372e664f4a267d9bd793938d4a8c76209c9d9516fbe2101 +"define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.1": + version: 1.1.1 + resolution: "define-data-property@npm:1.1.1" + dependencies: + get-intrinsic: ^1.2.1 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.0 + checksum: a29855ad3f0630ea82e3c5012c812efa6ca3078d5c2aa8df06b5f597c1cde6f7254692df41945851d903e05a1668607b6d34e778f402b9ff9ffb38111f1a3f0d languageName: node linkType: hard -"delayed-stream@npm:~1.0.0": - version: 1.0.0 - resolution: "delayed-stream@npm:1.0.0" - checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 +"define-lazy-prop@npm:^3.0.0": + version: 3.0.0 + resolution: "define-lazy-prop@npm:3.0.0" + checksum: 54884f94caac0791bf6395a3ec530ce901cf71c47b0196b8754f3fd17edb6c0e80149c1214429d851873bb0d689dbe08dcedbb2306dc45c8534a5934723851b6 languageName: node linkType: hard -"delegates@npm:^1.0.0": - version: 1.0.0 - resolution: "delegates@npm:1.0.0" - checksum: a51744d9b53c164ba9c0492471a1a2ffa0b6727451bdc89e31627fdf4adda9d51277cfcbfb20f0a6f08ccb3c436f341df3e92631a3440226d93a8971724771fd +"define-properties@npm:^1.1.4": + version: 1.2.1 + resolution: "define-properties@npm:1.2.1" + dependencies: + define-data-property: ^1.0.1 + has-property-descriptors: ^1.0.0 + object-keys: ^1.1.1 + checksum: b4ccd00597dd46cb2d4a379398f5b19fca84a16f3374e2249201992f36b30f6835949a9429669ee6b41b6e837205a163eadd745e472069e70dfc10f03e5fcc12 languageName: node linkType: hard -"depd@npm:^1.1.2": - version: 1.1.2 - resolution: "depd@npm:1.1.2" - checksum: 6b406620d269619852885ce15965272b829df6f409724415e0002c8632ab6a8c0a08ec1f0bd2add05dc7bd7507606f7e2cc034fa24224ab829580040b835ecd9 +"defined@npm:^1.0.0": + version: 1.0.1 + resolution: "defined@npm:1.0.1" + checksum: b1a852300bdb57f297289b55eafdd0c517afaa3ec8190e78fce91b9d8d0c0369d4505ecbdacfd3d98372e664f4a267d9bd793938d4a8c76209c9d9516fbe2101 languageName: node linkType: hard @@ -4867,12 +3406,12 @@ __metadata: linkType: hard "des.js@npm:^1.0.0": - version: 1.0.1 - resolution: "des.js@npm:1.0.1" + version: 1.1.0 + resolution: "des.js@npm:1.1.0" dependencies: inherits: ^2.0.1 minimalistic-assert: ^1.0.0 - checksum: 1ec2eedd7ed6bd61dd5e0519fd4c96124e93bb22de8a9d211b02d63e5dd152824853d919bb2090f965cc0e3eb9c515950a9836b332020d810f9c71feb0fd7df4 + checksum: 0e9c1584b70d31e20f20a613fc9ef60fbc6a147dfec9e448a168794a4b97ac04d8dc47ea008f1fa93b0f8aaf7c1ead632a5e59ce1913a6079d2d244c9f5ebe33 languageName: node linkType: hard @@ -4890,13 +3429,6 @@ __metadata: languageName: node linkType: hard -"detect-newline@npm:^3.0.0": - version: 3.1.0 - resolution: "detect-newline@npm:3.1.0" - checksum: ae6cd429c41ad01b164c59ea36f264a2c479598e61cba7c99da24175a7ab80ddf066420f2bec9a1c57a6bead411b4655ff15ad7d281c000a89791f48cbe939e7 - languageName: node - linkType: hard - "detective@npm:^5.2.0": version: 5.2.1 resolution: "detective@npm:5.2.1" @@ -4911,9 +3443,9 @@ __metadata: linkType: hard "diff-sequences@npm:^29.4.3": - version: 29.4.3 - resolution: "diff-sequences@npm:29.4.3" - checksum: 28b265e04fdddcf7f9f814effe102cc95a9dec0564a579b5aed140edb24fc345c611ca52d76d725a3cab55d3888b915b5e8a4702e0f6058968a90fa5f41fcde7 + version: 29.6.3 + resolution: "diff-sequences@npm:29.6.3" + checksum: f4914158e1f2276343d98ff5b31fc004e7304f5470bf0f1adb2ac6955d85a531a6458d33e87667f98f6ae52ebd3891bb47d420bb48a5bd8b7a27ee25b20e33aa languageName: node linkType: hard @@ -4951,51 +3483,39 @@ __metadata: languageName: node linkType: hard -"discord-api-types@npm:^0.33.3, discord-api-types@npm:^0.33.5, discord-api-types@npm:~0.33.5": - version: 0.33.5 - resolution: "discord-api-types@npm:0.33.5" - checksum: 6dcaad640c5693a69c9a4f5e444e739dde11ba835164ae6fd3dd5a1ab7b4d7f96cd022ed653eeaff2c8051ead0d998a5d502a2915cfacdde596364b82d9e3b3f - languageName: node - linkType: hard - -"discord-api-types@npm:^0.36.2, discord-api-types@npm:^0.36.3": - version: 0.36.3 - resolution: "discord-api-types@npm:0.36.3" - checksum: 3089c0fb37425dc5df03c76d82988d43fcc272699b06a02fc830d0a3bef550009aaebdf6d646529e8a7ccea76ae3f43b099d736ea5ef37a0be143142ab49871d +"discord-api-types@npm:0.37.50": + version: 0.37.50 + resolution: "discord-api-types@npm:0.37.50" + checksum: 08dc5145dbefda5f52b479cd42d96ac2b8110300861855e1f92cc8a0a6525a4059e32724cd5237490c286f5afd86797a86823238cd5eee016198560bb36f6d43 languageName: node linkType: hard -"discord.js@npm:13.16.0": - version: 13.16.0 - resolution: "discord.js@npm:13.16.0" - dependencies: - "@discordjs/builders": ^0.16.0 - "@discordjs/collection": ^0.7.0 - "@sapphire/async-queue": ^1.5.0 - "@types/node-fetch": ^2.6.3 - "@types/ws": ^8.5.4 - discord-api-types: ^0.33.5 - form-data: ^4.0.0 - node-fetch: ^2.6.7 - ws: ^8.13.0 - checksum: 42457561d13412d42d6247dec35ac13f5996958ee643be84b8e108326ec9b1420d2216d60527cbaaab10e5f6a5d14a3509ac189e6cf7f72a27e67f77789029c6 +"discord-api-types@npm:^0.37.55, discord-api-types@npm:~0.37.62": + version: 0.37.62 + resolution: "discord-api-types@npm:0.37.62" + checksum: 1d9aafab1ad29f9951f039de7e4e8ee48c766775068abad0730e576298b8b4da52572eb0e56802b16f04f24116c957072646e75c7953db8928e6fbedd9047cc5 languageName: node linkType: hard -"discord.js@patch:discord.js@npm%3A13.16.0#./.yarn/patches/discord.js-npm-13.16.0-03bbf983c5.patch::locator=skyra%40workspace%3A.": - version: 13.16.0 - resolution: "discord.js@patch:discord.js@npm%3A13.16.0#./.yarn/patches/discord.js-npm-13.16.0-03bbf983c5.patch::version=13.16.0&hash=5000f3&locator=skyra%40workspace%3A." +"discord.js@npm:^14.13.0": + version: 14.13.0 + resolution: "discord.js@npm:14.13.0" dependencies: - "@discordjs/builders": ^0.16.0 - "@discordjs/collection": ^0.7.0 - "@sapphire/async-queue": ^1.5.0 - "@types/node-fetch": ^2.6.3 - "@types/ws": ^8.5.4 - discord-api-types: ^0.33.5 - form-data: ^4.0.0 - node-fetch: ^2.6.7 + "@discordjs/builders": ^1.6.5 + "@discordjs/collection": ^1.5.3 + "@discordjs/formatters": ^0.3.2 + "@discordjs/rest": ^2.0.1 + "@discordjs/util": ^1.0.1 + "@discordjs/ws": ^1.0.1 + "@sapphire/snowflake": ^3.5.1 + "@types/ws": ^8.5.5 + discord-api-types: 0.37.50 + fast-deep-equal: ^3.1.3 + lodash.snakecase: ^4.1.1 + tslib: ^2.6.1 + undici: 5.22.1 ws: ^8.13.0 - checksum: 2f97aca32172b744a2b614749c3758684c7f263d7254a7a1dff48e47384dc0db20a94cbc477c38b45a243eed39443a8f11de3e2250c8ee08687d9fce667aa1b4 + checksum: c273645ac2f92a5052914261c40d04f7fbf81f8d2542f7f0ec9b2e5f9006ff7436d7c6254db924a12826b7f3b49cbfdd577807a0a4ed396036e106f39701a167 languageName: node linkType: hard @@ -5031,20 +3551,13 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.3.0": +"dotenv@npm:^16.0.3, dotenv@npm:^16.3.0": version: 16.3.1 resolution: "dotenv@npm:16.3.1" checksum: 15d75e7279018f4bafd0ee9706593dd14455ddb71b3bcba9c52574460b7ccaf67d5cf8b2c08a5af1a9da6db36c956a04a1192b101ee102a3e0cf8817bbcf3dfd languageName: node linkType: hard -"dotenv@npm:^8.2.0": - version: 8.6.0 - resolution: "dotenv@npm:8.6.0" - checksum: 38e902c80b0666ab59e9310a3d24ed237029a7ce34d976796349765ac96b8d769f6df19090f1f471b77a25ca391971efde8a1ea63bb83111bd8bec8e5cc9b2cd - languageName: node - linkType: hard - "duplexer2@npm:^0.1.2, duplexer2@npm:~0.1.0, duplexer2@npm:~0.1.2": version: 0.1.4 resolution: "duplexer2@npm:0.1.4" @@ -5080,13 +3593,6 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.431": - version: 1.4.454 - resolution: "electron-to-chromium@npm:1.4.454" - checksum: 26a756485b442be04a640b8733c3e0d1ad9630541e56906332b1a5f25ec0027647561ec98d0d2a5069a1aae3875c9751c6d1c6cb9ef400b2beabedc36da14ba1 - languageName: node - linkType: hard - "elliptic@npm:^6.5.3, elliptic@npm:^6.5.4": version: 6.5.4 resolution: "elliptic@npm:6.5.4" @@ -5102,13 +3608,6 @@ __metadata: languageName: node linkType: hard -"emittery@npm:^0.13.1": - version: 0.13.1 - resolution: "emittery@npm:0.13.1" - checksum: 2b089ab6306f38feaabf4f6f02792f9ec85fc054fda79f44f6790e61bbf6bc4e1616afb9b232e0c5ec5289a8a452f79bfa6d905a6fd64e94b49981f0934001c6 - languageName: node - linkType: hard - "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -5171,6 +3670,160 @@ __metadata: languageName: node linkType: hard +"esbuild@npm:^0.19.3": + version: 0.19.5 + resolution: "esbuild@npm:0.19.5" + dependencies: + "@esbuild/android-arm": 0.19.5 + "@esbuild/android-arm64": 0.19.5 + "@esbuild/android-x64": 0.19.5 + "@esbuild/darwin-arm64": 0.19.5 + "@esbuild/darwin-x64": 0.19.5 + "@esbuild/freebsd-arm64": 0.19.5 + "@esbuild/freebsd-x64": 0.19.5 + "@esbuild/linux-arm": 0.19.5 + "@esbuild/linux-arm64": 0.19.5 + "@esbuild/linux-ia32": 0.19.5 + "@esbuild/linux-loong64": 0.19.5 + "@esbuild/linux-mips64el": 0.19.5 + "@esbuild/linux-ppc64": 0.19.5 + "@esbuild/linux-riscv64": 0.19.5 + "@esbuild/linux-s390x": 0.19.5 + "@esbuild/linux-x64": 0.19.5 + "@esbuild/netbsd-x64": 0.19.5 + "@esbuild/openbsd-x64": 0.19.5 + "@esbuild/sunos-x64": 0.19.5 + "@esbuild/win32-arm64": 0.19.5 + "@esbuild/win32-ia32": 0.19.5 + "@esbuild/win32-x64": 0.19.5 + dependenciesMeta: + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: 5a0227cf6ffffa3076714d88230af1dfdd2fc363d91bd712a81fb91230c315a395e2c9b7588eee62986aeebf4999804b9b1b59eeab8e2457184eb0056bfe20c8 + languageName: node + linkType: hard + +"esbuild@npm:~0.18.20": + version: 0.18.20 + resolution: "esbuild@npm:0.18.20" + dependencies: + "@esbuild/android-arm": 0.18.20 + "@esbuild/android-arm64": 0.18.20 + "@esbuild/android-x64": 0.18.20 + "@esbuild/darwin-arm64": 0.18.20 + "@esbuild/darwin-x64": 0.18.20 + "@esbuild/freebsd-arm64": 0.18.20 + "@esbuild/freebsd-x64": 0.18.20 + "@esbuild/linux-arm": 0.18.20 + "@esbuild/linux-arm64": 0.18.20 + "@esbuild/linux-ia32": 0.18.20 + "@esbuild/linux-loong64": 0.18.20 + "@esbuild/linux-mips64el": 0.18.20 + "@esbuild/linux-ppc64": 0.18.20 + "@esbuild/linux-riscv64": 0.18.20 + "@esbuild/linux-s390x": 0.18.20 + "@esbuild/linux-x64": 0.18.20 + "@esbuild/netbsd-x64": 0.18.20 + "@esbuild/openbsd-x64": 0.18.20 + "@esbuild/sunos-x64": 0.18.20 + "@esbuild/win32-arm64": 0.18.20 + "@esbuild/win32-ia32": 0.18.20 + "@esbuild/win32-x64": 0.18.20 + dependenciesMeta: + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: 5d253614e50cdb6ec22095afd0c414f15688e7278a7eb4f3720a6dd1306b0909cf431e7b9437a90d065a31b1c57be60130f63fe3e8d0083b588571f31ee6ec7b + languageName: node + linkType: hard + "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -5185,13 +3838,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:^2.0.0": - version: 2.0.0 - resolution: "escape-string-regexp@npm:2.0.0" - checksum: 9f8a2d5743677c16e85c810e3024d54f0c8dea6424fad3c79ef6666e81dd0846f7437f5e729dfcdac8981bc9e5294c39b4580814d114076b8d36318f46ae4395 - languageName: node - linkType: hard - "escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" @@ -5199,79 +3845,74 @@ __metadata: languageName: node linkType: hard -"eslint-config-prettier@npm:^8.8.0": - version: 8.8.0 - resolution: "eslint-config-prettier@npm:8.8.0" +"eslint-config-prettier@npm:^9.0.0": + version: 9.0.0 + resolution: "eslint-config-prettier@npm:9.0.0" peerDependencies: eslint: ">=7.0.0" bin: eslint-config-prettier: bin/cli.js - checksum: 1e94c3882c4d5e41e1dcfa2c368dbccbfe3134f6ac7d40101644d3bfbe3eb2f2ffac757f3145910b5eacf20c0e85e02b91293d3126d770cbf3dc390b3564681c + checksum: 362e991b6cb343f79362bada2d97c202e5303e6865888918a7445c555fb75e4c078b01278e90be98aa98ae22f8597d8e93d48314bec6824f540f7efcab3ce451 languageName: node linkType: hard -"eslint-plugin-prettier@npm:^4.2.1": - version: 4.2.1 - resolution: "eslint-plugin-prettier@npm:4.2.1" +"eslint-plugin-prettier@npm:^5.0.0, eslint-plugin-prettier@npm:^5.0.1": + version: 5.0.1 + resolution: "eslint-plugin-prettier@npm:5.0.1" dependencies: prettier-linter-helpers: ^1.0.0 + synckit: ^0.8.5 peerDependencies: - eslint: ">=7.28.0" - prettier: ">=2.0.0" + "@types/eslint": ">=8.0.0" + eslint: ">=8.0.0" + prettier: ">=3.0.0" peerDependenciesMeta: + "@types/eslint": + optional: true eslint-config-prettier: optional: true - checksum: b9e839d2334ad8ec7a5589c5cb0f219bded260839a857d7a486997f9870e95106aa59b8756ff3f37202085ebab658de382b0267cae44c3a7f0eb0bcc03a4f6d6 - languageName: node - linkType: hard - -"eslint-scope@npm:^5.1.1": - version: 5.1.1 - resolution: "eslint-scope@npm:5.1.1" - dependencies: - esrecurse: ^4.3.0 - estraverse: ^4.1.1 - checksum: 47e4b6a3f0cc29c7feedee6c67b225a2da7e155802c6ea13bbef4ac6b9e10c66cd2dcb987867ef176292bf4e64eccc680a49e35e9e9c669f4a02bac17e86abdb + checksum: c2261033b97bafe99ccb7cc47c2fac6fa85b8bbc8b128042e52631f906b69e12afed2cdd9d7e3021cc892ee8dd4204a3574e1f32a0b718b4bb3b440944b6983b languageName: node linkType: hard -"eslint-scope@npm:^7.2.0": - version: 7.2.0 - resolution: "eslint-scope@npm:7.2.0" +"eslint-scope@npm:^7.2.2": + version: 7.2.2 + resolution: "eslint-scope@npm:7.2.2" dependencies: esrecurse: ^4.3.0 estraverse: ^5.2.0 - checksum: 64591a2d8b244ade9c690b59ef238a11d5c721a98bcee9e9f445454f442d03d3e04eda88e95a4daec558220a99fa384309d9faae3d459bd40e7a81b4063980ae + checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1": - version: 3.4.1 - resolution: "eslint-visitor-keys@npm:3.4.1" - checksum: f05121d868202736b97de7d750847a328fcfa8593b031c95ea89425333db59676ac087fa905eba438d0a3c5769632f828187e0c1a0d271832a2153c1d3661c2c +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": + version: 3.4.3 + resolution: "eslint-visitor-keys@npm:3.4.3" + checksum: 36e9ef87fca698b6fd7ca5ca35d7b2b6eeaaf106572e2f7fd31c12d3bfdaccdb587bba6d3621067e5aece31c8c3a348b93922ab8f7b2cbc6aaab5e1d89040c60 languageName: node linkType: hard -"eslint@npm:^8.44.0, eslint@npm:^8.45.0": - version: 8.45.0 - resolution: "eslint@npm:8.45.0" +"eslint@npm:^8.48.0, eslint@npm:^8.53.0": + version: 8.53.0 + resolution: "eslint@npm:8.53.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 - "@eslint-community/regexpp": ^4.4.0 - "@eslint/eslintrc": ^2.1.0 - "@eslint/js": 8.44.0 - "@humanwhocodes/config-array": ^0.11.10 + "@eslint-community/regexpp": ^4.6.1 + "@eslint/eslintrc": ^2.1.3 + "@eslint/js": 8.53.0 + "@humanwhocodes/config-array": ^0.11.13 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 - ajv: ^6.10.0 + "@ungap/structured-clone": ^1.2.0 + ajv: ^6.12.4 chalk: ^4.0.0 cross-spawn: ^7.0.2 debug: ^4.3.2 doctrine: ^3.0.0 escape-string-regexp: ^4.0.0 - eslint-scope: ^7.2.0 - eslint-visitor-keys: ^3.4.1 - espree: ^9.6.0 + eslint-scope: ^7.2.2 + eslint-visitor-keys: ^3.4.3 + espree: ^9.6.1 esquery: ^1.4.2 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 @@ -5295,37 +3936,27 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 3e6dcce5cc43c5e301662db88ee26d1d188b22c177b9f104d7eefd1191236980bd953b3670fe2fac287114b26d7c5420ab48407d7ea1c3a446d6313c000009da + checksum: 2da808655c7aa4b33f8970ba30d96b453c3071cc4d6cd60d367163430677e32ff186b65270816b662d29139283138bff81f28dddeb2e73265495245a316ed02c languageName: node linkType: hard -"espree@npm:^9.6.0": - version: 9.6.0 - resolution: "espree@npm:9.6.0" +"espree@npm:^9.6.0, espree@npm:^9.6.1": + version: 9.6.1 + resolution: "espree@npm:9.6.1" dependencies: acorn: ^8.9.0 acorn-jsx: ^5.3.2 eslint-visitor-keys: ^3.4.1 - checksum: 1287979510efb052a6a97c73067ea5d0a40701b29adde87bbe2d3eb1667e39ca55e8129e20e2517fed3da570150e7ef470585228459a8f3e3755f45007a1c662 - languageName: node - linkType: hard - -"esprima@npm:^4.0.0": - version: 4.0.1 - resolution: "esprima@npm:4.0.1" - bin: - esparse: ./bin/esparse.js - esvalidate: ./bin/esvalidate.js - checksum: b45bc805a613dbea2835278c306b91aff6173c8d034223fa81498c77dcbce3b2931bf6006db816f62eacd9fd4ea975dfd85a5b7f3c6402cfd050d4ca3c13a628 + checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 languageName: node linkType: hard "esquery@npm:^1.4.2": - version: 1.4.2 - resolution: "esquery@npm:1.4.2" + version: 1.5.0 + resolution: "esquery@npm:1.5.0" dependencies: estraverse: ^5.1.0 - checksum: 2f4ad89c5aafaca61cc2c15e256190f0d6deb4791cae6552d3cb4b1eb8867958cdf27a56aaa3272ff17435e3eaa19ee0d4129fac336ca6373d7354d7b5da7966 + checksum: aefb0d2596c230118656cd4ec7532d447333a410a48834d80ea648b1e7b5c9bc9ed8b5e33a89cb04e487b60d622f44cf5713bf4abed7c97343edefdc84a35900 languageName: node linkType: hard @@ -5338,13 +3969,6 @@ __metadata: languageName: node linkType: hard -"estraverse@npm:^4.1.1": - version: 4.3.0 - resolution: "estraverse@npm:4.3.0" - checksum: a6299491f9940bb246124a8d44b7b7a413a8336f5436f9837aaa9330209bd9ee8af7e91a654a3545aee9c54b3308e78ee360cef1d777d37cfef77d2fa33b5827 - languageName: node - linkType: hard - "estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": version: 5.3.0 resolution: "estraverse@npm:5.3.0" @@ -5381,6 +4005,13 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^5.0.1": + version: 5.0.1 + resolution: "eventemitter3@npm:5.0.1" + checksum: 543d6c858ab699303c3c32e0f0f47fc64d360bf73c3daf0ac0b5079710e340d6fe9f15487f94e66c629f5f82cd1a8678d692f3dbb6f6fcd1190e1b97fcad36f8 + languageName: node + linkType: hard + "events@npm:^3.0.0": version: 3.3.0 resolution: "events@npm:3.3.0" @@ -5399,6 +4030,23 @@ __metadata: languageName: node linkType: hard +"execa@npm:8.0.1": + version: 8.0.1 + resolution: "execa@npm:8.0.1" + dependencies: + cross-spawn: ^7.0.3 + get-stream: ^8.0.1 + human-signals: ^5.0.0 + is-stream: ^3.0.0 + merge-stream: ^2.0.0 + npm-run-path: ^5.1.0 + onetime: ^6.0.0 + signal-exit: ^4.1.0 + strip-final-newline: ^3.0.0 + checksum: cac1bf86589d1d9b73bdc5dda65c52012d1a9619c44c526891956745f7b366ca2603d29fe3f7460bacc2b48c6eab5d6a4f7afe0534b31473d3708d1265545e1f + languageName: node + linkType: hard + "execa@npm:^5.0.0": version: 5.1.1 resolution: "execa@npm:5.1.1" @@ -5416,9 +4064,9 @@ __metadata: languageName: node linkType: hard -"execa@npm:^7.0.0": - version: 7.1.0 - resolution: "execa@npm:7.1.0" +"execa@npm:^7.1.1": + version: 7.2.0 + resolution: "execa@npm:7.2.0" dependencies: cross-spawn: ^7.0.3 get-stream: ^6.0.1 @@ -5429,7 +4077,7 @@ __metadata: onetime: ^6.0.0 signal-exit: ^3.0.7 strip-final-newline: ^3.0.0 - checksum: feb446802885a0bace8400efdd7320f811203a53af29e8a65a6ff18e58582909eefeec31e163fbee9debcfeb7d464be2887beeb85c817ca873ac720064404247 + checksum: 14fd17ba0ca8c87b277584d93b1d9fc24f2a65e5152b31d5eb159a3b814854283eaae5f51efa9525e304447e2f757c691877f7adff8fde5746aae67eb1edd1cc languageName: node linkType: hard @@ -5442,13 +4090,6 @@ __metadata: languageName: node linkType: hard -"exit@npm:^0.1.2": - version: 0.1.2 - resolution: "exit@npm:0.1.2" - checksum: abc407f07a875c3961e4781dfcb743b58d6c93de9ab263f4f8c9d23bb6da5f9b7764fc773f86b43dd88030444d5ab8abcb611cb680fba8ca075362b77114bba3 - languageName: node - linkType: hard - "expand-tilde@npm:^2.0.0, expand-tilde@npm:^2.0.2": version: 2.0.2 resolution: "expand-tilde@npm:2.0.2" @@ -5458,17 +4099,10 @@ __metadata: languageName: node linkType: hard -"expect@npm:^29.0.0, expect@npm:^29.6.1": - version: 29.6.1 - resolution: "expect@npm:29.6.1" - dependencies: - "@jest/expect-utils": ^29.6.1 - "@types/node": "*" - jest-get-type: ^29.4.3 - jest-matcher-utils: ^29.6.1 - jest-message-util: ^29.6.1 - jest-util: ^29.6.1 - checksum: 4e712e52c90f6c54e748fd2876be33c43ada6a59088ddf6a1acb08b18b3b97b3a672124684abe32599986d2f2a438d5afad148837ee06ea386d2a4bf0348de78 +"exponential-backoff@npm:^3.1.1": + version: 3.1.1 + resolution: "exponential-backoff@npm:3.1.1" + checksum: 3d21519a4f8207c99f7457287291316306255a328770d320b401114ec8481986e4e467e854cb9914dd965e0a1ca810a23ccb559c642c88f4c7f55c55778a9b48 languageName: node linkType: hard @@ -5491,26 +4125,26 @@ __metadata: linkType: hard "fast-diff@npm:^1.1.2": - version: 1.2.0 - resolution: "fast-diff@npm:1.2.0" - checksum: 1b5306eaa9e826564d9e5ffcd6ebd881eb5f770b3f977fcbf38f05c824e42172b53c79920e8429c54eb742ce15a0caf268b0fdd5b38f6de52234c4a8368131ae + version: 1.3.0 + resolution: "fast-diff@npm:1.3.0" + checksum: d22d371b994fdc8cce9ff510d7b8dc4da70ac327bcba20df607dd5b9cae9f908f4d1028f5fe467650f058d1e7270235ae0b8230809a262b4df587a3b3aa216c3 languageName: node linkType: hard -"fast-glob@npm:^3.2.9": - version: 3.2.12 - resolution: "fast-glob@npm:3.2.12" +"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.0": + version: 3.3.2 + resolution: "fast-glob@npm:3.3.2" dependencies: "@nodelib/fs.stat": ^2.0.2 "@nodelib/fs.walk": ^1.2.3 glob-parent: ^5.1.2 merge2: ^1.3.0 micromatch: ^4.0.4 - checksum: 0b1990f6ce831c7e28c4d505edcdaad8e27e88ab9fa65eedadb730438cfc7cde4910d6c975d6b7b8dc8a73da4773702ebcfcd6e3518e73938bb1383badfe01c2 + checksum: 900e4979f4dbc3313840078419245621259f349950411ca2fa445a2f9a1a6d98c3b5e7e0660c5ccd563aa61abe133a21765c6c0dec8e57da1ba71d8000b05ec1 languageName: node linkType: hard -"fast-json-stable-stringify@npm:^2.0.0, fast-json-stable-stringify@npm:^2.1.0": +"fast-json-stable-stringify@npm:^2.0.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" checksum: b191531e36c607977e5b1c47811158733c34ccb3bfde92c44798929e9b4154884378536d26ad90dfecd32e1ffc09c545d23535ad91b3161a27ddbb8ebe0cbecb @@ -5540,22 +4174,6 @@ __metadata: languageName: node linkType: hard -"fb-watchman@npm:^2.0.0": - version: 2.0.2 - resolution: "fb-watchman@npm:2.0.2" - dependencies: - bser: 2.1.1 - checksum: b15a124cef28916fe07b400eb87cbc73ca082c142abf7ca8e8de6af43eca79ca7bd13eb4d4d48240b3bd3136eaac40d16e42d6edf87a8e5d1dd8070626860c78 - languageName: node - linkType: hard - -"figlet@npm:^1.1.1": - version: 1.5.2 - resolution: "figlet@npm:1.5.2" - checksum: cc860391669b44e119871d589e09a2814aa86351726a5791e0d3e2d098e4fc37171c85fcfed13f4e9000995bd004dc6dbf848da5fe458cf1477e776b7318986f - languageName: node - linkType: hard - "figures@npm:^3.0.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -5607,7 +4225,7 @@ __metadata: languageName: node linkType: hard -"find-up@npm:^4.0.0, find-up@npm:^4.1.0": +"find-up@npm:^4.1.0": version: 4.1.0 resolution: "find-up@npm:4.1.0" dependencies: @@ -5640,19 +4258,20 @@ __metadata: linkType: hard "flat-cache@npm:^3.0.4": - version: 3.0.4 - resolution: "flat-cache@npm:3.0.4" + version: 3.1.1 + resolution: "flat-cache@npm:3.1.1" dependencies: - flatted: ^3.1.0 + flatted: ^3.2.9 + keyv: ^4.5.3 rimraf: ^3.0.2 - checksum: 4fdd10ecbcbf7d520f9040dd1340eb5dfe951e6f0ecf2252edeec03ee68d989ec8b9a20f4434270e71bcfd57800dc09b3344fca3966b2eb8f613072c7d9a2365 + checksum: 4958cfe0f46acf84953d4e16676ef5f0d38eab3a92d532a1e8d5f88f11eea8b36d5d598070ff2aeae15f1fde18f8d7d089eefaf9db10b5a587cc1c9072325c7a languageName: node linkType: hard -"flatted@npm:^3.1.0": - version: 3.2.7 - resolution: "flatted@npm:3.2.7" - checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 +"flatted@npm:^3.2.9": + version: 3.2.9 + resolution: "flatted@npm:3.2.9" + checksum: f14167fbe26a9d20f6fca8d998e8f1f41df72c8e81f9f2c9d61ed2bea058248f5e1cbd05e7f88c0e5087a6a0b822a1e5e2b446e879f3cfbe0b07ba2d7f80b026 languageName: node linkType: hard @@ -5665,25 +4284,13 @@ __metadata: languageName: node linkType: hard -"form-data@npm:^3.0.0": - version: 3.0.1 - resolution: "form-data@npm:3.0.1" - dependencies: - asynckit: ^0.4.0 - combined-stream: ^1.0.8 - mime-types: ^2.1.12 - checksum: b019e8d35c8afc14a2bd8a7a92fa4f525a4726b6d5a9740e8d2623c30e308fbb58dc8469f90415a856698933c8479b01646a9dff33c87cc4e76d72aedbbf860d - languageName: node - linkType: hard - -"form-data@npm:^4.0.0": - version: 4.0.0 - resolution: "form-data@npm:4.0.0" +"foreground-child@npm:^3.1.0": + version: 3.1.1 + resolution: "foreground-child@npm:3.1.1" dependencies: - asynckit: ^0.4.0 - combined-stream: ^1.0.8 - mime-types: ^2.1.12 - checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c + cross-spawn: ^7.0.0 + signal-exit: ^4.0.1 + checksum: 139d270bc82dc9e6f8bc045fe2aae4001dc2472157044fdfad376d0a3457f77857fa883c1c8b21b491c6caade9a926a4bed3d3d2e8d3c9202b151a4cbbd0bcd5 languageName: node linkType: hard @@ -5718,17 +4325,17 @@ __metadata: linkType: hard "fs-extra@npm:^11.0.0": - version: 11.1.0 - resolution: "fs-extra@npm:11.1.0" + version: 11.1.1 + resolution: "fs-extra@npm:11.1.1" dependencies: graceful-fs: ^4.2.0 jsonfile: ^6.0.1 universalify: ^2.0.0 - checksum: 5ca476103fa1f5ff4a9b3c4f331548f8a3c1881edaae323a4415d3153b5dc11dc6a981c8d1dd93eec8367ceee27b53f8bd27eecbbf66ffcdd04927510c171e7f + checksum: fb883c68245b2d777fbc1f2082c9efb084eaa2bbf9fddaa366130d196c03608eebef7fb490541276429ee1ca99f317e2d73e96f5ca0999eefedf5a624ae1edfd languageName: node linkType: hard -"fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": +"fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" dependencies: @@ -5737,6 +4344,15 @@ __metadata: languageName: node linkType: hard +"fs-minipass@npm:^3.0.0": + version: 3.0.3 + resolution: "fs-minipass@npm:3.0.3" + dependencies: + minipass: ^7.0.3 + checksum: 8722a41109130851d979222d3ec88aabaceeaaf8f57b2a8f744ef8bd2d1ce95453b04a61daa0078822bc5cd21e008814f06fe6586f56fef511e71b8d2394d802 + languageName: node + linkType: hard + "fs.realpath@npm:^1.0.0": version: 1.0.0 resolution: "fs.realpath@npm:1.0.0" @@ -5744,52 +4360,29 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2": - version: 2.3.2 - resolution: "fsevents@npm:2.3.2" +"fsevents@npm:~2.3.2, fsevents@npm:~2.3.3": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" dependencies: node-gyp: latest - checksum: 97ade64e75091afee5265e6956cb72ba34db7819b4c3e94c431d4be2b19b8bb7a2d4116da417950c3425f17c8fe693d25e20212cac583ac1521ad066b77ae31f + checksum: 11e6ea6fea15e42461fc55b4b0e4a0a3c654faa567f1877dbd353f39156f69def97a69936d1746619d656c4b93de2238bf731f6085a03a50cabf287c9d024317 conditions: os=darwin languageName: node linkType: hard -"fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": - version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" +"fsevents@patch:fsevents@~2.3.2#~builtin, fsevents@patch:fsevents@~2.3.3#~builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" dependencies: node-gyp: latest conditions: os=darwin languageName: node linkType: hard -"function-bind@npm:^1.1.1": - version: 1.1.1 - resolution: "function-bind@npm:1.1.1" - checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a - languageName: node - linkType: hard - -"gauge@npm:^4.0.3": - version: 4.0.4 - resolution: "gauge@npm:4.0.4" - dependencies: - aproba: ^1.0.3 || ^2.0.0 - color-support: ^1.1.3 - console-control-strings: ^1.1.0 - has-unicode: ^2.0.1 - signal-exit: ^3.0.7 - string-width: ^4.2.3 - strip-ansi: ^6.0.1 - wide-align: ^1.1.5 - checksum: 788b6bfe52f1dd8e263cda800c26ac0ca2ff6de0b6eee2fe0d9e3abf15e149b651bd27bf5226be10e6e3edb5c4e5d5985a5a1a98137e7a892f75eff76467ad2d - languageName: node - linkType: hard - -"gensync@npm:^1.0.0-beta.2": - version: 1.0.0-beta.2 - resolution: "gensync@npm:1.0.0-beta.2" - checksum: a7437e58c6be12aa6c90f7730eac7fa9833dc78872b4ad2963d2031b00a3367a93f98aec75f9aaac7220848e4026d67a8655e870b24f20a543d103c0d65952ec +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 2b0ff4ce708d99715ad14a6d1f894e2a83242e4a52ccfcefaee5e40050562e5f6dafc1adbb4ce2d4ab47279a45dc736ab91ea5042d843c3c092820dfe032efb1 languageName: node linkType: hard @@ -5807,21 +4400,22 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.3": - version: 1.2.0 - resolution: "get-intrinsic@npm:1.2.0" - dependencies: - function-bind: ^1.1.1 - has: ^1.0.3 - has-symbols: ^1.0.3 - checksum: 78fc0487b783f5c58cf2dccafc3ae656ee8d2d8062a8831ce4a95e7057af4587a1d4882246c033aca0a7b4965276f4802b45cc300338d1b77a73d3e3e3f4877d +"get-func-name@npm:^2.0.1, get-func-name@npm:^2.0.2": + version: 2.0.2 + resolution: "get-func-name@npm:2.0.2" + checksum: 3f62f4c23647de9d46e6f76d2b3eafe58933a9b3830c60669e4180d6c601ce1b4aa310ba8366143f55e52b139f992087a9f0647274e8745621fa2af7e0acf13b languageName: node linkType: hard -"get-package-type@npm:^0.1.0": - version: 0.1.0 - resolution: "get-package-type@npm:0.1.0" - checksum: bba0811116d11e56d702682ddef7c73ba3481f114590e705fc549f4d868972263896af313c57a25c076e3c0d567e11d919a64ba1b30c879be985fc9d44f96148 +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2": + version: 1.2.2 + resolution: "get-intrinsic@npm:1.2.2" + dependencies: + function-bind: ^1.1.2 + has-proto: ^1.0.1 + has-symbols: ^1.0.3 + hasown: ^2.0.0 + checksum: 447ff0724df26829908dc033b62732359596fcf66027bc131ab37984afb33842d9cd458fd6cecadfe7eac22fd8a54b349799ed334cf2726025c921c7250e7417 languageName: node linkType: hard @@ -5832,6 +4426,22 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^8.0.1": + version: 8.0.1 + resolution: "get-stream@npm:8.0.1" + checksum: 01e3d3cf29e1393f05f44d2f00445c5f9ec3d1c49e8179b31795484b9c117f4c695e5e07b88b50785d5c8248a788c85d9913a79266fc77e3ef11f78f10f1b974 + languageName: node + linkType: hard + +"get-tsconfig@npm:^4.7.2": + version: 4.7.2 + resolution: "get-tsconfig@npm:4.7.2" + dependencies: + resolve-pkg-maps: ^1.0.0 + checksum: 172358903250eff0103943f816e8a4e51d29b8e5449058bdf7266714a908a48239f6884308bd3a6ff28b09f692b9533dbebfd183ab63e4e14f073cda91f1bca9 + languageName: node + linkType: hard + "git-raw-commits@npm:^2.0.11": version: 2.0.11 resolution: "git-raw-commits@npm:2.0.11" @@ -5865,7 +4475,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:7.2.3, glob@npm:^7.1.0, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": +"glob@npm:7.2.3, glob@npm:^7.1.0, glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -5879,7 +4489,22 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.1": +"glob@npm:^10.2.2, glob@npm:^10.3.10": + version: 10.3.10 + resolution: "glob@npm:10.3.10" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^2.3.5 + minimatch: ^9.0.1 + minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 + path-scurry: ^1.10.1 + bin: + glob: dist/esm/bin.mjs + checksum: 4f2fe2511e157b5a3f525a54092169a5f92405f24d2aed3142f4411df328baca13059f4182f1db1bf933e2c69c0bd89e57ae87edd8950cba8c7ccbe84f721cf3 + languageName: node + linkType: hard + +"glob@npm:^8.1.0": version: 8.1.0 resolution: "glob@npm:8.1.0" dependencies: @@ -5925,19 +4550,12 @@ __metadata: languageName: node linkType: hard -"globals@npm:^11.1.0": - version: 11.12.0 - resolution: "globals@npm:11.12.0" - checksum: 67051a45eca3db904aee189dfc7cd53c20c7d881679c93f6146ddd4c9f4ab2268e68a919df740d39c71f4445d2b38ee360fc234428baea1dbdfe68bbcb46979e - languageName: node - linkType: hard - "globals@npm:^13.19.0": - version: 13.20.0 - resolution: "globals@npm:13.20.0" + version: 13.23.0 + resolution: "globals@npm:13.23.0" dependencies: type-fest: ^0.20.2 - checksum: ad1ecf914bd051325faad281d02ea2c0b1df5d01bd94d368dcc5513340eac41d14b3c61af325768e3c7f8d44576e72780ec0b6f2d366121f8eec6e03c3a3b97a + checksum: 194c97cf8d1ef6ba59417234c2386549c4103b6e5f24b1ff1952de61a4753e5d2069435ba629de711a6480b1b1d114a98e2ab27f85e966d5a10c319c3bbd3dc3 languageName: node linkType: hard @@ -5964,10 +4582,10 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": - version: 4.2.10 - resolution: "graceful-fs@npm:4.2.10" - checksum: 3f109d70ae123951905d85032ebeae3c2a5a7a997430df00ea30df0e3a6c60cf6689b109654d6fdacd28810a053348c4d14642da1d075049e6be1ba5216218da +"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6": + version: 4.2.11 + resolution: "graceful-fs@npm:4.2.11" + checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 languageName: node linkType: hard @@ -6008,6 +4626,22 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.0": + version: 1.0.1 + resolution: "has-property-descriptors@npm:1.0.1" + dependencies: + get-intrinsic: ^1.2.2 + checksum: 2bcc6bf6ec6af375add4e4b4ef586e43674850a91ad4d46666d0b28ba8e1fd69e424c7677d24d60f69470ad0afaa2f3197f508b20b0bb7dd99a8ab77ffc4b7c4 + languageName: node + linkType: hard + +"has-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "has-proto@npm:1.0.1" + checksum: febc5b5b531de8022806ad7407935e2135f1cc9e64636c3916c6842bd7995994ca3b29871ecd7954bd35f9e2986c17b3b227880484d22259e2f8e6ce63fd383e + languageName: node + linkType: hard + "has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" @@ -6031,12 +4665,10 @@ __metadata: languageName: node linkType: hard -"has@npm:^1.0.0, has@npm:^1.0.3": - version: 1.0.3 - resolution: "has@npm:1.0.3" - dependencies: - function-bind: ^1.1.1 - checksum: b9ad53d53be4af90ce5d1c38331e712522417d017d5ef1ebd0507e07c2fbad8686fffb8e12ddecd4c39ca9b9b47431afbb975b8abf7f3c3b82c98e9aad052792 +"has@npm:^1.0.0": + version: 1.0.4 + resolution: "has@npm:1.0.4" + checksum: 8a11ba062e0627c9578a1d08285401e39f1d071a9692ddf793199070edb5648b21c774dd733e2a181edd635bf6862731885f476f4ccf67c998d7a5ff7cef2550 languageName: node linkType: hard @@ -6061,6 +4693,15 @@ __metadata: languageName: node linkType: hard +"hasown@npm:^2.0.0": + version: 2.0.0 + resolution: "hasown@npm:2.0.0" + dependencies: + function-bind: ^1.1.2 + checksum: 6151c75ca12554565098641c98a40f4cc86b85b0fd5b6fe92360967e4605a4f9610f7757260b4e8098dd1c2ce7f4b095f2006fe72a570e3b6d2d28de0298c176 + languageName: node + linkType: hard + "he@npm:^1.2.0": version: 1.2.0 resolution: "he@npm:1.2.0" @@ -6134,21 +4775,20 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.1.0": +"http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236 languageName: node linkType: hard -"http-proxy-agent@npm:^5.0.0": - version: 5.0.0 - resolution: "http-proxy-agent@npm:5.0.0" +"http-proxy-agent@npm:^7.0.0": + version: 7.0.0 + resolution: "http-proxy-agent@npm:7.0.0" dependencies: - "@tootallnate/once": 2 - agent-base: 6 - debug: 4 - checksum: e2ee1ff1656a131953839b2a19cd1f3a52d97c25ba87bd2559af6ae87114abf60971e498021f9b73f9fd78aea8876d1fb0d4656aac8a03c6caa9fc175f22b786 + agent-base: ^7.1.0 + debug: ^4.3.4 + checksum: 48d4fac997917e15f45094852b63b62a46d0c8a4f0b9c6c23ca26d27b8df8d178bed88389e604745e748bd9a01f5023e25093722777f0593c3f052009ff438b6 languageName: node linkType: hard @@ -6169,6 +4809,16 @@ __metadata: languageName: node linkType: hard +"https-proxy-agent@npm:^7.0.1": + version: 7.0.2 + resolution: "https-proxy-agent@npm:7.0.2" + dependencies: + agent-base: ^7.0.2 + debug: 4 + checksum: 088969a0dd476ea7a0ed0a2cf1283013682b08f874c3bc6696c83fa061d2c157d29ef0ad3eb70a2046010bb7665573b2388d10fdcb3e410a66995e5248444292 + languageName: node + linkType: hard + "human-signals@npm:^2.1.0": version: 2.1.0 resolution: "human-signals@npm:2.1.0" @@ -6177,18 +4827,16 @@ __metadata: linkType: hard "human-signals@npm:^4.3.0": - version: 4.3.0 - resolution: "human-signals@npm:4.3.0" - checksum: 662b976b1063a8afb8fd7fa50bde6975997e17ea6ceba2aad54aacf1dc239a2cd7d14d27b3ceca0c6288627f4b45c56c2c89618455ff52cd9377c02d6328cd7c + version: 4.3.1 + resolution: "human-signals@npm:4.3.1" + checksum: 6f12958df3f21b6fdaf02d90896c271df00636a31e2bbea05bddf817a35c66b38a6fdac5863e2df85bd52f34958997f1f50350ff97249e1dff8452865d5235d1 languageName: node linkType: hard -"humanize-ms@npm:^1.2.1": - version: 1.2.1 - resolution: "humanize-ms@npm:1.2.1" - dependencies: - ms: ^2.0.0 - checksum: 9c7a74a2827f9294c009266c82031030eae811ca87b0da3dceb8d6071b9bde22c9f3daef0469c3c533cc67a97d8a167cd9fc0389350e5f415f61a79b171ded16 +"human-signals@npm:^5.0.0": + version: 5.0.0 + resolution: "human-signals@npm:5.0.0" + checksum: 6504560d5ed91444f16bea3bd9dfc66110a339442084e56c3e7fa7bbdf3f406426d6563d662bdce67064b165eac31eeabfc0857ed170aaa612cf14ec9f9a464c languageName: node linkType: hard @@ -6208,12 +4856,12 @@ __metadata: languageName: node linkType: hard -"i18next@npm:^21.8.13": - version: 21.10.0 - resolution: "i18next@npm:21.10.0" +"i18next@npm:^23.5.1": + version: 23.6.0 + resolution: "i18next@npm:23.6.0" dependencies: - "@babel/runtime": ^7.17.2 - checksum: f997985e2d4d15a62a0936a82ff6420b97f3f971e776fe685bdd50b4de0cb4dc2198bc75efe6b152844794ebd5040d8060d6d152506a687affad534834836d81 + "@babel/runtime": ^7.22.5 + checksum: 0898be75ce56a5901eb9763c8cd941a23cfc24fbe7b32ba0479c08f58c40c1c88c95596430154a6250087ec76d150335144b2cb637ebaa443490b9af7b6e275e languageName: node linkType: hard @@ -6235,14 +4883,14 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.1.13, ieee754@npm:^1.1.4": +"ieee754@npm:^1.1.13, ieee754@npm:^1.1.4, ieee754@npm:^1.2.1": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e languageName: node linkType: hard -"ignore@npm:^5.2.0": +"ignore@npm:^5.2.0, ignore@npm:^5.2.4": version: 5.2.4 resolution: "ignore@npm:5.2.4" checksum: 3d4c309c6006e2621659311783eaea7ebcd41fe4ca1d78c91c473157ad6666a57a2df790fe0d07a12300d9aac2888204d7be8d59f9aaf665b1c7fcdb432517ef @@ -6256,7 +4904,7 @@ __metadata: languageName: node linkType: hard -"import-fresh@npm:^3.0.0, import-fresh@npm:^3.2.1": +"import-fresh@npm:^3.0.0, import-fresh@npm:^3.2.1, import-fresh@npm:^3.3.0": version: 3.3.0 resolution: "import-fresh@npm:3.3.0" dependencies: @@ -6266,18 +4914,6 @@ __metadata: languageName: node linkType: hard -"import-local@npm:^3.0.2": - version: 3.1.0 - resolution: "import-local@npm:3.1.0" - dependencies: - pkg-dir: ^4.2.0 - resolve-cwd: ^3.0.0 - bin: - import-local-fixture: fixtures/cli.js - checksum: bfcdb63b5e3c0e245e347f3107564035b128a414c4da1172a20dc67db2504e05ede4ac2eee1252359f78b0bfd7b19ef180aec427c2fce6493ae782d73a04cddd - languageName: node - linkType: hard - "imurmurhash@npm:^0.1.4": version: 0.1.4 resolution: "imurmurhash@npm:0.1.4" @@ -6292,13 +4928,6 @@ __metadata: languageName: node linkType: hard -"infer-owner@npm:^1.0.4": - version: 1.0.4 - resolution: "infer-owner@npm:1.0.4" - checksum: 181e732764e4a0611576466b4b87dac338972b839920b2a8cde43642e4ed6bd54dc1fb0b40874728f2a2df9a1b097b8ff83b56d5f8f8e3927f837fdcb47d8a89 - languageName: node - linkType: hard - "inflight@npm:^1.0.4": version: 1.0.6 resolution: "inflight@npm:1.0.6" @@ -6316,10 +4945,10 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2.0.1": - version: 2.0.1 - resolution: "inherits@npm:2.0.1" - checksum: 6536b9377296d4ce8ee89c5c543cb75030934e61af42dba98a428e7d026938c5985ea4d1e3b87743a5b834f40ed1187f89c2d7479e9d59e41d2d1051aefba07b +"inherits@npm:2.0.3": + version: 2.0.3 + resolution: "inherits@npm:2.0.3" + checksum: 78cb8d7d850d20a5e9a7f3620db31483aa00ad5f722ce03a55b110e5a723539b3716a3b463e2b96ce3fe286f33afc7c131fa2f91407528ba80cea98a7545d4c0 languageName: node linkType: hard @@ -6450,12 +5079,30 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.5.0, is-core-module@npm:^2.9.0": - version: 2.11.0 - resolution: "is-core-module@npm:2.11.0" +"is-core-module@npm:^2.13.0, is-core-module@npm:^2.5.0": + version: 2.13.1 + resolution: "is-core-module@npm:2.13.1" dependencies: - has: ^1.0.3 - checksum: f96fd490c6b48eb4f6d10ba815c6ef13f410b0ba6f7eb8577af51697de523e5f2cd9de1c441b51d27251bf0e4aebc936545e33a5d26d5d51f28d25698d4a8bab + hasown: ^2.0.0 + checksum: 256559ee8a9488af90e4bad16f5583c6d59e92f0742e9e8bb4331e758521ee86b810b93bae44f390766ffbc518a0488b18d9dab7da9a5ff997d499efc9403f7c + languageName: node + linkType: hard + +"is-docker@npm:^2.0.0": + version: 2.2.1 + resolution: "is-docker@npm:2.2.1" + bin: + is-docker: cli.js + checksum: 3fef7ddbf0be25958e8991ad941901bf5922ab2753c46980b60b05c1bf9c9c2402d35e6dc32e4380b980ef5e1970a5d9d5e5aa2e02d77727c3b6b5e918474c56 + languageName: node + linkType: hard + +"is-docker@npm:^3.0.0": + version: 3.0.0 + resolution: "is-docker@npm:3.0.0" + bin: + is-docker: cli.js + checksum: b698118f04feb7eaf3338922bd79cba064ea54a1c3db6ec8c0c8d8ee7613e7e5854d802d3ef646812a8a3ace81182a085dfa0a71cc68b06f3fa794b9783b3c90 languageName: node linkType: hard @@ -6489,13 +5136,6 @@ __metadata: languageName: node linkType: hard -"is-generator-fn@npm:^2.0.0": - version: 2.1.0 - resolution: "is-generator-fn@npm:2.1.0" - checksum: a6ad5492cf9d1746f73b6744e0c43c0020510b59d56ddcb78a91cbc173f09b5e6beff53d75c9c5a29feb618bfef2bf458e025ecf3a57ad2268e2fb2569f56215 - languageName: node - linkType: hard - "is-generator-function@npm:^1.0.7": version: 1.0.10 resolution: "is-generator-function@npm:1.0.10" @@ -6514,6 +5154,17 @@ __metadata: languageName: node linkType: hard +"is-inside-container@npm:^1.0.0": + version: 1.0.0 + resolution: "is-inside-container@npm:1.0.0" + dependencies: + is-docker: ^3.0.0 + bin: + is-inside-container: cli.js + checksum: c50b75a2ab66ab3e8b92b3bc534e1ea72ca25766832c0623ac22d134116a98bcf012197d1caabe1d1c4bd5f84363d4aa5c36bb4b585fbcaf57be172cd10a1a03 + languageName: node + linkType: hard + "is-interactive@npm:^1.0.0": version: 1.0.0 resolution: "is-interactive@npm:1.0.0" @@ -6531,605 +5182,179 @@ __metadata: "is-number@npm:^7.0.0": version: 7.0.0 resolution: "is-number@npm:7.0.0" - checksum: 456ac6f8e0f3111ed34668a624e45315201dff921e5ac181f8ec24923b99e9f32ca1a194912dc79d539c97d33dba17dc635202ff0b2cf98326f608323276d27a - languageName: node - linkType: hard - -"is-obj@npm:^2.0.0": - version: 2.0.0 - resolution: "is-obj@npm:2.0.0" - checksum: c9916ac8f4621962a42f5e80e7ffdb1d79a3fab7456ceaeea394cd9e0858d04f985a9ace45be44433bf605673c8be8810540fe4cc7f4266fc7526ced95af5a08 - languageName: node - linkType: hard - -"is-path-inside@npm:^3.0.3": - version: 3.0.3 - resolution: "is-path-inside@npm:3.0.3" - checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 - languageName: node - linkType: hard - -"is-plain-obj@npm:^1.1.0": - version: 1.1.0 - resolution: "is-plain-obj@npm:1.1.0" - checksum: 0ee04807797aad50859652a7467481816cbb57e5cc97d813a7dcd8915da8195dc68c436010bf39d195226cde6a2d352f4b815f16f26b7bf486a5754290629931 - languageName: node - linkType: hard - -"is-stream@npm:^2.0.0": - version: 2.0.1 - resolution: "is-stream@npm:2.0.1" - checksum: b8e05ccdf96ac330ea83c12450304d4a591f9958c11fd17bed240af8d5ffe08aedafa4c0f4cfccd4d28dc9d4d129daca1023633d5c11601a6cbc77521f6fae66 - languageName: node - linkType: hard - -"is-stream@npm:^3.0.0": - version: 3.0.0 - resolution: "is-stream@npm:3.0.0" - checksum: 172093fe99119ffd07611ab6d1bcccfe8bc4aa80d864b15f43e63e54b7abc71e779acd69afdb854c4e2a67fdc16ae710e370eda40088d1cfc956a50ed82d8f16 - languageName: node - linkType: hard - -"is-text-path@npm:^1.0.1": - version: 1.0.1 - resolution: "is-text-path@npm:1.0.1" - dependencies: - text-extensions: ^1.0.0 - checksum: fb5d78752c22b3f73a7c9540768f765ffcfa38c9e421e2b9af869565307fa1ae5e3d3a2ba016a43549742856846566d327da406e94a5846ec838a288b1704fd2 - languageName: node - linkType: hard - -"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.3": - version: 1.1.10 - resolution: "is-typed-array@npm:1.1.10" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - for-each: ^0.3.3 - gopd: ^1.0.1 - has-tostringtag: ^1.0.0 - checksum: aac6ecb59d4c56a1cdeb69b1f129154ef462bbffe434cb8a8235ca89b42f258b7ae94073c41b3cb7bce37f6a1733ad4499f07882d5d5093a7ba84dfc4ebb8017 - languageName: node - linkType: hard - -"is-unicode-supported@npm:^0.1.0": - version: 0.1.0 - resolution: "is-unicode-supported@npm:0.1.0" - checksum: a2aab86ee7712f5c2f999180daaba5f361bdad1efadc9610ff5b8ab5495b86e4f627839d085c6530363c6d6d4ecbde340fb8e54bdb83da4ba8e0865ed5513c52 - languageName: node - linkType: hard - -"is-utf8@npm:^0.2.1": - version: 0.2.1 - resolution: "is-utf8@npm:0.2.1" - checksum: 167ccd2be869fc228cc62c1a28df4b78c6b5485d15a29027d3b5dceb09b383e86a3522008b56dcac14b592b22f0a224388718c2505027a994fd8471465de54b3 - languageName: node - linkType: hard - -"is-windows@npm:^1.0.1": - version: 1.0.2 - resolution: "is-windows@npm:1.0.2" - checksum: 438b7e52656fe3b9b293b180defb4e448088e7023a523ec21a91a80b9ff8cdb3377ddb5b6e60f7c7de4fa8b63ab56e121b6705fe081b3cf1b828b0a380009ad7 - languageName: node - linkType: hard - -"is-wsl@npm:^1.1.0": - version: 1.1.0 - resolution: "is-wsl@npm:1.1.0" - checksum: ea157d232351e68c92bd62fc541771096942fe72f69dff452dd26dcc31466258c570a3b04b8cda2e01cd2968255b02951b8670d08ea4ed76d6b1a646061ac4fe - languageName: node - linkType: hard - -"isarray@npm:~1.0.0": - version: 1.0.0 - resolution: "isarray@npm:1.0.0" - checksum: f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab - languageName: node - linkType: hard - -"isexe@npm:^2.0.0": - version: 2.0.0 - resolution: "isexe@npm:2.0.0" - checksum: 26bf6c5480dda5161c820c5b5c751ae1e766c587b1f951ea3fcfc973bafb7831ae5b54a31a69bd670220e42e99ec154475025a468eae58ea262f813fdc8d1c62 - languageName: node - linkType: hard - -"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": - version: 3.2.0 - resolution: "istanbul-lib-coverage@npm:3.2.0" - checksum: a2a545033b9d56da04a8571ed05c8120bf10e9bce01cf8633a3a2b0d1d83dff4ac4fe78d6d5673c27fc29b7f21a41d75f83a36be09f82a61c367b56aa73c1ff9 - languageName: node - linkType: hard - -"istanbul-lib-instrument@npm:^5.0.4, istanbul-lib-instrument@npm:^5.1.0": - version: 5.2.1 - resolution: "istanbul-lib-instrument@npm:5.2.1" - dependencies: - "@babel/core": ^7.12.3 - "@babel/parser": ^7.14.7 - "@istanbuljs/schema": ^0.1.2 - istanbul-lib-coverage: ^3.2.0 - semver: ^6.3.0 - checksum: bf16f1803ba5e51b28bbd49ed955a736488381e09375d830e42ddeb403855b2006f850711d95ad726f2ba3f1ae8e7366de7e51d2b9ac67dc4d80191ef7ddf272 - languageName: node - linkType: hard - -"istanbul-lib-report@npm:^3.0.0": - version: 3.0.0 - resolution: "istanbul-lib-report@npm:3.0.0" - dependencies: - istanbul-lib-coverage: ^3.0.0 - make-dir: ^3.0.0 - supports-color: ^7.1.0 - checksum: 3f29eb3f53c59b987386e07fe772d24c7f58c6897f34c9d7a296f4000de7ae3de9eb95c3de3df91dc65b134c84dee35c54eee572a56243e8907c48064e34ff1b - languageName: node - linkType: hard - -"istanbul-lib-source-maps@npm:^4.0.0": - version: 4.0.1 - resolution: "istanbul-lib-source-maps@npm:4.0.1" - dependencies: - debug: ^4.1.1 - istanbul-lib-coverage: ^3.0.0 - source-map: ^0.6.1 - checksum: 21ad3df45db4b81852b662b8d4161f6446cd250c1ddc70ef96a585e2e85c26ed7cd9c2a396a71533cfb981d1a645508bc9618cae431e55d01a0628e7dec62ef2 - languageName: node - linkType: hard - -"istanbul-reports@npm:^3.1.3": - version: 3.1.5 - resolution: "istanbul-reports@npm:3.1.5" - dependencies: - html-escaper: ^2.0.0 - istanbul-lib-report: ^3.0.0 - checksum: 7867228f83ed39477b188ea07e7ccb9b4f5320b6f73d1db93a0981b7414fa4ef72d3f80c4692c442f90fc250d9406e71d8d7ab65bb615cb334e6292b73192b89 - languageName: node - linkType: hard - -"jest-changed-files@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-changed-files@npm:29.5.0" - dependencies: - execa: ^5.0.0 - p-limit: ^3.1.0 - checksum: a67a7cb3c11f8f92bd1b7c79e84f724cbd11a9ad51f3cdadafe3ce7ee3c79ee50dbea128f920f5fddc807e9e4e83f5462143094391feedd959a77dd20ab96cf3 - languageName: node - linkType: hard - -"jest-circus@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-circus@npm:29.6.1" - dependencies: - "@jest/environment": ^29.6.1 - "@jest/expect": ^29.6.1 - "@jest/test-result": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/node": "*" - chalk: ^4.0.0 - co: ^4.6.0 - dedent: ^0.7.0 - is-generator-fn: ^2.0.0 - jest-each: ^29.6.1 - jest-matcher-utils: ^29.6.1 - jest-message-util: ^29.6.1 - jest-runtime: ^29.6.1 - jest-snapshot: ^29.6.1 - jest-util: ^29.6.1 - p-limit: ^3.1.0 - pretty-format: ^29.6.1 - pure-rand: ^6.0.0 - slash: ^3.0.0 - stack-utils: ^2.0.3 - checksum: f3e39a74b601929448df92037f0599978d4d7a4b8f636f64e8020533d2d2b2f669d6729c80c6efed69341ca26753e5061e9787a0acd6c70af2127a94375ebb76 - languageName: node - linkType: hard - -"jest-cli@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-cli@npm:29.6.1" - dependencies: - "@jest/core": ^29.6.1 - "@jest/test-result": ^29.6.1 - "@jest/types": ^29.6.1 - chalk: ^4.0.0 - exit: ^0.1.2 - graceful-fs: ^4.2.9 - import-local: ^3.0.2 - jest-config: ^29.6.1 - jest-util: ^29.6.1 - jest-validate: ^29.6.1 - prompts: ^2.0.1 - yargs: ^17.3.1 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - bin: - jest: bin/jest.js - checksum: f5854ffea977b9a12520ea71f8d0cc8a626cbb93d7e1e6eea18a2a1f2b25f70f1b6b08a89f11b4dc7dd36a1776a9ac2cf8ec5c7998086f913ee690c06c07c949 - languageName: node - linkType: hard - -"jest-config@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-config@npm:29.6.1" - dependencies: - "@babel/core": ^7.11.6 - "@jest/test-sequencer": ^29.6.1 - "@jest/types": ^29.6.1 - babel-jest: ^29.6.1 - chalk: ^4.0.0 - ci-info: ^3.2.0 - deepmerge: ^4.2.2 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - jest-circus: ^29.6.1 - jest-environment-node: ^29.6.1 - jest-get-type: ^29.4.3 - jest-regex-util: ^29.4.3 - jest-resolve: ^29.6.1 - jest-runner: ^29.6.1 - jest-util: ^29.6.1 - jest-validate: ^29.6.1 - micromatch: ^4.0.4 - parse-json: ^5.2.0 - pretty-format: ^29.6.1 - slash: ^3.0.0 - strip-json-comments: ^3.1.1 - peerDependencies: - "@types/node": "*" - ts-node: ">=9.0.0" - peerDependenciesMeta: - "@types/node": - optional: true - ts-node: - optional: true - checksum: 3a30afeb28cc5658ef9cd95f2551ab8a29641bb6d377eb239cba8e7522eb4611c9a98cdcf173d87f5ad7b5e1ad242c3cd5434a260107bd3c7e8305d05023e05c - languageName: node - linkType: hard - -"jest-diff@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-diff@npm:29.6.1" - dependencies: - chalk: ^4.0.0 - diff-sequences: ^29.4.3 - jest-get-type: ^29.4.3 - pretty-format: ^29.6.1 - checksum: c6350178ca27d92c7fd879790fb2525470c1ff1c5d29b1834a240fecd26c6904fb470ebddb98dc96dd85389c56c3b50e6965a1f5203e9236d213886ed9806219 + checksum: 456ac6f8e0f3111ed34668a624e45315201dff921e5ac181f8ec24923b99e9f32ca1a194912dc79d539c97d33dba17dc635202ff0b2cf98326f608323276d27a languageName: node linkType: hard -"jest-docblock@npm:^29.4.3": - version: 29.4.3 - resolution: "jest-docblock@npm:29.4.3" - dependencies: - detect-newline: ^3.0.0 - checksum: e0e9df1485bb8926e5b33478cdf84b3387d9caf3658e7dc1eaa6dc34cb93dea0d2d74797f6e940f0233a88f3dadd60957f2288eb8f95506361f85b84bf8661df +"is-obj@npm:^2.0.0": + version: 2.0.0 + resolution: "is-obj@npm:2.0.0" + checksum: c9916ac8f4621962a42f5e80e7ffdb1d79a3fab7456ceaeea394cd9e0858d04f985a9ace45be44433bf605673c8be8810540fe4cc7f4266fc7526ced95af5a08 languageName: node linkType: hard -"jest-each@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-each@npm:29.6.1" - dependencies: - "@jest/types": ^29.6.1 - chalk: ^4.0.0 - jest-get-type: ^29.4.3 - jest-util: ^29.6.1 - pretty-format: ^29.6.1 - checksum: 9d2ea7ed5326ee8c22523b22c66c85fe73754ea39f9b389881956508ee441392c61072a5fbf673e39beddd31d011bb94acae3edc77053ba4f9aa5c060114a5c8 +"is-path-inside@npm:^3.0.3": + version: 3.0.3 + resolution: "is-path-inside@npm:3.0.3" + checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 languageName: node linkType: hard -"jest-environment-node@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-environment-node@npm:29.6.1" - dependencies: - "@jest/environment": ^29.6.1 - "@jest/fake-timers": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/node": "*" - jest-mock: ^29.6.1 - jest-util: ^29.6.1 - checksum: a50287e1ff29d131646bd09acc3222ac6ea0ad61e86bf73851d318ef2be0633a421b8558c4a15ddc67e0ffcfc32da7f6a0d8a2ddbfa85453837899dec88d256c +"is-plain-obj@npm:^1.1.0": + version: 1.1.0 + resolution: "is-plain-obj@npm:1.1.0" + checksum: 0ee04807797aad50859652a7467481816cbb57e5cc97d813a7dcd8915da8195dc68c436010bf39d195226cde6a2d352f4b815f16f26b7bf486a5754290629931 languageName: node linkType: hard -"jest-get-type@npm:^29.4.3": - version: 29.4.3 - resolution: "jest-get-type@npm:29.4.3" - checksum: 6ac7f2dde1c65e292e4355b6c63b3a4897d7e92cb4c8afcf6d397f2682f8080e094c8b0b68205a74d269882ec06bf696a9de6cd3e1b7333531e5ed7b112605ce +"is-stream@npm:^2.0.0": + version: 2.0.1 + resolution: "is-stream@npm:2.0.1" + checksum: b8e05ccdf96ac330ea83c12450304d4a591f9958c11fd17bed240af8d5ffe08aedafa4c0f4cfccd4d28dc9d4d129daca1023633d5c11601a6cbc77521f6fae66 languageName: node linkType: hard -"jest-haste-map@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-haste-map@npm:29.6.1" - dependencies: - "@jest/types": ^29.6.1 - "@types/graceful-fs": ^4.1.3 - "@types/node": "*" - anymatch: ^3.0.3 - fb-watchman: ^2.0.0 - fsevents: ^2.3.2 - graceful-fs: ^4.2.9 - jest-regex-util: ^29.4.3 - jest-util: ^29.6.1 - jest-worker: ^29.6.1 - micromatch: ^4.0.4 - walker: ^1.0.8 - dependenciesMeta: - fsevents: - optional: true - checksum: 7c74d5a0f6aafa9f4e60fae7949d4774770c0243fb529c24f2f4c81229db479fa318dc8b81e8d226865aef1d600af10bd8404dd208e802318434b46f75d5d869 +"is-stream@npm:^3.0.0": + version: 3.0.0 + resolution: "is-stream@npm:3.0.0" + checksum: 172093fe99119ffd07611ab6d1bcccfe8bc4aa80d864b15f43e63e54b7abc71e779acd69afdb854c4e2a67fdc16ae710e370eda40088d1cfc956a50ed82d8f16 languageName: node linkType: hard -"jest-leak-detector@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-leak-detector@npm:29.6.1" +"is-text-path@npm:^2.0.0": + version: 2.0.0 + resolution: "is-text-path@npm:2.0.0" dependencies: - jest-get-type: ^29.4.3 - pretty-format: ^29.6.1 - checksum: 5122d40c248effaede4c9ee3a99046a3f30088fef7bfc4af534678b432455161399357af46deb6423de7e05c6597920d6ee8cd570e26048886a90d541334f8c8 + text-extensions: ^2.0.0 + checksum: 3a8725fc7c0d4c7741a97993bc2fecc09a0963660394d3ee76145274366c98ad57c6791d20d4ef829835f573b1137265051c05ecd65fbe72f69bb9ab9e3babbd languageName: node linkType: hard -"jest-matcher-utils@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-matcher-utils@npm:29.6.1" +"is-typed-array@npm:^1.1.3": + version: 1.1.12 + resolution: "is-typed-array@npm:1.1.12" dependencies: - chalk: ^4.0.0 - jest-diff: ^29.6.1 - jest-get-type: ^29.4.3 - pretty-format: ^29.6.1 - checksum: d2efa6aed6e4820758b732b9fefd315c7fa4508ee690da656e1c5ac4c1a0f4cee5b04c9719ee1fda9aeb883b4209186c145089ced521e715b9fa70afdfa4a9c6 + which-typed-array: ^1.1.11 + checksum: 4c89c4a3be07186caddadf92197b17fda663a9d259ea0d44a85f171558270d36059d1c386d34a12cba22dfade5aba497ce22778e866adc9406098c8fc4771796 languageName: node linkType: hard -"jest-message-util@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-message-util@npm:29.6.1" - dependencies: - "@babel/code-frame": ^7.12.13 - "@jest/types": ^29.6.1 - "@types/stack-utils": ^2.0.0 - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - micromatch: ^4.0.4 - pretty-format: ^29.6.1 - slash: ^3.0.0 - stack-utils: ^2.0.3 - checksum: 3e7cb2ff087fe72255292e151d24e4fbb4cd6134885c0a67a4b302f233fe4110bf7580b176f427f05ad7550eb878ed94237209785d09d659a7d171ffa59c068f +"is-unicode-supported@npm:^0.1.0": + version: 0.1.0 + resolution: "is-unicode-supported@npm:0.1.0" + checksum: a2aab86ee7712f5c2f999180daaba5f361bdad1efadc9610ff5b8ab5495b86e4f627839d085c6530363c6d6d4ecbde340fb8e54bdb83da4ba8e0865ed5513c52 languageName: node linkType: hard -"jest-mock-random@npm:^1.1.1": - version: 1.1.1 - resolution: "jest-mock-random@npm:1.1.1" - checksum: f2c68cce558bda4d94de32aa312201c2ce1daaa7c4a7452012bfe1307467deefe0f1b1e55a8f81dad8d3c488a779b0b20ef7af29b588c7f5eb6794e45a845f59 +"is-utf8@npm:^0.2.1": + version: 0.2.1 + resolution: "is-utf8@npm:0.2.1" + checksum: 167ccd2be869fc228cc62c1a28df4b78c6b5485d15a29027d3b5dceb09b383e86a3522008b56dcac14b592b22f0a224388718c2505027a994fd8471465de54b3 languageName: node linkType: hard -"jest-mock@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-mock@npm:29.6.1" - dependencies: - "@jest/types": ^29.6.1 - "@types/node": "*" - jest-util: ^29.6.1 - checksum: 5e902f1a7eba1eb1a64eb6c19947fe1316834359d9869d0e2644d8979b9cad0465885dc4c9909c471888cddeea835c938cec6263d386d3d1aad720fc74e52ea1 +"is-windows@npm:^1.0.1": + version: 1.0.2 + resolution: "is-windows@npm:1.0.2" + checksum: 438b7e52656fe3b9b293b180defb4e448088e7023a523ec21a91a80b9ff8cdb3377ddb5b6e60f7c7de4fa8b63ab56e121b6705fe081b3cf1b828b0a380009ad7 languageName: node linkType: hard -"jest-pnp-resolver@npm:^1.2.2": - version: 1.2.3 - resolution: "jest-pnp-resolver@npm:1.2.3" - peerDependencies: - jest-resolve: "*" - peerDependenciesMeta: - jest-resolve: - optional: true - checksum: db1a8ab2cb97ca19c01b1cfa9a9c8c69a143fde833c14df1fab0766f411b1148ff0df878adea09007ac6a2085ec116ba9a996a6ad104b1e58c20adbf88eed9b2 +"is-wsl@npm:^1.1.0": + version: 1.1.0 + resolution: "is-wsl@npm:1.1.0" + checksum: ea157d232351e68c92bd62fc541771096942fe72f69dff452dd26dcc31466258c570a3b04b8cda2e01cd2968255b02951b8670d08ea4ed76d6b1a646061ac4fe languageName: node linkType: hard -"jest-regex-util@npm:^29.4.3": - version: 29.4.3 - resolution: "jest-regex-util@npm:29.4.3" - checksum: 96fc7fc28cd4dd73a63c13a526202c4bd8b351d4e5b68b1a2a2c88da3308c2a16e26feaa593083eb0bac38cca1aa9dd05025412e7de013ba963fb8e66af22b8a +"is-wsl@npm:^2.2.0": + version: 2.2.0 + resolution: "is-wsl@npm:2.2.0" + dependencies: + is-docker: ^2.0.0 + checksum: 20849846ae414997d290b75e16868e5261e86ff5047f104027026fd61d8b5a9b0b3ade16239f35e1a067b3c7cc02f70183cb661010ed16f4b6c7c93dad1b19d8 languageName: node linkType: hard -"jest-resolve-dependencies@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-resolve-dependencies@npm:29.6.1" - dependencies: - jest-regex-util: ^29.4.3 - jest-snapshot: ^29.6.1 - checksum: cee0a0fe53fd4531492a526b6ccd32377baad1eff6e6c124f04e9dc920219fd23fd39be88bb9551ee68d5fe92a3af627b423c9bc65a2aa0ac8a223c0e74dbbbb +"isarray@npm:~1.0.0": + version: 1.0.0 + resolution: "isarray@npm:1.0.0" + checksum: f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab languageName: node linkType: hard -"jest-resolve@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-resolve@npm:29.6.1" - dependencies: - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.6.1 - jest-pnp-resolver: ^1.2.2 - jest-util: ^29.6.1 - jest-validate: ^29.6.1 - resolve: ^1.20.0 - resolve.exports: ^2.0.0 - slash: ^3.0.0 - checksum: 9ce979a0f4a751bea58caea76415112df2a3f4d58e294019872244728aadd001f0ec20c873a3c805dd8f7c762143b3c14d00f87d124ed87c9981fbf8723090ef +"isexe@npm:^2.0.0": + version: 2.0.0 + resolution: "isexe@npm:2.0.0" + checksum: 26bf6c5480dda5161c820c5b5c751ae1e766c587b1f951ea3fcfc973bafb7831ae5b54a31a69bd670220e42e99ec154475025a468eae58ea262f813fdc8d1c62 languageName: node linkType: hard -"jest-runner@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-runner@npm:29.6.1" - dependencies: - "@jest/console": ^29.6.1 - "@jest/environment": ^29.6.1 - "@jest/test-result": ^29.6.1 - "@jest/transform": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/node": "*" - chalk: ^4.0.0 - emittery: ^0.13.1 - graceful-fs: ^4.2.9 - jest-docblock: ^29.4.3 - jest-environment-node: ^29.6.1 - jest-haste-map: ^29.6.1 - jest-leak-detector: ^29.6.1 - jest-message-util: ^29.6.1 - jest-resolve: ^29.6.1 - jest-runtime: ^29.6.1 - jest-util: ^29.6.1 - jest-watcher: ^29.6.1 - jest-worker: ^29.6.1 - p-limit: ^3.1.0 - source-map-support: 0.5.13 - checksum: 0e4dbda26669ae31fee32f8a62b3119bba510f2d17a098d6157b48a73ed2fc9842405bf893f3045c12b3632c7c0e3399fb22684b18ab5566aff4905b26c79a9a - languageName: node - linkType: hard - -"jest-runtime@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-runtime@npm:29.6.1" - dependencies: - "@jest/environment": ^29.6.1 - "@jest/fake-timers": ^29.6.1 - "@jest/globals": ^29.6.1 - "@jest/source-map": ^29.6.0 - "@jest/test-result": ^29.6.1 - "@jest/transform": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/node": "*" - chalk: ^4.0.0 - cjs-module-lexer: ^1.0.0 - collect-v8-coverage: ^1.0.0 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.6.1 - jest-message-util: ^29.6.1 - jest-mock: ^29.6.1 - jest-regex-util: ^29.4.3 - jest-resolve: ^29.6.1 - jest-snapshot: ^29.6.1 - jest-util: ^29.6.1 - slash: ^3.0.0 - strip-bom: ^4.0.0 - checksum: 7c360c9694467d996f3d6d914fefa0e7bda554adda8c2b9fba31546dba663d71a64eda103ff68120a2422f3c16db8f0bc2c445923fe8fb934f37e53ef74fb429 +"isexe@npm:^3.1.1": + version: 3.1.1 + resolution: "isexe@npm:3.1.1" + checksum: 7fe1931ee4e88eb5aa524cd3ceb8c882537bc3a81b02e438b240e47012eef49c86904d0f0e593ea7c3a9996d18d0f1f3be8d3eaa92333977b0c3a9d353d5563e languageName: node linkType: hard -"jest-snapshot@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-snapshot@npm:29.6.1" - dependencies: - "@babel/core": ^7.11.6 - "@babel/generator": ^7.7.2 - "@babel/plugin-syntax-jsx": ^7.7.2 - "@babel/plugin-syntax-typescript": ^7.7.2 - "@babel/types": ^7.3.3 - "@jest/expect-utils": ^29.6.1 - "@jest/transform": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/prettier": ^2.1.5 - babel-preset-current-node-syntax: ^1.0.0 - chalk: ^4.0.0 - expect: ^29.6.1 - graceful-fs: ^4.2.9 - jest-diff: ^29.6.1 - jest-get-type: ^29.4.3 - jest-matcher-utils: ^29.6.1 - jest-message-util: ^29.6.1 - jest-util: ^29.6.1 - natural-compare: ^1.4.0 - pretty-format: ^29.6.1 - semver: ^7.5.3 - checksum: e8f69d1fd4a29d354d4dca9eb2a22674b300f8ef509e4f1e75337c880414a00d2bdc9d3849a6855dbb5a76bfbe74603f33435378a3877e69f0838e4cc2244350 +"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": + version: 3.2.2 + resolution: "istanbul-lib-coverage@npm:3.2.2" + checksum: 2367407a8d13982d8f7a859a35e7f8dd5d8f75aae4bb5484ede3a9ea1b426dc245aff28b976a2af48ee759fdd9be374ce2bd2669b644f31e76c5f46a2e29a831 languageName: node linkType: hard -"jest-util@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-util@npm:29.6.1" +"istanbul-lib-report@npm:^3.0.0, istanbul-lib-report@npm:^3.0.1": + version: 3.0.1 + resolution: "istanbul-lib-report@npm:3.0.1" dependencies: - "@jest/types": ^29.6.1 - "@types/node": "*" - chalk: ^4.0.0 - ci-info: ^3.2.0 - graceful-fs: ^4.2.9 - picomatch: ^2.2.3 - checksum: fc553556c1350c443449cadaba5fb9d604628e8b5ceb6ceaf4e7e08975b24277d0a14bf2e0f956024e03c23e556fcb074659423422a06fbedf2ab52978697ac7 + istanbul-lib-coverage: ^3.0.0 + make-dir: ^4.0.0 + supports-color: ^7.1.0 + checksum: fd17a1b879e7faf9bb1dc8f80b2a16e9f5b7b8498fe6ed580a618c34df0bfe53d2abd35bf8a0a00e628fb7405462576427c7df20bbe4148d19c14b431c974b21 languageName: node linkType: hard -"jest-validate@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-validate@npm:29.6.1" +"istanbul-lib-source-maps@npm:^4.0.1": + version: 4.0.1 + resolution: "istanbul-lib-source-maps@npm:4.0.1" dependencies: - "@jest/types": ^29.6.1 - camelcase: ^6.2.0 - chalk: ^4.0.0 - jest-get-type: ^29.4.3 - leven: ^3.1.0 - pretty-format: ^29.6.1 - checksum: d2491f3f33d9bbc2dcaaa6acbff26f257b59c5eeceb65a52a9c1cec2f679b836ec2a4658b7004c0ef9d90cd0d9bd664e41d5ed6900f932bea742dd8e6b85e7f1 + debug: ^4.1.1 + istanbul-lib-coverage: ^3.0.0 + source-map: ^0.6.1 + checksum: 21ad3df45db4b81852b662b8d4161f6446cd250c1ddc70ef96a585e2e85c26ed7cd9c2a396a71533cfb981d1a645508bc9618cae431e55d01a0628e7dec62ef2 languageName: node linkType: hard -"jest-watcher@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-watcher@npm:29.6.1" +"istanbul-reports@npm:^3.1.5": + version: 3.1.6 + resolution: "istanbul-reports@npm:3.1.6" dependencies: - "@jest/test-result": ^29.6.1 - "@jest/types": ^29.6.1 - "@types/node": "*" - ansi-escapes: ^4.2.1 - chalk: ^4.0.0 - emittery: ^0.13.1 - jest-util: ^29.6.1 - string-length: ^4.0.1 - checksum: 69bd5a602284fdce6eba5486c5c57aca6b511d91cb0907c34c104d6dd931e18ce67baa7f8e280fa473e5d81ea3e7b9e7d94f712c37ab0b3b8cc2aec30676955d + html-escaper: ^2.0.0 + istanbul-lib-report: ^3.0.0 + checksum: 44c4c0582f287f02341e9720997f9e82c071627e1e862895745d5f52ec72c9b9f38e1d12370015d2a71dcead794f34c7732aaef3fab80a24bc617a21c3d911d6 languageName: node linkType: hard -"jest-worker@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-worker@npm:29.6.1" +"jackspeak@npm:^2.3.5": + version: 2.3.6 + resolution: "jackspeak@npm:2.3.6" dependencies: - "@types/node": "*" - jest-util: ^29.6.1 - merge-stream: ^2.0.0 - supports-color: ^8.0.0 - checksum: 0af309ea4db17c4c47e84a9246f907960a15577683c005fdeafc8f3c06bc455136f95a6f28fa2a3e924b767eb4dacd9b40915a7707305f88586f099af3ac27a8 + "@isaacs/cliui": ^8.0.2 + "@pkgjs/parseargs": ^0.11.0 + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 57d43ad11eadc98cdfe7496612f6bbb5255ea69fe51ea431162db302c2a11011642f50cfad57288bd0aea78384a0612b16e131944ad8ecd09d619041c8531b54 languageName: node linkType: hard -"jest@npm:^29.6.1": - version: 29.6.1 - resolution: "jest@npm:29.6.1" - dependencies: - "@jest/core": ^29.6.1 - "@jest/types": ^29.6.1 - import-local: ^3.0.2 - jest-cli: ^29.6.1 - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true +"jiti@npm:^1.19.1": + version: 1.21.0 + resolution: "jiti@npm:1.21.0" bin: - jest: bin/jest.js - checksum: 7b8c0ca72f483e00ec19dcf9549f9a9af8ae468ab62925b148d714b58eb52d5fea9a082625193bc833d2d9b64cf65a11f3d37857636c5551af05c10aec4ce71b + jiti: bin/jiti.js + checksum: a7bd5d63921c170eaec91eecd686388181c7828e1fa0657ab374b9372bfc1f383cf4b039e6b272383d5cb25607509880af814a39abdff967322459cca41f2961 languageName: node linkType: hard @@ -7140,18 +5365,6 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:^3.13.1, js-yaml@npm:^3.14.0": - version: 3.14.1 - resolution: "js-yaml@npm:3.14.1" - dependencies: - argparse: ^1.0.7 - esprima: ^4.0.0 - bin: - js-yaml: bin/js-yaml.js - checksum: bef146085f472d44dee30ec34e5cf36bf89164f5d585435a3d3da89e52622dff0b188a580e4ad091c3341889e14cb88cac6e4deb16dc5b1e9623bb0601fc255c - languageName: node - linkType: hard - "js-yaml@npm:^4.1.0": version: 4.1.0 resolution: "js-yaml@npm:4.1.0" @@ -7163,21 +5376,10 @@ __metadata: languageName: node linkType: hard -"jsesc@npm:^2.5.1": - version: 2.5.2 - resolution: "jsesc@npm:2.5.2" - bin: - jsesc: bin/jsesc - checksum: 4dc190771129e12023f729ce20e1e0bfceac84d73a85bc3119f7f938843fe25a4aeccb54b6494dce26fcf263d815f5f31acdefac7cc9329efb8422a4f4d9fa9d - languageName: node - linkType: hard - -"jsesc@npm:~0.5.0": - version: 0.5.0 - resolution: "jsesc@npm:0.5.0" - bin: - jsesc: bin/jsesc - checksum: b8b44cbfc92f198ad972fba706ee6a1dfa7485321ee8c0b25f5cedd538dcb20cde3197de16a7265430fce8277a12db066219369e3d51055038946039f6e20e17 +"json-buffer@npm:3.0.1": + version: 3.0.1 + resolution: "json-buffer@npm:3.0.1" + checksum: 9026b03edc2847eefa2e37646c579300a1f3a4586cfb62bf857832b60c852042d0d6ae55d1afb8926163fa54c2b01d83ae24705f34990348bdac6273a29d4581 languageName: node linkType: hard @@ -7209,19 +5411,10 @@ __metadata: languageName: node linkType: hard -"json-stringify-safe@npm:^5.0.1": - version: 5.0.1 - resolution: "json-stringify-safe@npm:5.0.1" - checksum: 48ec0adad5280b8a96bb93f4563aa1667fd7a36334f79149abd42446d0989f2ddc58274b479f4819f1f00617957e6344c886c55d05a4e15ebb4ab931e4a6a8ee - languageName: node - linkType: hard - -"json5@npm:^2.2.2": - version: 2.2.3 - resolution: "json5@npm:2.2.3" - bin: - json5: lib/cli.js - checksum: 2a7436a93393830bce797d4626275152e37e877b265e94ca69c99e3d20c2b9dab021279146a39cdb700e71b2dd32a4cebd1514cd57cee102b1af906ce5040349 +"jsonc-parser@npm:^3.2.0": + version: 3.2.0 + resolution: "jsonc-parser@npm:3.2.0" + checksum: 946dd9a5f326b745aa326d48a7257e3f4a4b62c5e98ec8e49fa2bdd8d96cef7e6febf1399f5c7016114fd1f68a1c62c6138826d5d90bc650448e3cf0951c53c7 languageName: node linkType: hard @@ -7258,6 +5451,15 @@ __metadata: languageName: node linkType: hard +"keyv@npm:^4.5.3": + version: 4.5.4 + resolution: "keyv@npm:4.5.4" + dependencies: + json-buffer: 3.0.1 + checksum: 74a24395b1c34bd44ad5cb2b49140d087553e170625240b86755a6604cd65aa16efdbdeae5cdb17ba1284a0fbb25ad06263755dbc71b8d8b06f74232ce3cdd72 + languageName: node + linkType: hard + "kind-of@npm:^6.0.3": version: 6.0.3 resolution: "kind-of@npm:6.0.3" @@ -7265,13 +5467,6 @@ __metadata: languageName: node linkType: hard -"kleur@npm:^3.0.3": - version: 3.0.3 - resolution: "kleur@npm:3.0.3" - checksum: df82cd1e172f957bae9c536286265a5cdbd5eeca487cb0a3b2a7b41ef959fc61f8e7c0e9aeea9c114ccf2c166b6a8dd45a46fd619c1c569d210ecd2765ad5169 - languageName: node - linkType: hard - "labeled-stream-splicer@npm:^2.0.0": version: 2.0.2 resolution: "labeled-stream-splicer@npm:2.0.2" @@ -7282,13 +5477,6 @@ __metadata: languageName: node linkType: hard -"leven@npm:^3.1.0": - version: 3.1.0 - resolution: "leven@npm:3.1.0" - checksum: 638401d534585261b6003db9d99afd244dfe82d75ddb6db5c0df412842d5ab30b2ef18de471aaec70fe69a46f17b4ae3c7f01d8a4e6580ef7adb9f4273ad1e55 - languageName: node - linkType: hard - "levn@npm:^0.4.1": version: 0.4.1 resolution: "levn@npm:0.4.1" @@ -7299,13 +5487,6 @@ __metadata: languageName: node linkType: hard -"lexure@npm:^0.17.0": - version: 0.17.0 - resolution: "lexure@npm:0.17.0" - checksum: 95797b0ada9452bcdfdd30997572ab1673de1b2583a5af2fa309aa3587ec3b95ba361880b333ed446a6b0f07764b6d8d2cf1d72083c61fa9f96c06181f194453 - languageName: node - linkType: hard - "lie@npm:3.1.1": version: 3.1.1 resolution: "lie@npm:3.1.1" @@ -7329,47 +5510,44 @@ __metadata: languageName: node linkType: hard -"lint-staged@npm:^13.2.3": - version: 13.2.3 - resolution: "lint-staged@npm:13.2.3" +"lint-staged@npm:^15.0.2": + version: 15.0.2 + resolution: "lint-staged@npm:15.0.2" dependencies: - chalk: 5.2.0 - cli-truncate: ^3.1.0 - commander: ^10.0.0 - debug: ^4.3.4 - execa: ^7.0.0 + chalk: 5.3.0 + commander: 11.1.0 + debug: 4.3.4 + execa: 8.0.1 lilconfig: 2.1.0 - listr2: ^5.0.7 - micromatch: ^4.0.5 - normalize-path: ^3.0.0 - object-inspect: ^1.12.3 - pidtree: ^0.6.0 - string-argv: ^0.3.1 - yaml: ^2.2.2 + listr2: 7.0.2 + micromatch: 4.0.5 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.3.3 bin: lint-staged: bin/lint-staged.js - checksum: ff51a1e33072f488b28b938ed47323816a1ff278ef6d0e5cbe1704b292773a6c8ce945b504eae3a9b5702917a979523a741f17023e16077bd5fa35be687cc067 + checksum: 437bc006a103eda779584b0beccef03732d1e79fe3c5d66004fee0ba641b2defe81ed8f7b4909fd1b4c59a7b7e2587d811dcc3a2e171f95573976af4294da9fc languageName: node linkType: hard -"listr2@npm:^5.0.7": - version: 5.0.8 - resolution: "listr2@npm:5.0.8" +"listr2@npm:7.0.2": + version: 7.0.2 + resolution: "listr2@npm:7.0.2" dependencies: - cli-truncate: ^2.1.0 - colorette: ^2.0.19 - log-update: ^4.0.0 - p-map: ^4.0.0 + cli-truncate: ^3.1.0 + colorette: ^2.0.20 + eventemitter3: ^5.0.1 + log-update: ^5.0.1 rfdc: ^1.3.0 - rxjs: ^7.8.0 - through: ^2.3.8 - wrap-ansi: ^7.0.0 - peerDependencies: - enquirer: ">= 2.3.0 < 3" - peerDependenciesMeta: - enquirer: - optional: true - checksum: 8be9f5632627c4df0dc33f452c98d415a49e5f1614650d3cab1b103c33e95f2a7a0e9f3e1e5de00d51bf0b4179acd8ff11b25be77dbe097cf3773c05e728d46c + wrap-ansi: ^8.1.0 + checksum: 1734c6b9367ceeb09bf372427930a4586b3727097373408f2f840896b9333cc80e53a1a696771a83a7d4d9ada46229843f3052b87f3b0b58c20e9451362c2dd3 + languageName: node + linkType: hard + +"local-pkg@npm:^0.4.3": + version: 0.4.3 + resolution: "local-pkg@npm:0.4.3" + checksum: 7825aca531dd6afa3a3712a0208697aa4a5cd009065f32e3fb732aafcc42ed11f277b5ac67229222e96f4def55197171cdf3d5522d0381b489d2e5547b407d55 languageName: node linkType: hard @@ -7407,13 +5585,6 @@ __metadata: languageName: node linkType: hard -"lodash.debounce@npm:^4.0.8": - version: 4.0.8 - resolution: "lodash.debounce@npm:4.0.8" - checksum: a3f527d22c548f43ae31c861ada88b2637eb48ac6aa3eb56e82d44917971b8aa96fbb37aa60efea674dc4ee8c42074f90f7b1f772e9db375435f6c83a19b3bc6 - languageName: node - linkType: hard - "lodash.isfunction@npm:^3.0.9": version: 3.0.9 resolution: "lodash.isfunction@npm:3.0.9" @@ -7508,15 +5679,16 @@ __metadata: languageName: node linkType: hard -"log-update@npm:^4.0.0": - version: 4.0.0 - resolution: "log-update@npm:4.0.0" +"log-update@npm:^5.0.1": + version: 5.0.1 + resolution: "log-update@npm:5.0.1" dependencies: - ansi-escapes: ^4.3.0 - cli-cursor: ^3.1.0 - slice-ansi: ^4.0.0 - wrap-ansi: ^6.2.0 - checksum: ae2f85bbabc1906034154fb7d4c4477c79b3e703d22d78adee8b3862fa913942772e7fa11713e3d96fb46de4e3cabefbf5d0a544344f03b58d3c4bff52aa9eb2 + ansi-escapes: ^5.0.0 + cli-cursor: ^4.0.0 + slice-ansi: ^5.0.0 + strip-ansi: ^7.0.1 + wrap-ansi: ^8.0.1 + checksum: 2c6b47dcce6f9233df6d232a37d9834cb3657a0749ef6398f1706118de74c55f158587d4128c225297ea66803f35c5ac3db4f3f617046d817233c45eedc32ef1 languageName: node linkType: hard @@ -7527,6 +5699,15 @@ __metadata: languageName: node linkType: hard +"loupe@npm:^2.3.6": + version: 2.3.7 + resolution: "loupe@npm:2.3.7" + dependencies: + get-func-name: ^2.0.1 + checksum: 96c058ec7167598e238bb7fb9def2f9339215e97d6685d9c1e3e4bdb33d14600e11fe7a812cf0c003dfb73ca2df374f146280b2287cae9e8d989e9d7a69a203b + languageName: node + linkType: hard + "lower-case@npm:^1.1.1": version: 1.1.4 resolution: "lower-case@npm:1.1.4" @@ -7534,12 +5715,10 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^5.1.1": - version: 5.1.1 - resolution: "lru-cache@npm:5.1.1" - dependencies: - yallist: ^3.0.2 - checksum: c154ae1cbb0c2206d1501a0e94df349653c92c8cbb25236d7e85190bcaf4567a03ac6eb43166fabfa36fd35623694da7233e88d9601fbf411a9a481d85dbd2cb +"lru-cache@npm:^10.0.1, lru-cache@npm:^9.1.1 || ^10.0.0": + version: 10.0.1 + resolution: "lru-cache@npm:10.0.1" + checksum: 06f8d0e1ceabd76bb6f644a26dbb0b4c471b79c7b514c13c6856113879b3bf369eb7b497dad4ff2b7e2636db202412394865b33c332100876d838ad1372f0181 languageName: node linkType: hard @@ -7552,17 +5731,10 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^7.7.1": - version: 7.17.0 - resolution: "lru-cache@npm:7.17.0" - checksum: 28c2a98ad313b8d61beac1f08257b6f0ca990e39d24a9bc831030b6e209447cfb11c6d9d1a774282189bfc9609d1dfd17ebe485228dd68f7b96b6b9b7740894e - languageName: node - linkType: hard - -"lru_map@npm:^0.3.3": - version: 0.3.3 - resolution: "lru_map@npm:0.3.3" - checksum: ca9dd43c65ed7a4f117c548028101c5b6855e10923ea9d1f635af53ad20c5868ff428c364d454a7b57fe391b89c704982275410c3c5099cca5aeee00d76e169a +"magic-bytes.js@npm:^1.0.15": + version: 1.5.0 + resolution: "magic-bytes.js@npm:1.5.0" + checksum: 058c58344b2030f1e76c6209110a0f3056179237ebb501c314793cdeb449fb588f081b4569a2784d3264ee0fc56b0b9dc3c9d9c46eb2c629e3866f03a6f18846 languageName: node linkType: hard @@ -7575,7 +5747,16 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:^3.0.0, make-dir@npm:^3.1.0": +"magic-string@npm:^0.30.1": + version: 0.30.5 + resolution: "magic-string@npm:0.30.5" + dependencies: + "@jridgewell/sourcemap-codec": ^1.4.15 + checksum: da10fecff0c0a7d3faf756913ce62bd6d5e7b0402be48c3b27bfd651b90e29677e279069a63b764bcdc1b8ecdcdb898f29a5c5ec510f2323e8d62ee057a6eb18 + languageName: node + linkType: hard + +"make-dir@npm:^3.1.0": version: 3.1.0 resolution: "make-dir@npm:3.1.0" dependencies: @@ -7584,6 +5765,15 @@ __metadata: languageName: node linkType: hard +"make-dir@npm:^4.0.0": + version: 4.0.0 + resolution: "make-dir@npm:4.0.0" + dependencies: + semver: ^7.5.3 + checksum: bf0731a2dd3aab4db6f3de1585cea0b746bb73eb5a02e3d8d72757e376e64e6ada190b1eddcde5b2f24a81b688a9897efd5018737d05e02e2a671dda9cff8a8a + languageName: node + linkType: hard + "make-error@npm:^1.1.1": version: 1.3.6 resolution: "make-error@npm:1.3.6" @@ -7591,36 +5781,22 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^10.0.3": - version: 10.2.1 - resolution: "make-fetch-happen@npm:10.2.1" +"make-fetch-happen@npm:^13.0.0": + version: 13.0.0 + resolution: "make-fetch-happen@npm:13.0.0" dependencies: - agentkeepalive: ^4.2.1 - cacache: ^16.1.0 - http-cache-semantics: ^4.1.0 - http-proxy-agent: ^5.0.0 - https-proxy-agent: ^5.0.0 + "@npmcli/agent": ^2.0.0 + cacache: ^18.0.0 + http-cache-semantics: ^4.1.1 is-lambda: ^1.0.1 - lru-cache: ^7.7.1 - minipass: ^3.1.6 - minipass-collect: ^1.0.2 - minipass-fetch: ^2.0.3 + minipass: ^7.0.2 + minipass-fetch: ^3.0.0 minipass-flush: ^1.0.5 minipass-pipeline: ^1.2.4 negotiator: ^0.6.3 promise-retry: ^2.0.1 - socks-proxy-agent: ^7.0.0 - ssri: ^9.0.0 - checksum: 2332eb9a8ec96f1ffeeea56ccefabcb4193693597b132cd110734d50f2928842e22b84cfa1508e921b8385cdfd06dda9ad68645fed62b50fff629a580f5fb72c - languageName: node - linkType: hard - -"makeerror@npm:1.0.12": - version: 1.0.12 - resolution: "makeerror@npm:1.0.12" - dependencies: - tmpl: 1.0.5 - checksum: b38a025a12c8146d6eeea5a7f2bf27d51d8ad6064da8ca9405fcf7bf9b54acd43e3b30ddd7abb9b1bfa4ddb266019133313482570ddb207de568f71ecfcf6060 + ssri: ^10.0.0 + checksum: 7c7a6d381ce919dd83af398b66459a10e2fe8f4504f340d1d090d3fa3d1b0c93750220e1d898114c64467223504bd258612ba83efbc16f31b075cd56de24b4af languageName: node linkType: hard @@ -7656,6 +5832,13 @@ __metadata: languageName: node linkType: hard +"meow@npm:^12.0.1": + version: 12.1.1 + resolution: "meow@npm:12.1.1" + checksum: a6f3be85fbe53430ef53ab933dd790c39216eb4dbaabdbef593aa59efb40ecaa417897000175476bc33eed09e4cbce01df7ba53ba91e9a4bd84ec07024cb8914 + languageName: node + linkType: hard + "meow@npm:^8.0.0": version: 8.1.2 resolution: "meow@npm:8.1.2" @@ -7705,7 +5888,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": +"micromatch@npm:4.0.5, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -7727,22 +5910,6 @@ __metadata: languageName: node linkType: hard -"mime-db@npm:1.52.0": - version: 1.52.0 - resolution: "mime-db@npm:1.52.0" - checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f - languageName: node - linkType: hard - -"mime-types@npm:^2.1.12": - version: 2.1.35 - resolution: "mime-types@npm:2.1.35" - dependencies: - mime-db: 1.52.0 - checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 - languageName: node - linkType: hard - "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -7796,6 +5963,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.1": + version: 9.0.3 + resolution: "minimatch@npm:9.0.3" + dependencies: + brace-expansion: ^2.0.1 + checksum: 253487976bf485b612f16bf57463520a14f512662e592e95c571afdab1442a6a6864b6c88f248ce6fc4ff0b6de04ac7aa6c8bb51e868e99d1d65eb0658a708b5 + languageName: node + linkType: hard + "minimist-options@npm:4.1.0": version: 4.1.0 resolution: "minimist-options@npm:4.1.0" @@ -7823,18 +5999,18 @@ __metadata: languageName: node linkType: hard -"minipass-fetch@npm:^2.0.3": - version: 2.1.2 - resolution: "minipass-fetch@npm:2.1.2" +"minipass-fetch@npm:^3.0.0": + version: 3.0.4 + resolution: "minipass-fetch@npm:3.0.4" dependencies: encoding: ^0.1.13 - minipass: ^3.1.6 + minipass: ^7.0.3 minipass-sized: ^1.0.3 minizlib: ^2.1.2 dependenciesMeta: encoding: optional: true - checksum: 3f216be79164e915fc91210cea1850e488793c740534985da017a4cbc7a5ff50506956d0f73bb0cb60e4fe91be08b6b61ef35101706d3ef5da2c8709b5f08f91 + checksum: af7aad15d5c128ab1ebe52e043bdf7d62c3c6f0cecb9285b40d7b395e1375b45dcdfd40e63e93d26a0e8249c9efd5c325c65575aceee192883970ff8cb11364a languageName: node linkType: hard @@ -7865,7 +6041,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0, minipass@npm:^3.1.1, minipass@npm:^3.1.6": +"minipass@npm:^3.0.0": version: 3.3.6 resolution: "minipass@npm:3.3.6" dependencies: @@ -7874,10 +6050,17 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^4.0.0": - version: 4.2.4 - resolution: "minipass@npm:4.2.4" - checksum: c664f2ae4401408d1e7a6e4f50aca45f87b1b0634bc9261136df5c378e313e77355765f73f59c4a5abcadcdf43d83fcd3eb14e4a7cdcce8e36508e2290345753 +"minipass@npm:^5.0.0": + version: 5.0.0 + resolution: "minipass@npm:5.0.0" + checksum: 425dab288738853fded43da3314a0b5c035844d6f3097a8e3b5b29b328da8f3c1af6fc70618b32c29ff906284cf6406b6841376f21caaadd0793c1d5a6a620ea + languageName: node + linkType: hard + +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3": + version: 7.0.4 + resolution: "minipass@npm:7.0.4" + checksum: 87585e258b9488caf2e7acea242fd7856bbe9a2c84a7807643513a338d66f368c7d518200ad7b70a508664d408aa000517647b2930c259a8b1f9f0984f344a21 languageName: node linkType: hard @@ -7898,7 +6081,7 @@ __metadata: languageName: node linkType: hard -"mkdirp@npm:^1.0.3, mkdirp@npm:^1.0.4": +"mkdirp@npm:^1.0.3": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" bin: @@ -7907,6 +6090,27 @@ __metadata: languageName: node linkType: hard +"mkdirp@npm:^2.1.3": + version: 2.1.6 + resolution: "mkdirp@npm:2.1.6" + bin: + mkdirp: dist/cjs/src/bin.js + checksum: 8a1d09ffac585e55f41c54f445051f5bc33a7de99b952bb04c576cafdf1a67bb4bae8cb93736f7da6838771fbf75bc630430a3a59e1252047d2278690bd150ee + languageName: node + linkType: hard + +"mlly@npm:^1.2.0, mlly@npm:^1.4.0": + version: 1.4.2 + resolution: "mlly@npm:1.4.2" + dependencies: + acorn: ^8.10.0 + pathe: ^1.1.1 + pkg-types: ^1.0.3 + ufo: ^1.3.0 + checksum: ad0813eca133e59ac03b356b87deea57da96083dce7dda58a8eeb2dce92b7cc2315bedd9268f3ff8e98effe1867ddb1307486d4c5cd8be162daa8e0fa0a98ed4 + languageName: node + linkType: hard + "module-deps@npm:^6.2.3": version: 6.2.3 resolution: "module-deps@npm:6.2.3" @@ -7933,9 +6137,9 @@ __metadata: linkType: hard "morphdom@npm:^2.3.3": - version: 2.7.0 - resolution: "morphdom@npm:2.7.0" - checksum: de18e5b04b0a6222913e70d7a578eb0c15156a4501db3e8d9620ce9e5d998cd926418901b49726b6cc9344b05ea2df945ef77b0b49e3949f818c48d54f43d3c7 + version: 2.7.1 + resolution: "morphdom@npm:2.7.1" + checksum: 1c756488e4bd1486307fb75e056d7bbdb3d0c071f1320eaad3bfd2647022a61ef11b1b4129e783c6783c6cb75eb73a9d0acf41cab6a5f21f3cf8b3262bc97842 languageName: node linkType: hard @@ -7946,13 +6150,6 @@ __metadata: languageName: node linkType: hard -"ms@npm:^2.0.0": - version: 2.1.3 - resolution: "ms@npm:2.1.3" - checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d - languageName: node - linkType: hard - "mute-stream@npm:0.0.8": version: 0.0.8 resolution: "mute-stream@npm:0.0.8" @@ -7980,12 +6177,12 @@ __metadata: languageName: node linkType: hard -"nan@npm:^2.17.0": - version: 2.17.0 - resolution: "nan@npm:2.17.0" +"nan@npm:^2.18.0": + version: 2.18.0 + resolution: "nan@npm:2.18.0" dependencies: node-gyp: latest - checksum: ec609aeaf7e68b76592a3ba96b372aa7f5df5b056c1e37410b0f1deefbab5a57a922061e2c5b369bae9c7c6b5e6eecf4ad2dac8833a1a7d3a751e0a7c7f849ed + checksum: 4fe42f58456504eab3105c04a5cffb72066b5f22bd45decf33523cb17e7d6abc33cca2a19829407b9000539c5cb25f410312d4dc5b30220167a3594896ea6a0a languageName: node linkType: hard @@ -8030,10 +6227,12 @@ __metadata: languageName: node linkType: hard -"natural-compare-lite@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare-lite@npm:1.4.0" - checksum: 5222ac3986a2b78dd6069ac62cbb52a7bf8ffc90d972ab76dfe7b01892485d229530ed20d0c62e79a6b363a663b273db3bde195a1358ce9e5f779d4453887225 +"nanoid@npm:^3.3.6": + version: 3.3.7 + resolution: "nanoid@npm:3.3.7" + bin: + nanoid: bin/nanoid.cjs + checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2 languageName: node linkType: hard @@ -8060,24 +6259,12 @@ __metadata: languageName: node linkType: hard -"nock@npm:^13.3.2": - version: 13.3.2 - resolution: "nock@npm:13.3.2" - dependencies: - debug: ^4.1.0 - json-stringify-safe: ^5.0.1 - lodash: ^4.17.21 - propagate: ^2.0.0 - checksum: 1d7d5fda1816a3a0d2cb47f10283db139fcd15be6975db6f9b260efa781d5f0eeadf9bd7aab6db61191c519dd99bcd4c5c061e77880341be60abc39cd6163c1f - languageName: node - linkType: hard - "node-addon-api@npm:*": - version: 6.0.0 - resolution: "node-addon-api@npm:6.0.0" + version: 7.0.0 + resolution: "node-addon-api@npm:7.0.0" dependencies: node-gyp: latest - checksum: a34a901b9f0d6d201a173e12ed378033e4e0f27f77fd27c225dc7e6f96e88a88e94bd78b2b0404fc95deee20a137f1cbfc92738cbfba38862ed9b6c2e61c1ab2 + checksum: 4349465d737e284b280fc0e5fd2384f9379bca6b7f2a5a1460bea676ba5b90bf563e7d02a9254c35b9ed808641c81d9b4ca9e1da17d2849cd07727660b00b332 languageName: node linkType: hard @@ -8088,23 +6275,9 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.6.7": - version: 2.6.7 - resolution: "node-fetch@npm:2.6.7" - dependencies: - whatwg-url: ^5.0.0 - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - checksum: 8d816ffd1ee22cab8301c7756ef04f3437f18dace86a1dae22cf81db8ef29c0bf6655f3215cb0cdb22b420b6fe141e64b26905e7f33f9377a7fa59135ea3e10b - languageName: node - linkType: hard - -"node-fetch@npm:^2.6.7": - version: 2.6.9 - resolution: "node-fetch@npm:2.6.9" +"node-fetch@npm:^2.6.12": + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" dependencies: whatwg-url: ^5.0.0 peerDependencies: @@ -8112,63 +6285,49 @@ __metadata: peerDependenciesMeta: encoding: optional: true - checksum: acb04f9ce7224965b2b59e71b33c639794d8991efd73855b0b250921382b38331ffc9d61bce502571f6cc6e11a8905ca9b1b6d4aeb586ab093e2756a1fd190d0 + checksum: d76d2f5edb451a3f05b15115ec89fc6be39de37c6089f1b6368df03b91e1633fd379a7e01b7ab05089a25034b2023d959b47e59759cb38d88341b2459e89d6e5 languageName: node linkType: hard "node-gyp-build@npm:^4.3.0": - version: 4.6.0 - resolution: "node-gyp-build@npm:4.6.0" + version: 4.6.1 + resolution: "node-gyp-build@npm:4.6.1" bin: node-gyp-build: bin.js node-gyp-build-optional: optional.js node-gyp-build-test: build-test.js - checksum: 25d78c5ef1f8c24291f4a370c47ba52fcea14f39272041a90a7894cd50d766f7c8cb8fb06c0f42bf6f69b204b49d9be3c8fc344aac09714d5bdb95965499eb15 + checksum: c3676d337b36803bc7792e35bf7fdcda7cdcb7e289b8f9855a5535702a82498eb976842fefcf487258c58005ca32ce3d537fbed91280b04409161dcd7232a882 languageName: node linkType: hard "node-gyp@npm:latest": - version: 9.3.1 - resolution: "node-gyp@npm:9.3.1" + version: 10.0.1 + resolution: "node-gyp@npm:10.0.1" dependencies: env-paths: ^2.2.0 - glob: ^7.1.4 + exponential-backoff: ^3.1.1 + glob: ^10.3.10 graceful-fs: ^4.2.6 - make-fetch-happen: ^10.0.3 - nopt: ^6.0.0 - npmlog: ^6.0.0 - rimraf: ^3.0.2 + make-fetch-happen: ^13.0.0 + nopt: ^7.0.0 + proc-log: ^3.0.0 semver: ^7.3.5 tar: ^6.1.2 - which: ^2.0.2 + which: ^4.0.0 bin: node-gyp: bin/node-gyp.js - checksum: b860e9976fa645ca0789c69e25387401b4396b93c8375489b5151a6c55cf2640a3b6183c212b38625ef7c508994930b72198338e3d09b9d7ade5acc4aaf51ea7 - languageName: node - linkType: hard - -"node-int64@npm:^0.4.0": - version: 0.4.0 - resolution: "node-int64@npm:0.4.0" - checksum: d0b30b1ee6d961851c60d5eaa745d30b5c95d94bc0e74b81e5292f7c42a49e3af87f1eb9e89f59456f80645d679202537de751b7d72e9e40ceea40c5e449057e - languageName: node - linkType: hard - -"node-releases@npm:^2.0.12": - version: 2.0.13 - resolution: "node-releases@npm:2.0.13" - checksum: 17ec8f315dba62710cae71a8dad3cd0288ba943d2ece43504b3b1aa8625bf138637798ab470b1d9035b0545996f63000a8a926e0f6d35d0996424f8b6d36dda3 + checksum: 60a74e66d364903ce02049966303a57f898521d139860ac82744a5fdd9f7b7b3b61f75f284f3bfe6e6add3b8f1871ce305a1d41f775c7482de837b50c792223f languageName: node linkType: hard -"nopt@npm:^6.0.0": - version: 6.0.0 - resolution: "nopt@npm:6.0.0" +"nopt@npm:^7.0.0": + version: 7.2.0 + resolution: "nopt@npm:7.2.0" dependencies: - abbrev: ^1.0.0 + abbrev: ^2.0.0 bin: nopt: bin/nopt.js - checksum: 82149371f8be0c4b9ec2f863cc6509a7fd0fa729929c009f3a58e4eb0c9e4cae9920e8f1f8eb46e7d032fec8fb01bede7f0f41a67eb3553b7b8e14fa53de1dac + checksum: a9c0f57fb8cb9cc82ae47192ca2b7ef00e199b9480eed202482c962d61b59a7fbe7541920b2a5839a97b42ee39e288c0aed770e38057a608d7f579389dfde410 languageName: node linkType: hard @@ -8228,18 +6387,6 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:^6.0.0": - version: 6.0.2 - resolution: "npmlog@npm:6.0.2" - dependencies: - are-we-there-yet: ^3.0.0 - console-control-strings: ^1.1.0 - gauge: ^4.0.3 - set-blocking: ^2.0.0 - checksum: ae238cd264a1c3f22091cdd9e2b106f684297d3c184f1146984ecbe18aaa86343953f26b9520dedd1b1372bc0316905b736c1932d778dbeb1fcf5a1001390e2a - languageName: node - linkType: hard - "number-is-nan@npm:^1.0.0": version: 1.0.1 resolution: "number-is-nan@npm:1.0.1" @@ -8247,17 +6394,36 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4.0.1, object-assign@npm:^4.1.1": +"object-assign@npm:^4.0.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f languageName: node linkType: hard -"object-inspect@npm:^1.12.3": - version: 1.12.3 - resolution: "object-inspect@npm:1.12.3" - checksum: dabfd824d97a5f407e6d5d24810d888859f6be394d8b733a77442b277e0808860555176719c5905e765e3743a7cada6b8b0a3b85e5331c530fd418cc8ae991db +"object-inspect@npm:^1.9.0": + version: 1.13.1 + resolution: "object-inspect@npm:1.13.1" + checksum: 7d9fa9221de3311dcb5c7c307ee5dc011cdd31dc43624b7c184b3840514e118e05ef0002be5388304c416c0eb592feb46e983db12577fc47e47d5752fbbfb61f + languageName: node + linkType: hard + +"object-keys@npm:^1.1.1": + version: 1.1.1 + resolution: "object-keys@npm:1.1.1" + checksum: b363c5e7644b1e1b04aa507e88dcb8e3a2f52b6ffd0ea801e4c7a62d5aa559affe21c55a07fd4b1fd55fc03a33c610d73426664b20032405d7b92a1414c34d6a + languageName: node + linkType: hard + +"object.assign@npm:^4.1.4": + version: 4.1.4 + resolution: "object.assign@npm:4.1.4" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + has-symbols: ^1.0.3 + object-keys: ^1.1.1 + checksum: 76cab513a5999acbfe0ff355f15a6a125e71805fcf53de4e9d4e082e1989bdb81d1e329291e1e4e0ae7719f0e4ef80e88fb2d367ae60500d79d25a6224ac8864 languageName: node linkType: hard @@ -8302,6 +6468,18 @@ __metadata: languageName: node linkType: hard +"open@npm:^9.1.0": + version: 9.1.0 + resolution: "open@npm:9.1.0" + dependencies: + default-browser: ^4.0.0 + define-lazy-prop: ^3.0.0 + is-inside-container: ^1.0.0 + is-wsl: ^2.2.0 + checksum: 3993c0f61d51fed8ac290e99c9c3cf45d3b6cfb3e2aa2b74cafd312c3486c22fd81df16ac8f3ab91dd8a4e3e729a16fc2480cfc406c4833416cf908acf1ae7c9 + languageName: node + linkType: hard + "opn@npm:^5.4.0": version: 5.5.0 resolution: "opn@npm:5.5.0" @@ -8365,7 +6543,7 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^3.0.2, p-limit@npm:^3.1.0": +"p-limit@npm:^3.0.2": version: 3.1.0 resolution: "p-limit@npm:3.1.0" dependencies: @@ -8374,6 +6552,15 @@ __metadata: languageName: node linkType: hard +"p-limit@npm:^4.0.0": + version: 4.0.0 + resolution: "p-limit@npm:4.0.0" + dependencies: + yocto-queue: ^1.0.0 + checksum: 01d9d70695187788f984226e16c903475ec6a947ee7b21948d6f597bed788e3112cc7ec2e171c1d37125057a5f45f3da21d8653e04a3a793589e12e9e80e756b + languageName: node + linkType: hard + "p-locate@npm:^4.1.0": version: 4.1.0 resolution: "p-locate@npm:4.1.0" @@ -8431,13 +6618,6 @@ __metadata: languageName: node linkType: hard -"parent-require@npm:^1.0.0": - version: 1.0.0 - resolution: "parent-require@npm:1.0.0" - checksum: 91ecef2c8e0ecc06a7d68ebdfccec9cb8b34a7144cccda0141273c8871d4dd05856fe13b17ae1e1a32bfd769143671a6dbd2ad7ee72f55d1cb8e588dc60a8f4c - languageName: node - linkType: hard - "parents@npm:^1.0.0, parents@npm:^1.0.1": version: 1.0.1 resolution: "parents@npm:1.0.1" @@ -8551,6 +6731,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^1.10.1": + version: 1.10.1 + resolution: "path-scurry@npm:1.10.1" + dependencies: + lru-cache: ^9.1.1 || ^10.0.0 + minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 + checksum: e2557cff3a8fb8bc07afdd6ab163a92587884f9969b05bbbaf6fe7379348bfb09af9ed292af12ed32398b15fb443e81692047b786d1eeb6d898a51eb17ed7d90 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -8558,6 +6748,20 @@ __metadata: languageName: node linkType: hard +"pathe@npm:^1.1.0, pathe@npm:^1.1.1": + version: 1.1.1 + resolution: "pathe@npm:1.1.1" + checksum: 34ab3da2e5aa832ebc6a330ffe3f73d7ba8aec6e899b53b8ec4f4018de08e40742802deb12cf5add9c73b7bf719b62c0778246bd376ca62b0fb23e0dde44b759 + languageName: node + linkType: hard + +"pathval@npm:^1.1.1": + version: 1.1.1 + resolution: "pathval@npm:1.1.1" + checksum: 090e3147716647fb7fb5b4b8c8e5b55e5d0a6086d085b6cd23f3d3c01fcf0ff56fd3cc22f2f4a033bd2e46ed55d61ed8379e123b42afe7d531a2a5fc8bb556d6 + languageName: node + linkType: hard + "pause-stream@npm:0.0.11": version: 0.0.11 resolution: "pause-stream@npm:0.0.11" @@ -8587,10 +6791,10 @@ __metadata: languageName: node linkType: hard -"pg-connection-string@npm:^2.6.1": - version: 2.6.1 - resolution: "pg-connection-string@npm:2.6.1" - checksum: 882344a47e1ecf3a91383e0809bf2ac48facea97fcec0358d6e060e1cbcb8737acde419b4c86f05da4ce4a16634ee50fff1d2bb787d73b52ccbfde697243ad8a +"pg-connection-string@npm:^2.6.2": + version: 2.6.2 + resolution: "pg-connection-string@npm:2.6.2" + checksum: 22265882c3b6f2320785378d0760b051294a684989163d5a1cde4009e64e84448d7bf67d9a7b9e7f69440c3ee9e2212f9aa10dd17ad6773f6143c6020cebbcb5 languageName: node linkType: hard @@ -8652,14 +6856,14 @@ __metadata: languageName: node linkType: hard -"pg@npm:^8.11.1": - version: 8.11.1 - resolution: "pg@npm:8.11.1" +"pg@npm:^8.11.3": + version: 8.11.3 + resolution: "pg@npm:8.11.3" dependencies: buffer-writer: 2.0.0 packet-reader: 1.0.0 pg-cloudflare: ^1.1.1 - pg-connection-string: ^2.6.1 + pg-connection-string: ^2.6.2 pg-pool: ^3.6.1 pg-protocol: ^1.6.0 pg-types: ^2.1.0 @@ -8672,7 +6876,7 @@ __metadata: peerDependenciesMeta: pg-native: optional: true - checksum: e608fe1c52725e1c0c4cbdf97e29df8f41b9fd21aed821866e3488b3a0622be1c19801d8d8eb31f0de35f040c4f69163c211358e7df8c48d15ee8f660d2bd4cc + checksum: 8af9468b8969fa0d73a6b349216c8cbc953d938fcae5594f2d24043060e9226a072c8085fc4230172b5576fcab4c39c8563c655f271dc2a9209b6ad5370cafe5 languageName: node linkType: hard @@ -8692,14 +6896,14 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.3, picomatch@npm:^2.3.1": +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf languageName: node linkType: hard -"pidtree@npm:^0.6.0": +"pidtree@npm:0.6.0": version: 0.6.0 resolution: "pidtree@npm:0.6.0" bin: @@ -8708,19 +6912,25 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.4": - version: 4.0.5 - resolution: "pirates@npm:4.0.5" - checksum: c9994e61b85260bec6c4fc0307016340d9b0c4f4b6550a957afaaff0c9b1ad58fbbea5cfcf083860a25cb27a375442e2b0edf52e2e1e40e69934e08dcc52d227 +"pkg-types@npm:^1.0.3": + version: 1.0.3 + resolution: "pkg-types@npm:1.0.3" + dependencies: + jsonc-parser: ^3.2.0 + mlly: ^1.2.0 + pathe: ^1.1.0 + checksum: 4b305c834b912ddcc8a0fe77530c0b0321fe340396f84cbb87aecdbc126606f47f2178f23b8639e71a4870f9631c7217aef52ffed0ae17ea2dbbe7e43d116a6e languageName: node linkType: hard -"pkg-dir@npm:^4.2.0": - version: 4.2.0 - resolution: "pkg-dir@npm:4.2.0" +"postcss@npm:^8.4.31": + version: 8.4.31 + resolution: "postcss@npm:8.4.31" dependencies: - find-up: ^4.0.0 - checksum: 9863e3f35132bf99ae1636d31ff1e1e3501251d480336edb1c211133c8d58906bed80f154a1d723652df1fda91e01c7442c2eeaf9dc83157c7ae89087e43c8d6 + nanoid: ^3.3.6 + picocolors: ^1.0.0 + source-map-js: ^1.0.2 + checksum: 1d8611341b073143ad90486fcdfeab49edd243377b1f51834dc4f6d028e82ce5190e4f11bb2633276864503654fb7cab28e67abdc0fbf9d1f88cad4a0ff0beea languageName: node linkType: hard @@ -8807,23 +7017,23 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.8.2, prettier@npm:^2.8.8": - version: 2.8.8 - resolution: "prettier@npm:2.8.8" +"prettier@npm:^3.0.0, prettier@npm:^3.0.2, prettier@npm:^3.0.3": + version: 3.0.3 + resolution: "prettier@npm:3.0.3" bin: - prettier: bin-prettier.js - checksum: b49e409431bf129dd89238d64299ba80717b57ff5a6d1c1a8b1a28b590d998a34e083fa13573bc732bb8d2305becb4c9a4407f8486c81fa7d55100eb08263cf8 + prettier: bin/prettier.cjs + checksum: e10b9af02b281f6c617362ebd2571b1d7fc9fb8a3bd17e371754428cda992e5e8d8b7a046e8f7d3e2da1dcd21aa001e2e3c797402ebb6111b5cd19609dd228e0 languageName: node linkType: hard -"pretty-format@npm:^29.0.0, pretty-format@npm:^29.6.1": - version: 29.6.1 - resolution: "pretty-format@npm:29.6.1" +"pretty-format@npm:^29.5.0": + version: 29.7.0 + resolution: "pretty-format@npm:29.7.0" dependencies: - "@jest/schemas": ^29.6.0 + "@jest/schemas": ^29.6.3 ansi-styles: ^5.0.0 react-is: ^18.0.0 - checksum: 6f923a2379a37a425241dc223d76f671c73c4f37dba158050575a54095867d565c068b441843afdf3d7c37bed9df4bbadf46297976e60d4149972b779474203a + checksum: 032c1602383e71e9c0c02a01bbd25d6759d60e9c7cf21937dde8357aa753da348fcec5def5d1002c9678a8524d5fe099ad98861286550ef44de8808cc61e43b6 languageName: node linkType: hard @@ -8834,6 +7044,13 @@ __metadata: languageName: node linkType: hard +"proc-log@npm:^3.0.0": + version: 3.0.0 + resolution: "proc-log@npm:3.0.0" + checksum: 02b64e1b3919e63df06f836b98d3af002b5cd92655cab18b5746e37374bfb73e03b84fe305454614b34c25b485cc687a9eebdccf0242cda8fda2475dd2c97e02 + languageName: node + linkType: hard + "process-nextick-args@npm:~2.0.0": version: 2.0.1 resolution: "process-nextick-args@npm:2.0.1" @@ -8848,13 +7065,6 @@ __metadata: languageName: node linkType: hard -"promise-inflight@npm:^1.0.1": - version: 1.0.1 - resolution: "promise-inflight@npm:1.0.1" - checksum: 22749483091d2c594261517f4f80e05226d4d5ecc1fc917e1886929da56e22b5718b7f2a75f3807e7a7d471bc3be2907fe92e6e8f373ddf5c64bae35b5af3981 - languageName: node - linkType: hard - "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -8865,23 +7075,6 @@ __metadata: languageName: node linkType: hard -"prompts@npm:^2.0.1": - version: 2.4.2 - resolution: "prompts@npm:2.4.2" - dependencies: - kleur: ^3.0.3 - sisteransi: ^1.0.5 - checksum: d8fd1fe63820be2412c13bfc5d0a01909acc1f0367e32396962e737cb2fc52d004f3302475d5ce7d18a1e8a79985f93ff04ee03007d091029c3f9104bffc007d - languageName: node - linkType: hard - -"propagate@npm:^2.0.0": - version: 2.0.1 - resolution: "propagate@npm:2.0.1" - checksum: c4febaee2be0979e82fb6b3727878fd122a98d64a7fa3c9d09b0576751b88514a9e9275b1b92e76b364d488f508e223bd7e1dcdc616be4cdda876072fbc2a96c - languageName: node - linkType: hard - "ps-tree@npm:^1.2.0": version: 1.2.0 resolution: "ps-tree@npm:1.2.0" @@ -8893,13 +7086,6 @@ __metadata: languageName: node linkType: hard -"psl@npm:^1.9.0": - version: 1.9.0 - resolution: "psl@npm:1.9.0" - checksum: 20c4277f640c93d393130673f392618e9a8044c6c7bf61c53917a0fddb4952790f5f362c6c730a9c32b124813e173733f9895add8d26f566ed0ea0654b2e711d - languageName: node - linkType: hard - "public-encrypt@npm:^4.0.0": version: 4.0.3 resolution: "public-encrypt@npm:4.0.3" @@ -8935,14 +7121,7 @@ __metadata: languageName: node linkType: hard -"punycode@npm:1.3.2": - version: 1.3.2 - resolution: "punycode@npm:1.3.2" - checksum: b8807fd594b1db33335692d1f03e8beeddde6fda7fbb4a2e32925d88d20a3aa4cd8dcc0c109ccaccbd2ba761c208dfaaada83007087ea8bfb0129c9ef1b99ed6 - languageName: node - linkType: hard - -"punycode@npm:^1.3.2": +"punycode@npm:^1.3.2, punycode@npm:^1.4.1": version: 1.4.1 resolution: "punycode@npm:1.4.1" checksum: fa6e698cb53db45e4628559e557ddaf554103d2a96a1d62892c8f4032cd3bc8871796cae9eabc1bc700e2b6677611521ce5bb1d9a27700086039965d0cf34518 @@ -8950,23 +7129,18 @@ __metadata: linkType: hard "punycode@npm:^2.1.0": - version: 2.3.0 - resolution: "punycode@npm:2.3.0" - checksum: 39f760e09a2a3bbfe8f5287cf733ecdad69d6af2fe6f97ca95f24b8921858b91e9ea3c9eeec6e08cede96181b3bb33f95c6ffd8c77e63986508aa2e8159fa200 - languageName: node - linkType: hard - -"pure-rand@npm:^6.0.0": - version: 6.0.0 - resolution: "pure-rand@npm:6.0.0" - checksum: ad1378d0a4859482d053a5264b2b485b445ece4bbc56f8959c233ea678b81ac2d613737925d496ded134eff5f29cc5546bf7492b6bce319ee27bebbad8a0c612 + version: 2.3.1 + resolution: "punycode@npm:2.3.1" + checksum: bb0a0ceedca4c3c57a9b981b90601579058903c62be23c5e8e843d2c2d4148a3ecf029d5133486fb0e1822b098ba8bba09e89d6b21742d02fa26bda6441a6fb2 languageName: node linkType: hard -"q@npm:^1.5.1": - version: 1.5.1 - resolution: "q@npm:1.5.1" - checksum: 147baa93c805bc1200ed698bdf9c72e9e42c05f96d007e33a558b5fdfd63e5ea130e99313f28efc1783e90e6bdb4e48b67a36fcc026b7b09202437ae88a1fb12 +"qs@npm:^6.11.2": + version: 6.11.2 + resolution: "qs@npm:6.11.2" + dependencies: + side-channel: ^1.0.4 + checksum: e812f3c590b2262548647d62f1637b6989cc56656dc960b893fe2098d96e1bd633f36576f4cd7564dfbff9db42e17775884db96d846bebe4f37420d073ecdc0b languageName: node linkType: hard @@ -8977,13 +7151,6 @@ __metadata: languageName: node linkType: hard -"querystring@npm:0.2.0": - version: 0.2.0 - resolution: "querystring@npm:0.2.0" - checksum: 8258d6734f19be27e93f601758858c299bdebe71147909e367101ba459b95446fbe5b975bf9beb76390156a592b6f4ac3a68b6087cea165c259705b8b4e56a69 - languageName: node - linkType: hard - "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -9063,14 +7230,14 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:2 || 3, readable-stream@npm:3, readable-stream@npm:^3.0.0, readable-stream@npm:^3.0.2, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0": - version: 3.6.1 - resolution: "readable-stream@npm:3.6.1" +"readable-stream@npm:2 || 3, readable-stream@npm:3, readable-stream@npm:^3.0.0, readable-stream@npm:^3.0.2, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0, readable-stream@npm:^3.6.2": + version: 3.6.2 + resolution: "readable-stream@npm:3.6.2" dependencies: inherits: ^2.0.3 string_decoder: ^1.1.1 util-deprecate: ^1.0.1 - checksum: b7ab0508dba3c37277b9e43c0a970ea27635375698859a687f558c3c9393154b6c4f39c3aa5689641de183fffa26771bc1a45878ddde0236ad18fc8fdfde50ea + checksum: bdcbe6c22e846b6af075e32cf8f4751c2576238c5043169a1c221c92ee2878458a816a4ea33f4c67623c0b6827c8a400409bfb3cf0bf3381392d0b1dfb52ac8d languageName: node linkType: hard @@ -9089,17 +7256,6 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^3.6.2": - version: 3.6.2 - resolution: "readable-stream@npm:3.6.2" - dependencies: - inherits: ^2.0.3 - string_decoder: ^1.1.1 - util-deprecate: ^1.0.1 - checksum: bdcbe6c22e846b6af075e32cf8f4751c2576238c5043169a1c221c92ee2878458a816a4ea33f4c67623c0b6827c8a400409bfb3cf0bf3381392d0b1dfb52ac8d - languageName: node - linkType: hard - "readdirp@npm:~3.6.0": version: 3.6.0 resolution: "readdirp@npm:3.6.0" @@ -9126,60 +7282,10 @@ __metadata: languageName: node linkType: hard -"regenerate-unicode-properties@npm:^10.1.0": - version: 10.1.0 - resolution: "regenerate-unicode-properties@npm:10.1.0" - dependencies: - regenerate: ^1.4.2 - checksum: b1a8929588433ab8b9dc1a34cf3665b3b472f79f2af6ceae00d905fc496b332b9af09c6718fb28c730918f19a00dc1d7310adbaa9b72a2ec7ad2f435da8ace17 - languageName: node - linkType: hard - -"regenerate@npm:^1.4.2": - version: 1.4.2 - resolution: "regenerate@npm:1.4.2" - checksum: 3317a09b2f802da8db09aa276e469b57a6c0dd818347e05b8862959c6193408242f150db5de83c12c3fa99091ad95fb42a6db2c3329bfaa12a0ea4cbbeb30cb0 - languageName: node - linkType: hard - -"regenerator-runtime@npm:^0.13.11": - version: 0.13.11 - resolution: "regenerator-runtime@npm:0.13.11" - checksum: 27481628d22a1c4e3ff551096a683b424242a216fee44685467307f14d58020af1e19660bf2e26064de946bad7eff28950eae9f8209d55723e2d9351e632bbb4 - languageName: node - linkType: hard - -"regenerator-transform@npm:^0.15.1": - version: 0.15.1 - resolution: "regenerator-transform@npm:0.15.1" - dependencies: - "@babel/runtime": ^7.8.4 - checksum: 2d15bdeadbbfb1d12c93f5775493d85874dbe1d405bec323da5c61ec6e701bc9eea36167483e1a5e752de9b2df59ab9a2dfff6bf3784f2b28af2279a673d29a4 - languageName: node - linkType: hard - -"regexpu-core@npm:^5.3.1": - version: 5.3.1 - resolution: "regexpu-core@npm:5.3.1" - dependencies: - "@babel/regjsgen": ^0.8.0 - regenerate: ^1.4.2 - regenerate-unicode-properties: ^10.1.0 - regjsparser: ^0.9.1 - unicode-match-property-ecmascript: ^2.0.0 - unicode-match-property-value-ecmascript: ^2.1.0 - checksum: 446fbbb79059afcd64d11ea573276e2df97ee7ad45aa452834d3b2aef7edf7bfe206c310f57f9345d8c95bfedbf9c16a9529f9219a05ae6a6b0d6f0dbe523b33 - languageName: node - linkType: hard - -"regjsparser@npm:^0.9.1": - version: 0.9.1 - resolution: "regjsparser@npm:0.9.1" - dependencies: - jsesc: ~0.5.0 - bin: - regjsparser: bin/parser - checksum: 5e1b76afe8f1d03c3beaf9e0d935dd467589c3625f6d65fb8ffa14f224d783a0fed4bf49c2c1b8211043ef92b6117313419edf055a098ed8342e340586741afc +"regenerator-runtime@npm:^0.14.0": + version: 0.14.0 + resolution: "regenerator-runtime@npm:0.14.0" + checksum: 1c977ad82a82a4412e4f639d65d22be376d3ebdd30da2c003eeafdaaacd03fc00c2320f18120007ee700900979284fc78a9f00da7fb593f6e6eeebc673fba9a3 languageName: node linkType: hard @@ -9197,15 +7303,6 @@ __metadata: languageName: node linkType: hard -"resolve-cwd@npm:^3.0.0": - version: 3.0.0 - resolution: "resolve-cwd@npm:3.0.0" - dependencies: - resolve-from: ^5.0.0 - checksum: 546e0816012d65778e580ad62b29e975a642989108d9a3c5beabfb2304192fa3c9f9146fbdfe213563c6ff51975ae41bac1d3c6e047dd9572c94863a057b4d81 - languageName: node - linkType: hard - "resolve-dir@npm:^1.0.0, resolve-dir@npm:^1.0.1": version: 1.0.1 resolution: "resolve-dir@npm:1.0.1" @@ -9239,36 +7336,36 @@ __metadata: languageName: node linkType: hard -"resolve.exports@npm:^2.0.0": - version: 2.0.0 - resolution: "resolve.exports@npm:2.0.0" - checksum: d8bee3b0cc0a0ae6c8323710983505bc6a3a2574f718e96f01e048a0f0af035941434b386cc9efc7eededc5e1199726185c306ec6f6a1aa55d5fbad926fd0634 +"resolve-pkg-maps@npm:^1.0.0": + version: 1.0.0 + resolution: "resolve-pkg-maps@npm:1.0.0" + checksum: 1012afc566b3fdb190a6309cc37ef3b2dcc35dff5fa6683a9d00cd25c3247edfbc4691b91078c97adc82a29b77a2660c30d791d65dab4fc78bfc473f60289977 languageName: node linkType: hard -"resolve@npm:^1.1.4, resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.17.0, resolve@npm:^1.20.0, resolve@npm:^1.4.0": - version: 1.22.1 - resolution: "resolve@npm:1.22.1" +"resolve@npm:^1.1.4, resolve@npm:^1.10.0, resolve@npm:^1.17.0, resolve@npm:^1.4.0": + version: 1.22.8 + resolution: "resolve@npm:1.22.8" dependencies: - is-core-module: ^2.9.0 + is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: 07af5fc1e81aa1d866cbc9e9460fbb67318a10fa3c4deadc35c3ad8a898ee9a71a86a65e4755ac3195e0ea0cfbe201eb323ebe655ce90526fd61917313a34e4e + checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c languageName: node linkType: hard -"resolve@patch:resolve@^1.1.4#~builtin, resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.17.0#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.4.0#~builtin": - version: 1.22.1 - resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d" +"resolve@patch:resolve@^1.1.4#~builtin, resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.17.0#~builtin, resolve@patch:resolve@^1.4.0#~builtin": + version: 1.22.8 + resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" dependencies: - is-core-module: ^2.9.0 + is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: 5656f4d0bedcf8eb52685c1abdf8fbe73a1603bb1160a24d716e27a57f6cecbe2432ff9c89c2bd57542c3a7b9d14b1882b73bfe2e9d7849c9a4c0b8b39f02b8b + checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847 languageName: node linkType: hard @@ -9282,6 +7379,16 @@ __metadata: languageName: node linkType: hard +"restore-cursor@npm:^4.0.0": + version: 4.0.0 + resolution: "restore-cursor@npm:4.0.0" + dependencies: + onetime: ^5.1.0 + signal-exit: ^3.0.2 + checksum: 5b675c5a59763bf26e604289eab35711525f11388d77f409453904e1e69c0d37ae5889295706b2c81d23bd780165084d040f9b68fffc32cc921519031c4fa4af + languageName: node + linkType: hard + "retry@npm:^0.12.0": version: 0.12.0 resolution: "retry@npm:0.12.0" @@ -9324,6 +7431,65 @@ __metadata: languageName: node linkType: hard +"rollup@npm:^4.2.0": + version: 4.3.0 + resolution: "rollup@npm:4.3.0" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.3.0 + "@rollup/rollup-android-arm64": 4.3.0 + "@rollup/rollup-darwin-arm64": 4.3.0 + "@rollup/rollup-darwin-x64": 4.3.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.3.0 + "@rollup/rollup-linux-arm64-gnu": 4.3.0 + "@rollup/rollup-linux-arm64-musl": 4.3.0 + "@rollup/rollup-linux-x64-gnu": 4.3.0 + "@rollup/rollup-linux-x64-musl": 4.3.0 + "@rollup/rollup-win32-arm64-msvc": 4.3.0 + "@rollup/rollup-win32-ia32-msvc": 4.3.0 + "@rollup/rollup-win32-x64-msvc": 4.3.0 + fsevents: ~2.3.2 + dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: 8791b160407188a794fa4a529d1740e2310625254450753d2d8413cf26855ed8758146e110724492df8d6a108a5362c999f07a387c52143afc20cf27695b34c2 + languageName: node + linkType: hard + +"run-applescript@npm:^5.0.0": + version: 5.0.0 + resolution: "run-applescript@npm:5.0.0" + dependencies: + execa: ^5.0.0 + checksum: d00c2dbfa5b2d774de7451194b8b125f40f65fc183de7d9dcae97f57f59433586d3c39b9001e111c38bfa24c3436c99df1bb4066a2a0c90d39a8c4cd6889af77 + languageName: node + linkType: hard + "run-async@npm:^2.4.0": version: 2.4.1 resolution: "run-async@npm:2.4.1" @@ -9340,12 +7506,12 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:^7.5.5, rxjs@npm:^7.8.0": - version: 7.8.0 - resolution: "rxjs@npm:7.8.0" +"rxjs@npm:^7.5.5": + version: 7.8.1 + resolution: "rxjs@npm:7.8.1" dependencies: tslib: ^2.1.0 - checksum: 61b4d4fd323c1043d8d6ceb91f24183b28bcf5def4f01ca111511d5c6b66755bc5578587fe714ef5d67cf4c9f2e26f4490d4e1d8cabf9bd5967687835e9866a2 + checksum: de4b53db1063e618ec2eca0f7965d9137cabe98cf6be9272efe6c86b47c17b987383df8574861bcced18ebd590764125a901d5506082be84a8b8e364bf05f119 languageName: node linkType: hard @@ -9370,13 +7536,6 @@ __metadata: languageName: node linkType: hard -"sax@npm:>=0.6.0": - version: 1.2.4 - resolution: "sax@npm:1.2.4" - checksum: d3df7d32b897a2c2f28e941f732c71ba90e27c24f62ee918bd4d9a8cfb3553f2f81e5493c7f0be94a11c1911b643a9108f231dd6f60df3fa9586b5d2e3e9e1fe - languageName: node - linkType: hard - "semver@npm:2 || 3 || 4 || 5": version: 5.7.2 resolution: "semver@npm:5.7.2" @@ -9386,18 +7545,18 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.2": - version: 7.5.2 - resolution: "semver@npm:7.5.2" +"semver@npm:7.5.4, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4": + version: 7.5.4 + resolution: "semver@npm:7.5.4" dependencies: lru-cache: ^6.0.0 bin: semver: bin/semver.js - checksum: 3fdf5d1e6f170fe8bcc41669e31787649af91af7f54f05c71d0865bb7aa27e8b92f68b3e6b582483e2c1c648008bc84249d2cd86301771fe5cbf7621d1fe5375 + checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 languageName: node linkType: hard -"semver@npm:^6.0.0, semver@npm:^6.3.0, semver@npm:^6.3.1": +"semver@npm:^6.0.0": version: 6.3.1 resolution: "semver@npm:6.3.1" bin: @@ -9406,21 +7565,15 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3": - version: 7.5.4 - resolution: "semver@npm:7.5.4" +"set-function-length@npm:^1.1.1": + version: 1.1.1 + resolution: "set-function-length@npm:1.1.1" dependencies: - lru-cache: ^6.0.0 - bin: - semver: bin/semver.js - checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 - languageName: node - linkType: hard - -"set-blocking@npm:^2.0.0": - version: 2.0.0 - resolution: "set-blocking@npm:2.0.0" - checksum: 6e65a05f7cf7ebdf8b7c75b101e18c0b7e3dff4940d480efed8aad3a36a4005140b660fa1d804cb8bce911cac290441dc728084a30504d3516ac2ff7ad607b02 + define-data-property: ^1.1.1 + get-intrinsic: ^1.2.1 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.0 + checksum: c131d7569cd7e110cafdfbfbb0557249b538477624dfac4fc18c376d879672fa52563b74029ca01f8f4583a8acb35bb1e873d573a24edb80d978a7ee607c6e06 languageName: node linkType: hard @@ -9462,9 +7615,27 @@ __metadata: linkType: hard "shell-quote@npm:^1.6.1": - version: 1.8.0 - resolution: "shell-quote@npm:1.8.0" - checksum: 6ef7c5e308b9c77eedded882653a132214fa98b4a1512bb507588cf6cd2fc78bfee73e945d0c3211af028a1eabe09c6a19b96edd8977dc149810797e93809749 + version: 1.8.1 + resolution: "shell-quote@npm:1.8.1" + checksum: 5f01201f4ef504d4c6a9d0d283fa17075f6770bfbe4c5850b074974c68062f37929ca61700d95ad2ac8822e14e8c4b990ca0e6e9272e64befd74ce5e19f0736b + languageName: node + linkType: hard + +"side-channel@npm:^1.0.4": + version: 1.0.4 + resolution: "side-channel@npm:1.0.4" + dependencies: + call-bind: ^1.0.0 + get-intrinsic: ^1.0.2 + object-inspect: ^1.9.0 + checksum: 351e41b947079c10bd0858364f32bb3a7379514c399edb64ab3dce683933483fc63fb5e4efe0a15a2e8a7e3c436b6a91736ddb8d8c6591b0460a24bb4a1ee245 + languageName: node + linkType: hard + +"siginfo@npm:^2.0.0": + version: 2.0.0 + resolution: "siginfo@npm:2.0.0" + checksum: 8aa5a98640ca09fe00d74416eca97551b3e42991614a3d1b824b115fc1401543650914f651ab1311518177e4d297e80b953f4cd4cd7ea1eabe824e8f2091de01 languageName: node linkType: hard @@ -9475,6 +7646,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^4.0.1, signal-exit@npm:^4.1.0": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + "simple-concat@npm:^1.0.0": version: 1.0.1 resolution: "simple-concat@npm:1.0.1" @@ -9491,89 +7669,76 @@ __metadata: languageName: node linkType: hard -"sisteransi@npm:^1.0.5": - version: 1.0.5 - resolution: "sisteransi@npm:1.0.5" - checksum: aba6438f46d2bfcef94cf112c835ab395172c75f67453fe05c340c770d3c402363018ae1ab4172a1026a90c47eaccf3af7b6ff6fa749a680c2929bd7fa2b37a4 - languageName: node - linkType: hard - "skyra@workspace:.": version: 0.0.0-use.local resolution: "skyra@workspace:." dependencies: - 0x: ^5.5.0 - "@babel/core": ^7.22.9 - "@babel/plugin-proposal-class-properties": ^7.18.6 - "@babel/plugin-proposal-decorators": ^7.22.7 - "@babel/preset-env": ^7.22.9 - "@babel/preset-typescript": ^7.21.4 - "@commitlint/cli": ^17.6.6 - "@commitlint/config-conventional": ^17.6.6 - "@discordjs/builders": ^0.16.0 - "@discordjs/collection": ^1.5.1 + 0x: ^5.7.0 + "@commitlint/cli": ^18.2.0 + "@commitlint/config-conventional": ^18.1.0 + "@discordjs/builders": ^1.6.5 + "@discordjs/collection": ^1.5.3 + "@discordjs/core": ^1.0.1 "@influxdata/influxdb-client": ^1.33.2 "@influxdata/influxdb-client-apis": ^1.33.2 "@sapphire/async-queue": ^1.5.0 - "@sapphire/decorators": ^4.3.8 - "@sapphire/discord.js-utilities": 4.12.0 - "@sapphire/eslint-config": ^4.4.3 + "@sapphire/bitfield": ^1.2.0 + "@sapphire/decorators": ^6.0.2 + "@sapphire/discord.js-utilities": 7.0.2 + "@sapphire/eslint-config": ^5.0.2 "@sapphire/fetch": ^2.4.1 - "@sapphire/framework": 2.5.1 - "@sapphire/plugin-api": ^3.2.4 - "@sapphire/plugin-editable-commands": ^1.2.2 - "@sapphire/plugin-i18next": ^2.5.4 - "@sapphire/plugin-logger": ^2.2.3 - "@sapphire/plugin-subcommands": ^2.2.2 - "@sapphire/prettier-config": ^1.4.5 - "@sapphire/ratelimits": ^2.4.6 + "@sapphire/framework": 4.7.2 + "@sapphire/plugin-api": ^5.1.2 + "@sapphire/plugin-editable-commands": ^3.0.3 + "@sapphire/plugin-i18next": ^6.0.1 + "@sapphire/plugin-logger": ^3.0.6 + "@sapphire/plugin-subcommands": ^5.0.0 + "@sapphire/prettier-config": ^2.0.0 + "@sapphire/ratelimits": ^2.4.7 "@sapphire/snowflake": ^3.5.1 "@sapphire/stopwatch": ^1.5.0 - "@sapphire/time-utilities": ^1.7.9 - "@sapphire/ts-config": ^3.3.4 - "@sapphire/utilities": ^3.12.0 - "@sentry/hub": ^7.58.1 - "@sentry/integrations": ^7.58.1 - "@sentry/node": ^7.58.1 + "@sapphire/time-utilities": ^1.7.10 + "@sapphire/ts-config": ^5.0.0 + "@sapphire/utilities": ^3.13.0 + "@sentry/hub": ^7.79.0 + "@sentry/integrations": ^7.79.0 + "@sentry/node": ^7.79.0 "@skyra/ai": ^1.2.0 "@skyra/char": ^1.0.3 "@skyra/env-utilities": ^1.2.1 "@skyra/jaro-winkler": ^1.1.0 - "@types/backoff": ^2.5.2 - "@types/diff": ^5.0.3 - "@types/he": ^1.2.0 - "@types/jest": ^29.5.3 - "@types/node": ^18.16.19 - "@types/pg": ^8.10.2 - "@types/ws": ^8.5.5 - "@typescript-eslint/eslint-plugin": ^5.58.0 - "@typescript-eslint/parser": ^5.58.0 + "@types/backoff": ^2.5.5 + "@types/diff": ^5.0.8 + "@types/he": ^1.2.3 + "@types/node": ^20.9.0 + "@types/pg": ^8.10.9 + "@types/ws": ^8.5.9 + "@typescript-eslint/eslint-plugin": ^6.10.0 + "@typescript-eslint/parser": ^6.10.0 + "@vitest/coverage-v8": ^0.34.6 async-rwlock: ^1.1.1 - babel-plugin-const-enum: ^1.2.0 - bufferutil: ^4.0.7 + bufferutil: ^4.0.8 colorette: ^2.0.20 confusables: ^1.1.1 cz-conventional-changelog: ^3.3.0 diff: ^5.1.0 - discord-api-types: ~0.33.5 - discord.js: ^13.16.0 - eslint: ^8.45.0 - eslint-config-prettier: ^8.8.0 - eslint-plugin-prettier: ^4.2.1 + discord-api-types: ~0.37.62 + discord.js: ^14.13.0 + eslint: ^8.53.0 + eslint-config-prettier: ^9.0.0 + eslint-plugin-prettier: ^5.0.1 he: ^1.2.0 - jest: ^29.6.1 - jest-mock-random: ^1.1.1 - lint-staged: ^13.2.3 - nock: ^13.3.2 - pg: ^8.11.1 - prettier: ^2.8.8 + lint-staged: ^15.0.2 + pg: ^8.11.3 + prettier: ^3.0.3 ts-node: ^10.9.1 tsc-watch: ^6.0.4 - tslib: 1.14.1 - typeorm: 0.2.28 - typeorm-naming-strategies: ^2.0.0 - typescript: ~4.7.4 - zlib-sync: ^0.1.8 + tsx: ^4.0.0 + typeorm: 0.3.17 + typeorm-naming-strategies: ^4.1.0 + typescript: ^5.2.2 + vitest: ^0.34.6 + zlib-sync: ^0.1.9 languageName: unknown linkType: soft @@ -9584,28 +7749,6 @@ __metadata: languageName: node linkType: hard -"slice-ansi@npm:^3.0.0": - version: 3.0.0 - resolution: "slice-ansi@npm:3.0.0" - dependencies: - ansi-styles: ^4.0.0 - astral-regex: ^2.0.0 - is-fullwidth-code-point: ^3.0.0 - checksum: 5ec6d022d12e016347e9e3e98a7eb2a592213a43a65f1b61b74d2c78288da0aded781f665807a9f3876b9daa9ad94f64f77d7633a0458876c3a4fdc4eb223f24 - languageName: node - linkType: hard - -"slice-ansi@npm:^4.0.0": - version: 4.0.0 - resolution: "slice-ansi@npm:4.0.0" - dependencies: - ansi-styles: ^4.0.0 - astral-regex: ^2.0.0 - is-fullwidth-code-point: ^3.0.0 - checksum: 4a82d7f085b0e1b070e004941ada3c40d3818563ac44766cca4ceadd2080427d337554f9f99a13aaeb3b4a94d9964d9466c807b3d7b7541d1ec37ee32d308756 - languageName: node - linkType: hard - "slice-ansi@npm:^5.0.0": version: 5.0.0 resolution: "slice-ansi@npm:5.0.0" @@ -9623,18 +7766,18 @@ __metadata: languageName: node linkType: hard -"socks-proxy-agent@npm:^7.0.0": - version: 7.0.0 - resolution: "socks-proxy-agent@npm:7.0.0" +"socks-proxy-agent@npm:^8.0.1": + version: 8.0.2 + resolution: "socks-proxy-agent@npm:8.0.2" dependencies: - agent-base: ^6.0.2 - debug: ^4.3.3 - socks: ^2.6.2 - checksum: 720554370154cbc979e2e9ce6a6ec6ced205d02757d8f5d93fe95adae454fc187a5cbfc6b022afab850a5ce9b4c7d73e0f98e381879cf45f66317a4895953846 + agent-base: ^7.0.2 + debug: ^4.3.4 + socks: ^2.7.1 + checksum: 4fb165df08f1f380881dcd887b3cdfdc1aba3797c76c1e9f51d29048be6e494c5b06d68e7aea2e23df4572428f27a3ec22b3d7c75c570c5346507433899a4b6d languageName: node linkType: hard -"socks@npm:^2.6.2": +"socks@npm:^2.7.1": version: 2.7.1 resolution: "socks@npm:2.7.1" dependencies: @@ -9644,13 +7787,20 @@ __metadata: languageName: node linkType: hard -"source-map-support@npm:0.5.13": - version: 0.5.13 - resolution: "source-map-support@npm:0.5.13" +"source-map-js@npm:^1.0.2": + version: 1.0.2 + resolution: "source-map-js@npm:1.0.2" + checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c + languageName: node + linkType: hard + +"source-map-support@npm:^0.5.21": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" dependencies: buffer-from: ^1.0.0 source-map: ^0.6.0 - checksum: 933550047b6c1a2328599a21d8b7666507427c0f5ef5eaadd56b5da0fd9505e239053c66fe181bf1df469a3b7af9d775778eee283cbb7ae16b902ddc09e93a97 + checksum: 43e98d700d79af1d36f859bdb7318e601dfc918c7ba2e98456118ebc4c4872b327773e5a1df09b0524e9e5063bb18f0934538eace60cca2710d1fa687645d137 languageName: node linkType: hard @@ -9676,12 +7826,12 @@ __metadata: linkType: hard "spdx-correct@npm:^3.0.0": - version: 3.1.1 - resolution: "spdx-correct@npm:3.1.1" + version: 3.2.0 + resolution: "spdx-correct@npm:3.2.0" dependencies: spdx-expression-parse: ^3.0.0 spdx-license-ids: ^3.0.0 - checksum: 77ce438344a34f9930feffa61be0eddcda5b55fc592906ef75621d4b52c07400a97084d8701557b13f7d2aae0cb64f808431f469e566ef3fe0a3a131dcb775a6 + checksum: e9ae98d22f69c88e7aff5b8778dc01c361ef635580e82d29e5c60a6533cc8f4d820803e67d7432581af0cc4fb49973125076ee3b90df191d153e223c004193b2 languageName: node linkType: hard @@ -9703,9 +7853,9 @@ __metadata: linkType: hard "spdx-license-ids@npm:^3.0.0": - version: 3.0.12 - resolution: "spdx-license-ids@npm:3.0.12" - checksum: 92a4dddce62ce1db6fe54a7a839cf85e06abc308fc83b776a55b44e4f1906f02e7ebd506120847039e976bbbad359ea8bdfafb7925eae5cd7e73255f02e0b7d6 + version: 3.0.16 + resolution: "spdx-license-ids@npm:3.0.16" + checksum: 5cdaa85aaa24bd02f9353a2e357b4df0a4f205cb35655f3fd0a5674a4fb77081f28ffd425379214bc3be2c2b7593ce1215df6bcc75884aeee0a9811207feabe2 languageName: node linkType: hard @@ -9719,9 +7869,9 @@ __metadata: linkType: hard "split2@npm:^4.0.0, split2@npm:^4.1.0": - version: 4.1.0 - resolution: "split2@npm:4.1.0" - checksum: ec581597cb74c13cdfb5e2047543dd40cb1e8e9803c7b1e0c29ede05f2b4f049b2d6e7f2788a225d544549375719658b8f38e9366364dec35dc7a12edfda5ee5 + version: 4.2.0 + resolution: "split2@npm:4.2.0" + checksum: 05d54102546549fe4d2455900699056580cca006c0275c334611420f854da30ac999230857a85fdd9914dc2109ae50f80fda43d2a445f2aa86eccdc1dfce779d languageName: node linkType: hard @@ -9734,28 +7884,26 @@ __metadata: languageName: node linkType: hard -"sprintf-js@npm:~1.0.2": - version: 1.0.3 - resolution: "sprintf-js@npm:1.0.3" - checksum: 19d79aec211f09b99ec3099b5b2ae2f6e9cdefe50bc91ac4c69144b6d3928a640bb6ae5b3def70c2e85a2c3d9f5ec2719921e3a59d3ca3ef4b2fd1a4656a0df3 +"ssri@npm:^10.0.0": + version: 10.0.5 + resolution: "ssri@npm:10.0.5" + dependencies: + minipass: ^7.0.3 + checksum: 0a31b65f21872dea1ed3f7c200d7bc1c1b91c15e419deca14f282508ba917cbb342c08a6814c7f68ca4ca4116dd1a85da2bbf39227480e50125a1ceffeecb750 languageName: node linkType: hard -"ssri@npm:^9.0.0": - version: 9.0.1 - resolution: "ssri@npm:9.0.1" - dependencies: - minipass: ^3.1.1 - checksum: fb58f5e46b6923ae67b87ad5ef1c5ab6d427a17db0bead84570c2df3cd50b4ceb880ebdba2d60726588272890bae842a744e1ecce5bd2a2a582fccd5068309eb +"stackback@npm:0.0.2": + version: 0.0.2 + resolution: "stackback@npm:0.0.2" + checksum: 2d4dc4e64e2db796de4a3c856d5943daccdfa3dd092e452a1ce059c81e9a9c29e0b9badba91b43ef0d5ff5c04ee62feb3bcc559a804e16faf447bac2d883aa99 languageName: node linkType: hard -"stack-utils@npm:^2.0.3": - version: 2.0.6 - resolution: "stack-utils@npm:2.0.6" - dependencies: - escape-string-regexp: ^2.0.0 - checksum: 052bf4d25bbf5f78e06c1d5e67de2e088b06871fa04107ca8d3f0e9d9263326e2942c8bedee3545795fc77d787d443a538345eef74db2f8e35db3558c6f91ff7 +"std-env@npm:^3.3.3": + version: 3.4.3 + resolution: "std-env@npm:3.4.3" + checksum: bef186fb2baddda31911234b1e58fa18f181eb6930616aaec3b54f6d5db65f2da5daaa5f3b326b98445a7d50ca81d6fe8809ab4ebab85ecbe4a802f1b40921bf languageName: node linkType: hard @@ -9817,20 +7965,28 @@ __metadata: languageName: node linkType: hard -"string-argv@npm:^0.3.1": - version: 0.3.1 - resolution: "string-argv@npm:0.3.1" - checksum: efbd0289b599bee808ce80820dfe49c9635610715429c6b7cc50750f0437e3c2f697c81e5c390208c13b5d5d12d904a1546172a88579f6ee5cbaaaa4dc9ec5cf +"streamsearch@npm:^1.1.0": + version: 1.1.0 + resolution: "streamsearch@npm:1.1.0" + checksum: 1cce16cea8405d7a233d32ca5e00a00169cc0e19fbc02aa839959985f267335d435c07f96e5e0edd0eadc6d39c98d5435fb5bbbdefc62c41834eadc5622ad942 languageName: node linkType: hard -"string-length@npm:^4.0.1": - version: 4.0.2 - resolution: "string-length@npm:4.0.2" +"string-argv@npm:0.3.2, string-argv@npm:^0.3.1": + version: 0.3.2 + resolution: "string-argv@npm:0.3.2" + checksum: 8703ad3f3db0b2641ed2adbb15cf24d3945070d9a751f9e74a924966db9f325ac755169007233e8985a39a6a292f14d4fee20482989b89b96e473c4221508a0f + languageName: node + linkType: hard + +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": + version: 4.2.3 + resolution: "string-width@npm:4.2.3" dependencies: - char-regex: ^1.0.2 - strip-ansi: ^6.0.0 - checksum: ce85533ef5113fcb7e522bcf9e62cb33871aa99b3729cec5595f4447f660b0cefd542ca6df4150c97a677d58b0cb727a3fe09ac1de94071d05526c73579bf505 + emoji-regex: ^8.0.0 + is-fullwidth-code-point: ^3.0.0 + strip-ansi: ^6.0.1 + checksum: e52c10dc3fbfcd6c3a15f159f54a90024241d0f149cf8aed2982a2d801d2e64df0bf1dc351cf8e95c3319323f9f220c16e740b06faecd53e2462df1d2b5443fb languageName: node linkType: hard @@ -9845,18 +8001,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": - version: 4.2.3 - resolution: "string-width@npm:4.2.3" - dependencies: - emoji-regex: ^8.0.0 - is-fullwidth-code-point: ^3.0.0 - strip-ansi: ^6.0.1 - checksum: e52c10dc3fbfcd6c3a15f159f54a90024241d0f149cf8aed2982a2d801d2e64df0bf1dc351cf8e95c3319323f9f220c16e740b06faecd53e2462df1d2b5443fb - languageName: node - linkType: hard - -"string-width@npm:^5.0.0": +"string-width@npm:^5.0.0, string-width@npm:^5.0.1, string-width@npm:^5.1.2": version: 5.1.2 resolution: "string-width@npm:5.1.2" dependencies: @@ -9885,6 +8030,15 @@ __metadata: languageName: node linkType: hard +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: ^5.0.1 + checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + languageName: node + linkType: hard + "strip-ansi@npm:^3.0.0": version: 3.0.1 resolution: "strip-ansi@npm:3.0.1" @@ -9894,25 +8048,16 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": - version: 6.0.1 - resolution: "strip-ansi@npm:6.0.1" - dependencies: - ansi-regex: ^5.0.1 - checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c - languageName: node - linkType: hard - "strip-ansi@npm:^7.0.1": - version: 7.0.1 - resolution: "strip-ansi@npm:7.0.1" + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" dependencies: ansi-regex: ^6.0.1 - checksum: 257f78fa433520e7f9897722731d78599cb3fce29ff26a20a5e12ba4957463b50a01136f37c43707f4951817a75e90820174853d6ccc240997adc5df8f966039 + checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d languageName: node linkType: hard -"strip-bom@npm:4.0.0, strip-bom@npm:^4.0.0": +"strip-bom@npm:4.0.0": version: 4.0.0 resolution: "strip-bom@npm:4.0.0" checksum: 9dbcfbaf503c57c06af15fe2c8176fb1bf3af5ff65003851a102749f875a6dbe0ab3b30115eccf6e805e9d756830d3e40ec508b62b3f1ddf3761a20ebe29d3f3 @@ -9949,6 +8094,15 @@ __metadata: languageName: node linkType: hard +"strip-literal@npm:^1.0.1": + version: 1.3.0 + resolution: "strip-literal@npm:1.3.0" + dependencies: + acorn: ^8.10.0 + checksum: f5fa7e289df8ebe82e90091fd393974faf8871be087ca50114327506519323cf15f2f8fee6ebe68b5e58bfc795269cae8bdc7cb5a83e27b02b3fe953f37b0a89 + languageName: node + linkType: hard + "subarg@npm:^1.0.0": version: 1.0.0 resolution: "subarg@npm:1.0.0" @@ -9983,15 +8137,6 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^8.0.0": - version: 8.1.1 - resolution: "supports-color@npm:8.1.1" - dependencies: - has-flag: ^4.0.0 - checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 - languageName: node - linkType: hard - "supports-preserve-symlinks-flag@npm:^1.0.0": version: 1.0.0 resolution: "supports-preserve-symlinks-flag@npm:1.0.0" @@ -9999,6 +8144,16 @@ __metadata: languageName: node linkType: hard +"synckit@npm:^0.8.5": + version: 0.8.5 + resolution: "synckit@npm:0.8.5" + dependencies: + "@pkgr/utils": ^2.3.1 + tslib: ^2.5.0 + checksum: 8a9560e5d8f3d94dc3cf5f7b9c83490ffa30d320093560a37b88f59483040771fd1750e76b9939abfbb1b5a23fd6dfbae77f6b338abffe7cae7329cd9b9bb86b + languageName: node + linkType: hard + "syntax-error@npm:^1.1.1": version: 1.4.0 resolution: "syntax-error@npm:1.4.0" @@ -10016,16 +8171,16 @@ __metadata: linkType: hard "tar@npm:^6.1.11, tar@npm:^6.1.2": - version: 6.1.13 - resolution: "tar@npm:6.1.13" + version: 6.2.0 + resolution: "tar@npm:6.2.0" dependencies: chownr: ^2.0.0 fs-minipass: ^2.0.0 - minipass: ^4.0.0 + minipass: ^5.0.0 minizlib: ^2.1.1 mkdirp: ^1.0.3 yallist: ^4.0.0 - checksum: 8a278bed123aa9f53549b256a36b719e317c8b96fe86a63406f3c62887f78267cea9b22dc6f7007009738509800d4a4dccc444abd71d762287c90f35b002eb1c + checksum: db4d9fe74a2082c3a5016630092c54c8375ff3b280186938cfd104f2e089c4fd9bad58688ef6be9cf186a889671bf355c7cda38f09bbf60604b281715ca57f5c languageName: node linkType: hard @@ -10040,10 +8195,10 @@ __metadata: languageName: node linkType: hard -"text-extensions@npm:^1.0.0": - version: 1.9.0 - resolution: "text-extensions@npm:1.9.0" - checksum: 56a9962c1b62d39b2bcb369b7558ca85c1b55e554b38dfd725edcc0a1babe5815782a60c17ff6b839093b163dfebb92b804208aaaea616ec7571c8059ae0cf44 +"text-extensions@npm:^2.0.0": + version: 2.4.0 + resolution: "text-extensions@npm:2.4.0" + checksum: 9bdbc9959e004ccc86a6ec076d6c5bb6765978263e9d0d5febb640d7675c09919ea912f3fe9d50b68c3c7c43cc865610a7cb24954343abb31f74c205fbae4e45 languageName: node linkType: hard @@ -10101,7 +8256,7 @@ __metadata: languageName: node linkType: hard -"through@npm:2, through@npm:>=2.2.7 <3, through@npm:^2.3.6, through@npm:^2.3.8, through@npm:~2.3, through@npm:~2.3.1": +"through@npm:2, through@npm:>=2.2.7 <3, through@npm:^2.3.6, through@npm:~2.3, through@npm:~2.3.1": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd @@ -10117,26 +8272,58 @@ __metadata: languageName: node linkType: hard -"tmp@npm:^0.0.33": - version: 0.0.33 - resolution: "tmp@npm:0.0.33" - dependencies: - os-tmpdir: ~1.0.2 - checksum: 902d7aceb74453ea02abbf58c203f4a8fc1cead89b60b31e354f74ed5b3fb09ea817f94fb310f884a5d16987dd9fa5a735412a7c2dd088dd3d415aa819ae3a28 +"tinybench@npm:^2.5.0": + version: 2.5.1 + resolution: "tinybench@npm:2.5.1" + checksum: 6d98526c00b68b50ab0a37590b3cc6713b96fee7dd6756a2a77bab071ed1b4a4fc54e7b11e28b35ec2f761c6a806c2befa95f10acf2fee111c49327b6fc3386f languageName: node linkType: hard -"tmpl@npm:1.0.5": - version: 1.0.5 - resolution: "tmpl@npm:1.0.5" - checksum: cd922d9b853c00fe414c5a774817be65b058d54a2d01ebb415840960406c669a0fc632f66df885e24cb022ec812739199ccbdb8d1164c3e513f85bfca5ab2873 +"tinypool@npm:^0.7.0": + version: 0.7.0 + resolution: "tinypool@npm:0.7.0" + checksum: fdcccd5c750574fce51f8801a877f8284e145d12b79cd5f2d72bfbddfe20c895e915555bc848e122bb6aa968098e7ac4fe1e8e88104904d518dc01cccd18a510 languageName: node linkType: hard -"to-fast-properties@npm:^2.0.0": - version: 2.0.0 - resolution: "to-fast-properties@npm:2.0.0" - checksum: be2de62fe58ead94e3e592680052683b1ec986c72d589e7b21e5697f8744cdbf48c266fa72f6c15932894c10187b5f54573a3bcf7da0bfd964d5caf23d436168 +"tinyspy@npm:^2.1.1": + version: 2.2.0 + resolution: "tinyspy@npm:2.2.0" + checksum: 36431acaa648054406147a92b9bde494b7548d0f9f3ffbcc02113c25a6e59f3310cbe924353d7f4c51436299150bec2dbb3dc595748f58c4ddffea22d5baaadb + languageName: node + linkType: hard + +"titleize@npm:^3.0.0": + version: 3.0.0 + resolution: "titleize@npm:3.0.0" + checksum: 71fbbeabbfb36ccd840559f67f21e356e1d03da2915b32d2ae1a60ddcc13a124be2739f696d2feb884983441d159a18649e8d956648d591bdad35c430a6b6d28 + languageName: node + linkType: hard + +"tldts-core@npm:^6.0.19": + version: 6.0.19 + resolution: "tldts-core@npm:6.0.19" + checksum: 24d4215b683982f6ae438d9dc690dbce143b90bc41f177fa046d33a5350e711b220e607a54296c3fab88c41c6ac730145780ae65594dc3d9969650fd638dd6e1 + languageName: node + linkType: hard + +"tldts@npm:^6.0.17": + version: 6.0.19 + resolution: "tldts@npm:6.0.19" + dependencies: + tldts-core: ^6.0.19 + bin: + tldts: bin/cli.js + checksum: 31c1ffc9b1aa89739e1a6630bc57cf0823b5a034dfb83d9d268415e98393b621dc5a4c6e291b113c433ae8039d522b74c9e9e0f4fa8aa49b5426678b5f1e0727 + languageName: node + linkType: hard + +"tmp@npm:^0.0.33": + version: 0.0.33 + resolution: "tmp@npm:0.0.33" + dependencies: + os-tmpdir: ~1.0.2 + checksum: 902d7aceb74453ea02abbf58c203f4a8fc1cead89b60b31e354f74ed5b3fb09ea817f94fb310f884a5d16987dd9fa5a735412a7c2dd088dd3d415aa819ae3a28 languageName: node linkType: hard @@ -10178,14 +8365,23 @@ __metadata: languageName: node linkType: hard -"ts-mixer@npm:^6.0.1": +"ts-api-utils@npm:^1.0.1": + version: 1.0.3 + resolution: "ts-api-utils@npm:1.0.3" + peerDependencies: + typescript: ">=4.2.0" + checksum: 441cc4489d65fd515ae6b0f4eb8690057add6f3b6a63a36073753547fb6ce0c9ea0e0530220a0b282b0eec535f52c4dfc315d35f8a4c9a91c0def0707a714ca6 + languageName: node + linkType: hard + +"ts-mixer@npm:^6.0.3": version: 6.0.3 resolution: "ts-mixer@npm:6.0.3" checksum: 7fbaba0a413bf817835a6a23d46bccf4192dd4d7345b6bae9d594c88acffac35bf4995ef3cce753090c8abcdf2afd16dba8899365584a1f960ccc2a15bf2e2d6 languageName: node linkType: hard -"ts-node@npm:^10.8.1, ts-node@npm:^10.9.1": +"ts-node@npm:^10.9.1": version: 10.9.1 resolution: "ts-node@npm:10.9.1" dependencies: @@ -10239,28 +8435,27 @@ __metadata: languageName: node linkType: hard -"tslib@npm:1.14.1, tslib@npm:^1.13.0, tslib@npm:^1.8.1": - version: 1.14.1 - resolution: "tslib@npm:1.14.1" - checksum: dbe628ef87f66691d5d2959b3e41b9ca0045c3ee3c7c7b906cc1e328b39f199bb1ad9e671c39025bd56122ac57dfbf7385a94843b1cc07c60a4db74795829acd - languageName: node - linkType: hard - -"tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.4.1 || ^1.9.3": - version: 2.6.0 - resolution: "tslib@npm:2.6.0" - checksum: c01066038f950016a18106ddeca4649b4d76caa76ec5a31e2a26e10586a59fceb4ee45e96719bf6c715648e7c14085a81fee5c62f7e9ebee68e77a5396e5538f +"tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.6.0, tslib@npm:^2.6.1, tslib@npm:^2.6.2": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad languageName: node linkType: hard -"tsutils@npm:^3.21.0": - version: 3.21.0 - resolution: "tsutils@npm:3.21.0" +"tsx@npm:^4.0.0": + version: 4.0.0 + resolution: "tsx@npm:4.0.0" dependencies: - tslib: ^1.8.1 - peerDependencies: - typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - checksum: 1843f4c1b2e0f975e08c4c21caa4af4f7f65a12ac1b81b3b8489366826259323feb3fc7a243123453d2d1a02314205a7634e048d4a8009921da19f99755cdc48 + esbuild: ~0.18.20 + fsevents: ~2.3.3 + get-tsconfig: ^4.7.2 + source-map-support: ^0.5.21 + dependenciesMeta: + fsevents: + optional: true + bin: + tsx: dist/cli.mjs + checksum: bf3ca90ac9adac59ea96fd675017ba369d39d3091136f5f0eba1db21efec5993139e64721ff821dc26e7afa73a5ab93317caeb299425c2c2caa0e486a76766af languageName: node linkType: hard @@ -10287,7 +8482,7 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:4.0.8": +"type-detect@npm:^4.0.0, type-detect@npm:^4.0.8": version: 4.0.8 resolution: "type-detect@npm:4.0.8" checksum: 62b5628bff67c0eb0b66afa371bd73e230399a8d2ad30d852716efcc4656a7516904570cd8631a49a3ce57c10225adf5d0cbdcb47f6b0255fe6557c453925a15 @@ -10329,6 +8524,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^1.0.2": + version: 1.4.0 + resolution: "type-fest@npm:1.4.0" + checksum: b011c3388665b097ae6a109a437a04d6f61d81b7357f74cbcb02246f2f5bd72b888ae33631b99871388122ba0a87f4ff1c94078e7119ff22c70e52c0ff828201 + languageName: node + linkType: hard + "typedarray@npm:^0.0.6": version: 0.0.6 resolution: "typedarray@npm:0.0.6" @@ -10336,58 +8538,119 @@ __metadata: languageName: node linkType: hard -"typeorm-naming-strategies@npm:^2.0.0": - version: 2.0.0 - resolution: "typeorm-naming-strategies@npm:2.0.0" +"typeorm-naming-strategies@npm:^4.1.0": + version: 4.1.0 + resolution: "typeorm-naming-strategies@npm:4.1.0" peerDependencies: - typeorm: ^0.2.0 - checksum: c75a1529bb3c1dfde40530a398e77396fe69a25cbeed70e7aa49d67ab0348e61c129f7b181ee9469901036f81a9493d027d00cd536215953b233f691480368f0 + typeorm: ^0.2.0 || ^0.3.0 + checksum: 9654f386915532b134e00d10fa50b75d2c63d462a4acafad8d67071548cb41447b67bc5029ea07afae043f504a3e76c0f7526fc16c40081a70ade2a862a92164 languageName: node linkType: hard -"typeorm@npm:0.2.28": - version: 0.2.28 - resolution: "typeorm@npm:0.2.28" +"typeorm@npm:0.3.17": + version: 0.3.17 + resolution: "typeorm@npm:0.3.17" dependencies: - "@sqltools/formatter": 1.2.2 - app-root-path: ^3.0.0 - buffer: ^5.5.0 - chalk: ^4.1.0 - cli-highlight: ^2.1.4 - debug: ^4.1.1 - dotenv: ^8.2.0 - glob: ^7.1.6 - js-yaml: ^3.14.0 - mkdirp: ^1.0.4 + "@sqltools/formatter": ^1.2.5 + app-root-path: ^3.1.0 + buffer: ^6.0.3 + chalk: ^4.1.2 + cli-highlight: ^2.1.11 + date-fns: ^2.29.3 + debug: ^4.3.4 + dotenv: ^16.0.3 + glob: ^8.1.0 + mkdirp: ^2.1.3 reflect-metadata: ^0.1.13 sha.js: ^2.4.11 - tslib: ^1.13.0 - xml2js: ^0.4.23 - yargonaut: ^1.1.2 - yargs: ^16.0.3 + tslib: ^2.5.0 + uuid: ^9.0.0 + yargs: ^17.6.2 + peerDependencies: + "@google-cloud/spanner": ^5.18.0 + "@sap/hana-client": ^2.12.25 + better-sqlite3: ^7.1.2 || ^8.0.0 + hdb-pool: ^0.1.6 + ioredis: ^5.0.4 + mongodb: ^5.2.0 + mssql: ^9.1.1 + mysql2: ^2.2.5 || ^3.0.1 + oracledb: ^5.1.0 + pg: ^8.5.1 + pg-native: ^3.0.0 + pg-query-stream: ^4.0.0 + redis: ^3.1.1 || ^4.0.0 + sql.js: ^1.4.0 + sqlite3: ^5.0.3 + ts-node: ^10.7.0 + typeorm-aurora-data-api-driver: ^2.0.0 + peerDependenciesMeta: + "@google-cloud/spanner": + optional: true + "@sap/hana-client": + optional: true + better-sqlite3: + optional: true + hdb-pool: + optional: true + ioredis: + optional: true + mongodb: + optional: true + mssql: + optional: true + mysql2: + optional: true + oracledb: + optional: true + pg: + optional: true + pg-native: + optional: true + pg-query-stream: + optional: true + redis: + optional: true + sql.js: + optional: true + sqlite3: + optional: true + ts-node: + optional: true + typeorm-aurora-data-api-driver: + optional: true bin: typeorm: cli.js - checksum: 1c58cbb3fcac85ffdf24da2b5271f48779363bbdd18cb5f50702bc84dffad6607aa33dc6144aed6b18974ddc0419256f84084496c42485746a74cd2941264704 + typeorm-ts-node-commonjs: cli-ts-node-commonjs.js + typeorm-ts-node-esm: cli-ts-node-esm.js + checksum: 71fcb2b2e889c759b24add6c6ab7938c9a52f7c206b055f3a2abd77725acfec125b8f303e263381258ee03e52f7d3eb88c1fb893b15750b5237c8fc9db31ed78 languageName: node linkType: hard -"typescript@npm:~4.7.4": - version: 4.7.4 - resolution: "typescript@npm:4.7.4" +"typescript@npm:^5.2.2": + version: 5.2.2 + resolution: "typescript@npm:5.2.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 5750181b1cd7e6482c4195825547e70f944114fb47e58e4aa7553e62f11b3f3173766aef9c281783edfd881f7b8299cf35e3ca8caebe73d8464528c907a164df + checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~4.7.4#~builtin": - version: 4.7.4 - resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin::version=4.7.4&hash=65a307" +"typescript@patch:typescript@^5.2.2#~builtin": + version: 5.2.2 + resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=14eedb" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 9096d8f6c16cb80ef3bf96fcbbd055bf1c4a43bd14f3b7be45a9fbe7ada46ec977f604d5feed3263b4f2aa7d4c7477ce5f9cd87de0d6feedec69a983f3a4f93e + checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554 + languageName: node + linkType: hard + +"ufo@npm:^1.3.0": + version: 1.3.1 + resolution: "ufo@npm:1.3.1" + checksum: 2db2f9d24e3f572ddb9b2f4415eda679fd366cbb9eec4c56996651323737f17528b4aab2bb45c5f2effff2304f9b0c46e0981aee3e48f38ac51106a8993dff31 languageName: node linkType: hard @@ -10415,73 +8678,60 @@ __metadata: languageName: node linkType: hard -"unicode-canonical-property-names-ecmascript@npm:^2.0.0": - version: 2.0.0 - resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.0" - checksum: 39be078afd014c14dcd957a7a46a60061bc37c4508ba146517f85f60361acf4c7539552645ece25de840e17e293baa5556268d091ca6762747fdd0c705001a45 +"undici-types@npm:~5.26.4": + version: 5.26.5 + resolution: "undici-types@npm:5.26.5" + checksum: 3192ef6f3fd5df652f2dc1cd782b49d6ff14dc98e5dced492aa8a8c65425227da5da6aafe22523c67f035a272c599bb89cfe803c1db6311e44bed3042fc25487 languageName: node linkType: hard -"unicode-match-property-ecmascript@npm:^2.0.0": - version: 2.0.0 - resolution: "unicode-match-property-ecmascript@npm:2.0.0" +"undici@npm:5.22.1": + version: 5.22.1 + resolution: "undici@npm:5.22.1" dependencies: - unicode-canonical-property-names-ecmascript: ^2.0.0 - unicode-property-aliases-ecmascript: ^2.0.0 - checksum: 1f34a7434a23df4885b5890ac36c5b2161a809887000be560f56ad4b11126d433c0c1c39baf1016bdabed4ec54829a6190ee37aa24919aa116dc1a5a8a62965a - languageName: node - linkType: hard - -"unicode-match-property-value-ecmascript@npm:^2.1.0": - version: 2.1.0 - resolution: "unicode-match-property-value-ecmascript@npm:2.1.0" - checksum: 8d6f5f586b9ce1ed0e84a37df6b42fdba1317a05b5df0c249962bd5da89528771e2d149837cad11aa26bcb84c35355cb9f58a10c3d41fa3b899181ece6c85220 + busboy: ^1.6.0 + checksum: 048a3365f622be44fb319316cedfaa241c59cf7f3368ae7667a12323447e1822e8cc3d00f6956c852d1478a6fde1cbbe753f49e05f2fdaed229693e716ebaf35 languageName: node linkType: hard -"unicode-property-aliases-ecmascript@npm:^2.0.0": - version: 2.1.0 - resolution: "unicode-property-aliases-ecmascript@npm:2.1.0" - checksum: 243524431893649b62cc674d877bd64ef292d6071dd2fd01ab4d5ad26efbc104ffcd064f93f8a06b7e4ec54c172bf03f6417921a0d8c3a9994161fe1f88f815b +"undici@npm:^5.26.5": + version: 5.27.2 + resolution: "undici@npm:5.27.2" + dependencies: + "@fastify/busboy": ^2.0.0 + checksum: 22bbdd763798700979986546d70072b67223189353d2a811efa9c6e44476161a0d1781ffe24115221f69a1b344b95d5926bd39a6eb760a2cd8804781cec0c5eb languageName: node linkType: hard -"unique-filename@npm:^2.0.0": - version: 2.0.1 - resolution: "unique-filename@npm:2.0.1" +"unique-filename@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-filename@npm:3.0.0" dependencies: - unique-slug: ^3.0.0 - checksum: 807acf3381aff319086b64dc7125a9a37c09c44af7620bd4f7f3247fcd5565660ac12d8b80534dcbfd067e6fe88a67e621386dd796a8af828d1337a8420a255f + unique-slug: ^4.0.0 + checksum: 8e2f59b356cb2e54aab14ff98a51ac6c45781d15ceaab6d4f1c2228b780193dc70fae4463ce9e1df4479cb9d3304d7c2043a3fb905bdeca71cc7e8ce27e063df languageName: node linkType: hard -"unique-slug@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-slug@npm:3.0.0" +"unique-slug@npm:^4.0.0": + version: 4.0.0 + resolution: "unique-slug@npm:4.0.0" dependencies: imurmurhash: ^0.1.4 - checksum: 49f8d915ba7f0101801b922062ee46b7953256c93ceca74303bd8e6413ae10aa7e8216556b54dc5382895e8221d04f1efaf75f945c2e4a515b4139f77aa6640c + checksum: 0884b58365af59f89739e6f71e3feacb5b1b41f2df2d842d0757933620e6de08eff347d27e9d499b43c40476cbaf7988638d3acb2ffbcb9d35fd035591adfd15 languageName: node linkType: hard "universalify@npm:^2.0.0": - version: 2.0.0 - resolution: "universalify@npm:2.0.0" - checksum: 2406a4edf4a8830aa6813278bab1f953a8e40f2f63a37873ffa9a3bc8f9745d06cc8e88f3572cb899b7e509013f7f6fcc3e37e8a6d914167a5381d8440518c44 + version: 2.0.1 + resolution: "universalify@npm:2.0.1" + checksum: ecd8469fe0db28e7de9e5289d32bd1b6ba8f7183db34f3bfc4ca53c49891c2d6aa05f3fb3936a81285a905cc509fb641a0c3fc131ec786167eff41236ae32e60 languageName: node linkType: hard -"update-browserslist-db@npm:^1.0.11": - version: 1.0.11 - resolution: "update-browserslist-db@npm:1.0.11" - dependencies: - escalade: ^3.1.1 - picocolors: ^1.0.0 - peerDependencies: - browserslist: ">= 4.21.0" - bin: - update-browserslist-db: cli.js - checksum: b98327518f9a345c7cad5437afae4d2ae7d865f9779554baf2a200fdf4bac4969076b679b1115434bd6557376bdd37ca7583d0f9b8f8e302d7d4cc1e91b5f231 +"untildify@npm:^4.0.0": + version: 4.0.0 + resolution: "untildify@npm:4.0.0" + checksum: 39ced9c418a74f73f0a56e1ba4634b4d959422dff61f4c72a8e39f60b99380c1b45ed776fbaa0a4101b157e4310d873ad7d114e8534ca02609b4916bb4187fb9 languageName: node linkType: hard @@ -10502,12 +8752,12 @@ __metadata: linkType: hard "url@npm:~0.11.0": - version: 0.11.0 - resolution: "url@npm:0.11.0" + version: 0.11.3 + resolution: "url@npm:0.11.3" dependencies: - punycode: 1.3.2 - querystring: 0.2.0 - checksum: 50d100d3dd2d98b9fe3ada48cadb0b08aa6be6d3ac64112b867b56b19be4bfcba03c2a9a0d7922bfd7ac17d4834e88537749fe182430dfd9b68e520175900d90 + punycode: ^1.4.1 + qs: ^6.11.2 + checksum: f9e7886f46a16f96d2e42fbcc5d682c231c55ef5442c1ff66150c0f6556f6e3a97d094a84f51be15ec2432711d212eb60426659ce418f5fcadeaa3f601532c4e languageName: node linkType: hard @@ -10525,12 +8775,12 @@ __metadata: languageName: node linkType: hard -"util@npm:0.10.3": - version: 0.10.3 - resolution: "util@npm:0.10.3" +"util@npm:^0.10.4": + version: 0.10.4 + resolution: "util@npm:0.10.4" dependencies: - inherits: 2.0.1 - checksum: bd800f5d237a82caddb61723a6cbe45297d25dd258651a31335a4d5d981fd033cb4771f82db3d5d59b582b187cb69cfe727dc6f4d8d7826f686ee6c07ce611e0 + inherits: 2.0.3 + checksum: 913f9a90d05a60e91f91af01b8bd37e06bca4cc02d7b49e01089f9d5b78be2fffd61fb1a41b517de7238c5fc7337fa939c62d1fb4eb82e014894c7bee6637aaf languageName: node linkType: hard @@ -10547,6 +8797,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^9.0.0": + version: 9.0.1 + resolution: "uuid@npm:9.0.1" + bin: + uuid: dist/bin/uuid + checksum: 39931f6da74e307f51c0fb463dc2462807531dc80760a9bff1e35af4316131b4fc3203d16da60ae33f07fdca5b56f3f1dd662da0c99fea9aaeab2004780cc5f4 + languageName: node + linkType: hard + "v8-compile-cache-lib@npm:^3.0.1": version: 3.0.1 resolution: "v8-compile-cache-lib@npm:3.0.1" @@ -10554,14 +8813,14 @@ __metadata: languageName: node linkType: hard -"v8-to-istanbul@npm:^9.0.1": - version: 9.1.0 - resolution: "v8-to-istanbul@npm:9.1.0" +"v8-to-istanbul@npm:^9.1.0": + version: 9.1.3 + resolution: "v8-to-istanbul@npm:9.1.3" dependencies: "@jridgewell/trace-mapping": ^0.3.12 "@types/istanbul-lib-coverage": ^2.0.1 - convert-source-map: ^1.6.0 - checksum: 2069d59ee46cf8d83b4adfd8a5c1a90834caffa9f675e4360f1157ffc8578ef0f763c8f32d128334424159bb6b01f3876acd39cd13297b2769405a9da241f8d1 + convert-source-map: ^2.0.0 + checksum: 5d592ab3d186b386065dace8e01c543a922a904b3cfac39667de172455a6b3d0e8e1401574fecb8a12092ad0809b5a8fd15f1cc14d0666139a1bb77cd6ac2cf8 languageName: node linkType: hard @@ -10575,19 +8834,126 @@ __metadata: languageName: node linkType: hard -"vm-browserify@npm:^1.0.0": - version: 1.1.2 - resolution: "vm-browserify@npm:1.1.2" - checksum: 10a1c50aab54ff8b4c9042c15fc64aefccce8d2fb90c0640403242db0ee7fb269f9b102bdb69cfb435d7ef3180d61fd4fb004a043a12709abaf9056cfd7e039d +"vite-node@npm:0.34.6": + version: 0.34.6 + resolution: "vite-node@npm:0.34.6" + dependencies: + cac: ^6.7.14 + debug: ^4.3.4 + mlly: ^1.4.0 + pathe: ^1.1.1 + picocolors: ^1.0.0 + vite: ^3.0.0 || ^4.0.0 || ^5.0.0-0 + bin: + vite-node: vite-node.mjs + checksum: 46eba82bf8b69c7dfeed901502533b172cc6303212f0f49f82c2f64758fa4b60acd1b1e37cb96aff944e36b510b0d1beedb50d9cb25ef39e0159b2b9d1136b1f + languageName: node + linkType: hard + +"vite@npm:^3.0.0 || ^4.0.0 || ^5.0.0-0, vite@npm:^3.1.0 || ^4.0.0 || ^5.0.0-0": + version: 5.0.0-beta.17 + resolution: "vite@npm:5.0.0-beta.17" + dependencies: + esbuild: ^0.19.3 + fsevents: ~2.3.3 + postcss: ^8.4.31 + rollup: ^4.2.0 + peerDependencies: + "@types/node": ^18.0.0 || >=20.0.0 + less: "*" + lightningcss: ^1.21.0 + sass: "*" + stylus: "*" + sugarss: "*" + terser: ^5.4.0 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + bin: + vite: bin/vite.js + checksum: 2d77fbb328a4422206315651e205980770a4aed99efff52fc2e9d7d835f17ad0816ea10231ba8b28222785c6fefb5282cf792b27cd847bdc419556ca222c4221 languageName: node linkType: hard -"walker@npm:^1.0.8": - version: 1.0.8 - resolution: "walker@npm:1.0.8" +"vitest@npm:^0.34.6": + version: 0.34.6 + resolution: "vitest@npm:0.34.6" dependencies: - makeerror: 1.0.12 - checksum: ad7a257ea1e662e57ef2e018f97b3c02a7240ad5093c392186ce0bcf1f1a60bbadd520d073b9beb921ed99f64f065efb63dfc8eec689a80e569f93c1c5d5e16c + "@types/chai": ^4.3.5 + "@types/chai-subset": ^1.3.3 + "@types/node": "*" + "@vitest/expect": 0.34.6 + "@vitest/runner": 0.34.6 + "@vitest/snapshot": 0.34.6 + "@vitest/spy": 0.34.6 + "@vitest/utils": 0.34.6 + acorn: ^8.9.0 + acorn-walk: ^8.2.0 + cac: ^6.7.14 + chai: ^4.3.10 + debug: ^4.3.4 + local-pkg: ^0.4.3 + magic-string: ^0.30.1 + pathe: ^1.1.1 + picocolors: ^1.0.0 + std-env: ^3.3.3 + strip-literal: ^1.0.1 + tinybench: ^2.5.0 + tinypool: ^0.7.0 + vite: ^3.1.0 || ^4.0.0 || ^5.0.0-0 + vite-node: 0.34.6 + why-is-node-running: ^2.2.2 + peerDependencies: + "@edge-runtime/vm": "*" + "@vitest/browser": "*" + "@vitest/ui": "*" + happy-dom: "*" + jsdom: "*" + playwright: "*" + safaridriver: "*" + webdriverio: "*" + peerDependenciesMeta: + "@edge-runtime/vm": + optional: true + "@vitest/browser": + optional: true + "@vitest/ui": + optional: true + happy-dom: + optional: true + jsdom: + optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + bin: + vitest: vitest.mjs + checksum: 45f5c1987fa8c76dbaf5db379bbdb4f6e3713c484e850149af38247b627e70016c1863286fd7fcfab08a1d98430f66ba1f45af6f14f5c467ded4b1ea6f26afa3 + languageName: node + linkType: hard + +"vm-browserify@npm:^1.0.0": + version: 1.1.2 + resolution: "vm-browserify@npm:1.1.2" + checksum: 10a1c50aab54ff8b4c9042c15fc64aefccce8d2fb90c0640403242db0ee7fb269f9b102bdb69cfb435d7ef3180d61fd4fb004a043a12709abaf9056cfd7e039d languageName: node linkType: hard @@ -10617,17 +8983,16 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.2": - version: 1.1.9 - resolution: "which-typed-array@npm:1.1.9" +"which-typed-array@npm:^1.1.11, which-typed-array@npm:^1.1.2": + version: 1.1.13 + resolution: "which-typed-array@npm:1.1.13" dependencies: available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 + call-bind: ^1.0.4 for-each: ^0.3.3 gopd: ^1.0.1 has-tostringtag: ^1.0.0 - is-typed-array: ^1.1.10 - checksum: fe0178ca44c57699ca2c0e657b64eaa8d2db2372a4e2851184f568f98c478ae3dc3fdb5f7e46c384487046b0cf9e23241423242b277e03e8ba3dabc7c84c98ef + checksum: 3828a0d5d72c800e369d447e54c7620742a4cc0c9baf1b5e8c17e9b6ff90d8d861a3a6dd4800f1953dbf80e5e5cec954a289e5b4a223e3bee4aeb1f8c5f33309 languageName: node linkType: hard @@ -10653,34 +9018,37 @@ __metadata: languageName: node linkType: hard -"wide-align@npm:^1.1.5": - version: 1.1.5 - resolution: "wide-align@npm:1.1.5" +"which@npm:^4.0.0": + version: 4.0.0 + resolution: "which@npm:4.0.0" dependencies: - string-width: ^1.0.2 || 2 || 3 || 4 - checksum: d5fc37cd561f9daee3c80e03b92ed3e84d80dde3365a8767263d03dacfc8fa06b065ffe1df00d8c2a09f731482fcacae745abfbb478d4af36d0a891fad4834d3 + isexe: ^3.1.1 + bin: + node-which: bin/which.js + checksum: f17e84c042592c21e23c8195108cff18c64050b9efb8459589116999ea9da6dd1509e6a1bac3aeebefd137be00fabbb61b5c2bc0aa0f8526f32b58ee2f545651 languageName: node linkType: hard -"word-wrap@npm:^1.0.3": - version: 1.2.4 - resolution: "word-wrap@npm:1.2.4" - checksum: 8f1f2e0a397c0e074ca225ba9f67baa23f99293bc064e31355d426ae91b8b3f6b5f6c1fc9ae5e9141178bb362d563f55e62fd8d5c31f2a77e3ade56cb3e35bd1 +"why-is-node-running@npm:^2.2.2": + version: 2.2.2 + resolution: "why-is-node-running@npm:2.2.2" + dependencies: + siginfo: ^2.0.0 + stackback: 0.0.2 + bin: + why-is-node-running: cli.js + checksum: 50820428f6a82dfc3cbce661570bcae9b658723217359b6037b67e495255409b4c8bc7931745f5c175df71210450464517cab32b2f7458ac9c40b4925065200a languageName: node linkType: hard -"wrap-ansi@npm:^6.2.0": - version: 6.2.0 - resolution: "wrap-ansi@npm:6.2.0" - dependencies: - ansi-styles: ^4.0.0 - string-width: ^4.1.0 - strip-ansi: ^6.0.0 - checksum: 6cd96a410161ff617b63581a08376f0cb9162375adeb7956e10c8cd397821f7eb2a6de24eb22a0b28401300bf228c86e50617cd568209b5f6775b93c97d2fe3a +"word-wrap@npm:^1.0.3": + version: 1.2.5 + resolution: "word-wrap@npm:1.2.5" + checksum: f93ba3586fc181f94afdaff3a6fef27920b4b6d9eaefed0f428f8e07adea2a7f54a5f2830ce59406c8416f033f86902b91eb824072354645eea687dff3691ccb languageName: node linkType: hard -"wrap-ansi@npm:^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" dependencies: @@ -10691,6 +9059,17 @@ __metadata: languageName: node linkType: hard +"wrap-ansi@npm:^8.0.1, wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" + dependencies: + ansi-styles: ^6.1.0 + string-width: ^5.0.1 + strip-ansi: ^7.0.1 + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 + languageName: node + linkType: hard + "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" @@ -10698,19 +9077,9 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.2": - version: 4.0.2 - resolution: "write-file-atomic@npm:4.0.2" - dependencies: - imurmurhash: ^0.1.4 - signal-exit: ^3.0.7 - checksum: 5da60bd4eeeb935eec97ead3df6e28e5917a6bd317478e4a85a5285e8480b8ed96032bbcc6ecd07b236142a24f3ca871c924ec4a6575e623ec1b11bf8c1c253c - languageName: node - linkType: hard - "ws@npm:^8.13.0": - version: 8.13.0 - resolution: "ws@npm:8.13.0" + version: 8.14.2 + resolution: "ws@npm:8.14.2" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -10719,24 +9088,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 53e991bbf928faf5dc6efac9b8eb9ab6497c69feeb94f963d648b7a3530a720b19ec2e0ec037344257e05a4f35bd9ad04d9de6f289615ffb133282031b18c61c - languageName: node - linkType: hard - -"xml2js@npm:^0.4.23": - version: 0.4.23 - resolution: "xml2js@npm:0.4.23" - dependencies: - sax: ">=0.6.0" - xmlbuilder: ~11.0.0 - checksum: ca0cf2dfbf6deeaae878a891c8fbc0db6fd04398087084edf143cdc83d0509ad0fe199b890f62f39c4415cf60268a27a6aed0d343f0658f8779bd7add690fa98 - languageName: node - linkType: hard - -"xmlbuilder@npm:~11.0.0": - version: 11.0.1 - resolution: "xmlbuilder@npm:11.0.1" - checksum: 7152695e16f1a9976658215abab27e55d08b1b97bca901d58b048d2b6e106b5af31efccbdecf9b07af37c8377d8e7e821b494af10b3a68b0ff4ae60331b415b0 + checksum: 3ca0dad26e8cc6515ff392b622a1467430814c463b3368b0258e33696b1d4bed7510bc7030f7b72838b9fdeb8dbd8839cbf808367d6aae2e1d668ce741d4308b languageName: node linkType: hard @@ -10754,13 +9106,6 @@ __metadata: languageName: node linkType: hard -"yallist@npm:^3.0.2": - version: 3.1.1 - resolution: "yallist@npm:3.1.1" - checksum: 48f7bb00dc19fc635a13a39fe547f527b10c9290e7b3e836b9a8f1ca04d4d342e85714416b3c2ab74949c9c66f9cebb0473e6bc353b79035356103b47641285d - languageName: node - linkType: hard - "yallist@npm:^4.0.0": version: 4.0.0 resolution: "yallist@npm:4.0.0" @@ -10768,21 +9113,10 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.2.2": - version: 2.2.2 - resolution: "yaml@npm:2.2.2" - checksum: d90c235e099e30094dcff61ba3350437aef53325db4a6bcd04ca96e1bfe7e348b191f6a7a52b5211e2dbc4eeedb22a00b291527da030de7c189728ef3f2b4eb3 - languageName: node - linkType: hard - -"yargonaut@npm:^1.1.2": - version: 1.1.4 - resolution: "yargonaut@npm:1.1.4" - dependencies: - chalk: ^1.1.1 - figlet: ^1.1.1 - parent-require: ^1.0.0 - checksum: d0ffc310a761782ae38022d88e13e84486080b2be2c43e8d5cbb987e40c3d2dd18274c39ce34e05d6bc312a4e768cd4c469d338ed60409adf6f4d870017c63a3 +"yaml@npm:2.3.3": + version: 2.3.3 + resolution: "yaml@npm:2.3.3" + checksum: cdfd132e7e0259f948929efe8835923df05c013c273c02bb7a2de9b46ac3af53c2778a35b32c7c0f877cc355dc9340ed564018c0242bfbb1278c2a3e53a0e99e languageName: node linkType: hard @@ -10800,7 +9134,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^16.0.0, yargs@npm:^16.0.3": +"yargs@npm:^16.0.0": version: 16.2.0 resolution: "yargs@npm:16.2.0" dependencies: @@ -10815,9 +9149,9 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^17.0.0, yargs@npm:^17.3.1": - version: 17.7.1 - resolution: "yargs@npm:17.7.1" +"yargs@npm:^17.0.0, yargs@npm:^17.6.2": + version: 17.7.2 + resolution: "yargs@npm:17.7.2" dependencies: cliui: ^8.0.1 escalade: ^3.1.1 @@ -10826,7 +9160,7 @@ __metadata: string-width: ^4.2.3 y18n: ^5.0.5 yargs-parser: ^21.1.1 - checksum: 3d8a43c336a4942bc68080768664aca85c7bd406f018bad362fd255c41c8f4e650277f42fd65d543fce99e084124ddafee7bbfc1a5c6a8fda4cec78609dcf8d4 + checksum: 73b572e863aa4a8cbef323dd911d79d193b772defd5a51aab0aca2d446655216f5002c42c5306033968193bdbf892a7a4c110b0d77954a7fdf563e653967b56a languageName: node linkType: hard @@ -10844,12 +9178,19 @@ __metadata: languageName: node linkType: hard -"zlib-sync@npm:^0.1.8": - version: 0.1.8 - resolution: "zlib-sync@npm:0.1.8" +"yocto-queue@npm:^1.0.0": + version: 1.0.0 + resolution: "yocto-queue@npm:1.0.0" + checksum: 2cac84540f65c64ccc1683c267edce396b26b1e931aa429660aefac8fbe0188167b7aee815a3c22fa59a28a58d898d1a2b1825048f834d8d629f4c2a5d443801 + languageName: node + linkType: hard + +"zlib-sync@npm:^0.1.9": + version: 0.1.9 + resolution: "zlib-sync@npm:0.1.9" dependencies: - nan: ^2.17.0 + nan: ^2.18.0 node-gyp: latest - checksum: 3ee774339f50b49de764312b74d6ef090e85a9a2d6401e89f6eb1bd33dd59d644d2831c6811e01aa8a51d0ecf51d5f435bd7f551d68d40d3c360a8eebb555b6f + checksum: 36605c354b8c56bd44b0035d986ef393ad85c6774854da981a107b832c32b856b45d71529aeeca3de16aa65ed39cf9129250138c487de99cc89f14d5ee65dd2f languageName: node linkType: hard