From 805234acc146dea1dd7db10d37482c0d2e912a57 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 9 Apr 2024 18:32:01 +0300 Subject: [PATCH 01/11] refactor: simplify logs plugin types; remove deprecated format.timestamp field --- .../functions/createMessageSpamTrigger.ts | 2 +- backend/src/plugins/Logs/LogsPlugin.ts | 5 +---- .../Logs/logFunctions/logAutomodAction.ts | 2 +- .../plugins/Logs/logFunctions/logBotAlert.ts | 2 +- .../Logs/logFunctions/logCaseCreate.ts | 2 +- .../Logs/logFunctions/logCaseDelete.ts | 2 +- .../Logs/logFunctions/logCaseUpdate.ts | 2 +- .../plugins/Logs/logFunctions/logCensor.ts | 2 +- .../Logs/logFunctions/logChannelCreate.ts | 2 +- .../Logs/logFunctions/logChannelDelete.ts | 2 +- .../Logs/logFunctions/logChannelUpdate.ts | 2 +- .../src/plugins/Logs/logFunctions/logClean.ts | 2 +- .../plugins/Logs/logFunctions/logDmFailed.ts | 2 +- .../Logs/logFunctions/logEmojiCreate.ts | 2 +- .../Logs/logFunctions/logEmojiDelete.ts | 2 +- .../Logs/logFunctions/logEmojiUpdate.ts | 2 +- .../plugins/Logs/logFunctions/logMassBan.ts | 2 +- .../plugins/Logs/logFunctions/logMassMute.ts | 2 +- .../plugins/Logs/logFunctions/logMassUnban.ts | 2 +- .../plugins/Logs/logFunctions/logMemberBan.ts | 2 +- .../Logs/logFunctions/logMemberForceban.ts | 2 +- .../Logs/logFunctions/logMemberJoin.ts | 2 +- .../logMemberJoinWithPriorRecords.ts | 2 +- .../Logs/logFunctions/logMemberKick.ts | 2 +- .../Logs/logFunctions/logMemberLeave.ts | 2 +- .../Logs/logFunctions/logMemberMute.ts | 2 +- .../Logs/logFunctions/logMemberMuteExpired.ts | 2 +- .../Logs/logFunctions/logMemberMuteRejoin.ts | 2 +- .../Logs/logFunctions/logMemberNickChange.ts | 2 +- .../Logs/logFunctions/logMemberNote.ts | 2 +- .../Logs/logFunctions/logMemberRestore.ts | 2 +- .../Logs/logFunctions/logMemberRoleAdd.ts | 2 +- .../Logs/logFunctions/logMemberRoleChanges.ts | 2 +- .../Logs/logFunctions/logMemberRoleRemove.ts | 2 +- .../Logs/logFunctions/logMemberTimedBan.ts | 2 +- .../Logs/logFunctions/logMemberTimedMute.ts | 2 +- .../Logs/logFunctions/logMemberTimedUnban.ts | 2 +- .../Logs/logFunctions/logMemberTimedUnmute.ts | 2 +- .../Logs/logFunctions/logMemberUnban.ts | 2 +- .../Logs/logFunctions/logMemberUnmute.ts | 2 +- .../Logs/logFunctions/logMemberWarn.ts | 2 +- .../Logs/logFunctions/logMessageDelete.ts | 7 ++---- .../Logs/logFunctions/logMessageDeleteAuto.ts | 2 +- .../Logs/logFunctions/logMessageDeleteBare.ts | 2 +- .../Logs/logFunctions/logMessageDeleteBulk.ts | 2 +- .../Logs/logFunctions/logMessageEdit.ts | 2 +- .../logFunctions/logMessageSpamDetected.ts | 2 +- .../Logs/logFunctions/logOtherSpamDetected.ts | 2 +- .../logFunctions/logPostedScheduledMessage.ts | 2 +- .../Logs/logFunctions/logRepeatedMessage.ts | 2 +- .../Logs/logFunctions/logRoleCreate.ts | 2 +- .../Logs/logFunctions/logRoleDelete.ts | 2 +- .../Logs/logFunctions/logRoleUpdate.ts | 2 +- .../Logs/logFunctions/logScheduledMessage.ts | 2 +- .../logScheduledRepeatedMessage.ts | 2 +- .../Logs/logFunctions/logSetAntiraidAuto.ts | 2 +- .../Logs/logFunctions/logSetAntiraidUser.ts | 2 +- .../logFunctions/logStageInstanceCreate.ts | 2 +- .../logFunctions/logStageInstanceDelete.ts | 2 +- .../logFunctions/logStageInstanceUpdate.ts | 2 +- .../Logs/logFunctions/logStickerCreate.ts | 2 +- .../Logs/logFunctions/logStickerDelete.ts | 2 +- .../Logs/logFunctions/logStickerUpdate.ts | 2 +- .../Logs/logFunctions/logThreadCreate.ts | 2 +- .../Logs/logFunctions/logThreadDelete.ts | 2 +- .../Logs/logFunctions/logThreadUpdate.ts | 2 +- .../logVoiceChannelForceDisconnect.ts | 2 +- .../logFunctions/logVoiceChannelForceMove.ts | 2 +- .../Logs/logFunctions/logVoiceChannelJoin.ts | 2 +- .../Logs/logFunctions/logVoiceChannelLeave.ts | 2 +- .../Logs/logFunctions/logVoiceChannelMove.ts | 2 +- backend/src/plugins/Logs/types.ts | 22 +++++-------------- .../src/plugins/Logs/util/getLogMessage.ts | 5 +---- backend/src/plugins/Spam/types.ts | 2 +- backend/src/utils.ts | 4 ++-- 75 files changed, 81 insertions(+), 102 deletions(-) diff --git a/backend/src/plugins/Automod/functions/createMessageSpamTrigger.ts b/backend/src/plugins/Automod/functions/createMessageSpamTrigger.ts index cb7eb2888..605a4e986 100644 --- a/backend/src/plugins/Automod/functions/createMessageSpamTrigger.ts +++ b/backend/src/plugins/Automod/functions/createMessageSpamTrigger.ts @@ -9,7 +9,7 @@ import { findRecentSpam } from "./findRecentSpam"; import { getMatchingMessageRecentActions } from "./getMatchingMessageRecentActions"; import { getMessageSpamIdentifier } from "./getSpamIdentifier"; -interface TMessageSpamMatchResultType { +export interface TMessageSpamMatchResultType { archiveId: string; } diff --git a/backend/src/plugins/Logs/LogsPlugin.ts b/backend/src/plugins/Logs/LogsPlugin.ts index 62a6de4d0..3bb102d7d 100644 --- a/backend/src/plugins/Logs/LogsPlugin.ts +++ b/backend/src/plugins/Logs/LogsPlugin.ts @@ -118,10 +118,7 @@ function getCasesPlugin(): Promise { const defaultOptions: PluginOptions = { config: { channels: {}, - format: { - timestamp: FORMAT_NO_TIMESTAMP, - ...DefaultLogMessages, - }, + format: DefaultLogMessages, ping_user: true, allow_user_mentions: false, timestamp_format: "[]", diff --git a/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts b/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts index 2a2fd69c5..bd9921c08 100644 --- a/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts +++ b/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts @@ -6,7 +6,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogAutomodActionData { +export interface LogAutomodActionData { rule: string; user?: User | null; users: User[]; diff --git a/backend/src/plugins/Logs/logFunctions/logBotAlert.ts b/backend/src/plugins/Logs/logFunctions/logBotAlert.ts index 1438b2496..372a7489c 100644 --- a/backend/src/plugins/Logs/logFunctions/logBotAlert.ts +++ b/backend/src/plugins/Logs/logFunctions/logBotAlert.ts @@ -4,7 +4,7 @@ import { createTypedTemplateSafeValueContainer } from "../../../templateFormatte import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogBotAlertData { +export interface LogBotAlertData { body: string; } diff --git a/backend/src/plugins/Logs/logFunctions/logCaseCreate.ts b/backend/src/plugins/Logs/logFunctions/logCaseCreate.ts index d2fe96b92..dd144a726 100644 --- a/backend/src/plugins/Logs/logFunctions/logCaseCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logCaseCreate.ts @@ -6,7 +6,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogCaseCreateData { +export interface LogCaseCreateData { mod: User; userId: string; caseNum: number; diff --git a/backend/src/plugins/Logs/logFunctions/logCaseDelete.ts b/backend/src/plugins/Logs/logFunctions/logCaseDelete.ts index 8c701cc5f..300348339 100644 --- a/backend/src/plugins/Logs/logFunctions/logCaseDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logCaseDelete.ts @@ -7,7 +7,7 @@ import { caseToTemplateSafeCase, memberToTemplateSafeMember } from "../../../uti import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogCaseDeleteData { +export interface LogCaseDeleteData { mod: GuildMember; case: Case; } diff --git a/backend/src/plugins/Logs/logFunctions/logCaseUpdate.ts b/backend/src/plugins/Logs/logFunctions/logCaseUpdate.ts index 4c8b8fd65..c6499aac6 100644 --- a/backend/src/plugins/Logs/logFunctions/logCaseUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logCaseUpdate.ts @@ -6,7 +6,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogCaseUpdateData { +export interface LogCaseUpdateData { mod: User; caseNumber: number; caseType: string; diff --git a/backend/src/plugins/Logs/logFunctions/logCensor.ts b/backend/src/plugins/Logs/logFunctions/logCensor.ts index c1853baf6..e911a61e5 100644 --- a/backend/src/plugins/Logs/logFunctions/logCensor.ts +++ b/backend/src/plugins/Logs/logFunctions/logCensor.ts @@ -14,7 +14,7 @@ import { import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogCensorData { +export interface LogCensorData { user: User | UnknownUser; channel: GuildTextBasedChannel; reason: string; diff --git a/backend/src/plugins/Logs/logFunctions/logChannelCreate.ts b/backend/src/plugins/Logs/logFunctions/logChannelCreate.ts index be8adf8cd..04ab025eb 100644 --- a/backend/src/plugins/Logs/logFunctions/logChannelCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logChannelCreate.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogChannelCreateData { +export interface LogChannelCreateData { channel: GuildBasedChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logChannelDelete.ts b/backend/src/plugins/Logs/logFunctions/logChannelDelete.ts index 6078f3119..1db174e2a 100644 --- a/backend/src/plugins/Logs/logFunctions/logChannelDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logChannelDelete.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogChannelDeleteData { +export interface LogChannelDeleteData { channel: GuildBasedChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logChannelUpdate.ts b/backend/src/plugins/Logs/logFunctions/logChannelUpdate.ts index 2963520ae..b05f26bb6 100644 --- a/backend/src/plugins/Logs/logFunctions/logChannelUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logChannelUpdate.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogChannelUpdateData { +export interface LogChannelUpdateData { oldChannel: GuildBasedChannel; newChannel: GuildBasedChannel; differenceString: string; diff --git a/backend/src/plugins/Logs/logFunctions/logClean.ts b/backend/src/plugins/Logs/logFunctions/logClean.ts index 2a156868d..7e43f8545 100644 --- a/backend/src/plugins/Logs/logFunctions/logClean.ts +++ b/backend/src/plugins/Logs/logFunctions/logClean.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../u import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogCleanData { +export interface LogCleanData { mod: User; channel: GuildTextBasedChannel; count: number; diff --git a/backend/src/plugins/Logs/logFunctions/logDmFailed.ts b/backend/src/plugins/Logs/logFunctions/logDmFailed.ts index 4b540624c..d88ad515f 100644 --- a/backend/src/plugins/Logs/logFunctions/logDmFailed.ts +++ b/backend/src/plugins/Logs/logFunctions/logDmFailed.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogDmFailedData { +export interface LogDmFailedData { source: string; user: User | UnknownUser; } diff --git a/backend/src/plugins/Logs/logFunctions/logEmojiCreate.ts b/backend/src/plugins/Logs/logFunctions/logEmojiCreate.ts index 11c6c0d92..843232a0c 100644 --- a/backend/src/plugins/Logs/logFunctions/logEmojiCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logEmojiCreate.ts @@ -6,7 +6,7 @@ import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogEmojiCreateData { +export interface LogEmojiCreateData { emoji: Emoji; } diff --git a/backend/src/plugins/Logs/logFunctions/logEmojiDelete.ts b/backend/src/plugins/Logs/logFunctions/logEmojiDelete.ts index 4ef31c4e6..6c08f2eeb 100644 --- a/backend/src/plugins/Logs/logFunctions/logEmojiDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logEmojiDelete.ts @@ -6,7 +6,7 @@ import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogEmojiDeleteData { +export interface LogEmojiDeleteData { emoji: Emoji; } diff --git a/backend/src/plugins/Logs/logFunctions/logEmojiUpdate.ts b/backend/src/plugins/Logs/logFunctions/logEmojiUpdate.ts index 3d455530b..3d307eae1 100644 --- a/backend/src/plugins/Logs/logFunctions/logEmojiUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logEmojiUpdate.ts @@ -6,7 +6,7 @@ import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogEmojiUpdateData { +export interface LogEmojiUpdateData { oldEmoji: Emoji; newEmoji: Emoji; differenceString: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMassBan.ts b/backend/src/plugins/Logs/logFunctions/logMassBan.ts index 6f2695cc9..ab19de5f4 100644 --- a/backend/src/plugins/Logs/logFunctions/logMassBan.ts +++ b/backend/src/plugins/Logs/logFunctions/logMassBan.ts @@ -6,7 +6,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMassBanData { +export interface LogMassBanData { mod: User; count: number; reason: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMassMute.ts b/backend/src/plugins/Logs/logFunctions/logMassMute.ts index 74c8694bf..06ca3ad85 100644 --- a/backend/src/plugins/Logs/logFunctions/logMassMute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMassMute.ts @@ -6,7 +6,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMassMuteData { +export interface LogMassMuteData { mod: User; count: number; } diff --git a/backend/src/plugins/Logs/logFunctions/logMassUnban.ts b/backend/src/plugins/Logs/logFunctions/logMassUnban.ts index 59709bef4..5bfdc0a3c 100644 --- a/backend/src/plugins/Logs/logFunctions/logMassUnban.ts +++ b/backend/src/plugins/Logs/logFunctions/logMassUnban.ts @@ -6,7 +6,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMassUnbanData { +export interface LogMassUnbanData { mod: User; count: number; reason: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberBan.ts b/backend/src/plugins/Logs/logFunctions/logMemberBan.ts index cdeaec622..e4e2f5c84 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberBan.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberBan.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberBanData { +export interface LogMemberBanData { mod: User | UnknownUser | null; user: User | UnknownUser; caseNumber: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberForceban.ts b/backend/src/plugins/Logs/logFunctions/logMemberForceban.ts index dc47736cc..f60c2b7ba 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberForceban.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberForceban.ts @@ -6,7 +6,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberForcebanData { +export interface LogMemberForcebanData { mod: GuildMember; userId: Snowflake; caseNumber: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberJoin.ts b/backend/src/plugins/Logs/logFunctions/logMemberJoin.ts index 81771fbdf..535721fbf 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberJoin.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberJoin.ts @@ -8,7 +8,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberJoinData { +export interface LogMemberJoinData { member: GuildMember; } diff --git a/backend/src/plugins/Logs/logFunctions/logMemberJoinWithPriorRecords.ts b/backend/src/plugins/Logs/logFunctions/logMemberJoinWithPriorRecords.ts index 01cbd81f5..8a4eaf646 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberJoinWithPriorRecords.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberJoinWithPriorRecords.ts @@ -6,7 +6,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberJoinWithPriorRecordsData { +export interface LogMemberJoinWithPriorRecordsData { member: GuildMember; recentCaseSummary: string; } diff --git a/backend/src/plugins/Logs/logFunctions/logMemberKick.ts b/backend/src/plugins/Logs/logFunctions/logMemberKick.ts index e60f11245..8f080cf83 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberKick.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberKick.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberKickData { +export interface LogMemberKickData { mod: User | UnknownUser | null; user: User; caseNumber: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberLeave.ts b/backend/src/plugins/Logs/logFunctions/logMemberLeave.ts index 8753b68bf..334360b49 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberLeave.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberLeave.ts @@ -6,7 +6,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberLeaveData { +export interface LogMemberLeaveData { member: GuildMember | PartialGuildMember; } diff --git a/backend/src/plugins/Logs/logFunctions/logMemberMute.ts b/backend/src/plugins/Logs/logFunctions/logMemberMute.ts index 76e7f3526..202b3cdba 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberMute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberMute.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberMuteData { +export interface LogMemberMuteData { mod: User | UnknownUser; user: User | UnknownUser; caseNumber: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberMuteExpired.ts b/backend/src/plugins/Logs/logFunctions/logMemberMuteExpired.ts index 24e52aba9..3f3da5c6e 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberMuteExpired.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberMuteExpired.ts @@ -11,7 +11,7 @@ import { import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberMuteExpiredData { +export interface LogMemberMuteExpiredData { member: GuildMember | UnknownUser; } diff --git a/backend/src/plugins/Logs/logFunctions/logMemberMuteRejoin.ts b/backend/src/plugins/Logs/logFunctions/logMemberMuteRejoin.ts index 455a13d80..dfa26e249 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberMuteRejoin.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberMuteRejoin.ts @@ -6,7 +6,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberMuteRejoinData { +export interface LogMemberMuteRejoinData { member: GuildMember; } diff --git a/backend/src/plugins/Logs/logFunctions/logMemberNickChange.ts b/backend/src/plugins/Logs/logFunctions/logMemberNickChange.ts index 437dfa027..df42a503d 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberNickChange.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberNickChange.ts @@ -6,7 +6,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberNickChangeData { +export interface LogMemberNickChangeData { member: GuildMember; oldNick: string; newNick: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberNote.ts b/backend/src/plugins/Logs/logFunctions/logMemberNote.ts index c81ccb7a3..28c35816b 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberNote.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberNote.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberNoteData { +export interface LogMemberNoteData { mod: User; user: User | UnknownUser; caseNumber: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberRestore.ts b/backend/src/plugins/Logs/logFunctions/logMemberRestore.ts index b93b5558a..28d83d88c 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberRestore.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberRestore.ts @@ -6,7 +6,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberRestoreData { +export interface LogMemberRestoreData { member: GuildMember; restoredData: string; } diff --git a/backend/src/plugins/Logs/logFunctions/logMemberRoleAdd.ts b/backend/src/plugins/Logs/logFunctions/logMemberRoleAdd.ts index bb6255dfd..6c3fcd908 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberRoleAdd.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberRoleAdd.ts @@ -7,7 +7,7 @@ import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../uti import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberRoleAddData { +export interface LogMemberRoleAddData { mod: User | null; member: GuildMember; roles: Array; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberRoleChanges.ts b/backend/src/plugins/Logs/logFunctions/logMemberRoleChanges.ts index f548fe2df..98c783c07 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberRoleChanges.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberRoleChanges.ts @@ -7,7 +7,7 @@ import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../uti import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberRoleChangesData { +export interface LogMemberRoleChangesData { mod: User | UnknownUser | null; member: GuildMember; addedRoles: Role[]; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberRoleRemove.ts b/backend/src/plugins/Logs/logFunctions/logMemberRoleRemove.ts index 4e620eec7..431b1cd56 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberRoleRemove.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberRoleRemove.ts @@ -7,7 +7,7 @@ import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../uti import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberRoleRemoveData { +export interface LogMemberRoleRemoveData { mod: User | null; member: GuildMember; roles: Array; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberTimedBan.ts b/backend/src/plugins/Logs/logFunctions/logMemberTimedBan.ts index ecc1d2a26..cf697a589 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberTimedBan.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberTimedBan.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberTimedBanData { +export interface LogMemberTimedBanData { mod: User | UnknownUser; user: User | UnknownUser; banTime: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberTimedMute.ts b/backend/src/plugins/Logs/logFunctions/logMemberTimedMute.ts index 4ef04bed8..66a71d794 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberTimedMute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberTimedMute.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberTimedMuteData { +export interface LogMemberTimedMuteData { mod: User | UnknownUser; user: User | UnknownUser; time: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberTimedUnban.ts b/backend/src/plugins/Logs/logFunctions/logMemberTimedUnban.ts index ada44504c..c56632b41 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberTimedUnban.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberTimedUnban.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberTimedUnbanData { +export interface LogMemberTimedUnbanData { mod: User | UnknownUser; userId: string; banTime: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberTimedUnmute.ts b/backend/src/plugins/Logs/logFunctions/logMemberTimedUnmute.ts index ce036761d..3020fd694 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberTimedUnmute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberTimedUnmute.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberTimedUnmuteData { +export interface LogMemberTimedUnmuteData { mod: User; user: User | UnknownUser; time: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberUnban.ts b/backend/src/plugins/Logs/logFunctions/logMemberUnban.ts index 305bbada5..e8438649d 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberUnban.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberUnban.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberUnbanData { +export interface LogMemberUnbanData { mod: User | UnknownUser | null; userId: Snowflake; caseNumber: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberUnmute.ts b/backend/src/plugins/Logs/logFunctions/logMemberUnmute.ts index 5afbf075e..b444373c4 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberUnmute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberUnmute.ts @@ -7,7 +7,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberUnmuteData { +export interface LogMemberUnmuteData { mod: User; user: User | UnknownUser; caseNumber: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberWarn.ts b/backend/src/plugins/Logs/logFunctions/logMemberWarn.ts index 8cdc533b0..e7ba09da9 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberWarn.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberWarn.ts @@ -6,7 +6,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMemberWarnData { +export interface LogMemberWarnData { mod: GuildMember; member: GuildMember; caseNumber: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts b/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts index b56f74101..b1e6f58b5 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts @@ -15,7 +15,7 @@ import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; import { FORMAT_NO_TIMESTAMP, LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMessageDeleteData { +export interface LogMessageDeleteData { user: User | UnknownUser; channel: GuildTextBasedChannel; message: SavedMessage; @@ -31,10 +31,7 @@ export function logMessageDelete(pluginData: GuildPluginData, da // See comment on FORMAT_NO_TIMESTAMP in types.ts const config = pluginData.config.get(); - const timestampFormat = - (config.format.timestamp !== FORMAT_NO_TIMESTAMP ? config.format.timestamp : null) ?? - config.timestamp_format ?? - undefined; + const timestampFormat = config.timestamp_format ?? undefined; return log( pluginData, diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDeleteAuto.ts b/backend/src/plugins/Logs/logFunctions/logMessageDeleteAuto.ts index 1b2b1fe3c..b84a1f552 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDeleteAuto.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDeleteAuto.ts @@ -13,7 +13,7 @@ import { import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMessageDeleteAutoData { +export interface LogMessageDeleteAutoData { message: SavedMessage; user: User | UnknownUser; channel: GuildBasedChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDeleteBare.ts b/backend/src/plugins/Logs/logFunctions/logMessageDeleteBare.ts index 8e1787ab9..a0d9143e7 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDeleteBare.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDeleteBare.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMessageDeleteBareData { +export interface LogMessageDeleteBareData { messageId: string; channel: GuildTextBasedChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDeleteBulk.ts b/backend/src/plugins/Logs/logFunctions/logMessageDeleteBulk.ts index 46ca16489..35456c2f4 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDeleteBulk.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDeleteBulk.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMessageDeleteBulkData { +export interface LogMessageDeleteBulkData { count: number; authorIds: string[]; channel: GuildTextBasedChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageEdit.ts b/backend/src/plugins/Logs/logFunctions/logMessageEdit.ts index 6e31605d5..8bef8f559 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageEdit.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageEdit.ts @@ -13,7 +13,7 @@ import { import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMessageEditData { +export interface LogMessageEditData { user: User | UnknownUser; channel: GuildTextBasedChannel; before: SavedMessage; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageSpamDetected.ts b/backend/src/plugins/Logs/logFunctions/logMessageSpamDetected.ts index 5a79e5ab1..0fa55ff5d 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageSpamDetected.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageSpamDetected.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../ import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogMessageSpamDetectedData { +export interface LogMessageSpamDetectedData { member: GuildMember; channel: GuildTextBasedChannel; description: string; diff --git a/backend/src/plugins/Logs/logFunctions/logOtherSpamDetected.ts b/backend/src/plugins/Logs/logFunctions/logOtherSpamDetected.ts index 9cbd8b254..67171ceee 100644 --- a/backend/src/plugins/Logs/logFunctions/logOtherSpamDetected.ts +++ b/backend/src/plugins/Logs/logFunctions/logOtherSpamDetected.ts @@ -6,7 +6,7 @@ import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogOtherSpamDetectedData { +export interface LogOtherSpamDetectedData { member: GuildMember; description: string; limit: number; diff --git a/backend/src/plugins/Logs/logFunctions/logPostedScheduledMessage.ts b/backend/src/plugins/Logs/logFunctions/logPostedScheduledMessage.ts index e92d02925..dca4c8bf1 100644 --- a/backend/src/plugins/Logs/logFunctions/logPostedScheduledMessage.ts +++ b/backend/src/plugins/Logs/logFunctions/logPostedScheduledMessage.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../u import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogPostedScheduledMessageData { +export interface LogPostedScheduledMessageData { author: User; channel: GuildTextBasedChannel; messageId: string; diff --git a/backend/src/plugins/Logs/logFunctions/logRepeatedMessage.ts b/backend/src/plugins/Logs/logFunctions/logRepeatedMessage.ts index 227ca7f7a..c20227a68 100644 --- a/backend/src/plugins/Logs/logFunctions/logRepeatedMessage.ts +++ b/backend/src/plugins/Logs/logFunctions/logRepeatedMessage.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../u import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogRepeatedMessageData { +export interface LogRepeatedMessageData { author: User; channel: GuildTextBasedChannel; datetime: string; diff --git a/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts b/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts index 9bb177d60..7ceb4be76 100644 --- a/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts @@ -6,7 +6,7 @@ import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogRoleCreateData { +export interface LogRoleCreateData { role: Role; } diff --git a/backend/src/plugins/Logs/logFunctions/logRoleDelete.ts b/backend/src/plugins/Logs/logFunctions/logRoleDelete.ts index 0ec6e87ac..a4e6e448e 100644 --- a/backend/src/plugins/Logs/logFunctions/logRoleDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logRoleDelete.ts @@ -6,7 +6,7 @@ import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogRoleDeleteData { +export interface LogRoleDeleteData { role: Role; } diff --git a/backend/src/plugins/Logs/logFunctions/logRoleUpdate.ts b/backend/src/plugins/Logs/logFunctions/logRoleUpdate.ts index caf8b0c54..7fe118b52 100644 --- a/backend/src/plugins/Logs/logFunctions/logRoleUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logRoleUpdate.ts @@ -6,7 +6,7 @@ import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogRoleUpdateData { +export interface LogRoleUpdateData { oldRole: Role; newRole: Role; differenceString: string; diff --git a/backend/src/plugins/Logs/logFunctions/logScheduledMessage.ts b/backend/src/plugins/Logs/logFunctions/logScheduledMessage.ts index 098b79188..4499ccb6b 100644 --- a/backend/src/plugins/Logs/logFunctions/logScheduledMessage.ts +++ b/backend/src/plugins/Logs/logFunctions/logScheduledMessage.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../u import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogScheduledMessageData { +export interface LogScheduledMessageData { author: User; channel: GuildTextBasedChannel; datetime: string; diff --git a/backend/src/plugins/Logs/logFunctions/logScheduledRepeatedMessage.ts b/backend/src/plugins/Logs/logFunctions/logScheduledRepeatedMessage.ts index dc4c42005..d94be7b9e 100644 --- a/backend/src/plugins/Logs/logFunctions/logScheduledRepeatedMessage.ts +++ b/backend/src/plugins/Logs/logFunctions/logScheduledRepeatedMessage.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../u import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogScheduledRepeatedMessageData { +export interface LogScheduledRepeatedMessageData { author: User; channel: GuildTextBasedChannel; datetime: string; diff --git a/backend/src/plugins/Logs/logFunctions/logSetAntiraidAuto.ts b/backend/src/plugins/Logs/logFunctions/logSetAntiraidAuto.ts index 6c841eeb4..1175d23cd 100644 --- a/backend/src/plugins/Logs/logFunctions/logSetAntiraidAuto.ts +++ b/backend/src/plugins/Logs/logFunctions/logSetAntiraidAuto.ts @@ -4,7 +4,7 @@ import { createTypedTemplateSafeValueContainer } from "../../../templateFormatte import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogSetAntiraidAutoData { +export interface LogSetAntiraidAutoData { level: string; } diff --git a/backend/src/plugins/Logs/logFunctions/logSetAntiraidUser.ts b/backend/src/plugins/Logs/logFunctions/logSetAntiraidUser.ts index 7d43423be..cc42d701b 100644 --- a/backend/src/plugins/Logs/logFunctions/logSetAntiraidUser.ts +++ b/backend/src/plugins/Logs/logFunctions/logSetAntiraidUser.ts @@ -6,7 +6,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogSetAntiraidUserData { +export interface LogSetAntiraidUserData { level: string; user: User; } diff --git a/backend/src/plugins/Logs/logFunctions/logStageInstanceCreate.ts b/backend/src/plugins/Logs/logFunctions/logStageInstanceCreate.ts index 31d900c43..162d24b6b 100644 --- a/backend/src/plugins/Logs/logFunctions/logStageInstanceCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logStageInstanceCreate.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../.. import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogStageInstanceCreateData { +export interface LogStageInstanceCreateData { stageInstance: StageInstance; stageChannel: StageChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logStageInstanceDelete.ts b/backend/src/plugins/Logs/logFunctions/logStageInstanceDelete.ts index ff69b13f0..b87de4cda 100644 --- a/backend/src/plugins/Logs/logFunctions/logStageInstanceDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logStageInstanceDelete.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../.. import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogStageInstanceDeleteData { +export interface LogStageInstanceDeleteData { stageInstance: StageInstance; stageChannel: StageChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logStageInstanceUpdate.ts b/backend/src/plugins/Logs/logFunctions/logStageInstanceUpdate.ts index be53b5983..6013311f3 100644 --- a/backend/src/plugins/Logs/logFunctions/logStageInstanceUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logStageInstanceUpdate.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../.. import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogStageInstanceUpdateData { +export interface LogStageInstanceUpdateData { oldStageInstance: StageInstance | null; newStageInstance: StageInstance; stageChannel: StageChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logStickerCreate.ts b/backend/src/plugins/Logs/logFunctions/logStickerCreate.ts index 6c715235a..2ec980b56 100644 --- a/backend/src/plugins/Logs/logFunctions/logStickerCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logStickerCreate.ts @@ -6,7 +6,7 @@ import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogStickerCreateData { +export interface LogStickerCreateData { sticker: Sticker; } diff --git a/backend/src/plugins/Logs/logFunctions/logStickerDelete.ts b/backend/src/plugins/Logs/logFunctions/logStickerDelete.ts index 99c4532f3..630ab54d9 100644 --- a/backend/src/plugins/Logs/logFunctions/logStickerDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logStickerDelete.ts @@ -6,7 +6,7 @@ import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogStickerDeleteData { +export interface LogStickerDeleteData { sticker: Sticker; } diff --git a/backend/src/plugins/Logs/logFunctions/logStickerUpdate.ts b/backend/src/plugins/Logs/logFunctions/logStickerUpdate.ts index e1e2e727e..421f0d375 100644 --- a/backend/src/plugins/Logs/logFunctions/logStickerUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logStickerUpdate.ts @@ -6,7 +6,7 @@ import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogStickerUpdateData { +export interface LogStickerUpdateData { oldSticker: Sticker; newSticker: Sticker; differenceString: string; diff --git a/backend/src/plugins/Logs/logFunctions/logThreadCreate.ts b/backend/src/plugins/Logs/logFunctions/logThreadCreate.ts index 62f9a47cb..4b061dfe8 100644 --- a/backend/src/plugins/Logs/logFunctions/logThreadCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logThreadCreate.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogThreadCreateData { +export interface LogThreadCreateData { thread: AnyThreadChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logThreadDelete.ts b/backend/src/plugins/Logs/logFunctions/logThreadDelete.ts index 52dd49088..faf23dec0 100644 --- a/backend/src/plugins/Logs/logFunctions/logThreadDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logThreadDelete.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogThreadDeleteData { +export interface LogThreadDeleteData { thread: AnyThreadChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logThreadUpdate.ts b/backend/src/plugins/Logs/logFunctions/logThreadUpdate.ts index f73bab5d7..2c7591779 100644 --- a/backend/src/plugins/Logs/logFunctions/logThreadUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logThreadUpdate.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogThreadUpdateData { +export interface LogThreadUpdateData { oldThread: AnyThreadChannel; newThread: AnyThreadChannel; differenceString: string; diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceDisconnect.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceDisconnect.ts index 79efc8446..075e4ac23 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceDisconnect.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceDisconnect.ts @@ -11,7 +11,7 @@ import { import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogVoiceChannelForceDisconnectData { +export interface LogVoiceChannelForceDisconnectData { mod: User; member: GuildMember; oldChannel: VoiceBasedChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceMove.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceMove.ts index 70978304a..13ef2adb7 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceMove.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceMove.ts @@ -11,7 +11,7 @@ import { import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogVoiceChannelForceMoveData { +export interface LogVoiceChannelForceMoveData { mod: User; member: GuildMember; oldChannel: VoiceBasedChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelJoin.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelJoin.ts index f91cf4a23..a78a2f75e 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelJoin.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelJoin.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../ import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogVoiceChannelJoinData { +export interface LogVoiceChannelJoinData { member: GuildMember; channel: VoiceBasedChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelLeave.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelLeave.ts index 99b351555..059962e95 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelLeave.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelLeave.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../ import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogVoiceChannelLeaveData { +export interface LogVoiceChannelLeaveData { member: GuildMember; channel: VoiceBasedChannel; } diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelMove.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelMove.ts index 679c66d34..54026cfe9 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelMove.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelMove.ts @@ -7,7 +7,7 @@ import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../ import { LogsPluginType } from "../types"; import { log } from "../util/log"; -interface LogVoiceChannelMoveData { +export interface LogVoiceChannelMoveData { member: GuildMember; oldChannel: VoiceBasedChannel; newChannel: VoiceBasedChannel; diff --git a/backend/src/plugins/Logs/types.ts b/backend/src/plugins/Logs/types.ts index 47557514a..8f49afc21 100644 --- a/backend/src/plugins/Logs/types.ts +++ b/backend/src/plugins/Logs/types.ts @@ -26,16 +26,9 @@ const DEFAULT_BATCH_TIME = 1000; const MIN_BATCH_TIME = 250; const MAX_BATCH_TIME = 5000; -type ZLogFormatsHelper = { - -readonly [K in keyof typeof LogType]: typeof zMessageContent; -}; -export const zLogFormats = z.strictObject( - keys(LogType).reduce((map, logType) => { - map[logType] = zMessageContent; - return map; - }, {} as ZLogFormatsHelper), -); -export type TLogFormats = z.infer; +// A bit of a workaround so we can pass LogType keys to z.enum() +const logTypes = Object.keys(LogType) as [keyof typeof LogType, ...Array]; +const zLogFormats = z.record(z.enum(logTypes), zMessageContent); const zLogChannel = z.strictObject({ include: z.array(zBoundedCharacters(1, 255)).default([]), @@ -49,7 +42,7 @@ const zLogChannel = z.strictObject({ excluded_threads: z.array(zSnowflake).nullable().default(null), exclude_bots: z.boolean().default(false), excluded_roles: z.array(zSnowflake).nullable().default(null), - format: zLogFormats.partial().default({}), + format: zLogFormats.default({}), timestamp_format: z.string().nullable().default(null), include_embed_timestamp: z.boolean().nullable().default(null), }); @@ -60,12 +53,7 @@ export type TLogChannelMap = z.infer; export const zLogsConfig = z.strictObject({ channels: zLogChannelMap, - format: zLogFormats.merge( - z.strictObject({ - // Legacy/deprecated, use timestamp_format below instead - timestamp: zBoundedCharacters(0, 64).nullable(), - }), - ), + format: zLogFormats, // Legacy/deprecated, if below is false mentions wont actually ping. In case you really want the old behavior, set below to true ping_user: z.boolean(), allow_user_mentions: z.boolean(), diff --git a/backend/src/plugins/Logs/util/getLogMessage.ts b/backend/src/plugins/Logs/util/getLogMessage.ts index 4887cb821..2109f2157 100644 --- a/backend/src/plugins/Logs/util/getLogMessage.ts +++ b/backend/src/plugins/Logs/util/getLogMessage.ts @@ -38,10 +38,7 @@ export async function getLogMessage( if (format === "" || format == null) return null; // See comment on FORMAT_NO_TIMESTAMP in types.ts - const timestampFormat = - opts?.timestamp_format ?? - (config.format.timestamp !== FORMAT_NO_TIMESTAMP ? config.format.timestamp : null) ?? - config.timestamp_format; + const timestampFormat = opts?.timestamp_format ?? config.timestamp_format; const includeEmbedTimestamp = opts?.include_embed_timestamp ?? config.include_embed_timestamp; diff --git a/backend/src/plugins/Spam/types.ts b/backend/src/plugins/Spam/types.ts index f71e41806..7017b113d 100644 --- a/backend/src/plugins/Spam/types.ts +++ b/backend/src/plugins/Spam/types.ts @@ -42,7 +42,7 @@ export enum RecentActionType { VoiceChannelMove, } -interface IRecentAction { +export interface IRecentAction { type: RecentActionType; userId: string; actionGroupId: string; diff --git a/backend/src/utils.ts b/backend/src/utils.ts index 174a720f0..ca0503e44 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -285,9 +285,9 @@ export type StrictMessageContent = { embeds?: APIEmbed[]; }; -export const zMessageContent = z.union([zBoundedCharacters(0, 4000), zStrictMessageContent]); - export type MessageContent = string | StrictMessageContent; +export const zMessageContent = z.union([zBoundedCharacters(0, 4000), zStrictMessageContent]) as z.ZodType; + export function validateAndParseMessageContent(input: unknown): StrictMessageContent { if (input == null) { From 1f0a01f15f30aa9131c7c5c1c264f6e2661cf009 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:52:29 +0000 Subject: [PATCH 02/11] refactor: convert /shared to ESM --- shared/package.json | 7 +++++-- shared/src/apiPermissions.test.ts | 2 +- shared/src/index.ts | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/shared/package.json b/shared/package.json index 46b1324b7..39bcb2d9f 100644 --- a/shared/package.json +++ b/shared/package.json @@ -3,8 +3,11 @@ "version": "0.0.1", "description": "", "private": true, - "main": "dist/index.js", - "types": "dist/index.d.ts", + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": "./dist/*" + }, "scripts": { "test": "ava" }, diff --git a/shared/src/apiPermissions.test.ts b/shared/src/apiPermissions.test.ts index 365e4f08b..c86cbde1a 100644 --- a/shared/src/apiPermissions.test.ts +++ b/shared/src/apiPermissions.test.ts @@ -1,5 +1,5 @@ import test from "ava"; -import { ApiPermissions, hasPermission } from "./apiPermissions"; +import { ApiPermissions, hasPermission } from "./apiPermissions.js"; test("Directly granted permissions match", (t) => { t.is(hasPermission(new Set([ApiPermissions.ManageAccess]), ApiPermissions.ManageAccess), true); diff --git a/shared/src/index.ts b/shared/src/index.ts index ce5c7796d..3410a406f 100644 --- a/shared/src/index.ts +++ b/shared/src/index.ts @@ -1 +1 @@ -export * from "./apiPermissions"; +export * from "./apiPermissions.js"; From 31d74c05aa12208473a572a30e0486eb922fd6d3 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:59:41 +0000 Subject: [PATCH 03/11] chore: remove husky/lint-staged --- package-lock.json | 1308 +-------------------------------------------- package.json | 15 - 2 files changed, 27 insertions(+), 1296 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1558e553d..239f9d254 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,6 @@ "@typescript-eslint/parser": "^5.59.5", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", - "husky": "^3.0.9", - "lint-staged": "^9.4.2", "prettier": "^2.8.4", "prettier-plugin-organize-imports": "^3.2.2", "ts-toolbelt": "^9.6.0", @@ -3807,26 +3805,6 @@ "node": ">=14" } }, - "node_modules/@samverschueren/stream-to-observable": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz", - "integrity": "sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ==", - "dev": true, - "dependencies": { - "any-observable": "^0.3.0" - }, - "engines": { - "node": ">=6" - }, - "peerDependenciesMeta": { - "rxjs": { - "optional": true - }, - "zen-observable": { - "optional": true - } - } - }, "node_modules/@sapphire/async-queue": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.2.tgz", @@ -4040,16 +4018,6 @@ "@types/send": "*" } }, - "node_modules/@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", - "dev": true, - "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, "node_modules/@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -4148,12 +4116,6 @@ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "dev": true }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true - }, "node_modules/@types/moment-timezone": { "version": "0.5.30", "resolved": "https://registry.npmjs.org/@types/moment-timezone/-/moment-timezone-0.5.30.tgz", @@ -4187,12 +4149,6 @@ "@types/node": "*" } }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "dev": true - }, "node_modules/@types/oauth": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.4.tgz", @@ -5067,28 +5023,6 @@ "node": ">=0.4.0" } }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/aggregate-error/node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -5226,15 +5160,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-observable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz", - "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", @@ -6896,15 +6821,6 @@ "node": ">=0.10.0" } }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/clean-yaml-object": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", @@ -7087,19 +7003,6 @@ "node": ">=8" } }, - "node_modules/cli-truncate": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz", - "integrity": "sha512-f4r4yJnbT++qUPI9NR4XLDLq41gQ+uqnPItWG0F5ZkehuNiTTa3EY0S4AqTSUOeJ7/zU41oWPQSNkW5BqPL9bg==", - "dev": true, - "dependencies": { - "slice-ansi": "0.0.4", - "string-width": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -8657,12 +8560,6 @@ "node": ">=0.10" } }, - "node_modules/date-fns": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz", - "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==", - "dev": true - }, "node_modules/date-time": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", @@ -8748,12 +8645,6 @@ "node": ">=4" } }, - "node_modules/dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", - "dev": true - }, "node_modules/deep-diff": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/deep-diff/-/deep-diff-1.0.2.tgz", @@ -8929,44 +8820,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/del": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", - "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", - "dev": true, - "dependencies": { - "globby": "^10.0.1", - "graceful-fs": "^4.2.2", - "is-glob": "^4.0.1", - "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.1", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/del/node_modules/globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "dev": true, - "dependencies": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -9365,15 +9218,6 @@ "integrity": "sha512-9AQB5eFTHyR3Gvt2t/NwR0le2jBSUNwCnMbUCejFWHD+so4tH40/dRLgoE+jxlPeWS43XJewyvCv+I8LPMl49Q==", "dev": true }, - "node_modules/elegant-spinner": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", - "integrity": "sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -10061,91 +9905,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/execa/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "node_modules/execa/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/execa/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/execa/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/execa/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/execa/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, "node_modules/execspawn": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz", @@ -10438,28 +10197,6 @@ "node": ">=0.8.0" } }, - "node_modules/figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/figures/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -10992,21 +10729,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-own-enumerable-property-symbols": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", - "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", - "dev": true - }, - "node_modules/get-stdin": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", - "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -11467,12 +11189,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, "node_modules/hpack.js": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", @@ -11780,108 +11496,6 @@ "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.31.0.tgz", "integrity": "sha512-fRrehgBG26NNZysRlTq1S+HPtDpp3u+Jzdc/d5A4cEzOD86YLAkDaJyJg8krSdCi7CJ+s7ht3fwRj8Dl+Btd0w==" }, - "node_modules/husky": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/husky/-/husky-3.1.0.tgz", - "integrity": "sha512-FJkPoHHB+6s4a+jwPqBudBDvYZsoQW5/HBuMSehC8qDiCe50kpcxeqFoDSlow+9I6wg47YxBoT3WxaURlrDIIQ==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "chalk": "^2.4.2", - "ci-info": "^2.0.0", - "cosmiconfig": "^5.2.1", - "execa": "^1.0.0", - "get-stdin": "^7.0.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^4.2.0", - "please-upgrade-node": "^3.2.0", - "read-pkg": "^5.2.0", - "run-node": "^1.0.0", - "slash": "^3.0.0" - }, - "bin": { - "husky-run": "run.js", - "husky-upgrade": "lib/upgrader/bin.js" - }, - "engines": { - "node": ">=8.6.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/husky" - } - }, - "node_modules/husky/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/husky/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/husky/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/husky/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/husky/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/husky/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/husky/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/hyperid": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/hyperid/-/hyperid-3.2.0.tgz", @@ -12024,15 +11638,6 @@ "node": ">=0.8.19" } }, - "node_modules/indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/indexes-of": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", @@ -12649,36 +12254,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-observable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz", - "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==", - "dev": true, - "dependencies": { - "symbol-observable": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -12708,12 +12283,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-promise": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", - "dev": true - }, "node_modules/is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -12735,15 +12304,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", - "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", @@ -12762,15 +12322,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -13350,428 +12901,6 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "node_modules/lint-staged": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-9.5.0.tgz", - "integrity": "sha512-nawMob9cb/G1J98nb8v3VC/E8rcX1rryUYXVZ69aT9kde6YWX+uvNOEHY5yf2gcWcTJGiD0kqXmCnS3oD75GIA==", - "dev": true, - "dependencies": { - "chalk": "^2.4.2", - "commander": "^2.20.0", - "cosmiconfig": "^5.2.1", - "debug": "^4.1.1", - "dedent": "^0.7.0", - "del": "^5.0.0", - "execa": "^2.0.3", - "listr": "^0.14.3", - "log-symbols": "^3.0.0", - "micromatch": "^4.0.2", - "normalize-path": "^3.0.0", - "please-upgrade-node": "^3.1.1", - "string-argv": "^0.3.0", - "stringify-object": "^3.3.0" - }, - "bin": { - "lint-staged": "bin/lint-staged" - } - }, - "node_modules/lint-staged/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/lint-staged/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/lint-staged/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/lint-staged/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/lint-staged/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/lint-staged/node_modules/execa": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-2.1.0.tgz", - "integrity": "sha512-Y/URAVapfbYy2Xp/gb6A0E7iR8xeqOCXsuuaoMn7A5PzrXUK84E1gyiEfq0wQd/GHA6GsoHWwhNq8anb0mleIw==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^3.0.0", - "onetime": "^5.1.0", - "p-finally": "^2.0.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": "^8.12.0 || >=9.7.0" - } - }, - "node_modules/lint-staged/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lint-staged/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/lint-staged/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lint-staged/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/lint-staged/node_modules/npm-run-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz", - "integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/lint-staged/node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lint-staged/node_modules/p-finally": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", - "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/lint-staged/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz", - "integrity": "sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA==", - "dev": true, - "dependencies": { - "@samverschueren/stream-to-observable": "^0.3.0", - "is-observable": "^1.1.0", - "is-promise": "^2.1.0", - "is-stream": "^1.1.0", - "listr-silent-renderer": "^1.1.1", - "listr-update-renderer": "^0.5.0", - "listr-verbose-renderer": "^0.5.0", - "p-map": "^2.0.0", - "rxjs": "^6.3.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/listr-silent-renderer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz", - "integrity": "sha512-L26cIFm7/oZeSNVhWB6faeorXhMg4HNlb/dS/7jHhr708jxlXrtrBWo4YUxZQkc6dGoxEAe6J/D3juTRBUzjtA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-update-renderer": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz", - "integrity": "sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "cli-truncate": "^0.2.1", - "elegant-spinner": "^1.0.1", - "figures": "^1.7.0", - "indent-string": "^3.0.0", - "log-symbols": "^1.0.2", - "log-update": "^2.3.0", - "strip-ansi": "^3.0.1" - }, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "listr": "^0.14.2" - } - }, - "node_modules/listr-update-renderer/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/listr-update-renderer/node_modules/log-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", - "integrity": "sha512-mmPrW0Fh2fxOzdBbFv4g1m6pR72haFLPJ2G5SJEELf1y+iaQrDG6cWCPjy54RHYbZAt7X+ls690Kw62AdWXBzQ==", - "dev": true, - "dependencies": { - "chalk": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/listr-update-renderer/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/listr-verbose-renderer": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz", - "integrity": "sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw==", - "dev": true, - "dependencies": { - "chalk": "^2.4.1", - "cli-cursor": "^2.1.0", - "date-fns": "^1.27.2", - "figures": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-verbose-renderer/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-verbose-renderer/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-verbose-renderer/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/listr-verbose-renderer/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/listr-verbose-renderer/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/listr-verbose-renderer/node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-verbose-renderer/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr-verbose-renderer/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/listr/node_modules/p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/load-json-file": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-7.0.1.tgz", @@ -13855,136 +12984,39 @@ "node_modules/lodash.intersection": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.intersection/-/lodash.intersection-4.4.0.tgz", - "integrity": "sha512-N+L0cCfnqMv6mxXtSPeKt+IavbOBBSiAEkKyLasZ8BVcP9YXQgxLO12oPR8OyURwKV8l5vJKiE1M8aS70heuMg==" - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" - }, - "node_modules/lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==" - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==" - }, - "node_modules/lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" - }, - "node_modules/lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", - "dev": true - }, - "node_modules/log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", - "dev": true, - "dependencies": { - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } + "integrity": "sha512-N+L0cCfnqMv6mxXtSPeKt+IavbOBBSiAEkKyLasZ8BVcP9YXQgxLO12oPR8OyURwKV8l5vJKiE1M8aS70heuMg==" }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "node_modules/lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==" }, - "node_modules/log-symbols/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } + "node_modules/lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==" }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" }, - "node_modules/log-update": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz", - "integrity": "sha512-vlP11XfFGyeNQlmEn9tJ66rEW1coA/79m5z6BCkudjbAGE83uhAcGYrBFwfs3AdLiLzGRusRPAbSPK9xZteCmg==", - "dev": true, - "dependencies": { - "ansi-escapes": "^3.0.0", - "cli-cursor": "^2.0.0", - "wrap-ansi": "^3.0.1" - }, - "engines": { - "node": ">=4" - } + "node_modules/lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", + "dev": true }, "node_modules/long": { "version": "4.0.0", @@ -14981,12 +14013,6 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "node_modules/no-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", @@ -15079,27 +14105,6 @@ "node": ">= 0.10" } }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -15133,27 +14138,6 @@ "integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==", "dev": true }, - "node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", - "dev": true, - "dependencies": { - "path-key": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -15360,15 +14344,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true, - "bin": { - "opencollective-postinstall": "index.js" - } - }, "node_modules/opn": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", @@ -15547,15 +14522,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -15586,18 +14552,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/p-retry": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", @@ -16297,15 +15251,6 @@ "node": ">=4" } }, - "node_modules/please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "dependencies": { - "semver-compare": "^1.0.0" - } - }, "node_modules/plur": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/plur/-/plur-5.1.0.tgz", @@ -19317,48 +18262,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg/node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/readable-stream": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", @@ -19836,18 +18739,6 @@ "node": ">=0.12.0" } }, - "node_modules/run-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz", - "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==", - "dev": true, - "bin": { - "run-node": "run-node" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -20087,12 +18978,6 @@ "node": ">=10" } }, - "node_modules/semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true - }, "node_modules/semver-diff": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", @@ -20675,15 +19560,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha512-up04hB2hR92PgjpyU3y/eg91yIBILyjVY26NvvciY3EVVPjybkMszMpXQ9QAkcS3I5rtJBDLoTxxg+qvW8c7rw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/sockjs": { "version": "0.3.24", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", @@ -20784,38 +19660,6 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "deprecated": "Please use @jridgewell/sourcemap-codec instead" }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", - "dev": true - }, "node_modules/spdy": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", @@ -21269,20 +20113,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/stringify-object": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", - "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", - "dev": true, - "dependencies": { - "get-own-enumerable-property-symbols": "^3.0.0", - "is-obj": "^1.0.1", - "is-regexp": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -21319,15 +20149,6 @@ "resolved": "https://registry.npmjs.org/strip-combining-marks/-/strip-combining-marks-1.0.0.tgz", "integrity": "sha512-8YrtmJKxvDmMIoJMOyvh/s3Oe8TxolM5ThgZPmE39vvkfXVuOHAUyiZ1yOZUxDg/kb1QLRyZ0CfQQqeTISAeTA==" }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -21741,15 +20562,6 @@ "node": ">=4" } }, - "node_modules/symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/syntax-error": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", @@ -23205,16 +22017,6 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "devOptional": true }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "node_modules/varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -23941,19 +22743,6 @@ "node": ">=0.10.0" } }, - "node_modules/wrap-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz", - "integrity": "sha512-iXR3tDXpbnTpzjKSylUJRkLuOrEC7hwEB221cgn6wtF8wpmz28puFXAEfPT5zrjM3wahygB//VuWEr1vTkDcNQ==", - "dev": true, - "dependencies": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", @@ -23992,49 +22781,6 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 2851d76eb..813142e8d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "format": "prettier --write \"./backend/src/**/*.{css,html,js,json,ts,tsx}\" \"./dashboard/src/**/*.{css,html,js,json,ts,tsx}\"", "lint": "eslint \"./backend/src/**/*.{js,ts,tsx}\" \"./dashboard/src/**/*.{js,ts,tsx}\"", "codestyle-check": "prettier --check \"./backend/src/**/*.{css,html,js,json,ts,tsx}\" \"./dashboard/src/**/*.{css,html,js,json,ts,tsx}\"", - "start-bot": "cd backend && npm run start-bot-prod", "start-api": "cd backend && npm run start-api-prod", "start-dashboard": "cd dashboard && node serve.js" @@ -17,26 +16,12 @@ "@typescript-eslint/parser": "^5.59.5", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", - "husky": "^3.0.9", - "lint-staged": "^9.4.2", "prettier": "^2.8.4", "prettier-plugin-organize-imports": "^3.2.2", "ts-toolbelt": "^9.6.0", "tsc-watch": "^6.0.4", "typescript": "^5.0.4" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, - "lint-staged": { - "*.ts": [ - "eslint", - "prettier --write", - "git add" - ] - }, "workspaces": [ "shared", "backend", From 5772e27cda5418427f60680df05ea2f6b867a771 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 9 Apr 2024 20:57:18 +0300 Subject: [PATCH 04/11] refactor: convert /backend to ESM --- backend/package.json | 9 +- backend/src/Queue.ts | 2 +- backend/src/QueuedEventEmitter.ts | 2 +- backend/src/RegExpRunner.ts | 2 +- backend/src/api/archives.ts | 4 +- backend/src/api/auth.ts | 14 +- backend/src/api/docs.ts | 8 +- backend/src/api/guilds.ts | 30 +-- backend/src/api/guilds/importExport.ts | 12 +- backend/src/api/guilds/index.ts | 6 +- backend/src/api/guilds/misc.ts | 28 +-- backend/src/api/index.ts | 8 +- backend/src/api/permissions.ts | 6 +- backend/src/api/rateLimits.ts | 2 +- backend/src/api/staff.ts | 4 +- backend/src/api/start.ts | 14 +- backend/src/api/tasks.ts | 4 +- backend/src/commandTypes.ts | 6 +- backend/src/configValidator.ts | 6 +- backend/src/data/AllowedGuilds.ts | 10 +- backend/src/data/ApiAuditLog.ts | 10 +- backend/src/data/ApiLogins.ts | 8 +- backend/src/data/ApiPermissionAssignments.ts | 10 +- backend/src/data/ApiUserInfo.ts | 8 +- backend/src/data/Archives.ts | 6 +- backend/src/data/BaseGuildRepository.ts | 2 +- backend/src/data/BaseRepository.ts | 2 +- backend/src/data/Configs.ts | 12 +- backend/src/data/GuildAntiraidLevels.ts | 6 +- backend/src/data/GuildArchives.ts | 18 +- backend/src/data/GuildAutoReactions.ts | 6 +- backend/src/data/GuildButtonRoles.ts | 4 +- backend/src/data/GuildCases.ts | 14 +- backend/src/data/GuildContextMenuLinks.ts | 6 +- backend/src/data/GuildCounters.ts | 16 +- backend/src/data/GuildEvents.ts | 10 +- backend/src/data/GuildLogs.ts | 2 +- backend/src/data/GuildMemberCache.ts | 10 +- backend/src/data/GuildMemberTimezones.ts | 8 +- backend/src/data/GuildMutes.ts | 10 +- backend/src/data/GuildNicknameHistory.ts | 12 +- backend/src/data/GuildPersistedData.ts | 6 +- backend/src/data/GuildPingableRoles.ts | 6 +- backend/src/data/GuildReactionRoles.ts | 6 +- backend/src/data/GuildReminders.ts | 6 +- backend/src/data/GuildRoleButtons.ts | 6 +- backend/src/data/GuildRoleQueue.ts | 6 +- backend/src/data/GuildSavedMessages.ts | 16 +- backend/src/data/GuildScheduledPosts.ts | 6 +- backend/src/data/GuildSlowmodes.ts | 8 +- backend/src/data/GuildStarboardMessages.ts | 6 +- backend/src/data/GuildStarboardReactions.ts | 6 +- backend/src/data/GuildStats.ts | 6 +- backend/src/data/GuildTags.ts | 8 +- backend/src/data/GuildTempbans.ts | 6 +- backend/src/data/GuildVCAlerts.ts | 6 +- backend/src/data/MemberCache.ts | 8 +- backend/src/data/Mutes.ts | 10 +- backend/src/data/Phisherman.ts | 12 +- backend/src/data/Reminders.ts | 8 +- backend/src/data/ScheduledPosts.ts | 8 +- backend/src/data/Supporters.ts | 6 +- backend/src/data/Tempbans.ts | 8 +- backend/src/data/UsernameHistory.ts | 12 +- backend/src/data/VCAlerts.ts | 8 +- backend/src/data/Webhooks.ts | 8 +- backend/src/data/apiAuditLogTypes.ts | 2 +- backend/src/data/cleanup/configs.ts | 6 +- backend/src/data/cleanup/messages.ts | 6 +- backend/src/data/cleanup/nicknames.ts | 6 +- backend/src/data/cleanup/usernames.ts | 6 +- backend/src/data/dataSource.ts | 4 +- backend/src/data/db.ts | 4 +- backend/src/data/entities/ApiAuditLogEntry.ts | 2 +- backend/src/data/entities/ApiLogin.ts | 6 +- .../data/entities/ApiPermissionAssignment.ts | 4 +- backend/src/data/entities/ApiUserInfo.ts | 10 +- backend/src/data/entities/Case.ts | 6 +- backend/src/data/entities/CaseNote.ts | 6 +- backend/src/data/entities/Config.ts | 2 +- .../src/data/entities/PhishermanCacheEntry.ts | 2 +- backend/src/data/entities/SavedMessage.ts | 3 +- backend/src/data/entities/ScheduledPost.ts | 2 +- backend/src/data/entities/StarboardMessage.ts | 2 +- .../src/data/entities/StarboardReaction.ts | 2 +- backend/src/data/getChannelIdFromMessageId.ts | 4 +- .../data/loops/expiredArchiveDeletionLoop.ts | 4 +- .../loops/expiredMemberCacheDeletionLoop.ts | 4 +- backend/src/data/loops/expiringMutesLoop.ts | 8 +- .../src/data/loops/expiringTempbansLoop.ts | 8 +- .../src/data/loops/expiringVCAlertsLoop.ts | 8 +- .../src/data/loops/memberCacheDeletionLoop.ts | 4 +- backend/src/data/loops/phishermanLoops.ts | 4 +- .../src/data/loops/savedMessageCleanupLoop.ts | 4 +- .../src/data/loops/upcomingRemindersLoop.ts | 8 +- .../data/loops/upcomingScheduledPostsLoop.ts | 8 +- backend/src/data/queryLogger.ts | 2 +- backend/src/env.ts | 2 +- backend/src/exportSchemas.ts | 6 +- backend/src/index.ts | 64 +++--- backend/src/migrateConfigsToDB.ts | 6 +- .../1596994103885-AddCaseNotesForeignKey.ts | 2 +- .../1597015567215-AddLogMessageIdToCases.ts | 2 +- ...597109357201-CreateMemberTimezonesTable.ts | 2 +- .../1600283341726-EncryptExistingMessages.ts | 2 +- .../1600285077890-EncryptArchives.ts | 2 +- .../1617363975046-UpdateCounterTriggers.ts | 2 +- backend/src/paths.ts | 2 +- backend/src/pluginUtils.ts | 10 +- .../plugins/AutoDelete/AutoDeletePlugin.ts | 16 +- backend/src/plugins/AutoDelete/info.ts | 2 +- backend/src/plugins/AutoDelete/types.ts | 8 +- .../util/addMessageToDeletionQueue.ts | 8 +- .../plugins/AutoDelete/util/deleteNextItem.ts | 16 +- .../AutoDelete/util/onMessageCreate.ts | 10 +- .../AutoDelete/util/onMessageDelete.ts | 6 +- .../AutoDelete/util/onMessageDeleteBulk.ts | 6 +- .../AutoDelete/util/scheduleNextDeletion.ts | 4 +- .../AutoReactions/AutoReactionsPlugin.ts | 14 +- .../commands/DisableAutoReactionsCmd.ts | 6 +- .../commands/NewAutoReactionsCmd.ts | 14 +- .../AutoReactions/events/AddReactionsEvt.ts | 14 +- backend/src/plugins/AutoReactions/info.ts | 4 +- backend/src/plugins/AutoReactions/types.ts | 8 +- backend/src/plugins/Automod/AutomodPlugin.ts | 58 +++--- .../src/plugins/Automod/actions/addRoles.ts | 16 +- .../plugins/Automod/actions/addToCounter.ts | 8 +- backend/src/plugins/Automod/actions/alert.ts | 18 +- .../plugins/Automod/actions/archiveThread.ts | 4 +- .../Automod/actions/availableActions.ts | 40 ++-- backend/src/plugins/Automod/actions/ban.ts | 12 +- .../plugins/Automod/actions/changeNickname.ts | 6 +- .../plugins/Automod/actions/changePerms.ts | 10 +- backend/src/plugins/Automod/actions/clean.ts | 6 +- .../plugins/Automod/actions/exampleAction.ts | 4 +- backend/src/plugins/Automod/actions/kick.ts | 12 +- backend/src/plugins/Automod/actions/log.ts | 6 +- backend/src/plugins/Automod/actions/mute.ts | 16 +- .../plugins/Automod/actions/pauseInvites.ts | 2 +- .../plugins/Automod/actions/removeRoles.ts | 16 +- backend/src/plugins/Automod/actions/reply.ts | 16 +- .../Automod/actions/setAntiraidLevel.ts | 6 +- .../src/plugins/Automod/actions/setCounter.ts | 10 +- .../plugins/Automod/actions/setSlowmode.ts | 6 +- .../plugins/Automod/actions/startThread.ts | 10 +- backend/src/plugins/Automod/actions/warn.ts | 12 +- .../Automod/commands/AntiraidClearCmd.ts | 6 +- .../Automod/commands/SetAntiraidCmd.ts | 8 +- .../Automod/commands/ViewAntiraidCmd.ts | 2 +- backend/src/plugins/Automod/constants.ts | 2 +- .../events/RunAutomodOnJoinLeaveEvt.ts | 6 +- .../events/RunAutomodOnMemberUpdate.ts | 8 +- .../events/runAutomodOnAntiraidLevel.ts | 4 +- .../events/runAutomodOnCounterTrigger.ts | 8 +- .../Automod/events/runAutomodOnMessage.ts | 12 +- .../Automod/events/runAutomodOnModAction.ts | 8 +- .../events/runAutomodOnThreadEvents.ts | 6 +- .../functions/addRecentActionsFromMessage.ts | 6 +- .../Automod/functions/applyCooldown.ts | 4 +- .../Automod/functions/checkCooldown.ts | 2 +- .../functions/clearOldNicknameChanges.ts | 4 +- .../functions/clearOldRecentActions.ts | 6 +- .../Automod/functions/clearOldRecentSpam.ts | 6 +- .../functions/clearRecentActionsForMessage.ts | 4 +- .../functions/createMessageSpamTrigger.ts | 18 +- .../Automod/functions/findRecentSpam.ts | 6 +- .../getMatchingMessageRecentActions.ts | 10 +- .../functions/getMatchingRecentActions.ts | 6 +- .../Automod/functions/getSpamIdentifier.ts | 2 +- .../functions/getTextMatchPartialSummary.ts | 6 +- .../Automod/functions/ignoredRoleChanges.ts | 4 +- .../matchMultipleTextTypesOnMessage.ts | 6 +- .../functions/resolveActionContactMethods.ts | 6 +- .../plugins/Automod/functions/runAutomod.ts | 16 +- .../Automod/functions/setAntiraidLevel.ts | 6 +- .../functions/sumRecentActionCounts.ts | 2 +- backend/src/plugins/Automod/helpers.ts | 4 +- backend/src/plugins/Automod/info.ts | 4 +- .../plugins/Automod/triggers/antiraidLevel.ts | 2 +- .../plugins/Automod/triggers/anyMessage.ts | 4 +- .../Automod/triggers/attachmentSpam.ts | 4 +- .../Automod/triggers/availableTriggers.ts | 70 +++---- backend/src/plugins/Automod/triggers/ban.ts | 2 +- .../plugins/Automod/triggers/characterSpam.ts | 4 +- .../Automod/triggers/counterTrigger.ts | 2 +- .../src/plugins/Automod/triggers/emojiSpam.ts | 4 +- .../Automod/triggers/exampleTrigger.ts | 2 +- backend/src/plugins/Automod/triggers/kick.ts | 2 +- .../src/plugins/Automod/triggers/lineSpam.ts | 4 +- .../src/plugins/Automod/triggers/linkSpam.ts | 4 +- .../Automod/triggers/matchAttachmentType.ts | 4 +- .../plugins/Automod/triggers/matchInvites.ts | 8 +- .../plugins/Automod/triggers/matchLinks.ts | 18 +- .../plugins/Automod/triggers/matchMimeType.ts | 4 +- .../plugins/Automod/triggers/matchRegex.ts | 16 +- .../plugins/Automod/triggers/matchWords.ts | 10 +- .../plugins/Automod/triggers/memberJoin.ts | 4 +- .../Automod/triggers/memberJoinSpam.ts | 12 +- .../plugins/Automod/triggers/memberLeave.ts | 2 +- .../plugins/Automod/triggers/mentionSpam.ts | 4 +- .../plugins/Automod/triggers/messageSpam.ts | 4 +- backend/src/plugins/Automod/triggers/mute.ts | 2 +- backend/src/plugins/Automod/triggers/note.ts | 2 +- .../src/plugins/Automod/triggers/roleAdded.ts | 6 +- .../plugins/Automod/triggers/roleRemoved.ts | 6 +- .../plugins/Automod/triggers/stickerSpam.ts | 4 +- .../plugins/Automod/triggers/threadArchive.ts | 4 +- .../plugins/Automod/triggers/threadCreate.ts | 2 +- .../Automod/triggers/threadCreateSpam.ts | 12 +- .../plugins/Automod/triggers/threadDelete.ts | 2 +- .../Automod/triggers/threadUnarchive.ts | 4 +- backend/src/plugins/Automod/triggers/unban.ts | 2 +- .../src/plugins/Automod/triggers/unmute.ts | 2 +- backend/src/plugins/Automod/triggers/warn.ts | 2 +- backend/src/plugins/Automod/types.ts | 28 +-- .../plugins/BotControl/BotControlPlugin.ts | 46 ++--- .../commands/AddDashboardUserCmd.ts | 8 +- .../commands/AddServerFromInviteCmd.ts | 10 +- .../BotControl/commands/AllowServerCmd.ts | 8 +- .../BotControl/commands/ChannelToServerCmd.ts | 6 +- .../BotControl/commands/DisallowServerCmd.ts | 8 +- .../BotControl/commands/EligibleCmd.ts | 10 +- .../BotControl/commands/LeaveServerCmd.ts | 6 +- .../commands/ListDashboardPermsCmd.ts | 12 +- .../commands/ListDashboardUsersCmd.ts | 8 +- .../BotControl/commands/ProfilerDataCmd.ts | 10 +- .../commands/RateLimitPerformanceCmd.ts | 8 +- .../commands/ReloadGlobalPluginsCmd.ts | 6 +- .../BotControl/commands/ReloadServerCmd.ts | 6 +- .../commands/RemoveDashboardUserCmd.ts | 8 +- .../BotControl/commands/RestPerformanceCmd.ts | 8 +- .../plugins/BotControl/commands/ServersCmd.ts | 8 +- .../BotControl/functions/isEligible.ts | 4 +- backend/src/plugins/BotControl/types.ts | 10 +- backend/src/plugins/Cases/CasesPlugin.ts | 30 +-- .../src/plugins/Cases/caseAbbreviations.ts | 2 +- backend/src/plugins/Cases/caseColors.ts | 2 +- backend/src/plugins/Cases/caseIcons.ts | 2 +- .../src/plugins/Cases/functions/createCase.ts | 10 +- .../plugins/Cases/functions/createCaseNote.ts | 10 +- .../plugins/Cases/functions/getCaseColor.ts | 6 +- .../plugins/Cases/functions/getCaseEmbed.ts | 14 +- .../plugins/Cases/functions/getCaseIcon.ts | 6 +- .../plugins/Cases/functions/getCaseSummary.ts | 12 +- .../functions/getCaseTypeAmountForUserId.ts | 4 +- .../Cases/functions/getRecentCasesByMod.ts | 4 +- .../Cases/functions/getTotalCasesByMod.ts | 2 +- .../Cases/functions/postToCaseLogChannel.ts | 16 +- .../plugins/Cases/functions/resolveCaseId.ts | 2 +- backend/src/plugins/Cases/info.ts | 4 +- backend/src/plugins/Cases/types.ts | 12 +- backend/src/plugins/Censor/CensorPlugin.ts | 14 +- backend/src/plugins/Censor/info.ts | 4 +- backend/src/plugins/Censor/types.ts | 8 +- .../plugins/Censor/util/applyFiltersToMsg.ts | 18 +- .../src/plugins/Censor/util/censorMessage.ts | 10 +- .../plugins/Censor/util/onMessageCreate.ts | 8 +- .../plugins/Censor/util/onMessageUpdate.ts | 8 +- .../ChannelArchiver/ChannelArchiverPlugin.ts | 6 +- .../commands/ArchiveChannelCmd.ts | 12 +- .../ChannelArchiver/rehostAttachment.ts | 2 +- .../CompanionChannelsPlugin.ts | 8 +- .../events/VoiceStateUpdateEvt.ts | 4 +- ...etCompanionChannelOptsForVoiceChannelId.ts | 2 +- .../functions/handleCompanionPermissions.ts | 12 +- backend/src/plugins/CompanionChannels/info.ts | 4 +- .../src/plugins/CompanionChannels/types.ts | 4 +- .../plugins/ContextMenus/ContextMenuPlugin.ts | 14 +- .../src/plugins/ContextMenus/actions/clean.ts | 8 +- .../src/plugins/ContextMenus/actions/mute.ts | 16 +- .../plugins/ContextMenus/actions/userInfo.ts | 4 +- .../ContextMenus/events/ContextClickedEvt.ts | 4 +- backend/src/plugins/ContextMenus/info.ts | 2 +- backend/src/plugins/ContextMenus/types.ts | 2 +- .../ContextMenus/utils/contextRouter.ts | 4 +- .../utils/hardcodedContextOptions.ts | 6 +- .../ContextMenus/utils/loadAllCommands.ts | 6 +- .../src/plugins/Counters/CountersPlugin.ts | 38 ++-- .../Counters/commands/AddCounterCmd.ts | 10 +- .../Counters/commands/CountersListCmd.ts | 8 +- .../commands/ResetAllCounterValuesCmd.ts | 10 +- .../Counters/commands/ResetCounterCmd.ts | 10 +- .../Counters/commands/SetCounterCmd.ts | 10 +- .../Counters/commands/ViewCounterCmd.ts | 8 +- .../Counters/functions/changeCounterValue.ts | 8 +- .../checkAllValuesForReverseTrigger.ts | 6 +- .../functions/checkAllValuesForTrigger.ts | 6 +- .../Counters/functions/checkCounterTrigger.ts | 6 +- .../functions/checkReverseCounterTrigger.ts | 6 +- .../Counters/functions/counterExists.ts | 2 +- .../Counters/functions/decayCounter.ts | 8 +- .../Counters/functions/emitCounterEvent.ts | 2 +- .../functions/getPrettyNameForCounter.ts | 2 +- .../getPrettyNameForCounterTrigger.ts | 2 +- .../Counters/functions/offCounterEvent.ts | 2 +- .../Counters/functions/onCounterEvent.ts | 2 +- .../functions/resetAllCounterValues.ts | 4 +- .../Counters/functions/setCounterValue.ts | 8 +- backend/src/plugins/Counters/info.ts | 4 +- backend/src/plugins/Counters/types.ts | 6 +- .../CustomEvents/CustomEventsPlugin.ts | 16 +- .../CustomEvents/actions/addRoleAction.ts | 12 +- .../CustomEvents/actions/createCaseAction.ts | 14 +- .../actions/makeRoleMentionableAction.ts | 8 +- .../actions/makeRoleUnmentionableAction.ts | 8 +- .../CustomEvents/actions/messageAction.ts | 10 +- .../actions/moveToVoiceChannelAction.ts | 12 +- .../actions/setChannelPermissionOverrides.ts | 8 +- .../CustomEvents/catchTemplateError.ts | 4 +- .../CustomEvents/functions/runEvent.ts | 22 +- backend/src/plugins/CustomEvents/info.ts | 2 +- backend/src/plugins/CustomEvents/types.ts | 16 +- .../GuildAccessMonitorPlugin.ts | 6 +- .../GuildConfigReloaderPlugin.ts | 6 +- .../functions/reloadChangedGuilds.ts | 4 +- .../src/plugins/GuildConfigReloader/info.ts | 2 +- .../src/plugins/GuildConfigReloader/types.ts | 2 +- .../GuildInfoSaver/GuildInfoSaverPlugin.ts | 8 +- backend/src/plugins/GuildInfoSaver/info.ts | 2 +- .../GuildMemberCachePlugin.ts | 22 +- .../events/cancelDeletionOnMemberJoin.ts | 2 +- .../events/removeMemberCacheOnMemberLeave.ts | 2 +- .../events/updateMemberCacheOnMemberUpdate.ts | 4 +- .../events/updateMemberCacheOnMessage.ts | 4 +- .../events/updateMemberCacheOnRoleChange.ts | 4 +- .../updateMemberCacheOnVoiceStateUpdate.ts | 4 +- .../functions/getCachedMemberData.ts | 4 +- .../functions/updateMemberCacheForMember.ts | 2 +- backend/src/plugins/GuildMemberCache/info.ts | 2 +- backend/src/plugins/GuildMemberCache/types.ts | 2 +- .../InternalPoster/InternalPosterPlugin.ts | 12 +- .../InternalPoster/functions/editMessage.ts | 4 +- .../getOrCreateWebhookClientForChannel.ts | 4 +- .../functions/getOrCreateWebhookForChannel.ts | 4 +- .../InternalPoster/functions/sendMessage.ts | 8 +- backend/src/plugins/InternalPoster/info.ts | 2 +- backend/src/plugins/InternalPoster/types.ts | 4 +- .../plugins/LocateUser/LocateUserPlugin.ts | 20 +- .../plugins/LocateUser/commands/FollowCmd.ts | 10 +- .../LocateUser/commands/ListFollowCmd.ts | 10 +- .../plugins/LocateUser/commands/WhereCmd.ts | 6 +- .../LocateUser/events/BanRemoveAlertsEvt.ts | 4 +- .../LocateUser/events/SendAlertsEvts.ts | 4 +- backend/src/plugins/LocateUser/info.ts | 6 +- backend/src/plugins/LocateUser/types.ts | 2 +- .../LocateUser/utils/clearExpiredAlert.ts | 6 +- .../LocateUser/utils/fillAlertsList.ts | 2 +- .../plugins/LocateUser/utils/moveMember.ts | 4 +- .../utils/removeUserIdFromActiveAlerts.ts | 2 +- .../plugins/LocateUser/utils/sendAlerts.ts | 8 +- .../src/plugins/LocateUser/utils/sendWhere.ts | 6 +- backend/src/plugins/Logs/LogsPlugin.ts | 194 +++++++++--------- .../Logs/events/LogsChannelModifyEvts.ts | 12 +- .../events/LogsEmojiAndStickerModifyEvts.ts | 18 +- .../plugins/Logs/events/LogsGuildBanEvts.ts | 12 +- .../Logs/events/LogsGuildMemberAddEvt.ts | 4 +- .../Logs/events/LogsGuildMemberRemoveEvt.ts | 4 +- .../events/LogsGuildMemberRoleChangeEvt.ts | 8 +- .../plugins/Logs/events/LogsRoleModifyEvts.ts | 12 +- .../events/LogsStageInstanceModifyEvts.ts | 12 +- .../Logs/events/LogsThreadModifyEvts.ts | 12 +- .../plugins/Logs/events/LogsUserUpdateEvts.ts | 4 +- .../Logs/events/LogsVoiceChannelEvts.ts | 8 +- backend/src/plugins/Logs/info.ts | 4 +- .../Logs/logFunctions/logAutomodAction.ts | 10 +- .../plugins/Logs/logFunctions/logBotAlert.ts | 8 +- .../Logs/logFunctions/logCaseCreate.ts | 10 +- .../Logs/logFunctions/logCaseDelete.ts | 12 +- .../Logs/logFunctions/logCaseUpdate.ts | 10 +- .../plugins/Logs/logFunctions/logCensor.ts | 16 +- .../Logs/logFunctions/logChannelCreate.ts | 12 +- .../Logs/logFunctions/logChannelDelete.ts | 12 +- .../Logs/logFunctions/logChannelUpdate.ts | 12 +- .../src/plugins/Logs/logFunctions/logClean.ts | 12 +- .../plugins/Logs/logFunctions/logDmFailed.ts | 12 +- .../Logs/logFunctions/logEmojiCreate.ts | 10 +- .../Logs/logFunctions/logEmojiDelete.ts | 10 +- .../Logs/logFunctions/logEmojiUpdate.ts | 10 +- .../plugins/Logs/logFunctions/logMassBan.ts | 10 +- .../plugins/Logs/logFunctions/logMassMute.ts | 10 +- .../plugins/Logs/logFunctions/logMassUnban.ts | 10 +- .../plugins/Logs/logFunctions/logMemberBan.ts | 12 +- .../Logs/logFunctions/logMemberForceban.ts | 10 +- .../Logs/logFunctions/logMemberJoin.ts | 10 +- .../logMemberJoinWithPriorRecords.ts | 10 +- .../Logs/logFunctions/logMemberKick.ts | 12 +- .../Logs/logFunctions/logMemberLeave.ts | 10 +- .../Logs/logFunctions/logMemberMute.ts | 12 +- .../Logs/logFunctions/logMemberMuteExpired.ts | 12 +- .../Logs/logFunctions/logMemberMuteRejoin.ts | 10 +- .../Logs/logFunctions/logMemberNickChange.ts | 10 +- .../Logs/logFunctions/logMemberNote.ts | 12 +- .../Logs/logFunctions/logMemberRestore.ts | 10 +- .../Logs/logFunctions/logMemberRoleAdd.ts | 12 +- .../Logs/logFunctions/logMemberRoleChanges.ts | 12 +- .../Logs/logFunctions/logMemberRoleRemove.ts | 12 +- .../Logs/logFunctions/logMemberTimedBan.ts | 12 +- .../Logs/logFunctions/logMemberTimedMute.ts | 12 +- .../Logs/logFunctions/logMemberTimedUnban.ts | 12 +- .../Logs/logFunctions/logMemberTimedUnmute.ts | 12 +- .../Logs/logFunctions/logMemberUnban.ts | 12 +- .../Logs/logFunctions/logMemberUnmute.ts | 12 +- .../Logs/logFunctions/logMemberWarn.ts | 10 +- .../Logs/logFunctions/logMessageDelete.ts | 18 +- .../Logs/logFunctions/logMessageDeleteAuto.ts | 16 +- .../Logs/logFunctions/logMessageDeleteBare.ts | 12 +- .../Logs/logFunctions/logMessageDeleteBulk.ts | 12 +- .../Logs/logFunctions/logMessageEdit.ts | 16 +- .../logFunctions/logMessageSpamDetected.ts | 12 +- .../Logs/logFunctions/logOtherSpamDetected.ts | 10 +- .../logFunctions/logPostedScheduledMessage.ts | 12 +- .../Logs/logFunctions/logRepeatedMessage.ts | 12 +- .../Logs/logFunctions/logRoleCreate.ts | 10 +- .../Logs/logFunctions/logRoleDelete.ts | 10 +- .../Logs/logFunctions/logRoleUpdate.ts | 10 +- .../Logs/logFunctions/logScheduledMessage.ts | 12 +- .../logScheduledRepeatedMessage.ts | 12 +- .../Logs/logFunctions/logSetAntiraidAuto.ts | 8 +- .../Logs/logFunctions/logSetAntiraidUser.ts | 10 +- .../logFunctions/logStageInstanceCreate.ts | 12 +- .../logFunctions/logStageInstanceDelete.ts | 12 +- .../logFunctions/logStageInstanceUpdate.ts | 12 +- .../Logs/logFunctions/logStickerCreate.ts | 10 +- .../Logs/logFunctions/logStickerDelete.ts | 10 +- .../Logs/logFunctions/logStickerUpdate.ts | 10 +- .../Logs/logFunctions/logThreadCreate.ts | 12 +- .../Logs/logFunctions/logThreadDelete.ts | 12 +- .../Logs/logFunctions/logThreadUpdate.ts | 12 +- .../logVoiceChannelForceDisconnect.ts | 12 +- .../logFunctions/logVoiceChannelForceMove.ts | 12 +- .../Logs/logFunctions/logVoiceChannelJoin.ts | 12 +- .../Logs/logFunctions/logVoiceChannelLeave.ts | 12 +- .../Logs/logFunctions/logVoiceChannelMove.ts | 12 +- backend/src/plugins/Logs/types.ts | 18 +- .../src/plugins/Logs/util/getLogMessage.ts | 16 +- backend/src/plugins/Logs/util/isLogIgnored.ts | 4 +- backend/src/plugins/Logs/util/log.ts | 16 +- .../src/plugins/Logs/util/onMessageDelete.ts | 14 +- .../plugins/Logs/util/onMessageDeleteBulk.ts | 12 +- .../src/plugins/Logs/util/onMessageUpdate.ts | 10 +- .../MessageSaver/MessageSaverPlugin.ts | 10 +- .../MessageSaver/commands/SaveMessagesToDB.ts | 8 +- .../MessageSaver/commands/SavePinsToDB.ts | 8 +- .../MessageSaver/events/SaveMessagesEvts.ts | 2 +- backend/src/plugins/MessageSaver/info.ts | 2 +- .../plugins/MessageSaver/saveMessagesToDB.ts | 2 +- backend/src/plugins/MessageSaver/types.ts | 2 +- .../plugins/ModActions/ModActionsPlugin.ts | 94 ++++----- .../plugins/ModActions/commands/AddCaseCmd.ts | 18 +- .../src/plugins/ModActions/commands/BanCmd.ts | 28 +-- .../plugins/ModActions/commands/CaseCmd.ts | 8 +- .../ModActions/commands/CasesModCmd.ts | 16 +- .../ModActions/commands/CasesUserCmd.ts | 16 +- .../ModActions/commands/DeleteCaseCmd.ts | 16 +- .../ModActions/commands/ForcebanCmd.ts | 22 +- .../ModActions/commands/ForcemuteCmd.ts | 10 +- .../ModActions/commands/ForceunmuteCmd.ts | 10 +- .../ModActions/commands/HideCaseCmd.ts | 6 +- .../plugins/ModActions/commands/KickCmd.ts | 6 +- .../plugins/ModActions/commands/MassBanCmd.ts | 22 +- .../ModActions/commands/MassUnbanCmd.ts | 20 +- .../ModActions/commands/MassmuteCmd.ts | 16 +- .../plugins/ModActions/commands/MuteCmd.ts | 14 +- .../plugins/ModActions/commands/NoteCmd.ts | 16 +- .../ModActions/commands/SoftbanCommand.ts | 8 +- .../plugins/ModActions/commands/UnbanCmd.ts | 22 +- .../ModActions/commands/UnhideCaseCmd.ts | 6 +- .../plugins/ModActions/commands/UnmuteCmd.ts | 16 +- .../plugins/ModActions/commands/UpdateCmd.ts | 6 +- .../plugins/ModActions/commands/WarnCmd.ts | 22 +- .../ModActions/events/AuditLogEvents.ts | 8 +- .../events/CreateBanCaseOnManualBanEvt.ts | 20 +- .../events/CreateKickCaseOnManualKickEvt.ts | 20 +- .../events/CreateUnbanCaseOnManualUnbanEvt.ts | 18 +- .../events/PostAlertOnMemberJoinEvt.ts | 8 +- .../functions/actualKickMemberCmd.ts | 18 +- .../ModActions/functions/actualMuteUserCmd.ts | 18 +- .../functions/actualUnmuteUserCmd.ts | 10 +- .../plugins/ModActions/functions/banUserId.ts | 24 +-- .../functions/clearIgnoredEvents.ts | 2 +- .../ModActions/functions/clearTempban.ts | 22 +- .../functions/getDefaultContactMethods.ts | 4 +- .../ModActions/functions/hasMutePerm.ts | 2 +- .../ModActions/functions/ignoreEvent.ts | 6 +- .../plugins/ModActions/functions/isBanned.ts | 8 +- .../ModActions/functions/isEventIgnored.ts | 2 +- .../ModActions/functions/kickMember.ts | 20 +- .../functions/offModActionsEvent.ts | 2 +- .../ModActions/functions/onModActionsEvent.ts | 2 +- .../functions/readContactMethodsFromArgs.ts | 2 +- .../ModActions/functions/updateCase.ts | 12 +- .../ModActions/functions/warnMember.ts | 18 +- backend/src/plugins/ModActions/info.ts | 6 +- backend/src/plugins/ModActions/types.ts | 16 +- backend/src/plugins/Mutes/MutesPlugin.ts | 44 ++-- .../Mutes/commands/ClearBannedMutesCmd.ts | 4 +- .../plugins/Mutes/commands/ClearMutesCmd.ts | 6 +- .../commands/ClearMutesWithoutRoleCmd.ts | 6 +- .../src/plugins/Mutes/commands/MutesCmd.ts | 10 +- .../events/ClearActiveMuteOnMemberBanEvt.ts | 2 +- .../events/ClearActiveMuteOnRoleRemovalEvt.ts | 4 +- .../events/ReapplyActiveMuteOnJoinEvt.ts | 10 +- .../Mutes/events/RegisterManualTimeoutsEvt.ts | 6 +- .../src/plugins/Mutes/functions/clearMute.ts | 16 +- .../Mutes/functions/getDefaultMuteType.ts | 4 +- .../Mutes/functions/getTimeoutExpiryTime.ts | 2 +- .../Mutes/functions/memberHasMutedRole.ts | 2 +- .../src/plugins/Mutes/functions/muteUser.ts | 34 +-- .../plugins/Mutes/functions/offMutesEvent.ts | 2 +- .../plugins/Mutes/functions/onMutesEvent.ts | 2 +- .../Mutes/functions/renewTimeoutMute.ts | 8 +- .../src/plugins/Mutes/functions/unmuteUser.ts | 26 +-- backend/src/plugins/Mutes/info.ts | 4 +- backend/src/plugins/Mutes/types.ts | 16 +- .../plugins/NameHistory/NameHistoryPlugin.ts | 10 +- .../plugins/NameHistory/commands/NamesCmd.ts | 14 +- .../NameHistory/events/UpdateNameEvts.ts | 4 +- backend/src/plugins/NameHistory/info.ts | 4 +- backend/src/plugins/NameHistory/types.ts | 6 +- .../src/plugins/NameHistory/updateNickname.ts | 2 +- backend/src/plugins/Persist/PersistPlugin.ts | 14 +- .../src/plugins/Persist/events/LoadDataEvt.ts | 18 +- .../plugins/Persist/events/StoreDataEvt.ts | 4 +- backend/src/plugins/Persist/info.ts | 6 +- backend/src/plugins/Persist/types.ts | 6 +- .../plugins/Phisherman/PhishermanPlugin.ts | 8 +- .../Phisherman/functions/getDomainInfo.ts | 6 +- backend/src/plugins/Phisherman/info.ts | 6 +- .../PingableRoles/PingableRolesPlugin.ts | 8 +- .../commands/PingableRoleDisableCmd.ts | 6 +- .../commands/PingableRoleEnableCmd.ts | 6 +- .../events/ChangePingableEvts.ts | 8 +- backend/src/plugins/PingableRoles/info.ts | 4 +- backend/src/plugins/PingableRoles/types.ts | 4 +- .../utils/disablePingableRoles.ts | 4 +- .../utils/enablePingableRoles.ts | 4 +- .../utils/getPingableRolesForChannel.ts | 4 +- backend/src/plugins/Post/PostPlugin.ts | 30 +-- backend/src/plugins/Post/commands/EditCmd.ts | 8 +- .../src/plugins/Post/commands/EditEmbedCmd.ts | 14 +- backend/src/plugins/Post/commands/PostCmd.ts | 6 +- .../src/plugins/Post/commands/PostEmbedCmd.ts | 16 +- .../Post/commands/ScheduledPostsDeleteCmd.ts | 10 +- .../Post/commands/ScheduledPostsListCmd.ts | 6 +- .../Post/commands/ScheduledPostsShowCmd.ts | 10 +- backend/src/plugins/Post/info.ts | 4 +- backend/src/plugins/Post/types.ts | 6 +- .../src/plugins/Post/util/actualPostCmd.ts | 16 +- .../plugins/Post/util/parseScheduleTime.ts | 4 +- backend/src/plugins/Post/util/postMessage.ts | 6 +- .../plugins/Post/util/postScheduledPost.ts | 14 +- .../ReactionRoles/ReactionRolesPlugin.ts | 20 +- .../commands/ClearReactionRolesCmd.ts | 8 +- .../commands/InitReactionRolesCmd.ts | 12 +- .../commands/RefreshReactionRolesCmd.ts | 8 +- .../events/AddReactionRoleEvt.ts | 6 +- .../ReactionRoles/events/MessageDeletedEvt.ts | 2 +- backend/src/plugins/ReactionRoles/info.ts | 4 +- backend/src/plugins/ReactionRoles/types.ts | 6 +- .../util/addMemberPendingRoleChange.ts | 8 +- .../applyReactionRoleReactionsToMessage.ts | 8 +- .../ReactionRoles/util/autoRefreshLoop.ts | 4 +- .../util/refreshReactionRoles.ts | 4 +- .../ReactionRoles/util/runAutoRefresh.ts | 4 +- .../src/plugins/Reminders/RemindersPlugin.ts | 16 +- .../plugins/Reminders/commands/RemindCmd.ts | 12 +- .../Reminders/commands/RemindersCmd.ts | 8 +- .../Reminders/commands/RemindersDeleteCmd.ts | 10 +- .../Reminders/functions/postReminder.ts | 6 +- backend/src/plugins/Reminders/info.ts | 4 +- backend/src/plugins/Reminders/types.ts | 2 +- .../plugins/RoleButtons/RoleButtonsPlugin.ts | 14 +- .../RoleButtons/commands/resetButtons.ts | 8 +- .../RoleButtons/events/buttonInteraction.ts | 10 +- .../functions/applyAllRoleButtons.ts | 4 +- .../RoleButtons/functions/applyRoleButtons.ts | 8 +- .../functions/createButtonComponents.ts | 6 +- .../functions/getAllRolesInButtons.ts | 2 +- backend/src/plugins/RoleButtons/info.ts | 6 +- backend/src/plugins/RoleButtons/types.ts | 8 +- .../plugins/RoleManager/RoleManagerPlugin.ts | 18 +- .../RoleManager/functions/addPriorityRole.ts | 6 +- .../plugins/RoleManager/functions/addRole.ts | 4 +- .../functions/removePriorityRole.ts | 6 +- .../RoleManager/functions/removeRole.ts | 4 +- .../functions/runRoleAssignmentLoop.ts | 6 +- backend/src/plugins/RoleManager/info.ts | 2 +- backend/src/plugins/RoleManager/types.ts | 2 +- backend/src/plugins/Roles/RolesPlugin.ts | 16 +- .../src/plugins/Roles/commands/AddRoleCmd.ts | 12 +- .../plugins/Roles/commands/MassAddRoleCmd.ts | 14 +- .../Roles/commands/MassRemoveRoleCmd.ts | 12 +- .../plugins/Roles/commands/RemoveRoleCmd.ts | 12 +- backend/src/plugins/Roles/info.ts | 6 +- backend/src/plugins/Roles/types.ts | 2 +- .../SelfGrantableRolesPlugin.ts | 8 +- .../SelfGrantableRoles/commands/RoleAddCmd.ts | 16 +- .../commands/RoleHelpCmd.ts | 6 +- .../commands/RoleRemoveCmd.ts | 16 +- .../src/plugins/SelfGrantableRoles/info.ts | 6 +- .../src/plugins/SelfGrantableRoles/types.ts | 2 +- .../util/findMatchingRoles.ts | 2 +- .../util/getApplyingEntries.ts | 2 +- .../src/plugins/Slowmode/SlowmodePlugin.ts | 26 +-- .../Slowmode/commands/SlowmodeClearCmd.ts | 16 +- .../Slowmode/commands/SlowmodeDisableCmd.ts | 6 +- .../Slowmode/commands/SlowmodeGetCmd.ts | 4 +- .../Slowmode/commands/SlowmodeListCmd.ts | 4 +- .../Slowmode/commands/SlowmodeSetCmd.ts | 18 +- backend/src/plugins/Slowmode/info.ts | 4 +- backend/src/plugins/Slowmode/types.ts | 8 +- .../Slowmode/util/actualDisableSlowmodeCmd.ts | 12 +- .../Slowmode/util/applyBotSlowmodeToUserId.ts | 10 +- .../util/clearBotSlowmodeFromUserId.ts | 4 +- .../Slowmode/util/clearExpiredSlowmodes.ts | 10 +- .../util/disableBotSlowmodeForChannel.ts | 4 +- .../plugins/Slowmode/util/onMessageCreate.ts | 22 +- backend/src/plugins/Spam/SpamPlugin.ts | 18 +- .../src/plugins/Spam/events/SpamVoiceEvt.ts | 4 +- backend/src/plugins/Spam/info.ts | 6 +- backend/src/plugins/Spam/types.ts | 10 +- .../src/plugins/Spam/util/addRecentAction.ts | 2 +- .../Spam/util/clearOldRecentActions.ts | 2 +- .../Spam/util/clearRecentUserActions.ts | 2 +- .../plugins/Spam/util/getRecentActionCount.ts | 2 +- .../src/plugins/Spam/util/getRecentActions.ts | 2 +- .../Spam/util/logAndDetectMessageSpam.ts | 32 +-- .../Spam/util/logAndDetectOtherSpam.ts | 20 +- backend/src/plugins/Spam/util/logCensor.ts | 6 +- .../src/plugins/Spam/util/onMessageCreate.ts | 8 +- .../src/plugins/Spam/util/saveSpamArchives.ts | 6 +- .../src/plugins/Starboard/StarboardPlugin.ts | 16 +- .../Starboard/commands/MigratePinsCmd.ts | 8 +- .../events/StarboardReactionAddEvt.ts | 10 +- .../events/StarboardReactionRemoveEvts.ts | 4 +- backend/src/plugins/Starboard/info.ts | 6 +- backend/src/plugins/Starboard/types.ts | 8 +- .../util/createStarboardEmbedFromMessage.ts | 2 +- .../createStarboardPseudoFooterForMessage.ts | 4 +- .../plugins/Starboard/util/onMessageDelete.ts | 8 +- .../util/removeMessageFromStarboard.ts | 6 +- .../removeMessageFromStarboardMessages.ts | 2 +- .../Starboard/util/saveMessageToStarboard.ts | 6 +- .../util/updateStarboardMessageStarCount.ts | 4 +- backend/src/plugins/Tags/TagsPlugin.ts | 36 ++-- .../src/plugins/Tags/commands/TagCreateCmd.ts | 8 +- .../src/plugins/Tags/commands/TagDeleteCmd.ts | 6 +- .../src/plugins/Tags/commands/TagEvalCmd.ts | 14 +- .../src/plugins/Tags/commands/TagListCmd.ts | 6 +- .../src/plugins/Tags/commands/TagSourceCmd.ts | 6 +- backend/src/plugins/Tags/info.ts | 8 +- backend/src/plugins/Tags/templateFunctions.ts | 2 +- backend/src/plugins/Tags/types.ts | 10 +- .../src/plugins/Tags/util/findTagByName.ts | 2 +- .../Tags/util/matchAndRenderTagFromString.ts | 6 +- .../src/plugins/Tags/util/onMessageCreate.ts | 14 +- .../src/plugins/Tags/util/onMessageDelete.ts | 2 +- .../src/plugins/Tags/util/renderTagBody.ts | 8 +- .../plugins/Tags/util/renderTagFromString.ts | 14 +- .../plugins/TimeAndDate/TimeAndDatePlugin.ts | 24 +-- .../TimeAndDate/commands/ResetTimezoneCmd.ts | 6 +- .../TimeAndDate/commands/SetTimezoneCmd.ts | 10 +- .../TimeAndDate/commands/ViewTimezoneCmd.ts | 4 +- .../TimeAndDate/functions/getDateFormat.ts | 4 +- .../TimeAndDate/functions/getGuildTz.ts | 2 +- .../TimeAndDate/functions/getMemberTz.ts | 4 +- .../TimeAndDate/functions/inGuildTz.ts | 4 +- .../TimeAndDate/functions/inMemberTz.ts | 4 +- backend/src/plugins/TimeAndDate/info.ts | 6 +- backend/src/plugins/TimeAndDate/types.ts | 8 +- .../UsernameSaver/UsernameSaverPlugin.ts | 8 +- .../events/UpdateUsernameEvts.ts | 4 +- backend/src/plugins/UsernameSaver/info.ts | 2 +- backend/src/plugins/UsernameSaver/types.ts | 4 +- .../plugins/UsernameSaver/updateUsername.ts | 4 +- backend/src/plugins/Utility/UtilityPlugin.ts | 84 ++++---- .../src/plugins/Utility/commands/AboutCmd.ts | 12 +- .../src/plugins/Utility/commands/AvatarCmd.ts | 8 +- .../plugins/Utility/commands/BanSearchCmd.ts | 6 +- .../Utility/commands/ChannelInfoCmd.ts | 8 +- .../src/plugins/Utility/commands/CleanCmd.ts | 20 +- .../plugins/Utility/commands/ContextCmd.ts | 10 +- .../plugins/Utility/commands/EmojiInfoCmd.ts | 10 +- .../src/plugins/Utility/commands/HelpCmd.ts | 6 +- .../src/plugins/Utility/commands/InfoCmd.ts | 32 +-- .../plugins/Utility/commands/InviteInfoCmd.ts | 10 +- .../src/plugins/Utility/commands/JumboCmd.ts | 8 +- .../src/plugins/Utility/commands/LevelCmd.ts | 6 +- .../Utility/commands/MessageInfoCmd.ts | 10 +- .../plugins/Utility/commands/NicknameCmd.ts | 8 +- .../Utility/commands/NicknameResetCmd.ts | 8 +- .../src/plugins/Utility/commands/PingCmd.ts | 4 +- .../Utility/commands/ReloadGuildCmd.ts | 4 +- .../plugins/Utility/commands/RoleInfoCmd.ts | 6 +- .../src/plugins/Utility/commands/RolesCmd.ts | 10 +- .../src/plugins/Utility/commands/SearchCmd.ts | 6 +- .../plugins/Utility/commands/ServerInfoCmd.ts | 8 +- .../Utility/commands/SnowflakeInfoCmd.ts | 6 +- .../src/plugins/Utility/commands/SourceCmd.ts | 8 +- .../plugins/Utility/commands/UserInfoCmd.ts | 8 +- .../Utility/commands/VcdisconnectCmd.ts | 10 +- .../src/plugins/Utility/commands/VcmoveCmd.ts | 10 +- .../Utility/events/AutoJoinThreadEvt.ts | 2 +- .../Utility/functions/getChannelInfoEmbed.ts | 4 +- .../Utility/functions/getEmojiInfoEmbed.ts | 4 +- .../Utility/functions/getGuildPreview.ts | 2 +- .../Utility/functions/getInviteInfoEmbed.ts | 6 +- .../Utility/functions/getMessageInfoEmbed.ts | 4 +- .../Utility/functions/getRoleInfoEmbed.ts | 4 +- .../Utility/functions/getServerInfoEmbed.ts | 8 +- .../functions/getSnowflakeInfoEmbed.ts | 4 +- .../Utility/functions/getUserInfoEmbed.ts | 6 +- .../Utility/functions/hasPermission.ts | 2 +- backend/src/plugins/Utility/info.ts | 4 +- backend/src/plugins/Utility/refreshMembers.ts | 2 +- backend/src/plugins/Utility/search.ts | 20 +- backend/src/plugins/Utility/types.ts | 12 +- .../WelcomeMessage/WelcomeMessagePlugin.ts | 8 +- .../events/SendWelcomeMessageEvt.ts | 12 +- backend/src/plugins/WelcomeMessage/info.ts | 4 +- backend/src/plugins/WelcomeMessage/types.ts | 2 +- backend/src/plugins/availablePlugins.ts | 78 +++---- backend/src/plugins/pluginInfo.ts | 142 ++++++------- backend/src/regExpRunners.ts | 2 +- backend/src/restCallStats.ts | 2 +- backend/src/staff.ts | 2 +- backend/src/templateFormatter.test.ts | 2 +- backend/src/templateFormatter.ts | 2 +- backend/src/threadsSignalFix.ts | 2 +- backend/src/types.ts | 2 +- backend/src/utils.test.ts | 4 +- backend/src/utils.ts | 16 +- backend/src/utils/MessageBuffer.ts | 4 +- backend/src/utils/async.ts | 2 +- backend/src/utils/canAssignRole.ts | 4 +- backend/src/utils/canReadChannel.ts | 4 +- backend/src/utils/createPaginatedMessage.ts | 4 +- backend/src/utils/crypt.test.ts | 2 +- backend/src/utils/crypt.ts | 6 +- backend/src/utils/cryptHelpers.ts | 2 +- backend/src/utils/cryptWorker.ts | 2 +- backend/src/utils/easyProfiler.ts | 2 +- .../src/utils/findMatchingAuditLogEntry.ts | 2 +- backend/src/utils/getChunkedEmbedFields.ts | 2 +- .../src/utils/getMissingChannelPermissions.ts | 2 +- backend/src/utils/loadYamlSafely.ts | 2 +- backend/src/utils/lockNameHelpers.ts | 2 +- backend/src/utils/mergeRegexes.ts | 2 +- backend/src/utils/messageIsEmpty.ts | 2 +- backend/src/utils/missingPermissionError.ts | 2 +- backend/src/utils/normalizeText.test.ts | 2 +- backend/src/utils/parseCustomId.ts | 2 +- backend/src/utils/permissionNames.ts | 2 +- backend/src/utils/resolveChannelIds.ts | 6 +- backend/src/utils/resolveMessageTarget.ts | 4 +- backend/src/utils/sendDM.ts | 4 +- backend/src/utils/snowflakeToTimestamp.ts | 2 +- backend/src/utils/templateSafeObjects.ts | 8 +- .../src/utils/validateNoObjectAliases.test.ts | 2 +- backend/src/utils/waitForInteraction.ts | 2 +- backend/src/utils/zColor.ts | 4 +- backend/src/utils/zValidTimezone.ts | 2 +- backend/src/validateActiveConfigs.ts | 14 +- backend/start-dev.js | 2 +- package-lock.json | 50 +---- package.json | 1 + 766 files changed, 3473 insertions(+), 3500 deletions(-) diff --git a/backend/package.json b/backend/package.json index 744cc320f..c16e3c002 100644 --- a/backend/package.json +++ b/backend/package.json @@ -3,6 +3,7 @@ "version": "0.0.1", "description": "", "private": true, + "type": "module", "scripts": { "watch": "tsc-watch --build --onSuccess \"node start-dev.js\"", "watch-yaml-parse-test": "tsc-watch --build --onSuccess \"node dist/yamlParseTest.js\"", @@ -48,12 +49,7 @@ "knub": "^32.0.0-next.21", "knub-command-manager": "^9.1.0", "last-commit-log": "^2.1.0", - "lodash.chunk": "^4.2.0", - "lodash.clonedeep": "^4.5.0", - "lodash.difference": "^4.5.0", - "lodash.intersection": "^4.4.0", - "lodash.isequal": "^4.5.0", - "lodash.pick": "^4.4.0", + "lodash": "^4.17.21", "moment-timezone": "^0.5.21", "multer": "^1.4.5-lts.1", "mysql2": "^3.9.3", @@ -87,7 +83,6 @@ "@types/lodash.at": "^4.6.3", "@types/moment-timezone": "^0.5.6", "@types/multer": "^1.4.7", - "@types/node": "^18.16.3", "@types/passport": "^1.0.0", "@types/passport-oauth2": "^1.4.8", "@types/passport-strategy": "^0.2.35", diff --git a/backend/src/Queue.ts b/backend/src/Queue.ts index a85054111..8d67ad7f1 100644 --- a/backend/src/Queue.ts +++ b/backend/src/Queue.ts @@ -1,4 +1,4 @@ -import { SECONDS } from "./utils"; +import { SECONDS } from "./utils.js"; type InternalQueueFn = () => Promise; type AnyFn = (...args: any[]) => any; diff --git a/backend/src/QueuedEventEmitter.ts b/backend/src/QueuedEventEmitter.ts index 2402c4919..42935f30e 100644 --- a/backend/src/QueuedEventEmitter.ts +++ b/backend/src/QueuedEventEmitter.ts @@ -1,4 +1,4 @@ -import { Queue } from "./Queue"; +import { Queue } from "./Queue.js"; type Listener = (...args: any[]) => void; diff --git a/backend/src/RegExpRunner.ts b/backend/src/RegExpRunner.ts index 1ac5f47cf..6d835a84f 100644 --- a/backend/src/RegExpRunner.ts +++ b/backend/src/RegExpRunner.ts @@ -1,7 +1,7 @@ import { EventEmitter } from "events"; import { CooldownManager } from "knub"; import { RegExpWorker, TimeoutError } from "regexp-worker"; -import { MINUTES, SECONDS } from "./utils"; +import { MINUTES, SECONDS } from "./utils.js"; import Timeout = NodeJS.Timeout; const isTimeoutError = (a): a is TimeoutError => { diff --git a/backend/src/api/archives.ts b/backend/src/api/archives.ts index 9494d1945..77da999d9 100644 --- a/backend/src/api/archives.ts +++ b/backend/src/api/archives.ts @@ -1,7 +1,7 @@ import express, { Request, Response } from "express"; import moment from "moment-timezone"; -import { GuildArchives } from "../data/GuildArchives"; -import { notFound } from "./responses"; +import { GuildArchives } from "../data/GuildArchives.js"; +import { notFound } from "./responses.js"; export function initArchives(router: express.Router) { const archives = new GuildArchives(null); diff --git a/backend/src/api/auth.ts b/backend/src/api/auth.ts index 543dab0f1..983a66923 100644 --- a/backend/src/api/auth.ts +++ b/backend/src/api/auth.ts @@ -1,15 +1,15 @@ import express, { Request, Response } from "express"; import https from "https"; -import pick from "lodash.pick"; +import pick from "lodash/pick.js"; import passport from "passport"; import { Strategy as CustomStrategy } from "passport-custom"; import OAuth2Strategy from "passport-oauth2"; -import { ApiLogins } from "../data/ApiLogins"; -import { ApiPermissionAssignments } from "../data/ApiPermissionAssignments"; -import { ApiUserInfo } from "../data/ApiUserInfo"; -import { ApiUserInfoData } from "../data/entities/ApiUserInfo"; -import { env } from "../env"; -import { ok } from "./responses"; +import { ApiLogins } from "../data/ApiLogins.js"; +import { ApiPermissionAssignments } from "../data/ApiPermissionAssignments.js"; +import { ApiUserInfo } from "../data/ApiUserInfo.js"; +import { ApiUserInfoData } from "../data/entities/ApiUserInfo.js"; +import { env } from "../env.js"; +import { ok } from "./responses.js"; interface IPassportApiUser { apiKey: string; diff --git a/backend/src/api/docs.ts b/backend/src/api/docs.ts index 8b742b5c9..ff0723a29 100644 --- a/backend/src/api/docs.ts +++ b/backend/src/api/docs.ts @@ -1,9 +1,9 @@ import express from "express"; import z from "zod"; -import { guildPlugins } from "../plugins/availablePlugins"; -import { guildPluginInfo } from "../plugins/pluginInfo"; -import { indentLines } from "../utils"; -import { notFound } from "./responses"; +import { guildPlugins } from "../plugins/availablePlugins.js"; +import { guildPluginInfo } from "../plugins/pluginInfo.js"; +import { indentLines } from "../utils.js"; +import { notFound } from "./responses.js"; function isZodObject(schema: z.ZodTypeAny): schema is z.ZodObject { return schema._def.typeName === "ZodObject"; diff --git a/backend/src/api/guilds.ts b/backend/src/api/guilds.ts index 29192c40f..afe881b5b 100644 --- a/backend/src/api/guilds.ts +++ b/backend/src/api/guilds.ts @@ -1,20 +1,22 @@ import { ApiPermissions } from "@zeppelinbot/shared"; import express, { Request, Response } from "express"; -import { YAMLException } from "js-yaml"; +import jsYaml from "js-yaml"; import moment from "moment-timezone"; -import { Queue } from "../Queue"; -import { validateGuildConfig } from "../configValidator"; -import { AllowedGuilds } from "../data/AllowedGuilds"; -import { ApiAuditLog } from "../data/ApiAuditLog"; -import { ApiPermissionAssignments, ApiPermissionTypes } from "../data/ApiPermissionAssignments"; -import { Configs } from "../data/Configs"; -import { AuditLogEventTypes } from "../data/apiAuditLogTypes"; -import { isSnowflake } from "../utils"; -import { loadYamlSafely } from "../utils/loadYamlSafely"; -import { ObjectAliasError } from "../utils/validateNoObjectAliases"; -import { apiTokenAuthHandlers } from "./auth"; -import { hasGuildPermission, requireGuildPermission } from "./permissions"; -import { clientError, ok, serverError, unauthorized } from "./responses"; +import { Queue } from "../Queue.js"; +import { validateGuildConfig } from "../configValidator.js"; +import { AllowedGuilds } from "../data/AllowedGuilds.js"; +import { ApiAuditLog } from "../data/ApiAuditLog.js"; +import { ApiPermissionAssignments, ApiPermissionTypes } from "../data/ApiPermissionAssignments.js"; +import { Configs } from "../data/Configs.js"; +import { AuditLogEventTypes } from "../data/apiAuditLogTypes.js"; +import { isSnowflake } from "../utils.js"; +import { loadYamlSafely } from "../utils/loadYamlSafely.js"; +import { ObjectAliasError } from "../utils/validateNoObjectAliases.js"; +import { apiTokenAuthHandlers } from "./auth.js"; +import { hasGuildPermission, requireGuildPermission } from "./permissions.js"; +import { clientError, ok, serverError, unauthorized } from "./responses.js"; + +const YAMLException = jsYaml.YAMLException; const apiPermissionAssignments = new ApiPermissionAssignments(); const auditLog = new ApiAuditLog(); diff --git a/backend/src/api/guilds/importExport.ts b/backend/src/api/guilds/importExport.ts index 9a4a8710d..132facff7 100644 --- a/backend/src/api/guilds/importExport.ts +++ b/backend/src/api/guilds/importExport.ts @@ -2,12 +2,12 @@ import { ApiPermissions } from "@zeppelinbot/shared"; import express, { Request, Response } from "express"; import moment from "moment-timezone"; import { z } from "zod"; -import { GuildCases } from "../../data/GuildCases"; -import { Case } from "../../data/entities/Case"; -import { MINUTES } from "../../utils"; -import { requireGuildPermission } from "../permissions"; -import { rateLimit } from "../rateLimits"; -import { clientError, ok } from "../responses"; +import { GuildCases } from "../../data/GuildCases.js"; +import { Case } from "../../data/entities/Case.js"; +import { MINUTES } from "../../utils.js"; +import { requireGuildPermission } from "../permissions.js"; +import { rateLimit } from "../rateLimits.js"; +import { clientError, ok } from "../responses.js"; const caseHandlingModeSchema = z.union([ z.literal("replace"), diff --git a/backend/src/api/guilds/index.ts b/backend/src/api/guilds/index.ts index 3da1384ae..a6436abc7 100644 --- a/backend/src/api/guilds/index.ts +++ b/backend/src/api/guilds/index.ts @@ -1,7 +1,7 @@ import express from "express"; -import { apiTokenAuthHandlers } from "../auth"; -import { initGuildsImportExportAPI } from "./importExport"; -import { initGuildsMiscAPI } from "./misc"; +import { apiTokenAuthHandlers } from "../auth.js"; +import { initGuildsImportExportAPI } from "./importExport.js"; +import { initGuildsMiscAPI } from "./misc.js"; export function initGuildsAPI(router: express.Router) { const guildRouter = express.Router(); diff --git a/backend/src/api/guilds/misc.ts b/backend/src/api/guilds/misc.ts index 388352275..af956b6d3 100644 --- a/backend/src/api/guilds/misc.ts +++ b/backend/src/api/guilds/misc.ts @@ -1,19 +1,21 @@ import { ApiPermissions } from "@zeppelinbot/shared"; import express, { Request, Response } from "express"; -import { YAMLException } from "js-yaml"; +import jsYaml from "js-yaml"; import moment from "moment-timezone"; -import { Queue } from "../../Queue"; -import { validateGuildConfig } from "../../configValidator"; -import { AllowedGuilds } from "../../data/AllowedGuilds"; -import { ApiAuditLog } from "../../data/ApiAuditLog"; -import { ApiPermissionAssignments, ApiPermissionTypes } from "../../data/ApiPermissionAssignments"; -import { Configs } from "../../data/Configs"; -import { AuditLogEventTypes } from "../../data/apiAuditLogTypes"; -import { isSnowflake } from "../../utils"; -import { loadYamlSafely } from "../../utils/loadYamlSafely"; -import { ObjectAliasError } from "../../utils/validateNoObjectAliases"; -import { hasGuildPermission, requireGuildPermission } from "../permissions"; -import { clientError, ok, serverError, unauthorized } from "../responses"; +import { Queue } from "../../Queue.js"; +import { validateGuildConfig } from "../../configValidator.js"; +import { AllowedGuilds } from "../../data/AllowedGuilds.js"; +import { ApiAuditLog } from "../../data/ApiAuditLog.js"; +import { ApiPermissionAssignments, ApiPermissionTypes } from "../../data/ApiPermissionAssignments.js"; +import { Configs } from "../../data/Configs.js"; +import { AuditLogEventTypes } from "../../data/apiAuditLogTypes.js"; +import { isSnowflake } from "../../utils.js"; +import { loadYamlSafely } from "../../utils/loadYamlSafely.js"; +import { ObjectAliasError } from "../../utils/validateNoObjectAliases.js"; +import { hasGuildPermission, requireGuildPermission } from "../permissions.js"; +import { clientError, ok, serverError, unauthorized } from "../responses.js"; + +const YAMLException = jsYaml.YAMLException; const apiPermissionAssignments = new ApiPermissionAssignments(); const auditLog = new ApiAuditLog(); diff --git a/backend/src/api/index.ts b/backend/src/api/index.ts index 503b717e1..b0f921e08 100644 --- a/backend/src/api/index.ts +++ b/backend/src/api/index.ts @@ -1,10 +1,10 @@ // KEEP THIS AS FIRST IMPORT // See comment in module for details -import "../threadsSignalFix"; +import "../threadsSignalFix.js"; -import { connect } from "../data/db"; -import { env } from "../env"; -import { setIsAPI } from "../globals"; +import { connect } from "../data/db.js"; +import { env } from "../env.js"; +import { setIsAPI } from "../globals.js"; if (!env.KEY) { // tslint:disable-next-line:no-console diff --git a/backend/src/api/permissions.ts b/backend/src/api/permissions.ts index 74675398c..e58e3a8f1 100644 --- a/backend/src/api/permissions.ts +++ b/backend/src/api/permissions.ts @@ -1,8 +1,8 @@ import { ApiPermissions, hasPermission, permissionArrToSet } from "@zeppelinbot/shared"; import { Request, Response } from "express"; -import { ApiPermissionAssignments } from "../data/ApiPermissionAssignments"; -import { isStaff } from "../staff"; -import { unauthorized } from "./responses"; +import { ApiPermissionAssignments } from "../data/ApiPermissionAssignments.js"; +import { isStaff } from "../staff.js"; +import { unauthorized } from "./responses.js"; const apiPermissionAssignments = new ApiPermissionAssignments(); diff --git a/backend/src/api/rateLimits.ts b/backend/src/api/rateLimits.ts index 90b344d59..50d857389 100644 --- a/backend/src/api/rateLimits.ts +++ b/backend/src/api/rateLimits.ts @@ -1,5 +1,5 @@ import { Request, Response } from "express"; -import { error } from "./responses"; +import { error } from "./responses.js"; const lastRequestsByKey: Map = new Map(); diff --git a/backend/src/api/staff.ts b/backend/src/api/staff.ts index 08f0dc099..fa2d644f7 100644 --- a/backend/src/api/staff.ts +++ b/backend/src/api/staff.ts @@ -1,6 +1,6 @@ import express, { Request, Response } from "express"; -import { isStaff } from "../staff"; -import { apiTokenAuthHandlers } from "./auth"; +import { isStaff } from "../staff.js"; +import { apiTokenAuthHandlers } from "./auth.js"; export function initStaff(app: express.Express) { const staffRouter = express.Router(); diff --git a/backend/src/api/start.ts b/backend/src/api/start.ts index 088c8ba97..9fdf29766 100644 --- a/backend/src/api/start.ts +++ b/backend/src/api/start.ts @@ -2,13 +2,13 @@ import cors from "cors"; import express from "express"; import multer from "multer"; import { TokenError } from "passport-oauth2"; -import { env } from "../env"; -import { initArchives } from "./archives"; -import { initAuth } from "./auth"; -import { initDocs } from "./docs"; -import { initGuildsAPI } from "./guilds/index"; -import { clientError, error, notFound } from "./responses"; -import { startBackgroundTasks } from "./tasks"; +import { env } from "../env.js"; +import { initArchives } from "./archives.js"; +import { initAuth } from "./auth.js"; +import { initDocs } from "./docs.js"; +import { initGuildsAPI } from "./guilds/index.js"; +import { clientError, error, notFound } from "./responses.js"; +import { startBackgroundTasks } from "./tasks.js"; const apiPathPrefix = env.API_PATH_PREFIX || (env.NODE_ENV === "development" ? "/api" : ""); diff --git a/backend/src/api/tasks.ts b/backend/src/api/tasks.ts index 6edf218dd..fc58c8a3e 100644 --- a/backend/src/api/tasks.ts +++ b/backend/src/api/tasks.ts @@ -1,5 +1,5 @@ -import { ApiPermissionAssignments } from "../data/ApiPermissionAssignments"; -import { MINUTES } from "../utils"; +import { ApiPermissionAssignments } from "../data/ApiPermissionAssignments.js"; +import { MINUTES } from "../utils.js"; export function startBackgroundTasks() { // Clear expired API permissions every minute diff --git a/backend/src/commandTypes.ts b/backend/src/commandTypes.ts index 9ace53128..ca231a5db 100644 --- a/backend/src/commandTypes.ts +++ b/backend/src/commandTypes.ts @@ -24,9 +24,9 @@ import { resolveUserId, roleMentionRegex, UnknownUser, -} from "./utils"; -import { isValidTimezone } from "./utils/isValidTimezone"; -import { MessageTarget, resolveMessageTarget } from "./utils/resolveMessageTarget"; +} from "./utils.js"; +import { isValidTimezone } from "./utils/isValidTimezone.js"; +import { MessageTarget, resolveMessageTarget } from "./utils/resolveMessageTarget.js"; export const commandTypes = { ...messageCommandBaseTypeConverters, diff --git a/backend/src/configValidator.ts b/backend/src/configValidator.ts index 282b03987..5fb00a2e2 100644 --- a/backend/src/configValidator.ts +++ b/backend/src/configValidator.ts @@ -1,9 +1,9 @@ import { ConfigValidationError, GuildPluginBlueprint, PluginConfigManager } from "knub"; import moment from "moment-timezone"; import { ZodError } from "zod"; -import { guildPlugins } from "./plugins/availablePlugins"; -import { ZeppelinGuildConfig, zZeppelinGuildConfig } from "./types"; -import { formatZodIssue } from "./utils/formatZodIssue"; +import { guildPlugins } from "./plugins/availablePlugins.js"; +import { ZeppelinGuildConfig, zZeppelinGuildConfig } from "./types.js"; +import { formatZodIssue } from "./utils/formatZodIssue.js"; const pluginNameToPlugin = new Map>(); for (const plugin of guildPlugins) { diff --git a/backend/src/data/AllowedGuilds.ts b/backend/src/data/AllowedGuilds.ts index f942c59a6..2224d66aa 100644 --- a/backend/src/data/AllowedGuilds.ts +++ b/backend/src/data/AllowedGuilds.ts @@ -1,10 +1,10 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { DBDateFormat } from "../utils"; -import { ApiPermissionTypes } from "./ApiPermissionAssignments"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { AllowedGuild } from "./entities/AllowedGuild"; +import { DBDateFormat } from "../utils.js"; +import { ApiPermissionTypes } from "./ApiPermissionAssignments.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { AllowedGuild } from "./entities/AllowedGuild.js"; export class AllowedGuilds extends BaseRepository { private allowedGuilds: Repository; diff --git a/backend/src/data/ApiAuditLog.ts b/backend/src/data/ApiAuditLog.ts index 98ecbe5ff..1f0034c7b 100644 --- a/backend/src/data/ApiAuditLog.ts +++ b/backend/src/data/ApiAuditLog.ts @@ -1,8 +1,8 @@ -import { Repository } from "typeorm/index"; -import { BaseRepository } from "./BaseRepository"; -import { AuditLogEventData, AuditLogEventType } from "./apiAuditLogTypes"; -import { dataSource } from "./dataSource"; -import { ApiAuditLogEntry } from "./entities/ApiAuditLogEntry"; +import { Repository } from "typeorm"; +import { BaseRepository } from "./BaseRepository.js"; +import { AuditLogEventData, AuditLogEventType } from "./apiAuditLogTypes.js"; +import { dataSource } from "./dataSource.js"; +import { ApiAuditLogEntry } from "./entities/ApiAuditLogEntry.js"; export class ApiAuditLog extends BaseRepository { private auditLog: Repository>; diff --git a/backend/src/data/ApiLogins.ts b/backend/src/data/ApiLogins.ts index 94ffac7d3..f2b0c9c5e 100644 --- a/backend/src/data/ApiLogins.ts +++ b/backend/src/data/ApiLogins.ts @@ -3,10 +3,10 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; // tslint:disable-next-line:no-submodule-imports import { v4 as uuidv4 } from "uuid"; -import { DAYS, DBDateFormat } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { ApiLogin } from "./entities/ApiLogin"; +import { DAYS, DBDateFormat } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { ApiLogin } from "./entities/ApiLogin.js"; const LOGIN_EXPIRY_TIME = 1 * DAYS; diff --git a/backend/src/data/ApiPermissionAssignments.ts b/backend/src/data/ApiPermissionAssignments.ts index b52fe01f8..b0c1ece94 100644 --- a/backend/src/data/ApiPermissionAssignments.ts +++ b/backend/src/data/ApiPermissionAssignments.ts @@ -1,10 +1,10 @@ import { ApiPermissions } from "@zeppelinbot/shared"; import { Repository } from "typeorm"; -import { ApiAuditLog } from "./ApiAuditLog"; -import { BaseRepository } from "./BaseRepository"; -import { AuditLogEventTypes } from "./apiAuditLogTypes"; -import { dataSource } from "./dataSource"; -import { ApiPermissionAssignment } from "./entities/ApiPermissionAssignment"; +import { ApiAuditLog } from "./ApiAuditLog.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { AuditLogEventTypes } from "./apiAuditLogTypes.js"; +import { dataSource } from "./dataSource.js"; +import { ApiPermissionAssignment } from "./entities/ApiPermissionAssignment.js"; export enum ApiPermissionTypes { User = "USER", diff --git a/backend/src/data/ApiUserInfo.ts b/backend/src/data/ApiUserInfo.ts index 1dbc9d451..f9c25c6d0 100644 --- a/backend/src/data/ApiUserInfo.ts +++ b/backend/src/data/ApiUserInfo.ts @@ -1,9 +1,9 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { DBDateFormat } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { ApiUserInfoData, ApiUserInfo as ApiUserInfoEntity } from "./entities/ApiUserInfo"; +import { DBDateFormat } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { ApiUserInfoData, ApiUserInfo as ApiUserInfoEntity } from "./entities/ApiUserInfo.js"; export class ApiUserInfo extends BaseRepository { private apiUserInfo: Repository; diff --git a/backend/src/data/Archives.ts b/backend/src/data/Archives.ts index 0978d8616..753341eb3 100644 --- a/backend/src/data/Archives.ts +++ b/backend/src/data/Archives.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { ArchiveEntry } from "./entities/ArchiveEntry"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { ArchiveEntry } from "./entities/ArchiveEntry.js"; export class Archives extends BaseRepository { protected archives: Repository; diff --git a/backend/src/data/BaseGuildRepository.ts b/backend/src/data/BaseGuildRepository.ts index 4ee2d757a..6d424628e 100644 --- a/backend/src/data/BaseGuildRepository.ts +++ b/backend/src/data/BaseGuildRepository.ts @@ -1,4 +1,4 @@ -import { BaseRepository } from "./BaseRepository"; +import { BaseRepository } from "./BaseRepository.js"; export class BaseGuildRepository extends BaseRepository { private static guildInstances: Map; diff --git a/backend/src/data/BaseRepository.ts b/backend/src/data/BaseRepository.ts index dcba61848..972268757 100644 --- a/backend/src/data/BaseRepository.ts +++ b/backend/src/data/BaseRepository.ts @@ -1,4 +1,4 @@ -import { asyncMap } from "../utils/async"; +import { asyncMap } from "../utils/async.js"; export class BaseRepository { private nextRelations: string[]; diff --git a/backend/src/data/Configs.ts b/backend/src/data/Configs.ts index bc702b5ed..d98d4710b 100644 --- a/backend/src/data/Configs.ts +++ b/backend/src/data/Configs.ts @@ -1,10 +1,10 @@ import { Repository } from "typeorm"; -import { isAPI } from "../globals"; -import { HOURS, SECONDS } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { cleanupConfigs } from "./cleanup/configs"; -import { dataSource } from "./dataSource"; -import { Config } from "./entities/Config"; +import { isAPI } from "../globals.js"; +import { HOURS, SECONDS } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { cleanupConfigs } from "./cleanup/configs.js"; +import { dataSource } from "./dataSource.js"; +import { Config } from "./entities/Config.js"; const CLEANUP_INTERVAL = 1 * HOURS; diff --git a/backend/src/data/GuildAntiraidLevels.ts b/backend/src/data/GuildAntiraidLevels.ts index 0d4eb30c3..bd0c5e665 100644 --- a/backend/src/data/GuildAntiraidLevels.ts +++ b/backend/src/data/GuildAntiraidLevels.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { AntiraidLevel } from "./entities/AntiraidLevel"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { AntiraidLevel } from "./entities/AntiraidLevel.js"; export class GuildAntiraidLevels extends BaseGuildRepository { protected antiraidLevels: Repository; diff --git a/backend/src/data/GuildArchives.ts b/backend/src/data/GuildArchives.ts index 4d74ccefe..1e133007e 100644 --- a/backend/src/data/GuildArchives.ts +++ b/backend/src/data/GuildArchives.ts @@ -1,15 +1,15 @@ import { Guild, Snowflake } from "discord.js"; import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { TemplateSafeValueContainer, renderTemplate } from "../templateFormatter"; -import { renderUsername, trimLines } from "../utils"; -import { decrypt, encrypt } from "../utils/crypt"; -import { isDefaultSticker } from "../utils/isDefaultSticker"; -import { channelToTemplateSafeChannel, guildToTemplateSafeGuild } from "../utils/templateSafeObjects"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { ArchiveEntry } from "./entities/ArchiveEntry"; -import { SavedMessage } from "./entities/SavedMessage"; +import { TemplateSafeValueContainer, renderTemplate } from "../templateFormatter.js"; +import { renderUsername, trimLines } from "../utils.js"; +import { decrypt, encrypt } from "../utils/crypt.js"; +import { isDefaultSticker } from "../utils/isDefaultSticker.js"; +import { channelToTemplateSafeChannel, guildToTemplateSafeGuild } from "../utils/templateSafeObjects.js"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { ArchiveEntry } from "./entities/ArchiveEntry.js"; +import { SavedMessage } from "./entities/SavedMessage.js"; const DEFAULT_EXPIRY_DAYS = 30; diff --git a/backend/src/data/GuildAutoReactions.ts b/backend/src/data/GuildAutoReactions.ts index fcab1a90f..39f45c45f 100644 --- a/backend/src/data/GuildAutoReactions.ts +++ b/backend/src/data/GuildAutoReactions.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { AutoReaction } from "./entities/AutoReaction"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { AutoReaction } from "./entities/AutoReaction.js"; export class GuildAutoReactions extends BaseGuildRepository { private autoReactions: Repository; diff --git a/backend/src/data/GuildButtonRoles.ts b/backend/src/data/GuildButtonRoles.ts index d493d4245..63ead42c5 100644 --- a/backend/src/data/GuildButtonRoles.ts +++ b/backend/src/data/GuildButtonRoles.ts @@ -1,6 +1,6 @@ import { getRepository, Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { ButtonRole } from "./entities/ButtonRole"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { ButtonRole } from "./entities/ButtonRole.js"; export class GuildButtonRoles extends BaseGuildRepository { private buttonRoles: Repository; diff --git a/backend/src/data/GuildCases.ts b/backend/src/data/GuildCases.ts index d0e7778a1..b04eea63e 100644 --- a/backend/src/data/GuildCases.ts +++ b/backend/src/data/GuildCases.ts @@ -1,11 +1,11 @@ import { In, InsertResult, Repository } from "typeorm"; -import { Queue } from "../Queue"; -import { chunkArray } from "../utils"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { CaseTypes } from "./CaseTypes"; -import { dataSource } from "./dataSource"; -import { Case } from "./entities/Case"; -import { CaseNote } from "./entities/CaseNote"; +import { Queue } from "../Queue.js"; +import { chunkArray } from "../utils.js"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { CaseTypes } from "./CaseTypes.js"; +import { dataSource } from "./dataSource.js"; +import { Case } from "./entities/Case.js"; +import { CaseNote } from "./entities/CaseNote.js"; export class GuildCases extends BaseGuildRepository { private cases: Repository; diff --git a/backend/src/data/GuildContextMenuLinks.ts b/backend/src/data/GuildContextMenuLinks.ts index d82b2dd09..9bbffd0e0 100644 --- a/backend/src/data/GuildContextMenuLinks.ts +++ b/backend/src/data/GuildContextMenuLinks.ts @@ -1,7 +1,7 @@ import { DeleteResult, InsertResult, Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { ContextMenuLink } from "./entities/ContextMenuLink"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { ContextMenuLink } from "./entities/ContextMenuLink.js"; export class GuildContextMenuLinks extends BaseGuildRepository { private contextLinks: Repository; diff --git a/backend/src/data/GuildCounters.ts b/backend/src/data/GuildCounters.ts index 18c9b5e6a..3313e3c8a 100644 --- a/backend/src/data/GuildCounters.ts +++ b/backend/src/data/GuildCounters.ts @@ -1,13 +1,13 @@ import moment from "moment-timezone"; import { FindOptionsWhere, In, IsNull, Not, Repository } from "typeorm"; -import { Queue } from "../Queue"; -import { DAYS, DBDateFormat, HOURS, MINUTES } from "../utils"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { Counter } from "./entities/Counter"; -import { CounterTrigger, TriggerComparisonOp, isValidCounterComparisonOp } from "./entities/CounterTrigger"; -import { CounterTriggerState } from "./entities/CounterTriggerState"; -import { CounterValue } from "./entities/CounterValue"; +import { Queue } from "../Queue.js"; +import { DAYS, DBDateFormat, HOURS, MINUTES } from "../utils.js"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { Counter } from "./entities/Counter.js"; +import { CounterTrigger, TriggerComparisonOp, isValidCounterComparisonOp } from "./entities/CounterTrigger.js"; +import { CounterTriggerState } from "./entities/CounterTriggerState.js"; +import { CounterValue } from "./entities/CounterValue.js"; const DELETE_UNUSED_COUNTERS_AFTER = 1 * DAYS; const DELETE_UNUSED_COUNTER_TRIGGERS_AFTER = 1 * DAYS; diff --git a/backend/src/data/GuildEvents.ts b/backend/src/data/GuildEvents.ts index 290b459de..efc7834b5 100644 --- a/backend/src/data/GuildEvents.ts +++ b/backend/src/data/GuildEvents.ts @@ -1,8 +1,8 @@ -import { Mute } from "./entities/Mute"; -import { Reminder } from "./entities/Reminder"; -import { ScheduledPost } from "./entities/ScheduledPost"; -import { Tempban } from "./entities/Tempban"; -import { VCAlert } from "./entities/VCAlert"; +import { Mute } from "./entities/Mute.js"; +import { Reminder } from "./entities/Reminder.js"; +import { ScheduledPost } from "./entities/ScheduledPost.js"; +import { Tempban } from "./entities/Tempban.js"; +import { VCAlert } from "./entities/VCAlert.js"; interface GuildEventArgs extends Record { expiredMute: [Mute]; diff --git a/backend/src/data/GuildLogs.ts b/backend/src/data/GuildLogs.ts index 5f7dc4ed5..dc4837eef 100644 --- a/backend/src/data/GuildLogs.ts +++ b/backend/src/data/GuildLogs.ts @@ -1,5 +1,5 @@ import * as events from "events"; -import { LogType } from "./LogType"; +import { LogType } from "./LogType.js"; // Use the same instance for the same guild, even if a new instance is created const guildInstances: Map = new Map(); diff --git a/backend/src/data/GuildMemberCache.ts b/backend/src/data/GuildMemberCache.ts index d64c532c9..4a309ca50 100644 --- a/backend/src/data/GuildMemberCache.ts +++ b/backend/src/data/GuildMemberCache.ts @@ -1,10 +1,10 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { Blocker } from "../Blocker"; -import { DBDateFormat, MINUTES } from "../utils"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { MemberCacheItem } from "./entities/MemberCacheItem"; +import { Blocker } from "../Blocker.js"; +import { DBDateFormat, MINUTES } from "../utils.js"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { MemberCacheItem } from "./entities/MemberCacheItem.js"; const SAVE_PENDING_BLOCKER_KEY = "save-pending" as const; diff --git a/backend/src/data/GuildMemberTimezones.ts b/backend/src/data/GuildMemberTimezones.ts index 68e1660b8..736006fac 100644 --- a/backend/src/data/GuildMemberTimezones.ts +++ b/backend/src/data/GuildMemberTimezones.ts @@ -1,7 +1,7 @@ -import { Repository } from "typeorm/index"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { MemberTimezone } from "./entities/MemberTimezone"; +import { Repository } from "typeorm"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { MemberTimezone } from "./entities/MemberTimezone.js"; export class GuildMemberTimezones extends BaseGuildRepository { protected memberTimezones: Repository; diff --git a/backend/src/data/GuildMutes.ts b/backend/src/data/GuildMutes.ts index 54e7e6c05..3b9c54e32 100644 --- a/backend/src/data/GuildMutes.ts +++ b/backend/src/data/GuildMutes.ts @@ -1,10 +1,10 @@ import moment from "moment-timezone"; import { Brackets, Repository } from "typeorm"; -import { DBDateFormat } from "../utils"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { MuteTypes } from "./MuteTypes"; -import { dataSource } from "./dataSource"; -import { Mute } from "./entities/Mute"; +import { DBDateFormat } from "../utils.js"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { MuteTypes } from "./MuteTypes.js"; +import { dataSource } from "./dataSource.js"; +import { Mute } from "./entities/Mute.js"; export type AddMuteParams = { userId: Mute["user_id"]; diff --git a/backend/src/data/GuildNicknameHistory.ts b/backend/src/data/GuildNicknameHistory.ts index 03f9d838b..84986cda8 100644 --- a/backend/src/data/GuildNicknameHistory.ts +++ b/backend/src/data/GuildNicknameHistory.ts @@ -1,10 +1,10 @@ import { In, Repository } from "typeorm"; -import { isAPI } from "../globals"; -import { MINUTES, SECONDS } from "../utils"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { cleanupNicknames } from "./cleanup/nicknames"; -import { dataSource } from "./dataSource"; -import { NicknameHistoryEntry } from "./entities/NicknameHistoryEntry"; +import { isAPI } from "../globals.js"; +import { MINUTES, SECONDS } from "../utils.js"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { cleanupNicknames } from "./cleanup/nicknames.js"; +import { dataSource } from "./dataSource.js"; +import { NicknameHistoryEntry } from "./entities/NicknameHistoryEntry.js"; const CLEANUP_INTERVAL = 5 * MINUTES; diff --git a/backend/src/data/GuildPersistedData.ts b/backend/src/data/GuildPersistedData.ts index f0947cd12..3a37e4b52 100644 --- a/backend/src/data/GuildPersistedData.ts +++ b/backend/src/data/GuildPersistedData.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { PersistedData } from "./entities/PersistedData"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { PersistedData } from "./entities/PersistedData.js"; export class GuildPersistedData extends BaseGuildRepository { private persistedData: Repository; diff --git a/backend/src/data/GuildPingableRoles.ts b/backend/src/data/GuildPingableRoles.ts index 2f229f546..48f0b89e4 100644 --- a/backend/src/data/GuildPingableRoles.ts +++ b/backend/src/data/GuildPingableRoles.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { PingableRole } from "./entities/PingableRole"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { PingableRole } from "./entities/PingableRole.js"; export class GuildPingableRoles extends BaseGuildRepository { private pingableRoles: Repository; diff --git a/backend/src/data/GuildReactionRoles.ts b/backend/src/data/GuildReactionRoles.ts index c1a01ca01..16d61245f 100644 --- a/backend/src/data/GuildReactionRoles.ts +++ b/backend/src/data/GuildReactionRoles.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { ReactionRole } from "./entities/ReactionRole"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { ReactionRole } from "./entities/ReactionRole.js"; export class GuildReactionRoles extends BaseGuildRepository { private reactionRoles: Repository; diff --git a/backend/src/data/GuildReminders.ts b/backend/src/data/GuildReminders.ts index 31c7babdd..e853908c9 100644 --- a/backend/src/data/GuildReminders.ts +++ b/backend/src/data/GuildReminders.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { Reminder } from "./entities/Reminder"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { Reminder } from "./entities/Reminder.js"; export class GuildReminders extends BaseGuildRepository { private reminders: Repository; diff --git a/backend/src/data/GuildRoleButtons.ts b/backend/src/data/GuildRoleButtons.ts index c12dd2e08..190fae9ba 100644 --- a/backend/src/data/GuildRoleButtons.ts +++ b/backend/src/data/GuildRoleButtons.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { RoleButtonsItem } from "./entities/RoleButtonsItem"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { RoleButtonsItem } from "./entities/RoleButtonsItem.js"; export class GuildRoleButtons extends BaseGuildRepository { private roleButtons: Repository; diff --git a/backend/src/data/GuildRoleQueue.ts b/backend/src/data/GuildRoleQueue.ts index 61172237f..d01bab790 100644 --- a/backend/src/data/GuildRoleQueue.ts +++ b/backend/src/data/GuildRoleQueue.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { RoleQueueItem } from "./entities/RoleQueueItem"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { RoleQueueItem } from "./entities/RoleQueueItem.js"; export class GuildRoleQueue extends BaseGuildRepository { private roleQueue: Repository; diff --git a/backend/src/data/GuildSavedMessages.ts b/backend/src/data/GuildSavedMessages.ts index 39eb4b7c4..3edc28104 100644 --- a/backend/src/data/GuildSavedMessages.ts +++ b/backend/src/data/GuildSavedMessages.ts @@ -1,14 +1,14 @@ import { GuildChannel, Message } from "discord.js"; import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { QueuedEventEmitter } from "../QueuedEventEmitter"; -import { noop } from "../utils"; -import { asyncMap } from "../utils/async"; -import { decryptJson, encryptJson } from "../utils/cryptHelpers"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { buildEntity } from "./buildEntity"; -import { dataSource } from "./dataSource"; -import { ISavedMessageData, SavedMessage } from "./entities/SavedMessage"; +import { QueuedEventEmitter } from "../QueuedEventEmitter.js"; +import { noop } from "../utils.js"; +import { asyncMap } from "../utils/async.js"; +import { decryptJson, encryptJson } from "../utils/cryptHelpers.js"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { buildEntity } from "./buildEntity.js"; +import { dataSource } from "./dataSource.js"; +import { ISavedMessageData, SavedMessage } from "./entities/SavedMessage.js"; export class GuildSavedMessages extends BaseGuildRepository { private messages: Repository; diff --git a/backend/src/data/GuildScheduledPosts.ts b/backend/src/data/GuildScheduledPosts.ts index eb1228615..3614114ba 100644 --- a/backend/src/data/GuildScheduledPosts.ts +++ b/backend/src/data/GuildScheduledPosts.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { ScheduledPost } from "./entities/ScheduledPost"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { ScheduledPost } from "./entities/ScheduledPost.js"; export class GuildScheduledPosts extends BaseGuildRepository { private scheduledPosts: Repository; diff --git a/backend/src/data/GuildSlowmodes.ts b/backend/src/data/GuildSlowmodes.ts index ee92a3f55..4ad4cd824 100644 --- a/backend/src/data/GuildSlowmodes.ts +++ b/backend/src/data/GuildSlowmodes.ts @@ -1,9 +1,9 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { SlowmodeChannel } from "./entities/SlowmodeChannel"; -import { SlowmodeUser } from "./entities/SlowmodeUser"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { SlowmodeChannel } from "./entities/SlowmodeChannel.js"; +import { SlowmodeUser } from "./entities/SlowmodeUser.js"; export class GuildSlowmodes extends BaseGuildRepository { private slowmodeChannels: Repository; diff --git a/backend/src/data/GuildStarboardMessages.ts b/backend/src/data/GuildStarboardMessages.ts index d5e568705..52dfc2adb 100644 --- a/backend/src/data/GuildStarboardMessages.ts +++ b/backend/src/data/GuildStarboardMessages.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { StarboardMessage } from "./entities/StarboardMessage"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { StarboardMessage } from "./entities/StarboardMessage.js"; export class GuildStarboardMessages extends BaseGuildRepository { private allStarboardMessages: Repository; diff --git a/backend/src/data/GuildStarboardReactions.ts b/backend/src/data/GuildStarboardReactions.ts index 9c74d6ddf..090cd6a5e 100644 --- a/backend/src/data/GuildStarboardReactions.ts +++ b/backend/src/data/GuildStarboardReactions.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { StarboardReaction } from "./entities/StarboardReaction"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { StarboardReaction } from "./entities/StarboardReaction.js"; export class GuildStarboardReactions extends BaseGuildRepository { private allStarboardReactions: Repository; diff --git a/backend/src/data/GuildStats.ts b/backend/src/data/GuildStats.ts index 9a3c0e9ae..061be7b01 100644 --- a/backend/src/data/GuildStats.ts +++ b/backend/src/data/GuildStats.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { StatValue } from "./entities/StatValue"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { StatValue } from "./entities/StatValue.js"; export class GuildStats extends BaseGuildRepository { private stats: Repository; diff --git a/backend/src/data/GuildTags.ts b/backend/src/data/GuildTags.ts index 004c4dbea..b8c28bef6 100644 --- a/backend/src/data/GuildTags.ts +++ b/backend/src/data/GuildTags.ts @@ -1,8 +1,8 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { Tag } from "./entities/Tag"; -import { TagResponse } from "./entities/TagResponse"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { Tag } from "./entities/Tag.js"; +import { TagResponse } from "./entities/TagResponse.js"; export class GuildTags extends BaseGuildRepository { private tags: Repository; diff --git a/backend/src/data/GuildTempbans.ts b/backend/src/data/GuildTempbans.ts index e74ba7a09..05ba6ff3c 100644 --- a/backend/src/data/GuildTempbans.ts +++ b/backend/src/data/GuildTempbans.ts @@ -1,8 +1,8 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { Tempban } from "./entities/Tempban"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { Tempban } from "./entities/Tempban.js"; export class GuildTempbans extends BaseGuildRepository { private tempbans: Repository; diff --git a/backend/src/data/GuildVCAlerts.ts b/backend/src/data/GuildVCAlerts.ts index 104196e2e..4a5669422 100644 --- a/backend/src/data/GuildVCAlerts.ts +++ b/backend/src/data/GuildVCAlerts.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseGuildRepository } from "./BaseGuildRepository"; -import { dataSource } from "./dataSource"; -import { VCAlert } from "./entities/VCAlert"; +import { BaseGuildRepository } from "./BaseGuildRepository.js"; +import { dataSource } from "./dataSource.js"; +import { VCAlert } from "./entities/VCAlert.js"; export class GuildVCAlerts extends BaseGuildRepository { private allAlerts: Repository; diff --git a/backend/src/data/MemberCache.ts b/backend/src/data/MemberCache.ts index b727c66eb..34aa54aa6 100644 --- a/backend/src/data/MemberCache.ts +++ b/backend/src/data/MemberCache.ts @@ -1,9 +1,9 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { DAYS } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { MemberCacheItem } from "./entities/MemberCacheItem"; +import { DAYS } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { MemberCacheItem } from "./entities/MemberCacheItem.js"; const STALE_PERIOD = 90 * DAYS; diff --git a/backend/src/data/Mutes.ts b/backend/src/data/Mutes.ts index ad50dcee4..9be15e95c 100644 --- a/backend/src/data/Mutes.ts +++ b/backend/src/data/Mutes.ts @@ -1,10 +1,10 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { DAYS, DBDateFormat } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { MuteTypes } from "./MuteTypes"; -import { dataSource } from "./dataSource"; -import { Mute } from "./entities/Mute"; +import { DAYS, DBDateFormat } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { MuteTypes } from "./MuteTypes.js"; +import { dataSource } from "./dataSource.js"; +import { Mute } from "./entities/Mute.js"; const OLD_EXPIRED_MUTE_THRESHOLD = 7 * DAYS; diff --git a/backend/src/data/Phisherman.ts b/backend/src/data/Phisherman.ts index 42f1fce95..a72f0c305 100644 --- a/backend/src/data/Phisherman.ts +++ b/backend/src/data/Phisherman.ts @@ -1,12 +1,12 @@ import crypto from "crypto"; import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { env } from "../env"; -import { DAYS, DBDateFormat, HOURS, MINUTES } from "../utils"; -import { dataSource } from "./dataSource"; -import { PhishermanCacheEntry } from "./entities/PhishermanCacheEntry"; -import { PhishermanKeyCacheEntry } from "./entities/PhishermanKeyCacheEntry"; -import { PhishermanDomainInfo, PhishermanUnknownDomain } from "./types/phisherman"; +import { env } from "../env.js"; +import { DAYS, DBDateFormat, HOURS, MINUTES } from "../utils.js"; +import { dataSource } from "./dataSource.js"; +import { PhishermanCacheEntry } from "./entities/PhishermanCacheEntry.js"; +import { PhishermanKeyCacheEntry } from "./entities/PhishermanKeyCacheEntry.js"; +import { PhishermanDomainInfo, PhishermanUnknownDomain } from "./types/phisherman.js"; const API_URL = "https://api.phisherman.gg"; const MASTER_API_KEY = env.PHISHERMAN_API_KEY; diff --git a/backend/src/data/Reminders.ts b/backend/src/data/Reminders.ts index 1e6333d28..0e8eef1df 100644 --- a/backend/src/data/Reminders.ts +++ b/backend/src/data/Reminders.ts @@ -1,9 +1,9 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { DBDateFormat } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { Reminder } from "./entities/Reminder"; +import { DBDateFormat } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { Reminder } from "./entities/Reminder.js"; export class Reminders extends BaseRepository { private reminders: Repository; diff --git a/backend/src/data/ScheduledPosts.ts b/backend/src/data/ScheduledPosts.ts index ec5fafe8e..0151bbee3 100644 --- a/backend/src/data/ScheduledPosts.ts +++ b/backend/src/data/ScheduledPosts.ts @@ -1,9 +1,9 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { DBDateFormat } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { ScheduledPost } from "./entities/ScheduledPost"; +import { DBDateFormat } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { ScheduledPost } from "./entities/ScheduledPost.js"; export class ScheduledPosts extends BaseRepository { private scheduledPosts: Repository; diff --git a/backend/src/data/Supporters.ts b/backend/src/data/Supporters.ts index 679d58d1b..6784b745c 100644 --- a/backend/src/data/Supporters.ts +++ b/backend/src/data/Supporters.ts @@ -1,7 +1,7 @@ import { Repository } from "typeorm"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { Supporter } from "./entities/Supporter"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { Supporter } from "./entities/Supporter.js"; export class Supporters extends BaseRepository { private supporters: Repository; diff --git a/backend/src/data/Tempbans.ts b/backend/src/data/Tempbans.ts index 8346b1a1a..54d8dd4f5 100644 --- a/backend/src/data/Tempbans.ts +++ b/backend/src/data/Tempbans.ts @@ -1,9 +1,9 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { DBDateFormat } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { Tempban } from "./entities/Tempban"; +import { DBDateFormat } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { Tempban } from "./entities/Tempban.js"; export class Tempbans extends BaseRepository { private tempbans: Repository; diff --git a/backend/src/data/UsernameHistory.ts b/backend/src/data/UsernameHistory.ts index 59082ca4a..e7287070f 100644 --- a/backend/src/data/UsernameHistory.ts +++ b/backend/src/data/UsernameHistory.ts @@ -1,10 +1,10 @@ import { In, Repository } from "typeorm"; -import { isAPI } from "../globals"; -import { MINUTES, SECONDS } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { cleanupUsernames } from "./cleanup/usernames"; -import { dataSource } from "./dataSource"; -import { UsernameHistoryEntry } from "./entities/UsernameHistoryEntry"; +import { isAPI } from "../globals.js"; +import { MINUTES, SECONDS } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { cleanupUsernames } from "./cleanup/usernames.js"; +import { dataSource } from "./dataSource.js"; +import { UsernameHistoryEntry } from "./entities/UsernameHistoryEntry.js"; const CLEANUP_INTERVAL = 5 * MINUTES; diff --git a/backend/src/data/VCAlerts.ts b/backend/src/data/VCAlerts.ts index d5361f57e..71c364033 100644 --- a/backend/src/data/VCAlerts.ts +++ b/backend/src/data/VCAlerts.ts @@ -1,9 +1,9 @@ import moment from "moment-timezone"; import { Repository } from "typeorm"; -import { DBDateFormat } from "../utils"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { VCAlert } from "./entities/VCAlert"; +import { DBDateFormat } from "../utils.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { VCAlert } from "./entities/VCAlert.js"; export class VCAlerts extends BaseRepository { private allAlerts: Repository; diff --git a/backend/src/data/Webhooks.ts b/backend/src/data/Webhooks.ts index 719279845..6615abba7 100644 --- a/backend/src/data/Webhooks.ts +++ b/backend/src/data/Webhooks.ts @@ -1,8 +1,8 @@ import { Repository } from "typeorm"; -import { decrypt, encrypt } from "../utils/crypt"; -import { BaseRepository } from "./BaseRepository"; -import { dataSource } from "./dataSource"; -import { Webhook } from "./entities/Webhook"; +import { decrypt, encrypt } from "../utils/crypt.js"; +import { BaseRepository } from "./BaseRepository.js"; +import { dataSource } from "./dataSource.js"; +import { Webhook } from "./entities/Webhook.js"; export class Webhooks extends BaseRepository { repository: Repository = dataSource.getRepository(Webhook); diff --git a/backend/src/data/apiAuditLogTypes.ts b/backend/src/data/apiAuditLogTypes.ts index e75a071fb..fefce4d08 100644 --- a/backend/src/data/apiAuditLogTypes.ts +++ b/backend/src/data/apiAuditLogTypes.ts @@ -1,4 +1,4 @@ -import { ApiPermissionTypes } from "./ApiPermissionAssignments"; +import { ApiPermissionTypes } from "./ApiPermissionAssignments.js"; export const AuditLogEventTypes = { ADD_API_PERMISSION: "ADD_API_PERMISSION" as const, diff --git a/backend/src/data/cleanup/configs.ts b/backend/src/data/cleanup/configs.ts index 66f1e6578..a228cc328 100644 --- a/backend/src/data/cleanup/configs.ts +++ b/backend/src/data/cleanup/configs.ts @@ -1,8 +1,8 @@ import moment from "moment-timezone"; import { In } from "typeorm"; -import { DBDateFormat } from "../../utils"; -import { dataSource } from "../dataSource"; -import { Config } from "../entities/Config"; +import { DBDateFormat } from "../../utils.js"; +import { dataSource } from "../dataSource.js"; +import { Config } from "../entities/Config.js"; const CLEAN_PER_LOOP = 50; diff --git a/backend/src/data/cleanup/messages.ts b/backend/src/data/cleanup/messages.ts index 18d416a00..a30179a02 100644 --- a/backend/src/data/cleanup/messages.ts +++ b/backend/src/data/cleanup/messages.ts @@ -1,8 +1,8 @@ import moment from "moment-timezone"; import { In } from "typeorm"; -import { DAYS, DBDateFormat, MINUTES, SECONDS, sleep } from "../../utils"; -import { dataSource } from "../dataSource"; -import { SavedMessage } from "../entities/SavedMessage"; +import { DAYS, DBDateFormat, MINUTES, SECONDS, sleep } from "../../utils.js"; +import { dataSource } from "../dataSource.js"; +import { SavedMessage } from "../entities/SavedMessage.js"; /** * How long message edits, deletions, etc. will include the original message content. diff --git a/backend/src/data/cleanup/nicknames.ts b/backend/src/data/cleanup/nicknames.ts index da3406fd6..26e34f4ef 100644 --- a/backend/src/data/cleanup/nicknames.ts +++ b/backend/src/data/cleanup/nicknames.ts @@ -1,8 +1,8 @@ import moment from "moment-timezone"; import { In } from "typeorm"; -import { DAYS, DBDateFormat } from "../../utils"; -import { dataSource } from "../dataSource"; -import { NicknameHistoryEntry } from "../entities/NicknameHistoryEntry"; +import { DAYS, DBDateFormat } from "../../utils.js"; +import { dataSource } from "../dataSource.js"; +import { NicknameHistoryEntry } from "../entities/NicknameHistoryEntry.js"; export const NICKNAME_RETENTION_PERIOD = 30 * DAYS; const CLEAN_PER_LOOP = 500; diff --git a/backend/src/data/cleanup/usernames.ts b/backend/src/data/cleanup/usernames.ts index 982e3bfec..483b03c99 100644 --- a/backend/src/data/cleanup/usernames.ts +++ b/backend/src/data/cleanup/usernames.ts @@ -1,8 +1,8 @@ import moment from "moment-timezone"; import { In } from "typeorm"; -import { DAYS, DBDateFormat } from "../../utils"; -import { dataSource } from "../dataSource"; -import { UsernameHistoryEntry } from "../entities/UsernameHistoryEntry"; +import { DAYS, DBDateFormat } from "../../utils.js"; +import { dataSource } from "../dataSource.js"; +import { UsernameHistoryEntry } from "../entities/UsernameHistoryEntry.js"; export const USERNAME_RETENTION_PERIOD = 30 * DAYS; const CLEAN_PER_LOOP = 500; diff --git a/backend/src/data/dataSource.ts b/backend/src/data/dataSource.ts index 710329210..7d432316c 100644 --- a/backend/src/data/dataSource.ts +++ b/backend/src/data/dataSource.ts @@ -1,8 +1,8 @@ import moment from "moment-timezone"; import path from "path"; import { DataSource } from "typeorm"; -import { env } from "../env"; -import { backendDir } from "../paths"; +import { env } from "../env.js"; +import { backendDir } from "../paths.js"; moment.tz.setDefault("UTC"); diff --git a/backend/src/data/db.ts b/backend/src/data/db.ts index f8d8f3bf7..fe60b1485 100644 --- a/backend/src/data/db.ts +++ b/backend/src/data/db.ts @@ -1,5 +1,5 @@ -import { SimpleError } from "../SimpleError"; -import { dataSource } from "./dataSource"; +import { SimpleError } from "../SimpleError.js"; +import { dataSource } from "./dataSource.js"; let connectionPromise: Promise; diff --git a/backend/src/data/entities/ApiAuditLogEntry.ts b/backend/src/data/entities/ApiAuditLogEntry.ts index 6c142bd8f..f8900863a 100644 --- a/backend/src/data/entities/ApiAuditLogEntry.ts +++ b/backend/src/data/entities/ApiAuditLogEntry.ts @@ -1,5 +1,5 @@ import { Column, Entity, PrimaryColumn } from "typeorm"; -import { AuditLogEventData, AuditLogEventType } from "../apiAuditLogTypes"; +import { AuditLogEventData, AuditLogEventType } from "../apiAuditLogTypes.js"; @Entity("api_audit_log") export class ApiAuditLogEntry { diff --git a/backend/src/data/entities/ApiLogin.ts b/backend/src/data/entities/ApiLogin.ts index 764600684..6e208c2c4 100644 --- a/backend/src/data/entities/ApiLogin.ts +++ b/backend/src/data/entities/ApiLogin.ts @@ -1,5 +1,5 @@ -import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm"; -import { ApiUserInfo } from "./ApiUserInfo"; +import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn, Relation } from "typeorm"; +import { ApiUserInfo } from "./ApiUserInfo.js"; @Entity("api_logins") export class ApiLogin { @@ -21,5 +21,5 @@ export class ApiLogin { @ManyToOne(() => ApiUserInfo, (userInfo) => userInfo.logins) @JoinColumn({ name: "user_id" }) - userInfo: ApiUserInfo; + userInfo: Relation; } diff --git a/backend/src/data/entities/ApiPermissionAssignment.ts b/backend/src/data/entities/ApiPermissionAssignment.ts index 98ef500f4..062541270 100644 --- a/backend/src/data/entities/ApiPermissionAssignment.ts +++ b/backend/src/data/entities/ApiPermissionAssignment.ts @@ -1,6 +1,6 @@ import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm"; -import { ApiPermissionTypes } from "../ApiPermissionAssignments"; -import { ApiUserInfo } from "./ApiUserInfo"; +import { ApiPermissionTypes } from "../ApiPermissionAssignments.js"; +import { ApiUserInfo } from "./ApiUserInfo.js"; @Entity("api_permissions") export class ApiPermissionAssignment { diff --git a/backend/src/data/entities/ApiUserInfo.ts b/backend/src/data/entities/ApiUserInfo.ts index bb0844b53..b40410ea2 100644 --- a/backend/src/data/entities/ApiUserInfo.ts +++ b/backend/src/data/entities/ApiUserInfo.ts @@ -1,6 +1,6 @@ -import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm"; -import { ApiLogin } from "./ApiLogin"; -import { ApiPermissionAssignment } from "./ApiPermissionAssignment"; +import { Column, Entity, OneToMany, PrimaryColumn, Relation } from "typeorm"; +import { ApiLogin } from "./ApiLogin.js"; +import { ApiPermissionAssignment } from "./ApiPermissionAssignment.js"; export interface ApiUserInfoData { username: string; @@ -21,8 +21,8 @@ export class ApiUserInfo { updated_at: string; @OneToMany(() => ApiLogin, (login) => login.userInfo) - logins: ApiLogin[]; + logins: Relation; @OneToMany(() => ApiPermissionAssignment, (p) => p.userInfo) - permissionAssignments: ApiPermissionAssignment[]; + permissionAssignments: Relation; } diff --git a/backend/src/data/entities/Case.ts b/backend/src/data/entities/Case.ts index 5fb520031..355c05d32 100644 --- a/backend/src/data/entities/Case.ts +++ b/backend/src/data/entities/Case.ts @@ -1,5 +1,5 @@ -import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; -import { CaseNote } from "./CaseNote"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn, Relation } from "typeorm"; +import { CaseNote } from "./CaseNote.js"; @Entity("cases") export class Case { @@ -36,5 +36,5 @@ export class Case { @Column({ type: String, nullable: true }) log_message_id: string | null; @OneToMany(() => CaseNote, (note) => note.case) - notes: CaseNote[]; + notes: Relation; } diff --git a/backend/src/data/entities/CaseNote.ts b/backend/src/data/entities/CaseNote.ts index e82aa4052..f8c09b8ad 100644 --- a/backend/src/data/entities/CaseNote.ts +++ b/backend/src/data/entities/CaseNote.ts @@ -1,5 +1,5 @@ -import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; -import { Case } from "./Case"; +import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, Relation } from "typeorm"; +import { Case } from "./Case.js"; @Entity("case_notes") export class CaseNote { @@ -17,5 +17,5 @@ export class CaseNote { @ManyToOne(() => Case, (theCase) => theCase.notes) @JoinColumn({ name: "case_id" }) - case: Case; + case: Relation; } diff --git a/backend/src/data/entities/Config.ts b/backend/src/data/entities/Config.ts index 6d4a38c7a..1b0373197 100644 --- a/backend/src/data/entities/Config.ts +++ b/backend/src/data/entities/Config.ts @@ -1,5 +1,5 @@ import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm"; -import { ApiUserInfo } from "./ApiUserInfo"; +import { ApiUserInfo } from "./ApiUserInfo.js"; @Entity("configs") export class Config { diff --git a/backend/src/data/entities/PhishermanCacheEntry.ts b/backend/src/data/entities/PhishermanCacheEntry.ts index cad135bfc..e7dd0bdd1 100644 --- a/backend/src/data/entities/PhishermanCacheEntry.ts +++ b/backend/src/data/entities/PhishermanCacheEntry.ts @@ -1,5 +1,5 @@ import { Column, Entity, PrimaryColumn } from "typeorm"; -import { PhishermanDomainInfo } from "../types/phisherman"; +import { PhishermanDomainInfo } from "../types/phisherman.js"; @Entity("phisherman_cache") export class PhishermanCacheEntry { diff --git a/backend/src/data/entities/SavedMessage.ts b/backend/src/data/entities/SavedMessage.ts index 67ac729b6..9a0b310ff 100644 --- a/backend/src/data/entities/SavedMessage.ts +++ b/backend/src/data/entities/SavedMessage.ts @@ -1,4 +1,4 @@ -import { Snowflake, StickerFormatType, StickerType } from "discord.js"; +import { EmbedType, Snowflake, StickerFormatType, StickerType } from "discord.js"; import { Column, Entity, PrimaryColumn } from "typeorm"; export interface ISavedMessageAttachmentData { @@ -14,6 +14,7 @@ export interface ISavedMessageAttachmentData { export interface ISavedMessageEmbedData { title: string | null; + type?: EmbedType; description: string | null; url: string | null; timestamp: number | null; diff --git a/backend/src/data/entities/ScheduledPost.ts b/backend/src/data/entities/ScheduledPost.ts index 45ba547ea..542e6f50d 100644 --- a/backend/src/data/entities/ScheduledPost.ts +++ b/backend/src/data/entities/ScheduledPost.ts @@ -1,6 +1,6 @@ import { Attachment } from "discord.js"; import { Column, Entity, PrimaryGeneratedColumn } from "typeorm"; -import { StrictMessageContent } from "../../utils"; +import { StrictMessageContent } from "../../utils.js"; @Entity("scheduled_posts") export class ScheduledPost { diff --git a/backend/src/data/entities/StarboardMessage.ts b/backend/src/data/entities/StarboardMessage.ts index 88512adf5..980ac7350 100644 --- a/backend/src/data/entities/StarboardMessage.ts +++ b/backend/src/data/entities/StarboardMessage.ts @@ -1,5 +1,5 @@ import { Column, Entity, JoinColumn, OneToOne, PrimaryColumn } from "typeorm"; -import { SavedMessage } from "./SavedMessage"; +import { SavedMessage } from "./SavedMessage.js"; @Entity("starboard_messages") export class StarboardMessage { diff --git a/backend/src/data/entities/StarboardReaction.ts b/backend/src/data/entities/StarboardReaction.ts index 9cc02850d..417b476ac 100644 --- a/backend/src/data/entities/StarboardReaction.ts +++ b/backend/src/data/entities/StarboardReaction.ts @@ -1,5 +1,5 @@ import { Column, Entity, JoinColumn, OneToOne, PrimaryColumn } from "typeorm"; -import { SavedMessage } from "./SavedMessage"; +import { SavedMessage } from "./SavedMessage.js"; @Entity("starboard_reactions") export class StarboardReaction { diff --git a/backend/src/data/getChannelIdFromMessageId.ts b/backend/src/data/getChannelIdFromMessageId.ts index 59095afbb..676952c86 100644 --- a/backend/src/data/getChannelIdFromMessageId.ts +++ b/backend/src/data/getChannelIdFromMessageId.ts @@ -1,6 +1,6 @@ import { Repository } from "typeorm"; -import { dataSource } from "./dataSource"; -import { SavedMessage } from "./entities/SavedMessage"; +import { dataSource } from "./dataSource.js"; +import { SavedMessage } from "./entities/SavedMessage.js"; let repository: Repository; diff --git a/backend/src/data/loops/expiredArchiveDeletionLoop.ts b/backend/src/data/loops/expiredArchiveDeletionLoop.ts index be39ab276..a0357726a 100644 --- a/backend/src/data/loops/expiredArchiveDeletionLoop.ts +++ b/backend/src/data/loops/expiredArchiveDeletionLoop.ts @@ -1,7 +1,7 @@ // tslint:disable:no-console -import { lazyMemoize, MINUTES } from "../../utils"; -import { Archives } from "../Archives"; +import { lazyMemoize, MINUTES } from "../../utils.js"; +import { Archives } from "../Archives.js"; const LOOP_INTERVAL = 15 * MINUTES; const getArchivesRepository = lazyMemoize(() => new Archives()); diff --git a/backend/src/data/loops/expiredMemberCacheDeletionLoop.ts b/backend/src/data/loops/expiredMemberCacheDeletionLoop.ts index 13c60da49..d7cb91617 100644 --- a/backend/src/data/loops/expiredMemberCacheDeletionLoop.ts +++ b/backend/src/data/loops/expiredMemberCacheDeletionLoop.ts @@ -1,7 +1,7 @@ // tslint:disable:no-console -import { HOURS, lazyMemoize } from "../../utils"; -import { MemberCache } from "../MemberCache"; +import { HOURS, lazyMemoize } from "../../utils.js"; +import { MemberCache } from "../MemberCache.js"; const LOOP_INTERVAL = 6 * HOURS; const getMemberCacheRepository = lazyMemoize(() => new MemberCache()); diff --git a/backend/src/data/loops/expiringMutesLoop.ts b/backend/src/data/loops/expiringMutesLoop.ts index d8c5cd57f..5e163559b 100644 --- a/backend/src/data/loops/expiringMutesLoop.ts +++ b/backend/src/data/loops/expiringMutesLoop.ts @@ -1,10 +1,10 @@ // tslint:disable:no-console import moment from "moment-timezone"; -import { lazyMemoize, MINUTES, SECONDS } from "../../utils"; -import { Mute } from "../entities/Mute"; -import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents"; -import { Mutes, TIMEOUT_RENEWAL_THRESHOLD } from "../Mutes"; +import { lazyMemoize, MINUTES, SECONDS } from "../../utils.js"; +import { Mute } from "../entities/Mute.js"; +import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents.js"; +import { Mutes, TIMEOUT_RENEWAL_THRESHOLD } from "../Mutes.js"; import Timeout = NodeJS.Timeout; const LOOP_INTERVAL = 15 * MINUTES; diff --git a/backend/src/data/loops/expiringTempbansLoop.ts b/backend/src/data/loops/expiringTempbansLoop.ts index 3929125d1..1d1f63a28 100644 --- a/backend/src/data/loops/expiringTempbansLoop.ts +++ b/backend/src/data/loops/expiringTempbansLoop.ts @@ -1,10 +1,10 @@ // tslint:disable:no-console import moment from "moment-timezone"; -import { lazyMemoize, MINUTES } from "../../utils"; -import { Tempban } from "../entities/Tempban"; -import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents"; -import { Tempbans } from "../Tempbans"; +import { lazyMemoize, MINUTES } from "../../utils.js"; +import { Tempban } from "../entities/Tempban.js"; +import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents.js"; +import { Tempbans } from "../Tempbans.js"; import Timeout = NodeJS.Timeout; const LOOP_INTERVAL = 15 * MINUTES; diff --git a/backend/src/data/loops/expiringVCAlertsLoop.ts b/backend/src/data/loops/expiringVCAlertsLoop.ts index dbf8c2ef1..d8a09b4d9 100644 --- a/backend/src/data/loops/expiringVCAlertsLoop.ts +++ b/backend/src/data/loops/expiringVCAlertsLoop.ts @@ -1,10 +1,10 @@ // tslint:disable:no-console import moment from "moment-timezone"; -import { lazyMemoize, MINUTES } from "../../utils"; -import { VCAlert } from "../entities/VCAlert"; -import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents"; -import { VCAlerts } from "../VCAlerts"; +import { lazyMemoize, MINUTES } from "../../utils.js"; +import { VCAlert } from "../entities/VCAlert.js"; +import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents.js"; +import { VCAlerts } from "../VCAlerts.js"; import Timeout = NodeJS.Timeout; const LOOP_INTERVAL = 15 * MINUTES; diff --git a/backend/src/data/loops/memberCacheDeletionLoop.ts b/backend/src/data/loops/memberCacheDeletionLoop.ts index ff1a6cab1..8442a5471 100644 --- a/backend/src/data/loops/memberCacheDeletionLoop.ts +++ b/backend/src/data/loops/memberCacheDeletionLoop.ts @@ -1,7 +1,7 @@ // tslint:disable:no-console -import { lazyMemoize, MINUTES } from "../../utils"; -import { MemberCache } from "../MemberCache"; +import { lazyMemoize, MINUTES } from "../../utils.js"; +import { MemberCache } from "../MemberCache.js"; const LOOP_INTERVAL = 5 * MINUTES; const getMemberCacheRepository = lazyMemoize(() => new MemberCache()); diff --git a/backend/src/data/loops/phishermanLoops.ts b/backend/src/data/loops/phishermanLoops.ts index 6ab894882..2550d450c 100644 --- a/backend/src/data/loops/phishermanLoops.ts +++ b/backend/src/data/loops/phishermanLoops.ts @@ -1,11 +1,11 @@ // tslint:disable:no-console -import { MINUTES } from "../../utils"; +import { MINUTES } from "../../utils.js"; import { deleteStalePhishermanCacheEntries, deleteStalePhishermanKeyCacheEntries, reportTrackedDomainsToPhisherman, -} from "../Phisherman"; +} from "../Phisherman.js"; const CACHE_CLEANUP_LOOP_INTERVAL = 15 * MINUTES; const REPORT_LOOP_INTERVAL = 15 * MINUTES; diff --git a/backend/src/data/loops/savedMessageCleanupLoop.ts b/backend/src/data/loops/savedMessageCleanupLoop.ts index b5b4dcc7f..05afb73ad 100644 --- a/backend/src/data/loops/savedMessageCleanupLoop.ts +++ b/backend/src/data/loops/savedMessageCleanupLoop.ts @@ -1,7 +1,7 @@ // tslint:disable:no-console -import { MINUTES } from "../../utils"; -import { cleanupMessages } from "../cleanup/messages"; +import { MINUTES } from "../../utils.js"; +import { cleanupMessages } from "../cleanup/messages.js"; const LOOP_INTERVAL = 5 * MINUTES; diff --git a/backend/src/data/loops/upcomingRemindersLoop.ts b/backend/src/data/loops/upcomingRemindersLoop.ts index 3ecc661ce..8bfd8b766 100644 --- a/backend/src/data/loops/upcomingRemindersLoop.ts +++ b/backend/src/data/loops/upcomingRemindersLoop.ts @@ -1,10 +1,10 @@ // tslint:disable:no-console import moment from "moment-timezone"; -import { lazyMemoize, MINUTES } from "../../utils"; -import { Reminder } from "../entities/Reminder"; -import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents"; -import { Reminders } from "../Reminders"; +import { lazyMemoize, MINUTES } from "../../utils.js"; +import { Reminder } from "../entities/Reminder.js"; +import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents.js"; +import { Reminders } from "../Reminders.js"; import Timeout = NodeJS.Timeout; const LOOP_INTERVAL = 15 * MINUTES; diff --git a/backend/src/data/loops/upcomingScheduledPostsLoop.ts b/backend/src/data/loops/upcomingScheduledPostsLoop.ts index edd9fdad3..2138687a4 100644 --- a/backend/src/data/loops/upcomingScheduledPostsLoop.ts +++ b/backend/src/data/loops/upcomingScheduledPostsLoop.ts @@ -1,10 +1,10 @@ // tslint:disable:no-console import moment from "moment-timezone"; -import { lazyMemoize, MINUTES } from "../../utils"; -import { ScheduledPost } from "../entities/ScheduledPost"; -import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents"; -import { ScheduledPosts } from "../ScheduledPosts"; +import { lazyMemoize, MINUTES } from "../../utils.js"; +import { ScheduledPost } from "../entities/ScheduledPost.js"; +import { emitGuildEvent, hasGuildEventListener } from "../GuildEvents.js"; +import { ScheduledPosts } from "../ScheduledPosts.js"; import Timeout = NodeJS.Timeout; const LOOP_INTERVAL = 15 * MINUTES; diff --git a/backend/src/data/queryLogger.ts b/backend/src/data/queryLogger.ts index c5fb3ee89..5c47513a1 100644 --- a/backend/src/data/queryLogger.ts +++ b/backend/src/data/queryLogger.ts @@ -1,4 +1,4 @@ -import { AdvancedConsoleLogger } from "typeorm/logger/AdvancedConsoleLogger"; +import { AdvancedConsoleLogger } from "typeorm"; let groupedQueryStats: Map = new Map(); diff --git a/backend/src/env.ts b/backend/src/env.ts index f04e2cd52..e4b9214d9 100644 --- a/backend/src/env.ts +++ b/backend/src/env.ts @@ -2,7 +2,7 @@ import dotenv from "dotenv"; import fs from "fs"; import path from "path"; import { z } from "zod"; -import { rootDir } from "./paths"; +import { rootDir } from "./paths.js"; const envType = z.object({ KEY: z.string().length(32), diff --git a/backend/src/exportSchemas.ts b/backend/src/exportSchemas.ts index 59cc5708a..7298ff135 100644 --- a/backend/src/exportSchemas.ts +++ b/backend/src/exportSchemas.ts @@ -1,7 +1,7 @@ import { z } from "zod"; -import zodToJsonSchema from "zod-to-json-schema"; -import { guildPluginInfo } from "./plugins/pluginInfo"; -import { zZeppelinGuildConfig } from "./types"; +import { zodToJsonSchema } from "zod-to-json-schema"; +import { guildPluginInfo } from "./plugins/pluginInfo.js"; +import { zZeppelinGuildConfig } from "./types.js"; const pluginSchemaMap = Object.entries(guildPluginInfo).reduce((map, [pluginName, pluginInfo]) => { if (pluginInfo.configSchema) { diff --git a/backend/src/index.ts b/backend/src/index.ts index 77d66cbad..10c196128 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -1,6 +1,6 @@ // KEEP THIS AS FIRST IMPORT // See comment in module for details -import "./threadsSignalFix"; +import "./threadsSignalFix.js"; import { Client, @@ -17,37 +17,37 @@ import { Knub, PluginError, PluginLoadError, PluginNotLoadedError } from "knub"; import moment from "moment-timezone"; import { performance } from "perf_hooks"; import process from "process"; -import { DiscordJSError } from "./DiscordJSError"; -import { RecoverablePluginError } from "./RecoverablePluginError"; -import { SimpleError } from "./SimpleError"; -import { AllowedGuilds } from "./data/AllowedGuilds"; -import { Configs } from "./data/Configs"; -import { GuildLogs } from "./data/GuildLogs"; -import { LogType } from "./data/LogType"; -import { hasPhishermanMasterAPIKey } from "./data/Phisherman"; -import { dataSource } from "./data/dataSource"; -import { connect } from "./data/db"; -import { runExpiredArchiveDeletionLoop } from "./data/loops/expiredArchiveDeletionLoop"; -import { runExpiredMemberCacheDeletionLoop } from "./data/loops/expiredMemberCacheDeletionLoop"; -import { runExpiringMutesLoop } from "./data/loops/expiringMutesLoop"; -import { runExpiringTempbansLoop } from "./data/loops/expiringTempbansLoop"; -import { runExpiringVCAlertsLoop } from "./data/loops/expiringVCAlertsLoop"; -import { runMemberCacheDeletionLoop } from "./data/loops/memberCacheDeletionLoop"; -import { runPhishermanCacheCleanupLoop, runPhishermanReportingLoop } from "./data/loops/phishermanLoops"; -import { runSavedMessageCleanupLoop } from "./data/loops/savedMessageCleanupLoop"; -import { runUpcomingRemindersLoop } from "./data/loops/upcomingRemindersLoop"; -import { runUpcomingScheduledPostsLoop } from "./data/loops/upcomingScheduledPostsLoop"; -import { consumeQueryStats } from "./data/queryLogger"; -import { env } from "./env"; -import { logger } from "./logger"; -import { baseGuildPlugins, globalPlugins, guildPlugins } from "./plugins/availablePlugins"; -import { setProfiler } from "./profiler"; -import { logRateLimit } from "./rateLimitStats"; -import { startUptimeCounter } from "./uptime"; -import { MINUTES, SECONDS, errorMessage, isDiscordAPIError, isDiscordHTTPError, sleep, successMessage } from "./utils"; -import { DecayingCounter } from "./utils/DecayingCounter"; -import { enableProfiling } from "./utils/easyProfiler"; -import { loadYamlSafely } from "./utils/loadYamlSafely"; +import { DiscordJSError } from "./DiscordJSError.js"; +import { RecoverablePluginError } from "./RecoverablePluginError.js"; +import { SimpleError } from "./SimpleError.js"; +import { AllowedGuilds } from "./data/AllowedGuilds.js"; +import { Configs } from "./data/Configs.js"; +import { GuildLogs } from "./data/GuildLogs.js"; +import { LogType } from "./data/LogType.js"; +import { hasPhishermanMasterAPIKey } from "./data/Phisherman.js"; +import { dataSource } from "./data/dataSource.js"; +import { connect } from "./data/db.js"; +import { runExpiredArchiveDeletionLoop } from "./data/loops/expiredArchiveDeletionLoop.js"; +import { runExpiredMemberCacheDeletionLoop } from "./data/loops/expiredMemberCacheDeletionLoop.js"; +import { runExpiringMutesLoop } from "./data/loops/expiringMutesLoop.js"; +import { runExpiringTempbansLoop } from "./data/loops/expiringTempbansLoop.js"; +import { runExpiringVCAlertsLoop } from "./data/loops/expiringVCAlertsLoop.js"; +import { runMemberCacheDeletionLoop } from "./data/loops/memberCacheDeletionLoop.js"; +import { runPhishermanCacheCleanupLoop, runPhishermanReportingLoop } from "./data/loops/phishermanLoops.js"; +import { runSavedMessageCleanupLoop } from "./data/loops/savedMessageCleanupLoop.js"; +import { runUpcomingRemindersLoop } from "./data/loops/upcomingRemindersLoop.js"; +import { runUpcomingScheduledPostsLoop } from "./data/loops/upcomingScheduledPostsLoop.js"; +import { consumeQueryStats } from "./data/queryLogger.js"; +import { env } from "./env.js"; +import { logger } from "./logger.js"; +import { baseGuildPlugins, globalPlugins, guildPlugins } from "./plugins/availablePlugins.js"; +import { setProfiler } from "./profiler.js"; +import { logRateLimit } from "./rateLimitStats.js"; +import { startUptimeCounter } from "./uptime.js"; +import { MINUTES, SECONDS, errorMessage, isDiscordAPIError, isDiscordHTTPError, sleep, successMessage } from "./utils.js"; +import { DecayingCounter } from "./utils/DecayingCounter.js"; +import { enableProfiling } from "./utils/easyProfiler.js"; +import { loadYamlSafely } from "./utils/loadYamlSafely.js"; // Error handling let recentPluginErrors = 0; diff --git a/backend/src/migrateConfigsToDB.ts b/backend/src/migrateConfigsToDB.ts index 67423c414..73a094a26 100644 --- a/backend/src/migrateConfigsToDB.ts +++ b/backend/src/migrateConfigsToDB.ts @@ -1,8 +1,8 @@ // tslint:disable:no-console import * as _fs from "fs"; import path from "path"; -import { Configs } from "./data/Configs"; -import { connect } from "./data/db"; +import { Configs } from "./data/Configs.js"; +import { connect } from "./data/db.js"; const fs = _fs.promises; @@ -17,7 +17,7 @@ connect().then(async () => { const configs = new Configs(); console.log("Loading config files"); - const configDir = path.join(__dirname, "..", "config"); + const configDir = path.join(import.meta.dirname, "..", "config"); const configFiles = await fs.readdir(configDir); console.log("Looping through config files"); diff --git a/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts b/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts index e6b6408d2..b9813a938 100644 --- a/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts +++ b/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { TableForeignKey } from "typeorm/index"; +import { TableForeignKey } from "typeorm"; export class AddCaseNotesForeignKey1596994103885 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/migrations/1597015567215-AddLogMessageIdToCases.ts b/backend/src/migrations/1597015567215-AddLogMessageIdToCases.ts index 95fa7027b..cdb0bb973 100644 --- a/backend/src/migrations/1597015567215-AddLogMessageIdToCases.ts +++ b/backend/src/migrations/1597015567215-AddLogMessageIdToCases.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { TableColumn } from "typeorm/index"; +import { TableColumn } from "typeorm"; export class AddLogMessageIdToCases1597015567215 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/migrations/1597109357201-CreateMemberTimezonesTable.ts b/backend/src/migrations/1597109357201-CreateMemberTimezonesTable.ts index df4b6cca1..a826fc603 100644 --- a/backend/src/migrations/1597109357201-CreateMemberTimezonesTable.ts +++ b/backend/src/migrations/1597109357201-CreateMemberTimezonesTable.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { Table } from "typeorm/index"; +import { Table } from "typeorm"; export class CreateMemberTimezonesTable1597109357201 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/migrations/1600283341726-EncryptExistingMessages.ts b/backend/src/migrations/1600283341726-EncryptExistingMessages.ts index 19a21fca5..50bbe6d2a 100644 --- a/backend/src/migrations/1600283341726-EncryptExistingMessages.ts +++ b/backend/src/migrations/1600283341726-EncryptExistingMessages.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { decrypt, encrypt } from "../utils/crypt"; +import { decrypt, encrypt } from "../utils/crypt.js"; export class EncryptExistingMessages1600283341726 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/migrations/1600285077890-EncryptArchives.ts b/backend/src/migrations/1600285077890-EncryptArchives.ts index 52d6393bd..9ba1f2c9c 100644 --- a/backend/src/migrations/1600285077890-EncryptArchives.ts +++ b/backend/src/migrations/1600285077890-EncryptArchives.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import { decrypt, encrypt } from "../utils/crypt"; +import { decrypt, encrypt } from "../utils/crypt.js"; export class EncryptArchives1600285077890 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/migrations/1617363975046-UpdateCounterTriggers.ts b/backend/src/migrations/1617363975046-UpdateCounterTriggers.ts index 2e1e8664c..2eae7cfe7 100644 --- a/backend/src/migrations/1617363975046-UpdateCounterTriggers.ts +++ b/backend/src/migrations/1617363975046-UpdateCounterTriggers.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner, TableColumn, TableIndex } from "typeorm"; -import { TableForeignKey } from "typeorm/index"; +import { TableForeignKey } from "typeorm"; export class UpdateCounterTriggers1617363975046 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/paths.ts b/backend/src/paths.ts index 9d45ca219..787803ed5 100644 --- a/backend/src/paths.ts +++ b/backend/src/paths.ts @@ -2,7 +2,7 @@ import path from "path"; import pkgUp from "pkg-up"; const backendPackageJson = pkgUp.sync({ - cwd: __dirname, + cwd: import.meta.dirname, }) as string; export const backendDir = path.dirname(backendPackageJson); diff --git a/backend/src/pluginUtils.ts b/backend/src/pluginUtils.ts index 05428bf7c..8cbc5b95f 100644 --- a/backend/src/pluginUtils.ts +++ b/backend/src/pluginUtils.ts @@ -11,11 +11,11 @@ import { TextBasedChannel, } from "discord.js"; import { AnyPluginData, BasePluginData, CommandContext, ExtendedMatchParams, GuildPluginData, helpers } from "knub"; -import { logger } from "./logger"; -import { isStaff } from "./staff"; -import { TZeppelinKnub } from "./types"; -import { errorMessage, successMessage } from "./utils"; -import { Tail } from "./utils/typeUtils"; +import { logger } from "./logger.js"; +import { isStaff } from "./staff.js"; +import { TZeppelinKnub } from "./types.js"; +import { errorMessage, successMessage } from "./utils.js"; +import { Tail } from "./utils/typeUtils.js"; const { getMemberLevel } = helpers; diff --git a/backend/src/plugins/AutoDelete/AutoDeletePlugin.ts b/backend/src/plugins/AutoDelete/AutoDeletePlugin.ts index 4c537bf0e..ab9d8ba7d 100644 --- a/backend/src/plugins/AutoDelete/AutoDeletePlugin.ts +++ b/backend/src/plugins/AutoDelete/AutoDeletePlugin.ts @@ -1,12 +1,12 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { AutoDeletePluginType, zAutoDeleteConfig } from "./types"; -import { onMessageCreate } from "./util/onMessageCreate"; -import { onMessageDelete } from "./util/onMessageDelete"; -import { onMessageDeleteBulk } from "./util/onMessageDeleteBulk"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { AutoDeletePluginType, zAutoDeleteConfig } from "./types.js"; +import { onMessageCreate } from "./util/onMessageCreate.js"; +import { onMessageDelete } from "./util/onMessageDelete.js"; +import { onMessageDeleteBulk } from "./util/onMessageDeleteBulk.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/AutoDelete/info.ts b/backend/src/plugins/AutoDelete/info.ts index 9ceeddee9..8a4438a30 100644 --- a/backend/src/plugins/AutoDelete/info.ts +++ b/backend/src/plugins/AutoDelete/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const autoDeletePluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/AutoDelete/types.ts b/backend/src/plugins/AutoDelete/types.ts index be6ff7ee1..749eec49c 100644 --- a/backend/src/plugins/AutoDelete/types.ts +++ b/backend/src/plugins/AutoDelete/types.ts @@ -1,9 +1,9 @@ import { BasePluginType } from "knub"; import z from "zod"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { SavedMessage } from "../../data/entities/SavedMessage"; -import { MINUTES, zDelayString } from "../../utils"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { SavedMessage } from "../../data/entities/SavedMessage.js"; +import { MINUTES, zDelayString } from "../../utils.js"; import Timeout = NodeJS.Timeout; export const MAX_DELAY = 5 * MINUTES; diff --git a/backend/src/plugins/AutoDelete/util/addMessageToDeletionQueue.ts b/backend/src/plugins/AutoDelete/util/addMessageToDeletionQueue.ts index 7d37c0031..f965e58ab 100644 --- a/backend/src/plugins/AutoDelete/util/addMessageToDeletionQueue.ts +++ b/backend/src/plugins/AutoDelete/util/addMessageToDeletionQueue.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { sorter } from "../../../utils"; -import { AutoDeletePluginType } from "../types"; -import { scheduleNextDeletion } from "./scheduleNextDeletion"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { sorter } from "../../../utils.js"; +import { AutoDeletePluginType } from "../types.js"; +import { scheduleNextDeletion } from "./scheduleNextDeletion.js"; export function addMessageToDeletionQueue( pluginData: GuildPluginData, diff --git a/backend/src/plugins/AutoDelete/util/deleteNextItem.ts b/backend/src/plugins/AutoDelete/util/deleteNextItem.ts index c3aa6f72d..af40ac938 100644 --- a/backend/src/plugins/AutoDelete/util/deleteNextItem.ts +++ b/backend/src/plugins/AutoDelete/util/deleteNextItem.ts @@ -1,14 +1,14 @@ import { ChannelType, PermissionsBitField, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { LogType } from "../../../data/LogType"; -import { logger } from "../../../logger"; -import { resolveUser, verboseChannelMention } from "../../../utils"; -import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { AutoDeletePluginType } from "../types"; -import { scheduleNextDeletion } from "./scheduleNextDeletion"; +import { LogType } from "../../../data/LogType.js"; +import { logger } from "../../../logger.js"; +import { resolveUser, verboseChannelMention } from "../../../utils.js"; +import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { AutoDeletePluginType } from "../types.js"; +import { scheduleNextDeletion } from "./scheduleNextDeletion.js"; export async function deleteNextItem(pluginData: GuildPluginData) { const [itemToDelete] = pluginData.state.deletionQueue.splice(0, 1); diff --git a/backend/src/plugins/AutoDelete/util/onMessageCreate.ts b/backend/src/plugins/AutoDelete/util/onMessageCreate.ts index 024e3cf08..1f1259004 100644 --- a/backend/src/plugins/AutoDelete/util/onMessageCreate.ts +++ b/backend/src/plugins/AutoDelete/util/onMessageCreate.ts @@ -1,9 +1,9 @@ import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { convertDelayStringToMS, resolveMember } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { AutoDeletePluginType, MAX_DELAY } from "../types"; -import { addMessageToDeletionQueue } from "./addMessageToDeletionQueue"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { convertDelayStringToMS, resolveMember } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { AutoDeletePluginType, MAX_DELAY } from "../types.js"; +import { addMessageToDeletionQueue } from "./addMessageToDeletionQueue.js"; export async function onMessageCreate(pluginData: GuildPluginData, msg: SavedMessage) { const member = await resolveMember(pluginData.client, pluginData.guild, msg.user_id); diff --git a/backend/src/plugins/AutoDelete/util/onMessageDelete.ts b/backend/src/plugins/AutoDelete/util/onMessageDelete.ts index 984a7850f..c479f381d 100644 --- a/backend/src/plugins/AutoDelete/util/onMessageDelete.ts +++ b/backend/src/plugins/AutoDelete/util/onMessageDelete.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { AutoDeletePluginType } from "../types"; -import { scheduleNextDeletion } from "./scheduleNextDeletion"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { AutoDeletePluginType } from "../types.js"; +import { scheduleNextDeletion } from "./scheduleNextDeletion.js"; export function onMessageDelete(pluginData: GuildPluginData, msg: SavedMessage) { const indexToDelete = pluginData.state.deletionQueue.findIndex((item) => item.message.id === msg.id); diff --git a/backend/src/plugins/AutoDelete/util/onMessageDeleteBulk.ts b/backend/src/plugins/AutoDelete/util/onMessageDeleteBulk.ts index 6c39a6679..6114c8d44 100644 --- a/backend/src/plugins/AutoDelete/util/onMessageDeleteBulk.ts +++ b/backend/src/plugins/AutoDelete/util/onMessageDeleteBulk.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { AutoDeletePluginType } from "../types"; -import { onMessageDelete } from "./onMessageDelete"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { AutoDeletePluginType } from "../types.js"; +import { onMessageDelete } from "./onMessageDelete.js"; export function onMessageDeleteBulk(pluginData: GuildPluginData, messages: SavedMessage[]) { for (const msg of messages) { diff --git a/backend/src/plugins/AutoDelete/util/scheduleNextDeletion.ts b/backend/src/plugins/AutoDelete/util/scheduleNextDeletion.ts index ebae82a98..27611b392 100644 --- a/backend/src/plugins/AutoDelete/util/scheduleNextDeletion.ts +++ b/backend/src/plugins/AutoDelete/util/scheduleNextDeletion.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { AutoDeletePluginType } from "../types"; -import { deleteNextItem } from "./deleteNextItem"; +import { AutoDeletePluginType } from "../types.js"; +import { deleteNextItem } from "./deleteNextItem.js"; export function scheduleNextDeletion(pluginData: GuildPluginData) { if (pluginData.state.deletionQueue.length === 0) { diff --git a/backend/src/plugins/AutoReactions/AutoReactionsPlugin.ts b/backend/src/plugins/AutoReactions/AutoReactionsPlugin.ts index 6c24b2967..6c03d640e 100644 --- a/backend/src/plugins/AutoReactions/AutoReactionsPlugin.ts +++ b/backend/src/plugins/AutoReactions/AutoReactionsPlugin.ts @@ -1,11 +1,11 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildAutoReactions } from "../../data/GuildAutoReactions"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { DisableAutoReactionsCmd } from "./commands/DisableAutoReactionsCmd"; -import { NewAutoReactionsCmd } from "./commands/NewAutoReactionsCmd"; -import { AddReactionsEvt } from "./events/AddReactionsEvt"; -import { AutoReactionsPluginType, zAutoReactionsConfig } from "./types"; +import { GuildAutoReactions } from "../../data/GuildAutoReactions.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { DisableAutoReactionsCmd } from "./commands/DisableAutoReactionsCmd.js"; +import { NewAutoReactionsCmd } from "./commands/NewAutoReactionsCmd.js"; +import { AddReactionsEvt } from "./events/AddReactionsEvt.js"; +import { AutoReactionsPluginType, zAutoReactionsConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/AutoReactions/commands/DisableAutoReactionsCmd.ts b/backend/src/plugins/AutoReactions/commands/DisableAutoReactionsCmd.ts index 20f749ea9..fc950aa70 100644 --- a/backend/src/plugins/AutoReactions/commands/DisableAutoReactionsCmd.ts +++ b/backend/src/plugins/AutoReactions/commands/DisableAutoReactionsCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { autoReactionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { autoReactionsCmd } from "../types.js"; export const DisableAutoReactionsCmd = autoReactionsCmd({ trigger: "auto_reactions disable", diff --git a/backend/src/plugins/AutoReactions/commands/NewAutoReactionsCmd.ts b/backend/src/plugins/AutoReactions/commands/NewAutoReactionsCmd.ts index a64cb95cd..6eed443a0 100644 --- a/backend/src/plugins/AutoReactions/commands/NewAutoReactionsCmd.ts +++ b/backend/src/plugins/AutoReactions/commands/NewAutoReactionsCmd.ts @@ -1,11 +1,11 @@ import { PermissionsBitField } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { canUseEmoji, customEmojiRegex, isEmoji } from "../../../utils"; -import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { readChannelPermissions } from "../../../utils/readChannelPermissions"; -import { autoReactionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { canUseEmoji, customEmojiRegex, isEmoji } from "../../../utils.js"; +import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { readChannelPermissions } from "../../../utils/readChannelPermissions.js"; +import { autoReactionsCmd } from "../types.js"; const requiredPermissions = readChannelPermissions | PermissionsBitField.Flags.AddReactions; diff --git a/backend/src/plugins/AutoReactions/events/AddReactionsEvt.ts b/backend/src/plugins/AutoReactions/events/AddReactionsEvt.ts index 574e500f4..136cb042b 100644 --- a/backend/src/plugins/AutoReactions/events/AddReactionsEvt.ts +++ b/backend/src/plugins/AutoReactions/events/AddReactionsEvt.ts @@ -1,11 +1,11 @@ import { GuildTextBasedChannel, PermissionsBitField } from "discord.js"; -import { AutoReaction } from "../../../data/entities/AutoReaction"; -import { isDiscordAPIError } from "../../../utils"; -import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { readChannelPermissions } from "../../../utils/readChannelPermissions"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { autoReactionsEvt } from "../types"; +import { AutoReaction } from "../../../data/entities/AutoReaction.js"; +import { isDiscordAPIError } from "../../../utils.js"; +import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { readChannelPermissions } from "../../../utils/readChannelPermissions.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { autoReactionsEvt } from "../types.js"; const p = PermissionsBitField.Flags; diff --git a/backend/src/plugins/AutoReactions/info.ts b/backend/src/plugins/AutoReactions/info.ts index d908f1630..05a41b74a 100644 --- a/backend/src/plugins/AutoReactions/info.ts +++ b/backend/src/plugins/AutoReactions/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; export const autoReactionsInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/AutoReactions/types.ts b/backend/src/plugins/AutoReactions/types.ts index 996fba8d2..f794b2461 100644 --- a/backend/src/plugins/AutoReactions/types.ts +++ b/backend/src/plugins/AutoReactions/types.ts @@ -1,9 +1,9 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildAutoReactions } from "../../data/GuildAutoReactions"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { AutoReaction } from "../../data/entities/AutoReaction"; +import { GuildAutoReactions } from "../../data/GuildAutoReactions.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { AutoReaction } from "../../data/entities/AutoReaction.js"; export const zAutoReactionsConfig = z.strictObject({ can_manage: z.boolean(), diff --git a/backend/src/plugins/Automod/AutomodPlugin.ts b/backend/src/plugins/Automod/AutomodPlugin.ts index 339565902..873f10fe3 100644 --- a/backend/src/plugins/Automod/AutomodPlugin.ts +++ b/backend/src/plugins/Automod/AutomodPlugin.ts @@ -1,37 +1,37 @@ import { CooldownManager, guildPlugin } from "knub"; -import { Queue } from "../../Queue"; -import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners"; -import { MINUTES, SECONDS } from "../../utils"; -import { registerEventListenersFromMap } from "../../utils/registerEventListenersFromMap"; -import { unregisterEventListenersFromMap } from "../../utils/unregisterEventListenersFromMap"; -import { CountersPlugin } from "../Counters/CountersPlugin"; -import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { ModActionsPlugin } from "../ModActions/ModActionsPlugin"; -import { MutesPlugin } from "../Mutes/MutesPlugin"; -import { PhishermanPlugin } from "../Phisherman/PhishermanPlugin"; -import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin"; -import { AntiraidClearCmd } from "./commands/AntiraidClearCmd"; -import { SetAntiraidCmd } from "./commands/SetAntiraidCmd"; -import { ViewAntiraidCmd } from "./commands/ViewAntiraidCmd"; -import { RunAutomodOnJoinEvt, RunAutomodOnLeaveEvt } from "./events/RunAutomodOnJoinLeaveEvt"; -import { RunAutomodOnMemberUpdate } from "./events/RunAutomodOnMemberUpdate"; -import { runAutomodOnCounterTrigger } from "./events/runAutomodOnCounterTrigger"; -import { runAutomodOnMessage } from "./events/runAutomodOnMessage"; -import { runAutomodOnModAction } from "./events/runAutomodOnModAction"; +import { Queue } from "../../Queue.js"; +import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels.js"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners.js"; +import { MINUTES, SECONDS } from "../../utils.js"; +import { registerEventListenersFromMap } from "../../utils/registerEventListenersFromMap.js"; +import { unregisterEventListenersFromMap } from "../../utils/unregisterEventListenersFromMap.js"; +import { CountersPlugin } from "../Counters/CountersPlugin.js"; +import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { ModActionsPlugin } from "../ModActions/ModActionsPlugin.js"; +import { MutesPlugin } from "../Mutes/MutesPlugin.js"; +import { PhishermanPlugin } from "../Phisherman/PhishermanPlugin.js"; +import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin.js"; +import { AntiraidClearCmd } from "./commands/AntiraidClearCmd.js"; +import { SetAntiraidCmd } from "./commands/SetAntiraidCmd.js"; +import { ViewAntiraidCmd } from "./commands/ViewAntiraidCmd.js"; +import { RunAutomodOnJoinEvt, RunAutomodOnLeaveEvt } from "./events/RunAutomodOnJoinLeaveEvt.js"; +import { RunAutomodOnMemberUpdate } from "./events/RunAutomodOnMemberUpdate.js"; +import { runAutomodOnCounterTrigger } from "./events/runAutomodOnCounterTrigger.js"; +import { runAutomodOnMessage } from "./events/runAutomodOnMessage.js"; +import { runAutomodOnModAction } from "./events/runAutomodOnModAction.js"; import { RunAutomodOnThreadCreate, RunAutomodOnThreadDelete, RunAutomodOnThreadUpdate, -} from "./events/runAutomodOnThreadEvents"; -import { clearOldRecentNicknameChanges } from "./functions/clearOldNicknameChanges"; -import { clearOldRecentActions } from "./functions/clearOldRecentActions"; -import { clearOldRecentSpam } from "./functions/clearOldRecentSpam"; -import { AutomodPluginType, zAutomodConfig } from "./types"; +} from "./events/runAutomodOnThreadEvents.js"; +import { clearOldRecentNicknameChanges } from "./functions/clearOldNicknameChanges.js"; +import { clearOldRecentActions } from "./functions/clearOldRecentActions.js"; +import { clearOldRecentSpam } from "./functions/clearOldRecentSpam.js"; +import { AutomodPluginType, zAutomodConfig } from "./types.js"; const defaultOptions = { config: { diff --git a/backend/src/plugins/Automod/actions/addRoles.ts b/backend/src/plugins/Automod/actions/addRoles.ts index 892947280..a12043140 100644 --- a/backend/src/plugins/Automod/actions/addRoles.ts +++ b/backend/src/plugins/Automod/actions/addRoles.ts @@ -1,13 +1,13 @@ import { PermissionFlagsBits, Snowflake } from "discord.js"; import z from "zod"; -import { nonNullish, unique, zSnowflake } from "../../../utils"; -import { canAssignRole } from "../../../utils/canAssignRole"; -import { getMissingPermissions } from "../../../utils/getMissingPermissions"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { ignoreRoleChange } from "../functions/ignoredRoleChanges"; -import { automodAction } from "../helpers"; +import { nonNullish, unique, zSnowflake } from "../../../utils.js"; +import { canAssignRole } from "../../../utils/canAssignRole.js"; +import { getMissingPermissions } from "../../../utils/getMissingPermissions.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { ignoreRoleChange } from "../functions/ignoredRoleChanges.js"; +import { automodAction } from "../helpers.js"; const p = PermissionFlagsBits; diff --git a/backend/src/plugins/Automod/actions/addToCounter.ts b/backend/src/plugins/Automod/actions/addToCounter.ts index 30ffe8faf..17a744627 100644 --- a/backend/src/plugins/Automod/actions/addToCounter.ts +++ b/backend/src/plugins/Automod/actions/addToCounter.ts @@ -1,8 +1,8 @@ import z from "zod"; -import { zBoundedCharacters } from "../../../utils"; -import { CountersPlugin } from "../../Counters/CountersPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; +import { zBoundedCharacters } from "../../../utils.js"; +import { CountersPlugin } from "../../Counters/CountersPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; const configSchema = z.object({ counter: zBoundedCharacters(0, 100), diff --git a/backend/src/plugins/Automod/actions/alert.ts b/backend/src/plugins/Automod/actions/alert.ts index d21fb4d5e..ea26d5bbc 100644 --- a/backend/src/plugins/Automod/actions/alert.ts +++ b/backend/src/plugins/Automod/actions/alert.ts @@ -1,12 +1,12 @@ import { Snowflake } from "discord.js"; import z from "zod"; -import { LogType } from "../../../data/LogType"; +import { LogType } from "../../../data/LogType.js"; import { createTypedTemplateSafeValueContainer, renderTemplate, TemplateParseError, TemplateSafeValueContainer, -} from "../../../templateFormatter"; +} from "../../../templateFormatter.js"; import { chunkMessageLines, isTruthy, @@ -17,13 +17,13 @@ import { zBoundedCharacters, zNullishToUndefined, zSnowflake, -} from "../../../utils"; -import { erisAllowedMentionsToDjsMentionOptions } from "../../../utils/erisAllowedMentionsToDjsMentionOptions"; -import { messageIsEmpty } from "../../../utils/messageIsEmpty"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { InternalPosterPlugin } from "../../InternalPoster/InternalPosterPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; +} from "../../../utils.js"; +import { erisAllowedMentionsToDjsMentionOptions } from "../../../utils/erisAllowedMentionsToDjsMentionOptions.js"; +import { messageIsEmpty } from "../../../utils/messageIsEmpty.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { InternalPosterPlugin } from "../../InternalPoster/InternalPosterPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; const configSchema = z.object({ channel: zSnowflake, diff --git a/backend/src/plugins/Automod/actions/archiveThread.ts b/backend/src/plugins/Automod/actions/archiveThread.ts index e73cb3dde..ca1e62425 100644 --- a/backend/src/plugins/Automod/actions/archiveThread.ts +++ b/backend/src/plugins/Automod/actions/archiveThread.ts @@ -1,7 +1,7 @@ import { AnyThreadChannel } from "discord.js"; import z from "zod"; -import { noop } from "../../../utils"; -import { automodAction } from "../helpers"; +import { noop } from "../../../utils.js"; +import { automodAction } from "../helpers.js"; const configSchema = z.strictObject({}); diff --git a/backend/src/plugins/Automod/actions/availableActions.ts b/backend/src/plugins/Automod/actions/availableActions.ts index a5183326e..e499a42d4 100644 --- a/backend/src/plugins/Automod/actions/availableActions.ts +++ b/backend/src/plugins/Automod/actions/availableActions.ts @@ -1,23 +1,23 @@ -import { AutomodActionBlueprint } from "../helpers"; -import { AddRolesAction } from "./addRoles"; -import { AddToCounterAction } from "./addToCounter"; -import { AlertAction } from "./alert"; -import { ArchiveThreadAction } from "./archiveThread"; -import { BanAction } from "./ban"; -import { ChangeNicknameAction } from "./changeNickname"; -import { ChangePermsAction } from "./changePerms"; -import { CleanAction } from "./clean"; -import { KickAction } from "./kick"; -import { LogAction } from "./log"; -import { MuteAction } from "./mute"; -import { PauseInvitesAction } from "./pauseInvites"; -import { RemoveRolesAction } from "./removeRoles"; -import { ReplyAction } from "./reply"; -import { SetAntiraidLevelAction } from "./setAntiraidLevel"; -import { SetCounterAction } from "./setCounter"; -import { SetSlowmodeAction } from "./setSlowmode"; -import { StartThreadAction } from "./startThread"; -import { WarnAction } from "./warn"; +import { AutomodActionBlueprint } from "../helpers.js"; +import { AddRolesAction } from "./addRoles.js"; +import { AddToCounterAction } from "./addToCounter.js"; +import { AlertAction } from "./alert.js"; +import { ArchiveThreadAction } from "./archiveThread.js"; +import { BanAction } from "./ban.js"; +import { ChangeNicknameAction } from "./changeNickname.js"; +import { ChangePermsAction } from "./changePerms.js"; +import { CleanAction } from "./clean.js"; +import { KickAction } from "./kick.js"; +import { LogAction } from "./log.js"; +import { MuteAction } from "./mute.js"; +import { PauseInvitesAction } from "./pauseInvites.js"; +import { RemoveRolesAction } from "./removeRoles.js"; +import { ReplyAction } from "./reply.js"; +import { SetAntiraidLevelAction } from "./setAntiraidLevel.js"; +import { SetCounterAction } from "./setCounter.js"; +import { SetSlowmodeAction } from "./setSlowmode.js"; +import { StartThreadAction } from "./startThread.js"; +import { WarnAction } from "./warn.js"; export const availableActions = { clean: CleanAction, diff --git a/backend/src/plugins/Automod/actions/ban.ts b/backend/src/plugins/Automod/actions/ban.ts index 5bf5b3a23..62a27e156 100644 --- a/backend/src/plugins/Automod/actions/ban.ts +++ b/backend/src/plugins/Automod/actions/ban.ts @@ -6,12 +6,12 @@ import { zBoundedCharacters, zDelayString, zSnowflake, -} from "../../../utils"; -import { CaseArgs } from "../../Cases/types"; -import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin"; -import { zNotify } from "../constants"; -import { resolveActionContactMethods } from "../functions/resolveActionContactMethods"; -import { automodAction } from "../helpers"; +} from "../../../utils.js"; +import { CaseArgs } from "../../Cases/types.js"; +import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin.js"; +import { zNotify } from "../constants.js"; +import { resolveActionContactMethods } from "../functions/resolveActionContactMethods.js"; +import { automodAction } from "../helpers.js"; const configSchema = z.strictObject({ reason: zBoundedCharacters(0, 4000).nullable().default(null), diff --git a/backend/src/plugins/Automod/actions/changeNickname.ts b/backend/src/plugins/Automod/actions/changeNickname.ts index ce7c610ef..a2a9ad4ac 100644 --- a/backend/src/plugins/Automod/actions/changeNickname.ts +++ b/backend/src/plugins/Automod/actions/changeNickname.ts @@ -1,7 +1,7 @@ import z from "zod"; -import { nonNullish, unique, zBoundedCharacters } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; +import { nonNullish, unique, zBoundedCharacters } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; export const ChangeNicknameAction = automodAction({ configSchema: z.union([ diff --git a/backend/src/plugins/Automod/actions/changePerms.ts b/backend/src/plugins/Automod/actions/changePerms.ts index 351b1637c..87f302d5f 100644 --- a/backend/src/plugins/Automod/actions/changePerms.ts +++ b/backend/src/plugins/Automod/actions/changePerms.ts @@ -1,15 +1,15 @@ import { PermissionsBitField, PermissionsString } from "discord.js"; import { U } from "ts-toolbelt"; import z from "zod"; -import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; -import { isValidSnowflake, keys, noop, zBoundedCharacters } from "../../../utils"; +import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; +import { isValidSnowflake, keys, noop, zBoundedCharacters } from "../../../utils.js"; import { guildToTemplateSafeGuild, savedMessageToTemplateSafeSavedMessage, userToTemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; +} from "../../../utils/templateSafeObjects.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; type LegacyPermMap = Record; const legacyPermMap = { diff --git a/backend/src/plugins/Automod/actions/clean.ts b/backend/src/plugins/Automod/actions/clean.ts index 5c66d370f..c44cd67a5 100644 --- a/backend/src/plugins/Automod/actions/clean.ts +++ b/backend/src/plugins/Automod/actions/clean.ts @@ -1,8 +1,8 @@ import { GuildTextBasedChannel, Snowflake } from "discord.js"; import z from "zod"; -import { LogType } from "../../../data/LogType"; -import { noop } from "../../../utils"; -import { automodAction } from "../helpers"; +import { LogType } from "../../../data/LogType.js"; +import { noop } from "../../../utils.js"; +import { automodAction } from "../helpers.js"; export const CleanAction = automodAction({ configSchema: z.boolean().default(false), diff --git a/backend/src/plugins/Automod/actions/exampleAction.ts b/backend/src/plugins/Automod/actions/exampleAction.ts index a43fc6768..f5406694b 100644 --- a/backend/src/plugins/Automod/actions/exampleAction.ts +++ b/backend/src/plugins/Automod/actions/exampleAction.ts @@ -1,6 +1,6 @@ import z from "zod"; -import { zBoundedCharacters } from "../../../utils"; -import { automodAction } from "../helpers"; +import { zBoundedCharacters } from "../../../utils.js"; +import { automodAction } from "../helpers.js"; export const ExampleAction = automodAction({ configSchema: z.strictObject({ diff --git a/backend/src/plugins/Automod/actions/kick.ts b/backend/src/plugins/Automod/actions/kick.ts index 2161e2c02..a1d7ef7ca 100644 --- a/backend/src/plugins/Automod/actions/kick.ts +++ b/backend/src/plugins/Automod/actions/kick.ts @@ -1,10 +1,10 @@ import z from "zod"; -import { asyncMap, nonNullish, resolveMember, unique, zBoundedCharacters, zSnowflake } from "../../../utils"; -import { CaseArgs } from "../../Cases/types"; -import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin"; -import { zNotify } from "../constants"; -import { resolveActionContactMethods } from "../functions/resolveActionContactMethods"; -import { automodAction } from "../helpers"; +import { asyncMap, nonNullish, resolveMember, unique, zBoundedCharacters, zSnowflake } from "../../../utils.js"; +import { CaseArgs } from "../../Cases/types.js"; +import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin.js"; +import { zNotify } from "../constants.js"; +import { resolveActionContactMethods } from "../functions/resolveActionContactMethods.js"; +import { automodAction } from "../helpers.js"; export const KickAction = automodAction({ configSchema: z.strictObject({ diff --git a/backend/src/plugins/Automod/actions/log.ts b/backend/src/plugins/Automod/actions/log.ts index dace25f12..fefa31681 100644 --- a/backend/src/plugins/Automod/actions/log.ts +++ b/backend/src/plugins/Automod/actions/log.ts @@ -1,7 +1,7 @@ import z from "zod"; -import { isTruthy, unique } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; +import { isTruthy, unique } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; export const LogAction = automodAction({ configSchema: z.boolean().default(true), diff --git a/backend/src/plugins/Automod/actions/mute.ts b/backend/src/plugins/Automod/actions/mute.ts index ba932b7fe..3708e71e2 100644 --- a/backend/src/plugins/Automod/actions/mute.ts +++ b/backend/src/plugins/Automod/actions/mute.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; import { convertDelayStringToMS, nonNullish, @@ -7,13 +7,13 @@ import { zBoundedCharacters, zDelayString, zSnowflake, -} from "../../../utils"; -import { CaseArgs } from "../../Cases/types"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { MutesPlugin } from "../../Mutes/MutesPlugin"; -import { zNotify } from "../constants"; -import { resolveActionContactMethods } from "../functions/resolveActionContactMethods"; -import { automodAction } from "../helpers"; +} from "../../../utils.js"; +import { CaseArgs } from "../../Cases/types.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { MutesPlugin } from "../../Mutes/MutesPlugin.js"; +import { zNotify } from "../constants.js"; +import { resolveActionContactMethods } from "../functions/resolveActionContactMethods.js"; +import { automodAction } from "../helpers.js"; export const MuteAction = automodAction({ configSchema: z.strictObject({ diff --git a/backend/src/plugins/Automod/actions/pauseInvites.ts b/backend/src/plugins/Automod/actions/pauseInvites.ts index 819bd1ffb..2fef2b339 100644 --- a/backend/src/plugins/Automod/actions/pauseInvites.ts +++ b/backend/src/plugins/Automod/actions/pauseInvites.ts @@ -1,6 +1,6 @@ import { GuildFeature } from "discord.js"; import z from "zod"; -import { automodAction } from "../helpers"; +import { automodAction } from "../helpers.js"; export const PauseInvitesAction = automodAction({ configSchema: z.strictObject({ diff --git a/backend/src/plugins/Automod/actions/removeRoles.ts b/backend/src/plugins/Automod/actions/removeRoles.ts index 8b065702c..5c2cef66c 100644 --- a/backend/src/plugins/Automod/actions/removeRoles.ts +++ b/backend/src/plugins/Automod/actions/removeRoles.ts @@ -1,13 +1,13 @@ import { PermissionFlagsBits, Snowflake } from "discord.js"; import z from "zod"; -import { nonNullish, unique, zSnowflake } from "../../../utils"; -import { canAssignRole } from "../../../utils/canAssignRole"; -import { getMissingPermissions } from "../../../utils/getMissingPermissions"; -import { memberRolesLock } from "../../../utils/lockNameHelpers"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { ignoreRoleChange } from "../functions/ignoredRoleChanges"; -import { automodAction } from "../helpers"; +import { nonNullish, unique, zSnowflake } from "../../../utils.js"; +import { canAssignRole } from "../../../utils/canAssignRole.js"; +import { getMissingPermissions } from "../../../utils/getMissingPermissions.js"; +import { memberRolesLock } from "../../../utils/lockNameHelpers.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { ignoreRoleChange } from "../functions/ignoredRoleChanges.js"; +import { automodAction } from "../helpers.js"; const p = PermissionFlagsBits; diff --git a/backend/src/plugins/Automod/actions/reply.ts b/backend/src/plugins/Automod/actions/reply.ts index 0628e26fa..aade027df 100644 --- a/backend/src/plugins/Automod/actions/reply.ts +++ b/backend/src/plugins/Automod/actions/reply.ts @@ -1,6 +1,6 @@ import { GuildTextBasedChannel, MessageCreateOptions, PermissionsBitField, Snowflake, User } from "discord.js"; import z from "zod"; -import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; +import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; import { convertDelayStringToMS, noop, @@ -11,13 +11,13 @@ import { zBoundedCharacters, zDelayString, zMessageContent, -} from "../../../utils"; -import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions"; -import { messageIsEmpty } from "../../../utils/messageIsEmpty"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; -import { AutomodContext } from "../types"; +} from "../../../utils.js"; +import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions.js"; +import { messageIsEmpty } from "../../../utils/messageIsEmpty.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; +import { AutomodContext } from "../types.js"; export const ReplyAction = automodAction({ configSchema: z.union([ diff --git a/backend/src/plugins/Automod/actions/setAntiraidLevel.ts b/backend/src/plugins/Automod/actions/setAntiraidLevel.ts index db2a6bef0..611195e4d 100644 --- a/backend/src/plugins/Automod/actions/setAntiraidLevel.ts +++ b/backend/src/plugins/Automod/actions/setAntiraidLevel.ts @@ -1,6 +1,6 @@ -import { zBoundedCharacters } from "../../../utils"; -import { setAntiraidLevel } from "../functions/setAntiraidLevel"; -import { automodAction } from "../helpers"; +import { zBoundedCharacters } from "../../../utils.js"; +import { setAntiraidLevel } from "../functions/setAntiraidLevel.js"; +import { automodAction } from "../helpers.js"; export const SetAntiraidLevelAction = automodAction({ configSchema: zBoundedCharacters(0, 100).nullable(), diff --git a/backend/src/plugins/Automod/actions/setCounter.ts b/backend/src/plugins/Automod/actions/setCounter.ts index 604d9bf4f..8b60a43a2 100644 --- a/backend/src/plugins/Automod/actions/setCounter.ts +++ b/backend/src/plugins/Automod/actions/setCounter.ts @@ -1,9 +1,9 @@ import z from "zod"; -import { MAX_COUNTER_VALUE, MIN_COUNTER_VALUE } from "../../../data/GuildCounters"; -import { zBoundedCharacters } from "../../../utils"; -import { CountersPlugin } from "../../Counters/CountersPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; +import { MAX_COUNTER_VALUE, MIN_COUNTER_VALUE } from "../../../data/GuildCounters.js"; +import { zBoundedCharacters } from "../../../utils.js"; +import { CountersPlugin } from "../../Counters/CountersPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; export const SetCounterAction = automodAction({ configSchema: z.strictObject({ diff --git a/backend/src/plugins/Automod/actions/setSlowmode.ts b/backend/src/plugins/Automod/actions/setSlowmode.ts index 7015e8f41..d23e16736 100644 --- a/backend/src/plugins/Automod/actions/setSlowmode.ts +++ b/backend/src/plugins/Automod/actions/setSlowmode.ts @@ -1,8 +1,8 @@ import { ChannelType, GuildTextBasedChannel, Snowflake } from "discord.js"; import z from "zod"; -import { convertDelayStringToMS, isDiscordAPIError, zDelayString, zSnowflake } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; +import { convertDelayStringToMS, isDiscordAPIError, zDelayString, zSnowflake } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; export const SetSlowmodeAction = automodAction({ configSchema: z.strictObject({ diff --git a/backend/src/plugins/Automod/actions/startThread.ts b/backend/src/plugins/Automod/actions/startThread.ts index a521d72f2..81b180331 100644 --- a/backend/src/plugins/Automod/actions/startThread.ts +++ b/backend/src/plugins/Automod/actions/startThread.ts @@ -1,10 +1,10 @@ import { ChannelType, GuildTextThreadCreateOptions, ThreadAutoArchiveDuration, ThreadChannel } from "discord.js"; import z from "zod"; -import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; -import { MINUTES, convertDelayStringToMS, noop, zBoundedCharacters, zDelayString } from "../../../utils"; -import { savedMessageToTemplateSafeSavedMessage, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { automodAction } from "../helpers"; +import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; +import { MINUTES, convertDelayStringToMS, noop, zBoundedCharacters, zDelayString } from "../../../utils.js"; +import { savedMessageToTemplateSafeSavedMessage, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { automodAction } from "../helpers.js"; const validThreadAutoArchiveDurations: ThreadAutoArchiveDuration[] = [ ThreadAutoArchiveDuration.OneHour, diff --git a/backend/src/plugins/Automod/actions/warn.ts b/backend/src/plugins/Automod/actions/warn.ts index d8a7805b1..9c36f637f 100644 --- a/backend/src/plugins/Automod/actions/warn.ts +++ b/backend/src/plugins/Automod/actions/warn.ts @@ -1,10 +1,10 @@ import z from "zod"; -import { asyncMap, nonNullish, resolveMember, unique, zBoundedCharacters, zSnowflake } from "../../../utils"; -import { CaseArgs } from "../../Cases/types"; -import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin"; -import { zNotify } from "../constants"; -import { resolveActionContactMethods } from "../functions/resolveActionContactMethods"; -import { automodAction } from "../helpers"; +import { asyncMap, nonNullish, resolveMember, unique, zBoundedCharacters, zSnowflake } from "../../../utils.js"; +import { CaseArgs } from "../../Cases/types.js"; +import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin.js"; +import { zNotify } from "../constants.js"; +import { resolveActionContactMethods } from "../functions/resolveActionContactMethods.js"; +import { automodAction } from "../helpers.js"; export const WarnAction = automodAction({ configSchema: z.strictObject({ diff --git a/backend/src/plugins/Automod/commands/AntiraidClearCmd.ts b/backend/src/plugins/Automod/commands/AntiraidClearCmd.ts index fd31d4b14..187696ea3 100644 --- a/backend/src/plugins/Automod/commands/AntiraidClearCmd.ts +++ b/backend/src/plugins/Automod/commands/AntiraidClearCmd.ts @@ -1,7 +1,7 @@ import { guildPluginMessageCommand } from "knub"; -import { sendSuccessMessage } from "../../../pluginUtils"; -import { setAntiraidLevel } from "../functions/setAntiraidLevel"; -import { AutomodPluginType } from "../types"; +import { sendSuccessMessage } from "../../../pluginUtils.js"; +import { setAntiraidLevel } from "../functions/setAntiraidLevel.js"; +import { AutomodPluginType } from "../types.js"; export const AntiraidClearCmd = guildPluginMessageCommand()({ trigger: ["antiraid clear", "antiraid reset", "antiraid none", "antiraid off"], diff --git a/backend/src/plugins/Automod/commands/SetAntiraidCmd.ts b/backend/src/plugins/Automod/commands/SetAntiraidCmd.ts index 159ff576e..cd942ea09 100644 --- a/backend/src/plugins/Automod/commands/SetAntiraidCmd.ts +++ b/backend/src/plugins/Automod/commands/SetAntiraidCmd.ts @@ -1,8 +1,8 @@ import { guildPluginMessageCommand } from "knub"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { setAntiraidLevel } from "../functions/setAntiraidLevel"; -import { AutomodPluginType } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { setAntiraidLevel } from "../functions/setAntiraidLevel.js"; +import { AutomodPluginType } from "../types.js"; export const SetAntiraidCmd = guildPluginMessageCommand()({ trigger: "antiraid", diff --git a/backend/src/plugins/Automod/commands/ViewAntiraidCmd.ts b/backend/src/plugins/Automod/commands/ViewAntiraidCmd.ts index f25f8e961..15762d2c9 100644 --- a/backend/src/plugins/Automod/commands/ViewAntiraidCmd.ts +++ b/backend/src/plugins/Automod/commands/ViewAntiraidCmd.ts @@ -1,5 +1,5 @@ import { guildPluginMessageCommand } from "knub"; -import { AutomodPluginType } from "../types"; +import { AutomodPluginType } from "../types.js"; export const ViewAntiraidCmd = guildPluginMessageCommand()({ trigger: "antiraid", diff --git a/backend/src/plugins/Automod/constants.ts b/backend/src/plugins/Automod/constants.ts index c2baae776..034122e59 100644 --- a/backend/src/plugins/Automod/constants.ts +++ b/backend/src/plugins/Automod/constants.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { MINUTES, SECONDS } from "../../utils"; +import { MINUTES, SECONDS } from "../../utils.js"; export const RECENT_SPAM_EXPIRY_TIME = 10 * SECONDS; export const RECENT_ACTION_EXPIRY_TIME = 5 * MINUTES; diff --git a/backend/src/plugins/Automod/events/RunAutomodOnJoinLeaveEvt.ts b/backend/src/plugins/Automod/events/RunAutomodOnJoinLeaveEvt.ts index 4cf34db2f..edf4314c1 100644 --- a/backend/src/plugins/Automod/events/RunAutomodOnJoinLeaveEvt.ts +++ b/backend/src/plugins/Automod/events/RunAutomodOnJoinLeaveEvt.ts @@ -1,7 +1,7 @@ import { guildPluginEventListener } from "knub"; -import { RecentActionType } from "../constants"; -import { runAutomod } from "../functions/runAutomod"; -import { AutomodContext, AutomodPluginType } from "../types"; +import { RecentActionType } from "../constants.js"; +import { runAutomod } from "../functions/runAutomod.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export const RunAutomodOnJoinEvt = guildPluginEventListener()({ event: "guildMemberAdd", diff --git a/backend/src/plugins/Automod/events/RunAutomodOnMemberUpdate.ts b/backend/src/plugins/Automod/events/RunAutomodOnMemberUpdate.ts index f6c3518a1..f2d9baf5c 100644 --- a/backend/src/plugins/Automod/events/RunAutomodOnMemberUpdate.ts +++ b/backend/src/plugins/Automod/events/RunAutomodOnMemberUpdate.ts @@ -1,8 +1,8 @@ import { guildPluginEventListener } from "knub"; -import diff from "lodash.difference"; -import isEqual from "lodash.isequal"; -import { runAutomod } from "../functions/runAutomod"; -import { AutomodContext, AutomodPluginType } from "../types"; +import diff from "lodash/difference.js"; +import isEqual from "lodash/isEqual.js"; +import { runAutomod } from "../functions/runAutomod.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export const RunAutomodOnMemberUpdate = guildPluginEventListener()({ event: "guildMemberUpdate", diff --git a/backend/src/plugins/Automod/events/runAutomodOnAntiraidLevel.ts b/backend/src/plugins/Automod/events/runAutomodOnAntiraidLevel.ts index 05dbb6f3e..1ca8e848d 100644 --- a/backend/src/plugins/Automod/events/runAutomodOnAntiraidLevel.ts +++ b/backend/src/plugins/Automod/events/runAutomodOnAntiraidLevel.ts @@ -1,7 +1,7 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { runAutomod } from "../functions/runAutomod"; -import { AutomodContext, AutomodPluginType } from "../types"; +import { runAutomod } from "../functions/runAutomod.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export async function runAutomodOnAntiraidLevel( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/events/runAutomodOnCounterTrigger.ts b/backend/src/plugins/Automod/events/runAutomodOnCounterTrigger.ts index 9de3dae00..b94cc8e78 100644 --- a/backend/src/plugins/Automod/events/runAutomodOnCounterTrigger.ts +++ b/backend/src/plugins/Automod/events/runAutomodOnCounterTrigger.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { resolveMember, resolveUser, UnknownUser } from "../../../utils"; -import { CountersPlugin } from "../../Counters/CountersPlugin"; -import { runAutomod } from "../functions/runAutomod"; -import { AutomodContext, AutomodPluginType } from "../types"; +import { resolveMember, resolveUser, UnknownUser } from "../../../utils.js"; +import { CountersPlugin } from "../../Counters/CountersPlugin.js"; +import { runAutomod } from "../functions/runAutomod.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export async function runAutomodOnCounterTrigger( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/events/runAutomodOnMessage.ts b/backend/src/plugins/Automod/events/runAutomodOnMessage.ts index 915a0cd78..c84972578 100644 --- a/backend/src/plugins/Automod/events/runAutomodOnMessage.ts +++ b/backend/src/plugins/Automod/events/runAutomodOnMessage.ts @@ -1,12 +1,12 @@ import { GuildPluginData } from "knub"; import moment from "moment-timezone"; import { performance } from "perf_hooks"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { profilingEnabled } from "../../../utils/easyProfiler"; -import { addRecentActionsFromMessage } from "../functions/addRecentActionsFromMessage"; -import { clearRecentActionsForMessage } from "../functions/clearRecentActionsForMessage"; -import { runAutomod } from "../functions/runAutomod"; -import { AutomodContext, AutomodPluginType } from "../types"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { profilingEnabled } from "../../../utils/easyProfiler.js"; +import { addRecentActionsFromMessage } from "../functions/addRecentActionsFromMessage.js"; +import { clearRecentActionsForMessage } from "../functions/clearRecentActionsForMessage.js"; +import { runAutomod } from "../functions/runAutomod.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export async function runAutomodOnMessage( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/events/runAutomodOnModAction.ts b/backend/src/plugins/Automod/events/runAutomodOnModAction.ts index cd7e70e45..19273686e 100644 --- a/backend/src/plugins/Automod/events/runAutomodOnModAction.ts +++ b/backend/src/plugins/Automod/events/runAutomodOnModAction.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { resolveMember, resolveUser, UnknownUser } from "../../../utils"; -import { ModActionType } from "../../ModActions/types"; -import { runAutomod } from "../functions/runAutomod"; -import { AutomodContext, AutomodPluginType } from "../types"; +import { resolveMember, resolveUser, UnknownUser } from "../../../utils.js"; +import { ModActionType } from "../../ModActions/types.js"; +import { runAutomod } from "../functions/runAutomod.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export async function runAutomodOnModAction( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/events/runAutomodOnThreadEvents.ts b/backend/src/plugins/Automod/events/runAutomodOnThreadEvents.ts index 977c84266..f428b9ca3 100644 --- a/backend/src/plugins/Automod/events/runAutomodOnThreadEvents.ts +++ b/backend/src/plugins/Automod/events/runAutomodOnThreadEvents.ts @@ -1,7 +1,7 @@ import { guildPluginEventListener } from "knub"; -import { RecentActionType } from "../constants"; -import { runAutomod } from "../functions/runAutomod"; -import { AutomodContext, AutomodPluginType } from "../types"; +import { RecentActionType } from "../constants.js"; +import { runAutomod } from "../functions/runAutomod.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export const RunAutomodOnThreadCreate = guildPluginEventListener()({ event: "threadCreate", diff --git a/backend/src/plugins/Automod/functions/addRecentActionsFromMessage.ts b/backend/src/plugins/Automod/functions/addRecentActionsFromMessage.ts index 9b5b88005..cdcb097fc 100644 --- a/backend/src/plugins/Automod/functions/addRecentActionsFromMessage.ts +++ b/backend/src/plugins/Automod/functions/addRecentActionsFromMessage.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { getEmojiInString, getRoleMentions, getUrlsInString, getUserMentions } from "../../../utils"; -import { RecentActionType } from "../constants"; -import { AutomodContext, AutomodPluginType } from "../types"; +import { getEmojiInString, getRoleMentions, getUrlsInString, getUserMentions } from "../../../utils.js"; +import { RecentActionType } from "../constants.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export function addRecentActionsFromMessage(pluginData: GuildPluginData, context: AutomodContext) { const message = context.message!; diff --git a/backend/src/plugins/Automod/functions/applyCooldown.ts b/backend/src/plugins/Automod/functions/applyCooldown.ts index 387ac448c..ff1bc44d5 100644 --- a/backend/src/plugins/Automod/functions/applyCooldown.ts +++ b/backend/src/plugins/Automod/functions/applyCooldown.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { convertDelayStringToMS } from "../../../utils"; -import { AutomodContext, AutomodPluginType, TRule } from "../types"; +import { convertDelayStringToMS } from "../../../utils.js"; +import { AutomodContext, AutomodPluginType, TRule } from "../types.js"; export function applyCooldown(pluginData: GuildPluginData, rule: TRule, context: AutomodContext) { const cooldownKey = `${rule.name}-${context.user?.id}`; diff --git a/backend/src/plugins/Automod/functions/checkCooldown.ts b/backend/src/plugins/Automod/functions/checkCooldown.ts index 3640c142f..0f45485fd 100644 --- a/backend/src/plugins/Automod/functions/checkCooldown.ts +++ b/backend/src/plugins/Automod/functions/checkCooldown.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { AutomodContext, AutomodPluginType, TRule } from "../types"; +import { AutomodContext, AutomodPluginType, TRule } from "../types.js"; export function checkCooldown(pluginData: GuildPluginData, rule: TRule, context: AutomodContext) { const cooldownKey = `${rule.name}-${context.user?.id}`; diff --git a/backend/src/plugins/Automod/functions/clearOldNicknameChanges.ts b/backend/src/plugins/Automod/functions/clearOldNicknameChanges.ts index 0d720c2d1..5572f294b 100644 --- a/backend/src/plugins/Automod/functions/clearOldNicknameChanges.ts +++ b/backend/src/plugins/Automod/functions/clearOldNicknameChanges.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { RECENT_NICKNAME_CHANGE_EXPIRY_TIME } from "../constants"; -import { AutomodPluginType } from "../types"; +import { RECENT_NICKNAME_CHANGE_EXPIRY_TIME } from "../constants.js"; +import { AutomodPluginType } from "../types.js"; export function clearOldRecentNicknameChanges(pluginData: GuildPluginData) { const now = Date.now(); diff --git a/backend/src/plugins/Automod/functions/clearOldRecentActions.ts b/backend/src/plugins/Automod/functions/clearOldRecentActions.ts index 881f3ff1c..8951ee38b 100644 --- a/backend/src/plugins/Automod/functions/clearOldRecentActions.ts +++ b/backend/src/plugins/Automod/functions/clearOldRecentActions.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { startProfiling } from "../../../utils/easyProfiler"; -import { RECENT_ACTION_EXPIRY_TIME } from "../constants"; -import { AutomodPluginType } from "../types"; +import { startProfiling } from "../../../utils/easyProfiler.js"; +import { RECENT_ACTION_EXPIRY_TIME } from "../constants.js"; +import { AutomodPluginType } from "../types.js"; export function clearOldRecentActions(pluginData: GuildPluginData) { const stopProfiling = startProfiling(pluginData.getKnubInstance().profiler, "automod:fns:clearOldRecentActions"); diff --git a/backend/src/plugins/Automod/functions/clearOldRecentSpam.ts b/backend/src/plugins/Automod/functions/clearOldRecentSpam.ts index f240b2da3..dce2f20c8 100644 --- a/backend/src/plugins/Automod/functions/clearOldRecentSpam.ts +++ b/backend/src/plugins/Automod/functions/clearOldRecentSpam.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { startProfiling } from "../../../utils/easyProfiler"; -import { RECENT_SPAM_EXPIRY_TIME } from "../constants"; -import { AutomodPluginType } from "../types"; +import { startProfiling } from "../../../utils/easyProfiler.js"; +import { RECENT_SPAM_EXPIRY_TIME } from "../constants.js"; +import { AutomodPluginType } from "../types.js"; export function clearOldRecentSpam(pluginData: GuildPluginData) { const stopProfiling = startProfiling(pluginData.getKnubInstance().profiler, "automod:fns:clearOldRecentSpam"); diff --git a/backend/src/plugins/Automod/functions/clearRecentActionsForMessage.ts b/backend/src/plugins/Automod/functions/clearRecentActionsForMessage.ts index 6f1fcdb67..69e188c12 100644 --- a/backend/src/plugins/Automod/functions/clearRecentActionsForMessage.ts +++ b/backend/src/plugins/Automod/functions/clearRecentActionsForMessage.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { startProfiling } from "../../../utils/easyProfiler"; -import { AutomodContext, AutomodPluginType } from "../types"; +import { startProfiling } from "../../../utils/easyProfiler.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; export function clearRecentActionsForMessage(pluginData: GuildPluginData, context: AutomodContext) { const stopProfiling = startProfiling( diff --git a/backend/src/plugins/Automod/functions/createMessageSpamTrigger.ts b/backend/src/plugins/Automod/functions/createMessageSpamTrigger.ts index 605a4e986..366d87468 100644 --- a/backend/src/plugins/Automod/functions/createMessageSpamTrigger.ts +++ b/backend/src/plugins/Automod/functions/createMessageSpamTrigger.ts @@ -1,13 +1,13 @@ import z from "zod"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { humanizeDurationShort } from "../../../humanizeDurationShort"; -import { getBaseUrl } from "../../../pluginUtils"; -import { convertDelayStringToMS, sorter, zDelayString } from "../../../utils"; -import { RecentActionType } from "../constants"; -import { automodTrigger } from "../helpers"; -import { findRecentSpam } from "./findRecentSpam"; -import { getMatchingMessageRecentActions } from "./getMatchingMessageRecentActions"; -import { getMessageSpamIdentifier } from "./getSpamIdentifier"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { humanizeDurationShort } from "../../../humanizeDurationShort.js"; +import { getBaseUrl } from "../../../pluginUtils.js"; +import { convertDelayStringToMS, sorter, zDelayString } from "../../../utils.js"; +import { RecentActionType } from "../constants.js"; +import { automodTrigger } from "../helpers.js"; +import { findRecentSpam } from "./findRecentSpam.js"; +import { getMatchingMessageRecentActions } from "./getMatchingMessageRecentActions.js"; +import { getMessageSpamIdentifier } from "./getSpamIdentifier.js"; export interface TMessageSpamMatchResultType { archiveId: string; diff --git a/backend/src/plugins/Automod/functions/findRecentSpam.ts b/backend/src/plugins/Automod/functions/findRecentSpam.ts index 93553b837..d13a0bc1a 100644 --- a/backend/src/plugins/Automod/functions/findRecentSpam.ts +++ b/backend/src/plugins/Automod/functions/findRecentSpam.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { startProfiling } from "../../../utils/easyProfiler"; -import { RecentActionType } from "../constants"; -import { AutomodPluginType } from "../types"; +import { startProfiling } from "../../../utils/easyProfiler.js"; +import { RecentActionType } from "../constants.js"; +import { AutomodPluginType } from "../types.js"; export function findRecentSpam( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/functions/getMatchingMessageRecentActions.ts b/backend/src/plugins/Automod/functions/getMatchingMessageRecentActions.ts index 99dae7162..6e509ac84 100644 --- a/backend/src/plugins/Automod/functions/getMatchingMessageRecentActions.ts +++ b/backend/src/plugins/Automod/functions/getMatchingMessageRecentActions.ts @@ -1,10 +1,10 @@ import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { startProfiling } from "../../../utils/easyProfiler"; -import { RecentActionType } from "../constants"; -import { AutomodPluginType } from "../types"; -import { getMatchingRecentActions } from "./getMatchingRecentActions"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { startProfiling } from "../../../utils/easyProfiler.js"; +import { RecentActionType } from "../constants.js"; +import { AutomodPluginType } from "../types.js"; +import { getMatchingRecentActions } from "./getMatchingRecentActions.js"; export function getMatchingMessageRecentActions( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/functions/getMatchingRecentActions.ts b/backend/src/plugins/Automod/functions/getMatchingRecentActions.ts index b22817c43..9262124be 100644 --- a/backend/src/plugins/Automod/functions/getMatchingRecentActions.ts +++ b/backend/src/plugins/Automod/functions/getMatchingRecentActions.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { startProfiling } from "../../../utils/easyProfiler"; -import { RecentActionType } from "../constants"; -import { AutomodPluginType } from "../types"; +import { startProfiling } from "../../../utils/easyProfiler.js"; +import { RecentActionType } from "../constants.js"; +import { AutomodPluginType } from "../types.js"; export function getMatchingRecentActions( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/functions/getSpamIdentifier.ts b/backend/src/plugins/Automod/functions/getSpamIdentifier.ts index 084332a43..e76e5f87e 100644 --- a/backend/src/plugins/Automod/functions/getSpamIdentifier.ts +++ b/backend/src/plugins/Automod/functions/getSpamIdentifier.ts @@ -1,4 +1,4 @@ -import { SavedMessage } from "../../../data/entities/SavedMessage"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; export function getMessageSpamIdentifier(message: SavedMessage, perChannel: boolean) { return perChannel ? `${message.channel_id}-${message.user_id}` : message.user_id; diff --git a/backend/src/plugins/Automod/functions/getTextMatchPartialSummary.ts b/backend/src/plugins/Automod/functions/getTextMatchPartialSummary.ts index 3d7e993f2..3feb5eea2 100644 --- a/backend/src/plugins/Automod/functions/getTextMatchPartialSummary.ts +++ b/backend/src/plugins/Automod/functions/getTextMatchPartialSummary.ts @@ -1,8 +1,8 @@ import { ActivityType, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { messageSummary, verboseChannelMention } from "../../../utils"; -import { AutomodContext, AutomodPluginType } from "../types"; -import { MatchableTextType } from "./matchMultipleTextTypesOnMessage"; +import { messageSummary, verboseChannelMention } from "../../../utils.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; +import { MatchableTextType } from "./matchMultipleTextTypesOnMessage.js"; export function getTextMatchPartialSummary( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/functions/ignoredRoleChanges.ts b/backend/src/plugins/Automod/functions/ignoredRoleChanges.ts index a8314a850..773368771 100644 --- a/backend/src/plugins/Automod/functions/ignoredRoleChanges.ts +++ b/backend/src/plugins/Automod/functions/ignoredRoleChanges.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { MINUTES } from "../../../utils"; -import { AutomodPluginType } from "../types"; +import { MINUTES } from "../../../utils.js"; +import { AutomodPluginType } from "../types.js"; const IGNORED_ROLE_CHANGE_LIFETIME = 5 * MINUTES; diff --git a/backend/src/plugins/Automod/functions/matchMultipleTextTypesOnMessage.ts b/backend/src/plugins/Automod/functions/matchMultipleTextTypesOnMessage.ts index a82c526ef..2152b4c2c 100644 --- a/backend/src/plugins/Automod/functions/matchMultipleTextTypesOnMessage.ts +++ b/backend/src/plugins/Automod/functions/matchMultipleTextTypesOnMessage.ts @@ -1,9 +1,9 @@ import { ActivityType, Embed } from "discord.js"; import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { renderUsername, resolveMember } from "../../../utils"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { renderUsername, resolveMember } from "../../../utils.js"; import { DeepMutable } from "../../../utils/typeUtils.js"; -import { AutomodPluginType } from "../types"; +import { AutomodPluginType } from "../types.js"; type TextTriggerWithMultipleMatchTypes = { match_messages: boolean; diff --git a/backend/src/plugins/Automod/functions/resolveActionContactMethods.ts b/backend/src/plugins/Automod/functions/resolveActionContactMethods.ts index 24d3ac6ac..93a0846da 100644 --- a/backend/src/plugins/Automod/functions/resolveActionContactMethods.ts +++ b/backend/src/plugins/Automod/functions/resolveActionContactMethods.ts @@ -1,8 +1,8 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; -import { UserNotificationMethod, disableUserNotificationStrings } from "../../../utils"; -import { AutomodPluginType } from "../types"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; +import { UserNotificationMethod, disableUserNotificationStrings } from "../../../utils.js"; +import { AutomodPluginType } from "../types.js"; export function resolveActionContactMethods( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/functions/runAutomod.ts b/backend/src/plugins/Automod/functions/runAutomod.ts index 4ccc38dee..8d3e78eb2 100644 --- a/backend/src/plugins/Automod/functions/runAutomod.ts +++ b/backend/src/plugins/Automod/functions/runAutomod.ts @@ -1,14 +1,14 @@ import { GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import { performance } from "perf_hooks"; -import { calculateBlocking, profilingEnabled } from "../../../utils/easyProfiler"; -import { availableActions } from "../actions/availableActions"; -import { CleanAction } from "../actions/clean"; -import { AutomodTriggerMatchResult } from "../helpers"; -import { availableTriggers } from "../triggers/availableTriggers"; -import { AutomodContext, AutomodPluginType } from "../types"; -import { applyCooldown } from "./applyCooldown"; -import { checkCooldown } from "./checkCooldown"; +import { calculateBlocking, profilingEnabled } from "../../../utils/easyProfiler.js"; +import { availableActions } from "../actions/availableActions.js"; +import { CleanAction } from "../actions/clean.js"; +import { AutomodTriggerMatchResult } from "../helpers.js"; +import { availableTriggers } from "../triggers/availableTriggers.js"; +import { AutomodContext, AutomodPluginType } from "../types.js"; +import { applyCooldown } from "./applyCooldown.js"; +import { checkCooldown } from "./checkCooldown.js"; export async function runAutomod(pluginData: GuildPluginData, context: AutomodContext) { const userId = context.user?.id || context.member?.id || context.message?.user_id; diff --git a/backend/src/plugins/Automod/functions/setAntiraidLevel.ts b/backend/src/plugins/Automod/functions/setAntiraidLevel.ts index c76555c22..a32155d12 100644 --- a/backend/src/plugins/Automod/functions/setAntiraidLevel.ts +++ b/backend/src/plugins/Automod/functions/setAntiraidLevel.ts @@ -1,8 +1,8 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { runAutomodOnAntiraidLevel } from "../events/runAutomodOnAntiraidLevel"; -import { AutomodPluginType } from "../types"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { runAutomodOnAntiraidLevel } from "../events/runAutomodOnAntiraidLevel.js"; +import { AutomodPluginType } from "../types.js"; export async function setAntiraidLevel( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Automod/functions/sumRecentActionCounts.ts b/backend/src/plugins/Automod/functions/sumRecentActionCounts.ts index 021e44e66..0da9a5d19 100644 --- a/backend/src/plugins/Automod/functions/sumRecentActionCounts.ts +++ b/backend/src/plugins/Automod/functions/sumRecentActionCounts.ts @@ -1,4 +1,4 @@ -import { RecentAction } from "../types"; +import { RecentAction } from "../types.js"; export function sumRecentActionCounts(actions: RecentAction[]) { return actions.reduce((total, action) => total + action.count, 0); diff --git a/backend/src/plugins/Automod/helpers.ts b/backend/src/plugins/Automod/helpers.ts index b4b9f764d..61d680762 100644 --- a/backend/src/plugins/Automod/helpers.ts +++ b/backend/src/plugins/Automod/helpers.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; import z, { ZodTypeAny } from "zod"; -import { Awaitable } from "../../utils/typeUtils"; -import { AutomodContext, AutomodPluginType } from "./types"; +import { Awaitable } from "../../utils/typeUtils.js"; +import { AutomodContext, AutomodPluginType } from "./types.js"; interface BaseAutomodTriggerMatchResult { extraContexts?: AutomodContext[]; diff --git a/backend/src/plugins/Automod/info.ts b/backend/src/plugins/Automod/info.ts index d33d628fb..7dd945604 100644 --- a/backend/src/plugins/Automod/info.ts +++ b/backend/src/plugins/Automod/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; export const automodPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Automod/triggers/antiraidLevel.ts b/backend/src/plugins/Automod/triggers/antiraidLevel.ts index c1467bf8e..1aacbd4d6 100644 --- a/backend/src/plugins/Automod/triggers/antiraidLevel.ts +++ b/backend/src/plugins/Automod/triggers/antiraidLevel.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; interface AntiraidLevelTriggerResult {} diff --git a/backend/src/plugins/Automod/triggers/anyMessage.ts b/backend/src/plugins/Automod/triggers/anyMessage.ts index 71c92019b..84f614262 100644 --- a/backend/src/plugins/Automod/triggers/anyMessage.ts +++ b/backend/src/plugins/Automod/triggers/anyMessage.ts @@ -1,7 +1,7 @@ import { Snowflake } from "discord.js"; import z from "zod"; -import { verboseChannelMention } from "../../../utils"; -import { automodTrigger } from "../helpers"; +import { verboseChannelMention } from "../../../utils.js"; +import { automodTrigger } from "../helpers.js"; interface AnyMessageResultType {} diff --git a/backend/src/plugins/Automod/triggers/attachmentSpam.ts b/backend/src/plugins/Automod/triggers/attachmentSpam.ts index 79c46d84f..9d8e991ba 100644 --- a/backend/src/plugins/Automod/triggers/attachmentSpam.ts +++ b/backend/src/plugins/Automod/triggers/attachmentSpam.ts @@ -1,4 +1,4 @@ -import { RecentActionType } from "../constants"; -import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger"; +import { RecentActionType } from "../constants.js"; +import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger.js"; export const AttachmentSpamTrigger = createMessageSpamTrigger(RecentActionType.Attachment, "attachment"); diff --git a/backend/src/plugins/Automod/triggers/availableTriggers.ts b/backend/src/plugins/Automod/triggers/availableTriggers.ts index a2ac60fba..04f8fc1f2 100644 --- a/backend/src/plugins/Automod/triggers/availableTriggers.ts +++ b/backend/src/plugins/Automod/triggers/availableTriggers.ts @@ -1,38 +1,38 @@ -import { AutomodTriggerBlueprint } from "../helpers"; -import { AntiraidLevelTrigger } from "./antiraidLevel"; -import { AnyMessageTrigger } from "./anyMessage"; -import { AttachmentSpamTrigger } from "./attachmentSpam"; -import { BanTrigger } from "./ban"; -import { CharacterSpamTrigger } from "./characterSpam"; -import { CounterTrigger } from "./counterTrigger"; -import { EmojiSpamTrigger } from "./emojiSpam"; -import { KickTrigger } from "./kick"; -import { LineSpamTrigger } from "./lineSpam"; -import { LinkSpamTrigger } from "./linkSpam"; -import { MatchAttachmentTypeTrigger } from "./matchAttachmentType"; -import { MatchInvitesTrigger } from "./matchInvites"; -import { MatchLinksTrigger } from "./matchLinks"; -import { MatchMimeTypeTrigger } from "./matchMimeType"; -import { MatchRegexTrigger } from "./matchRegex"; -import { MatchWordsTrigger } from "./matchWords"; -import { MemberJoinTrigger } from "./memberJoin"; -import { MemberJoinSpamTrigger } from "./memberJoinSpam"; -import { MemberLeaveTrigger } from "./memberLeave"; -import { MentionSpamTrigger } from "./mentionSpam"; -import { MessageSpamTrigger } from "./messageSpam"; -import { MuteTrigger } from "./mute"; -import { NoteTrigger } from "./note"; -import { RoleAddedTrigger } from "./roleAdded"; -import { RoleRemovedTrigger } from "./roleRemoved"; -import { StickerSpamTrigger } from "./stickerSpam"; -import { ThreadArchiveTrigger } from "./threadArchive"; -import { ThreadCreateTrigger } from "./threadCreate"; -import { ThreadCreateSpamTrigger } from "./threadCreateSpam"; -import { ThreadDeleteTrigger } from "./threadDelete"; -import { ThreadUnarchiveTrigger } from "./threadUnarchive"; -import { UnbanTrigger } from "./unban"; -import { UnmuteTrigger } from "./unmute"; -import { WarnTrigger } from "./warn"; +import { AutomodTriggerBlueprint } from "../helpers.js"; +import { AntiraidLevelTrigger } from "./antiraidLevel.js"; +import { AnyMessageTrigger } from "./anyMessage.js"; +import { AttachmentSpamTrigger } from "./attachmentSpam.js"; +import { BanTrigger } from "./ban.js"; +import { CharacterSpamTrigger } from "./characterSpam.js"; +import { CounterTrigger } from "./counterTrigger.js"; +import { EmojiSpamTrigger } from "./emojiSpam.js"; +import { KickTrigger } from "./kick.js"; +import { LineSpamTrigger } from "./lineSpam.js"; +import { LinkSpamTrigger } from "./linkSpam.js"; +import { MatchAttachmentTypeTrigger } from "./matchAttachmentType.js"; +import { MatchInvitesTrigger } from "./matchInvites.js"; +import { MatchLinksTrigger } from "./matchLinks.js"; +import { MatchMimeTypeTrigger } from "./matchMimeType.js"; +import { MatchRegexTrigger } from "./matchRegex.js"; +import { MatchWordsTrigger } from "./matchWords.js"; +import { MemberJoinTrigger } from "./memberJoin.js"; +import { MemberJoinSpamTrigger } from "./memberJoinSpam.js"; +import { MemberLeaveTrigger } from "./memberLeave.js"; +import { MentionSpamTrigger } from "./mentionSpam.js"; +import { MessageSpamTrigger } from "./messageSpam.js"; +import { MuteTrigger } from "./mute.js"; +import { NoteTrigger } from "./note.js"; +import { RoleAddedTrigger } from "./roleAdded.js"; +import { RoleRemovedTrigger } from "./roleRemoved.js"; +import { StickerSpamTrigger } from "./stickerSpam.js"; +import { ThreadArchiveTrigger } from "./threadArchive.js"; +import { ThreadCreateTrigger } from "./threadCreate.js"; +import { ThreadCreateSpamTrigger } from "./threadCreateSpam.js"; +import { ThreadDeleteTrigger } from "./threadDelete.js"; +import { ThreadUnarchiveTrigger } from "./threadUnarchive.js"; +import { UnbanTrigger } from "./unban.js"; +import { UnmuteTrigger } from "./unmute.js"; +import { WarnTrigger } from "./warn.js"; export const availableTriggers: Record> = { any_message: AnyMessageTrigger, diff --git a/backend/src/plugins/Automod/triggers/ban.ts b/backend/src/plugins/Automod/triggers/ban.ts index f6df0fd68..5ed8180d1 100644 --- a/backend/src/plugins/Automod/triggers/ban.ts +++ b/backend/src/plugins/Automod/triggers/ban.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; // tslint:disable-next-line:no-empty-interface interface BanTriggerResultType {} diff --git a/backend/src/plugins/Automod/triggers/characterSpam.ts b/backend/src/plugins/Automod/triggers/characterSpam.ts index 5412ffb20..ec0f7ac09 100644 --- a/backend/src/plugins/Automod/triggers/characterSpam.ts +++ b/backend/src/plugins/Automod/triggers/characterSpam.ts @@ -1,4 +1,4 @@ -import { RecentActionType } from "../constants"; -import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger"; +import { RecentActionType } from "../constants.js"; +import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger.js"; export const CharacterSpamTrigger = createMessageSpamTrigger(RecentActionType.Character, "character"); diff --git a/backend/src/plugins/Automod/triggers/counterTrigger.ts b/backend/src/plugins/Automod/triggers/counterTrigger.ts index 22de3df1d..a9866eea2 100644 --- a/backend/src/plugins/Automod/triggers/counterTrigger.ts +++ b/backend/src/plugins/Automod/triggers/counterTrigger.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; // tslint:disable-next-line interface CounterTriggerResult {} diff --git a/backend/src/plugins/Automod/triggers/emojiSpam.ts b/backend/src/plugins/Automod/triggers/emojiSpam.ts index 018cb8919..608d6c2da 100644 --- a/backend/src/plugins/Automod/triggers/emojiSpam.ts +++ b/backend/src/plugins/Automod/triggers/emojiSpam.ts @@ -1,4 +1,4 @@ -import { RecentActionType } from "../constants"; -import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger"; +import { RecentActionType } from "../constants.js"; +import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger.js"; export const EmojiSpamTrigger = createMessageSpamTrigger(RecentActionType.Emoji, "emoji"); diff --git a/backend/src/plugins/Automod/triggers/exampleTrigger.ts b/backend/src/plugins/Automod/triggers/exampleTrigger.ts index e6005e072..90424996b 100644 --- a/backend/src/plugins/Automod/triggers/exampleTrigger.ts +++ b/backend/src/plugins/Automod/triggers/exampleTrigger.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; interface ExampleMatchResultType { isBanana: boolean; diff --git a/backend/src/plugins/Automod/triggers/kick.ts b/backend/src/plugins/Automod/triggers/kick.ts index add6803e0..266ab7a7c 100644 --- a/backend/src/plugins/Automod/triggers/kick.ts +++ b/backend/src/plugins/Automod/triggers/kick.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; // tslint:disable-next-line:no-empty-interface interface KickTriggerResultType {} diff --git a/backend/src/plugins/Automod/triggers/lineSpam.ts b/backend/src/plugins/Automod/triggers/lineSpam.ts index 2a54f1b48..391d9fcba 100644 --- a/backend/src/plugins/Automod/triggers/lineSpam.ts +++ b/backend/src/plugins/Automod/triggers/lineSpam.ts @@ -1,4 +1,4 @@ -import { RecentActionType } from "../constants"; -import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger"; +import { RecentActionType } from "../constants.js"; +import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger.js"; export const LineSpamTrigger = createMessageSpamTrigger(RecentActionType.Line, "line"); diff --git a/backend/src/plugins/Automod/triggers/linkSpam.ts b/backend/src/plugins/Automod/triggers/linkSpam.ts index 0278d8d59..b987eb4ce 100644 --- a/backend/src/plugins/Automod/triggers/linkSpam.ts +++ b/backend/src/plugins/Automod/triggers/linkSpam.ts @@ -1,4 +1,4 @@ -import { RecentActionType } from "../constants"; -import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger"; +import { RecentActionType } from "../constants.js"; +import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger.js"; export const LinkSpamTrigger = createMessageSpamTrigger(RecentActionType.Link, "link"); diff --git a/backend/src/plugins/Automod/triggers/matchAttachmentType.ts b/backend/src/plugins/Automod/triggers/matchAttachmentType.ts index 8c562eb1c..5c871cc50 100644 --- a/backend/src/plugins/Automod/triggers/matchAttachmentType.ts +++ b/backend/src/plugins/Automod/triggers/matchAttachmentType.ts @@ -1,8 +1,8 @@ import { escapeInlineCode, Snowflake } from "discord.js"; import { extname } from "path"; import z from "zod"; -import { asSingleLine, messageSummary, verboseChannelMention } from "../../../utils"; -import { automodTrigger } from "../helpers"; +import { asSingleLine, messageSummary, verboseChannelMention } from "../../../utils.js"; +import { automodTrigger } from "../helpers.js"; interface MatchResultType { matchedType: string; diff --git a/backend/src/plugins/Automod/triggers/matchInvites.ts b/backend/src/plugins/Automod/triggers/matchInvites.ts index 4ea7c3cd6..54c881c9a 100644 --- a/backend/src/plugins/Automod/triggers/matchInvites.ts +++ b/backend/src/plugins/Automod/triggers/matchInvites.ts @@ -1,8 +1,8 @@ import z from "zod"; -import { getInviteCodesInString, GuildInvite, isGuildInvite, resolveInvite, zSnowflake } from "../../../utils"; -import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary"; -import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage"; -import { automodTrigger } from "../helpers"; +import { getInviteCodesInString, GuildInvite, isGuildInvite, resolveInvite, zSnowflake } from "../../../utils.js"; +import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary.js"; +import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage.js"; +import { automodTrigger } from "../helpers.js"; interface MatchResultType { type: MatchableTextType; diff --git a/backend/src/plugins/Automod/triggers/matchLinks.ts b/backend/src/plugins/Automod/triggers/matchLinks.ts index c43d83203..e40be002c 100644 --- a/backend/src/plugins/Automod/triggers/matchLinks.ts +++ b/backend/src/plugins/Automod/triggers/matchLinks.ts @@ -1,14 +1,14 @@ import { escapeInlineCode } from "discord.js"; import z from "zod"; -import { allowTimeout } from "../../../RegExpRunner"; -import { phishermanDomainIsSafe } from "../../../data/Phisherman"; -import { getUrlsInString, zRegex } from "../../../utils"; -import { mergeRegexes } from "../../../utils/mergeRegexes"; -import { mergeWordsIntoRegex } from "../../../utils/mergeWordsIntoRegex"; -import { PhishermanPlugin } from "../../Phisherman/PhishermanPlugin"; -import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary"; -import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage"; -import { automodTrigger } from "../helpers"; +import { allowTimeout } from "../../../RegExpRunner.js"; +import { phishermanDomainIsSafe } from "../../../data/Phisherman.js"; +import { getUrlsInString, zRegex } from "../../../utils.js"; +import { mergeRegexes } from "../../../utils/mergeRegexes.js"; +import { mergeWordsIntoRegex } from "../../../utils/mergeWordsIntoRegex.js"; +import { PhishermanPlugin } from "../../Phisherman/PhishermanPlugin.js"; +import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary.js"; +import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage.js"; +import { automodTrigger } from "../helpers.js"; interface MatchResultType { type: MatchableTextType; diff --git a/backend/src/plugins/Automod/triggers/matchMimeType.ts b/backend/src/plugins/Automod/triggers/matchMimeType.ts index 862329168..725665e4e 100644 --- a/backend/src/plugins/Automod/triggers/matchMimeType.ts +++ b/backend/src/plugins/Automod/triggers/matchMimeType.ts @@ -1,7 +1,7 @@ import { escapeInlineCode } from "discord.js"; import z from "zod"; -import { asSingleLine, messageSummary, verboseChannelMention } from "../../../utils"; -import { automodTrigger } from "../helpers"; +import { asSingleLine, messageSummary, verboseChannelMention } from "../../../utils.js"; +import { automodTrigger } from "../helpers.js"; interface MatchResultType { matchedType: string; diff --git a/backend/src/plugins/Automod/triggers/matchRegex.ts b/backend/src/plugins/Automod/triggers/matchRegex.ts index 41df0396b..507d4bc6e 100644 --- a/backend/src/plugins/Automod/triggers/matchRegex.ts +++ b/backend/src/plugins/Automod/triggers/matchRegex.ts @@ -1,12 +1,12 @@ import z from "zod"; -import { allowTimeout } from "../../../RegExpRunner"; -import { zRegex } from "../../../utils"; -import { mergeRegexes } from "../../../utils/mergeRegexes"; -import { normalizeText } from "../../../utils/normalizeText"; -import { stripMarkdown } from "../../../utils/stripMarkdown"; -import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary"; -import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage"; -import { automodTrigger } from "../helpers"; +import { allowTimeout } from "../../../RegExpRunner.js"; +import { zRegex } from "../../../utils.js"; +import { mergeRegexes } from "../../../utils/mergeRegexes.js"; +import { normalizeText } from "../../../utils/normalizeText.js"; +import { stripMarkdown } from "../../../utils/stripMarkdown.js"; +import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary.js"; +import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage.js"; +import { automodTrigger } from "../helpers.js"; interface MatchResultType { pattern: string; diff --git a/backend/src/plugins/Automod/triggers/matchWords.ts b/backend/src/plugins/Automod/triggers/matchWords.ts index df3ee3664..ef3f0ca2d 100644 --- a/backend/src/plugins/Automod/triggers/matchWords.ts +++ b/backend/src/plugins/Automod/triggers/matchWords.ts @@ -1,10 +1,10 @@ import escapeStringRegexp from "escape-string-regexp"; import z from "zod"; -import { normalizeText } from "../../../utils/normalizeText"; -import { stripMarkdown } from "../../../utils/stripMarkdown"; -import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary"; -import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage"; -import { automodTrigger } from "../helpers"; +import { normalizeText } from "../../../utils/normalizeText.js"; +import { stripMarkdown } from "../../../utils/stripMarkdown.js"; +import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary.js"; +import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage.js"; +import { automodTrigger } from "../helpers.js"; interface MatchResultType { word: string; diff --git a/backend/src/plugins/Automod/triggers/memberJoin.ts b/backend/src/plugins/Automod/triggers/memberJoin.ts index af9a1fae5..4d694e421 100644 --- a/backend/src/plugins/Automod/triggers/memberJoin.ts +++ b/backend/src/plugins/Automod/triggers/memberJoin.ts @@ -1,6 +1,6 @@ import z from "zod"; -import { convertDelayStringToMS, zDelayString } from "../../../utils"; -import { automodTrigger } from "../helpers"; +import { convertDelayStringToMS, zDelayString } from "../../../utils.js"; +import { automodTrigger } from "../helpers.js"; const configSchema = z.strictObject({ only_new: z.boolean().default(false), diff --git a/backend/src/plugins/Automod/triggers/memberJoinSpam.ts b/backend/src/plugins/Automod/triggers/memberJoinSpam.ts index e346a8d34..3e53a62da 100644 --- a/backend/src/plugins/Automod/triggers/memberJoinSpam.ts +++ b/backend/src/plugins/Automod/triggers/memberJoinSpam.ts @@ -1,10 +1,10 @@ import z from "zod"; -import { convertDelayStringToMS, zDelayString } from "../../../utils"; -import { RecentActionType } from "../constants"; -import { findRecentSpam } from "../functions/findRecentSpam"; -import { getMatchingRecentActions } from "../functions/getMatchingRecentActions"; -import { sumRecentActionCounts } from "../functions/sumRecentActionCounts"; -import { automodTrigger } from "../helpers"; +import { convertDelayStringToMS, zDelayString } from "../../../utils.js"; +import { RecentActionType } from "../constants.js"; +import { findRecentSpam } from "../functions/findRecentSpam.js"; +import { getMatchingRecentActions } from "../functions/getMatchingRecentActions.js"; +import { sumRecentActionCounts } from "../functions/sumRecentActionCounts.js"; +import { automodTrigger } from "../helpers.js"; const configSchema = z.strictObject({ amount: z.number().int(), diff --git a/backend/src/plugins/Automod/triggers/memberLeave.ts b/backend/src/plugins/Automod/triggers/memberLeave.ts index fa9f37a8b..2c6bb9f2e 100644 --- a/backend/src/plugins/Automod/triggers/memberLeave.ts +++ b/backend/src/plugins/Automod/triggers/memberLeave.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; const configSchema = z.strictObject({}); diff --git a/backend/src/plugins/Automod/triggers/mentionSpam.ts b/backend/src/plugins/Automod/triggers/mentionSpam.ts index fdcd8f46b..5b5c73266 100644 --- a/backend/src/plugins/Automod/triggers/mentionSpam.ts +++ b/backend/src/plugins/Automod/triggers/mentionSpam.ts @@ -1,4 +1,4 @@ -import { RecentActionType } from "../constants"; -import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger"; +import { RecentActionType } from "../constants.js"; +import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger.js"; export const MentionSpamTrigger = createMessageSpamTrigger(RecentActionType.Mention, "mention"); diff --git a/backend/src/plugins/Automod/triggers/messageSpam.ts b/backend/src/plugins/Automod/triggers/messageSpam.ts index 91b4f63b7..85e686f95 100644 --- a/backend/src/plugins/Automod/triggers/messageSpam.ts +++ b/backend/src/plugins/Automod/triggers/messageSpam.ts @@ -1,4 +1,4 @@ -import { RecentActionType } from "../constants"; -import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger"; +import { RecentActionType } from "../constants.js"; +import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger.js"; export const MessageSpamTrigger = createMessageSpamTrigger(RecentActionType.Message, "message"); diff --git a/backend/src/plugins/Automod/triggers/mute.ts b/backend/src/plugins/Automod/triggers/mute.ts index dcaf96c52..b8be5713a 100644 --- a/backend/src/plugins/Automod/triggers/mute.ts +++ b/backend/src/plugins/Automod/triggers/mute.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; // tslint:disable-next-line:no-empty-interface interface MuteTriggerResultType {} diff --git a/backend/src/plugins/Automod/triggers/note.ts b/backend/src/plugins/Automod/triggers/note.ts index eeaa2c27d..22ccc40fc 100644 --- a/backend/src/plugins/Automod/triggers/note.ts +++ b/backend/src/plugins/Automod/triggers/note.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; // tslint:disable-next-line:no-empty-interface interface NoteTriggerResultType {} diff --git a/backend/src/plugins/Automod/triggers/roleAdded.ts b/backend/src/plugins/Automod/triggers/roleAdded.ts index 5a9ee3af4..584a7a204 100644 --- a/backend/src/plugins/Automod/triggers/roleAdded.ts +++ b/backend/src/plugins/Automod/triggers/roleAdded.ts @@ -1,8 +1,8 @@ import { Snowflake } from "discord.js"; import z from "zod"; -import { renderUsername, zSnowflake } from "../../../utils"; -import { consumeIgnoredRoleChange } from "../functions/ignoredRoleChanges"; -import { automodTrigger } from "../helpers"; +import { renderUsername, zSnowflake } from "../../../utils.js"; +import { consumeIgnoredRoleChange } from "../functions/ignoredRoleChanges.js"; +import { automodTrigger } from "../helpers.js"; interface RoleAddedMatchResult { matchedRoleId: string; diff --git a/backend/src/plugins/Automod/triggers/roleRemoved.ts b/backend/src/plugins/Automod/triggers/roleRemoved.ts index 82479c0ec..3ce924744 100644 --- a/backend/src/plugins/Automod/triggers/roleRemoved.ts +++ b/backend/src/plugins/Automod/triggers/roleRemoved.ts @@ -1,8 +1,8 @@ import { Snowflake } from "discord.js"; import z from "zod"; -import { renderUsername, zSnowflake } from "../../../utils"; -import { consumeIgnoredRoleChange } from "../functions/ignoredRoleChanges"; -import { automodTrigger } from "../helpers"; +import { renderUsername, zSnowflake } from "../../../utils.js"; +import { consumeIgnoredRoleChange } from "../functions/ignoredRoleChanges.js"; +import { automodTrigger } from "../helpers.js"; interface RoleAddedMatchResult { matchedRoleId: string; diff --git a/backend/src/plugins/Automod/triggers/stickerSpam.ts b/backend/src/plugins/Automod/triggers/stickerSpam.ts index 05fcbc459..9d0ac9355 100644 --- a/backend/src/plugins/Automod/triggers/stickerSpam.ts +++ b/backend/src/plugins/Automod/triggers/stickerSpam.ts @@ -1,4 +1,4 @@ -import { RecentActionType } from "../constants"; -import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger"; +import { RecentActionType } from "../constants.js"; +import { createMessageSpamTrigger } from "../functions/createMessageSpamTrigger.js"; export const StickerSpamTrigger = createMessageSpamTrigger(RecentActionType.Sticker, "sticker"); diff --git a/backend/src/plugins/Automod/triggers/threadArchive.ts b/backend/src/plugins/Automod/triggers/threadArchive.ts index c9f7b75e6..599f64c48 100644 --- a/backend/src/plugins/Automod/triggers/threadArchive.ts +++ b/backend/src/plugins/Automod/triggers/threadArchive.ts @@ -1,7 +1,7 @@ import { User, escapeBold, type Snowflake } from "discord.js"; import z from "zod"; -import { renderUsername } from "../../../utils"; -import { automodTrigger } from "../helpers"; +import { renderUsername } from "../../../utils.js"; +import { automodTrigger } from "../helpers.js"; interface ThreadArchiveResult { matchedThreadId: Snowflake; diff --git a/backend/src/plugins/Automod/triggers/threadCreate.ts b/backend/src/plugins/Automod/triggers/threadCreate.ts index 1e8a23e69..5f1e6db21 100644 --- a/backend/src/plugins/Automod/triggers/threadCreate.ts +++ b/backend/src/plugins/Automod/triggers/threadCreate.ts @@ -1,7 +1,7 @@ import { User, escapeBold, type Snowflake } from "discord.js"; import z from "zod"; import { renderUsername } from "../../../utils.js"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; interface ThreadCreateResult { matchedThreadId: Snowflake; diff --git a/backend/src/plugins/Automod/triggers/threadCreateSpam.ts b/backend/src/plugins/Automod/triggers/threadCreateSpam.ts index a4352c118..ff01b165b 100644 --- a/backend/src/plugins/Automod/triggers/threadCreateSpam.ts +++ b/backend/src/plugins/Automod/triggers/threadCreateSpam.ts @@ -1,10 +1,10 @@ import z from "zod"; -import { convertDelayStringToMS, zDelayString } from "../../../utils"; -import { RecentActionType } from "../constants"; -import { findRecentSpam } from "../functions/findRecentSpam"; -import { getMatchingRecentActions } from "../functions/getMatchingRecentActions"; -import { sumRecentActionCounts } from "../functions/sumRecentActionCounts"; -import { automodTrigger } from "../helpers"; +import { convertDelayStringToMS, zDelayString } from "../../../utils.js"; +import { RecentActionType } from "../constants.js"; +import { findRecentSpam } from "../functions/findRecentSpam.js"; +import { getMatchingRecentActions } from "../functions/getMatchingRecentActions.js"; +import { sumRecentActionCounts } from "../functions/sumRecentActionCounts.js"; +import { automodTrigger } from "../helpers.js"; const configSchema = z.strictObject({ amount: z.number().int(), diff --git a/backend/src/plugins/Automod/triggers/threadDelete.ts b/backend/src/plugins/Automod/triggers/threadDelete.ts index 8c6d07d70..fb1d27f28 100644 --- a/backend/src/plugins/Automod/triggers/threadDelete.ts +++ b/backend/src/plugins/Automod/triggers/threadDelete.ts @@ -1,7 +1,7 @@ import { User, escapeBold, type Snowflake } from "discord.js"; import z from "zod"; import { renderUsername } from "../../../utils.js"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; interface ThreadDeleteResult { matchedThreadId: Snowflake; diff --git a/backend/src/plugins/Automod/triggers/threadUnarchive.ts b/backend/src/plugins/Automod/triggers/threadUnarchive.ts index 7eb7bf072..6b6908327 100644 --- a/backend/src/plugins/Automod/triggers/threadUnarchive.ts +++ b/backend/src/plugins/Automod/triggers/threadUnarchive.ts @@ -1,7 +1,7 @@ import { User, escapeBold, type Snowflake } from "discord.js"; import z from "zod"; -import { renderUsername } from "../../../utils"; -import { automodTrigger } from "../helpers"; +import { renderUsername } from "../../../utils.js"; +import { automodTrigger } from "../helpers.js"; interface ThreadUnarchiveResult { matchedThreadId: Snowflake; diff --git a/backend/src/plugins/Automod/triggers/unban.ts b/backend/src/plugins/Automod/triggers/unban.ts index 25f24ec95..fd52aef6c 100644 --- a/backend/src/plugins/Automod/triggers/unban.ts +++ b/backend/src/plugins/Automod/triggers/unban.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; // tslint:disable-next-line:no-empty-interface interface UnbanTriggerResultType {} diff --git a/backend/src/plugins/Automod/triggers/unmute.ts b/backend/src/plugins/Automod/triggers/unmute.ts index f9695ef00..59d470308 100644 --- a/backend/src/plugins/Automod/triggers/unmute.ts +++ b/backend/src/plugins/Automod/triggers/unmute.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; // tslint:disable-next-line:no-empty-interface interface UnmuteTriggerResultType {} diff --git a/backend/src/plugins/Automod/triggers/warn.ts b/backend/src/plugins/Automod/triggers/warn.ts index 3586e82dc..9d94235f7 100644 --- a/backend/src/plugins/Automod/triggers/warn.ts +++ b/backend/src/plugins/Automod/triggers/warn.ts @@ -1,5 +1,5 @@ import z from "zod"; -import { automodTrigger } from "../helpers"; +import { automodTrigger } from "../helpers.js"; // tslint:disable-next-line:no-empty-interface interface WarnTriggerResultType {} diff --git a/backend/src/plugins/Automod/types.ts b/backend/src/plugins/Automod/types.ts index 6cf88ad65..9e5e25279 100644 --- a/backend/src/plugins/Automod/types.ts +++ b/backend/src/plugins/Automod/types.ts @@ -1,20 +1,20 @@ import { GuildMember, GuildTextBasedChannel, PartialGuildMember, ThreadChannel, User } from "discord.js"; import { BasePluginType, CooldownManager } from "knub"; import z from "zod"; -import { Queue } from "../../Queue"; -import { RegExpRunner } from "../../RegExpRunner"; -import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { SavedMessage } from "../../data/entities/SavedMessage"; -import { entries, zBoundedRecord, zDelayString } from "../../utils"; -import { CounterEvents } from "../Counters/types"; -import { ModActionType, ModActionsEvents } from "../ModActions/types"; -import { MutesEvents } from "../Mutes/types"; -import { availableActions } from "./actions/availableActions"; -import { RecentActionType } from "./constants"; -import { availableTriggers } from "./triggers/availableTriggers"; +import { Queue } from "../../Queue.js"; +import { RegExpRunner } from "../../RegExpRunner.js"; +import { GuildAntiraidLevels } from "../../data/GuildAntiraidLevels.js"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { SavedMessage } from "../../data/entities/SavedMessage.js"; +import { entries, zBoundedRecord, zDelayString } from "../../utils.js"; +import { CounterEvents } from "../Counters/types.js"; +import { ModActionType, ModActionsEvents } from "../ModActions/types.js"; +import { MutesEvents } from "../Mutes/types.js"; +import { availableActions } from "./actions/availableActions.js"; +import { RecentActionType } from "./constants.js"; +import { availableTriggers } from "./triggers/availableTriggers.js"; import Timeout = NodeJS.Timeout; diff --git a/backend/src/plugins/BotControl/BotControlPlugin.ts b/backend/src/plugins/BotControl/BotControlPlugin.ts index 7fe9ed1ca..f2224e6ab 100644 --- a/backend/src/plugins/BotControl/BotControlPlugin.ts +++ b/backend/src/plugins/BotControl/BotControlPlugin.ts @@ -1,28 +1,28 @@ import { Snowflake, TextChannel } from "discord.js"; import { globalPlugin } from "knub"; -import { AllowedGuilds } from "../../data/AllowedGuilds"; -import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments"; -import { Configs } from "../../data/Configs"; -import { GuildArchives } from "../../data/GuildArchives"; -import { sendSuccessMessage } from "../../pluginUtils"; -import { getActiveReload, resetActiveReload } from "./activeReload"; -import { AddDashboardUserCmd } from "./commands/AddDashboardUserCmd"; -import { AddServerFromInviteCmd } from "./commands/AddServerFromInviteCmd"; -import { AllowServerCmd } from "./commands/AllowServerCmd"; -import { ChannelToServerCmd } from "./commands/ChannelToServerCmd"; -import { DisallowServerCmd } from "./commands/DisallowServerCmd"; -import { EligibleCmd } from "./commands/EligibleCmd"; -import { LeaveServerCmd } from "./commands/LeaveServerCmd"; -import { ListDashboardPermsCmd } from "./commands/ListDashboardPermsCmd"; -import { ListDashboardUsersCmd } from "./commands/ListDashboardUsersCmd"; -import { ProfilerDataCmd } from "./commands/ProfilerDataCmd"; -import { RateLimitPerformanceCmd } from "./commands/RateLimitPerformanceCmd"; -import { ReloadGlobalPluginsCmd } from "./commands/ReloadGlobalPluginsCmd"; -import { ReloadServerCmd } from "./commands/ReloadServerCmd"; -import { RemoveDashboardUserCmd } from "./commands/RemoveDashboardUserCmd"; -import { RestPerformanceCmd } from "./commands/RestPerformanceCmd"; -import { ServersCmd } from "./commands/ServersCmd"; -import { BotControlPluginType, zBotControlConfig } from "./types"; +import { AllowedGuilds } from "../../data/AllowedGuilds.js"; +import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments.js"; +import { Configs } from "../../data/Configs.js"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { sendSuccessMessage } from "../../pluginUtils.js"; +import { getActiveReload, resetActiveReload } from "./activeReload.js"; +import { AddDashboardUserCmd } from "./commands/AddDashboardUserCmd.js"; +import { AddServerFromInviteCmd } from "./commands/AddServerFromInviteCmd.js"; +import { AllowServerCmd } from "./commands/AllowServerCmd.js"; +import { ChannelToServerCmd } from "./commands/ChannelToServerCmd.js"; +import { DisallowServerCmd } from "./commands/DisallowServerCmd.js"; +import { EligibleCmd } from "./commands/EligibleCmd.js"; +import { LeaveServerCmd } from "./commands/LeaveServerCmd.js"; +import { ListDashboardPermsCmd } from "./commands/ListDashboardPermsCmd.js"; +import { ListDashboardUsersCmd } from "./commands/ListDashboardUsersCmd.js"; +import { ProfilerDataCmd } from "./commands/ProfilerDataCmd.js"; +import { RateLimitPerformanceCmd } from "./commands/RateLimitPerformanceCmd.js"; +import { ReloadGlobalPluginsCmd } from "./commands/ReloadGlobalPluginsCmd.js"; +import { ReloadServerCmd } from "./commands/ReloadServerCmd.js"; +import { RemoveDashboardUserCmd } from "./commands/RemoveDashboardUserCmd.js"; +import { RestPerformanceCmd } from "./commands/RestPerformanceCmd.js"; +import { ServersCmd } from "./commands/ServersCmd.js"; +import { BotControlPluginType, zBotControlConfig } from "./types.js"; const defaultOptions = { config: { diff --git a/backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts b/backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts index ff00fd8d5..f0fd1f903 100644 --- a/backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts +++ b/backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts @@ -1,8 +1,8 @@ import { ApiPermissions } from "@zeppelinbot/shared"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { renderUsername } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { renderUsername } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; export const AddDashboardUserCmd = botControlCmd({ trigger: ["add_dashboard_user"], diff --git a/backend/src/plugins/BotControl/commands/AddServerFromInviteCmd.ts b/backend/src/plugins/BotControl/commands/AddServerFromInviteCmd.ts index 584ed13f0..19a6d5715 100644 --- a/backend/src/plugins/BotControl/commands/AddServerFromInviteCmd.ts +++ b/backend/src/plugins/BotControl/commands/AddServerFromInviteCmd.ts @@ -1,10 +1,10 @@ import { ApiPermissions } from "@zeppelinbot/shared"; import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { DBDateFormat, isGuildInvite, resolveInvite } from "../../../utils"; -import { isEligible } from "../functions/isEligible"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { DBDateFormat, isGuildInvite, resolveInvite } from "../../../utils.js"; +import { isEligible } from "../functions/isEligible.js"; +import { botControlCmd } from "../types.js"; export const AddServerFromInviteCmd = botControlCmd({ trigger: ["add_server_from_invite", "allow_server_from_invite", "adv"], diff --git a/backend/src/plugins/BotControl/commands/AllowServerCmd.ts b/backend/src/plugins/BotControl/commands/AllowServerCmd.ts index 08305d22b..d68ee4534 100644 --- a/backend/src/plugins/BotControl/commands/AllowServerCmd.ts +++ b/backend/src/plugins/BotControl/commands/AllowServerCmd.ts @@ -1,9 +1,9 @@ import { ApiPermissions } from "@zeppelinbot/shared"; import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { DBDateFormat, isSnowflake } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { DBDateFormat, isSnowflake } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; export const AllowServerCmd = botControlCmd({ trigger: ["allow_server", "allowserver", "add_server", "addserver"], diff --git a/backend/src/plugins/BotControl/commands/ChannelToServerCmd.ts b/backend/src/plugins/BotControl/commands/ChannelToServerCmd.ts index 11d3a487c..927a75ab2 100644 --- a/backend/src/plugins/BotControl/commands/ChannelToServerCmd.ts +++ b/backend/src/plugins/BotControl/commands/ChannelToServerCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isStaffPreFilter, sendErrorMessage } from "../../../pluginUtils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isStaffPreFilter, sendErrorMessage } from "../../../pluginUtils.js"; +import { botControlCmd } from "../types.js"; export const ChannelToServerCmd = botControlCmd({ trigger: ["channel_to_server", "channel2server"], diff --git a/backend/src/plugins/BotControl/commands/DisallowServerCmd.ts b/backend/src/plugins/BotControl/commands/DisallowServerCmd.ts index 06bc1b143..17515a8b7 100644 --- a/backend/src/plugins/BotControl/commands/DisallowServerCmd.ts +++ b/backend/src/plugins/BotControl/commands/DisallowServerCmd.ts @@ -1,8 +1,8 @@ import { Snowflake } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { noop } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { noop } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; export const DisallowServerCmd = botControlCmd({ trigger: ["disallow_server", "disallowserver", "remove_server", "removeserver"], diff --git a/backend/src/plugins/BotControl/commands/EligibleCmd.ts b/backend/src/plugins/BotControl/commands/EligibleCmd.ts index face42a83..136266fd9 100644 --- a/backend/src/plugins/BotControl/commands/EligibleCmd.ts +++ b/backend/src/plugins/BotControl/commands/EligibleCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { isGuildInvite, resolveInvite } from "../../../utils"; -import { isEligible } from "../functions/isEligible"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { isGuildInvite, resolveInvite } from "../../../utils.js"; +import { isEligible } from "../functions/isEligible.js"; +import { botControlCmd } from "../types.js"; export const EligibleCmd = botControlCmd({ trigger: ["eligible", "is_eligible", "iseligible"], diff --git a/backend/src/plugins/BotControl/commands/LeaveServerCmd.ts b/backend/src/plugins/BotControl/commands/LeaveServerCmd.ts index 14aaf8337..02e026fd1 100644 --- a/backend/src/plugins/BotControl/commands/LeaveServerCmd.ts +++ b/backend/src/plugins/BotControl/commands/LeaveServerCmd.ts @@ -1,7 +1,7 @@ import { Snowflake } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { botControlCmd } from "../types.js"; export const LeaveServerCmd = botControlCmd({ trigger: ["leave_server", "leave_guild"], diff --git a/backend/src/plugins/BotControl/commands/ListDashboardPermsCmd.ts b/backend/src/plugins/BotControl/commands/ListDashboardPermsCmd.ts index 7c6d2aa52..540459ecf 100644 --- a/backend/src/plugins/BotControl/commands/ListDashboardPermsCmd.ts +++ b/backend/src/plugins/BotControl/commands/ListDashboardPermsCmd.ts @@ -1,9 +1,9 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { AllowedGuild } from "../../../data/entities/AllowedGuild"; -import { ApiPermissionAssignment } from "../../../data/entities/ApiPermissionAssignment"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { renderUsername, resolveUser } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { AllowedGuild } from "../../../data/entities/AllowedGuild.js"; +import { ApiPermissionAssignment } from "../../../data/entities/ApiPermissionAssignment.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { renderUsername, resolveUser } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; export const ListDashboardPermsCmd = botControlCmd({ trigger: ["list_dashboard_permissions", "list_dashboard_perms", "list_dash_permissions", "list_dash_perms"], diff --git a/backend/src/plugins/BotControl/commands/ListDashboardUsersCmd.ts b/backend/src/plugins/BotControl/commands/ListDashboardUsersCmd.ts index 1d3c1ffec..cc23caa4b 100644 --- a/backend/src/plugins/BotControl/commands/ListDashboardUsersCmd.ts +++ b/backend/src/plugins/BotControl/commands/ListDashboardUsersCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { renderUsername, resolveUser } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { renderUsername, resolveUser } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; export const ListDashboardUsersCmd = botControlCmd({ trigger: ["list_dashboard_users"], diff --git a/backend/src/plugins/BotControl/commands/ProfilerDataCmd.ts b/backend/src/plugins/BotControl/commands/ProfilerDataCmd.ts index 3b5a177f4..c83c0d72e 100644 --- a/backend/src/plugins/BotControl/commands/ProfilerDataCmd.ts +++ b/backend/src/plugins/BotControl/commands/ProfilerDataCmd.ts @@ -1,9 +1,9 @@ import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { GuildArchives } from "../../../data/GuildArchives"; -import { getBaseUrl } from "../../../pluginUtils"; -import { sorter } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { GuildArchives } from "../../../data/GuildArchives.js"; +import { getBaseUrl } from "../../../pluginUtils.js"; +import { sorter } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; const sortProps = { totalTime: "TOTAL TIME", diff --git a/backend/src/plugins/BotControl/commands/RateLimitPerformanceCmd.ts b/backend/src/plugins/BotControl/commands/RateLimitPerformanceCmd.ts index 46d2a0e04..c0c5bef14 100644 --- a/backend/src/plugins/BotControl/commands/RateLimitPerformanceCmd.ts +++ b/backend/src/plugins/BotControl/commands/RateLimitPerformanceCmd.ts @@ -1,8 +1,8 @@ import moment from "moment-timezone"; -import { GuildArchives } from "../../../data/GuildArchives"; -import { getBaseUrl, sendSuccessMessage } from "../../../pluginUtils"; -import { getRateLimitStats } from "../../../rateLimitStats"; -import { botControlCmd } from "../types"; +import { GuildArchives } from "../../../data/GuildArchives.js"; +import { getBaseUrl, sendSuccessMessage } from "../../../pluginUtils.js"; +import { getRateLimitStats } from "../../../rateLimitStats.js"; +import { botControlCmd } from "../types.js"; export const RateLimitPerformanceCmd = botControlCmd({ trigger: ["rate_limit_performance"], diff --git a/backend/src/plugins/BotControl/commands/ReloadGlobalPluginsCmd.ts b/backend/src/plugins/BotControl/commands/ReloadGlobalPluginsCmd.ts index 4f59f8a20..6c2b921fd 100644 --- a/backend/src/plugins/BotControl/commands/ReloadGlobalPluginsCmd.ts +++ b/backend/src/plugins/BotControl/commands/ReloadGlobalPluginsCmd.ts @@ -1,6 +1,6 @@ -import { isStaffPreFilter, sendErrorMessage } from "../../../pluginUtils"; -import { getActiveReload, setActiveReload } from "../activeReload"; -import { botControlCmd } from "../types"; +import { isStaffPreFilter, sendErrorMessage } from "../../../pluginUtils.js"; +import { getActiveReload, setActiveReload } from "../activeReload.js"; +import { botControlCmd } from "../types.js"; export const ReloadGlobalPluginsCmd = botControlCmd({ trigger: "bot_reload_global_plugins", diff --git a/backend/src/plugins/BotControl/commands/ReloadServerCmd.ts b/backend/src/plugins/BotControl/commands/ReloadServerCmd.ts index 0440129b1..a8b593de3 100644 --- a/backend/src/plugins/BotControl/commands/ReloadServerCmd.ts +++ b/backend/src/plugins/BotControl/commands/ReloadServerCmd.ts @@ -1,7 +1,7 @@ import { Snowflake } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { botControlCmd } from "../types.js"; export const ReloadServerCmd = botControlCmd({ trigger: ["reload_server", "reload_guild"], diff --git a/backend/src/plugins/BotControl/commands/RemoveDashboardUserCmd.ts b/backend/src/plugins/BotControl/commands/RemoveDashboardUserCmd.ts index c3d1ec991..86066734f 100644 --- a/backend/src/plugins/BotControl/commands/RemoveDashboardUserCmd.ts +++ b/backend/src/plugins/BotControl/commands/RemoveDashboardUserCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { renderUsername } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { renderUsername } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; export const RemoveDashboardUserCmd = botControlCmd({ trigger: ["remove_dashboard_user"], diff --git a/backend/src/plugins/BotControl/commands/RestPerformanceCmd.ts b/backend/src/plugins/BotControl/commands/RestPerformanceCmd.ts index 0c8c6e8e8..2f07ff809 100644 --- a/backend/src/plugins/BotControl/commands/RestPerformanceCmd.ts +++ b/backend/src/plugins/BotControl/commands/RestPerformanceCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { getTopRestCallStats } from "../../../restCallStats"; -import { createChunkedMessage } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { getTopRestCallStats } from "../../../restCallStats.js"; +import { createChunkedMessage } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; const leadingPathRegex = /(?<=\().+\/backend\//g; diff --git a/backend/src/plugins/BotControl/commands/ServersCmd.ts b/backend/src/plugins/BotControl/commands/ServersCmd.ts index 5b2cf9c76..af7bfecaf 100644 --- a/backend/src/plugins/BotControl/commands/ServersCmd.ts +++ b/backend/src/plugins/BotControl/commands/ServersCmd.ts @@ -1,8 +1,8 @@ import escapeStringRegexp from "escape-string-regexp"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isStaffPreFilter } from "../../../pluginUtils"; -import { createChunkedMessage, getUser, renderUsername, sorter } from "../../../utils"; -import { botControlCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isStaffPreFilter } from "../../../pluginUtils.js"; +import { createChunkedMessage, getUser, renderUsername, sorter } from "../../../utils.js"; +import { botControlCmd } from "../types.js"; export const ServersCmd = botControlCmd({ trigger: ["servers", "guilds"], diff --git a/backend/src/plugins/BotControl/functions/isEligible.ts b/backend/src/plugins/BotControl/functions/isEligible.ts index ba4dd31fb..ccc6689d0 100644 --- a/backend/src/plugins/BotControl/functions/isEligible.ts +++ b/backend/src/plugins/BotControl/functions/isEligible.ts @@ -1,7 +1,7 @@ import { User } from "discord.js"; import { GlobalPluginData } from "knub"; -import { GuildInvite } from "../../../utils"; -import { BotControlPluginType } from "../types"; +import { GuildInvite } from "../../../utils.js"; +import { BotControlPluginType } from "../types.js"; const REQUIRED_MEMBER_COUNT = 5000; diff --git a/backend/src/plugins/BotControl/types.ts b/backend/src/plugins/BotControl/types.ts index 1c1ccea64..05f8fb31e 100644 --- a/backend/src/plugins/BotControl/types.ts +++ b/backend/src/plugins/BotControl/types.ts @@ -1,10 +1,10 @@ import { BasePluginType, globalPluginEventListener, globalPluginMessageCommand } from "knub"; import z from "zod"; -import { AllowedGuilds } from "../../data/AllowedGuilds"; -import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments"; -import { Configs } from "../../data/Configs"; -import { GuildArchives } from "../../data/GuildArchives"; -import { zBoundedCharacters } from "../../utils"; +import { AllowedGuilds } from "../../data/AllowedGuilds.js"; +import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments.js"; +import { Configs } from "../../data/Configs.js"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { zBoundedCharacters } from "../../utils.js"; export const zBotControlConfig = z.strictObject({ can_use: z.boolean(), diff --git a/backend/src/plugins/Cases/CasesPlugin.ts b/backend/src/plugins/Cases/CasesPlugin.ts index b9f9d872f..8e5e66f3b 100644 --- a/backend/src/plugins/Cases/CasesPlugin.ts +++ b/backend/src/plugins/Cases/CasesPlugin.ts @@ -1,19 +1,19 @@ import { guildPlugin } from "knub"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildCases } from "../../data/GuildCases"; -import { GuildLogs } from "../../data/GuildLogs"; -import { makePublicFn } from "../../pluginUtils"; -import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { createCase } from "./functions/createCase"; -import { createCaseNote } from "./functions/createCaseNote"; -import { getCaseEmbed } from "./functions/getCaseEmbed"; -import { getCaseSummary } from "./functions/getCaseSummary"; -import { getCaseTypeAmountForUserId } from "./functions/getCaseTypeAmountForUserId"; -import { getRecentCasesByMod } from "./functions/getRecentCasesByMod"; -import { getTotalCasesByMod } from "./functions/getTotalCasesByMod"; -import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel"; -import { CasesPluginType, zCasesConfig } from "./types"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin.js"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { createCase } from "./functions/createCase.js"; +import { createCaseNote } from "./functions/createCaseNote.js"; +import { getCaseEmbed } from "./functions/getCaseEmbed.js"; +import { getCaseSummary } from "./functions/getCaseSummary.js"; +import { getCaseTypeAmountForUserId } from "./functions/getCaseTypeAmountForUserId.js"; +import { getRecentCasesByMod } from "./functions/getRecentCasesByMod.js"; +import { getTotalCasesByMod } from "./functions/getTotalCasesByMod.js"; +import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel.js"; +import { CasesPluginType, zCasesConfig } from "./types.js"; // The `any` cast here is to prevent TypeScript from locking up from the circular dependency function getLogsPlugin(): Promise { diff --git a/backend/src/plugins/Cases/caseAbbreviations.ts b/backend/src/plugins/Cases/caseAbbreviations.ts index 91ef6c764..518d1c712 100644 --- a/backend/src/plugins/Cases/caseAbbreviations.ts +++ b/backend/src/plugins/Cases/caseAbbreviations.ts @@ -1,4 +1,4 @@ -import { CaseTypes } from "../../data/CaseTypes"; +import { CaseTypes } from "../../data/CaseTypes.js"; export const caseAbbreviations = { [CaseTypes.Ban]: "BAN", diff --git a/backend/src/plugins/Cases/caseColors.ts b/backend/src/plugins/Cases/caseColors.ts index 3284010fb..c4954bde5 100644 --- a/backend/src/plugins/Cases/caseColors.ts +++ b/backend/src/plugins/Cases/caseColors.ts @@ -1,4 +1,4 @@ -import { CaseTypes } from "../../data/CaseTypes"; +import { CaseTypes } from "../../data/CaseTypes.js"; export const caseColors: Record = { [CaseTypes.Ban]: 0xcb4314, diff --git a/backend/src/plugins/Cases/caseIcons.ts b/backend/src/plugins/Cases/caseIcons.ts index 3d18cd128..874350afe 100644 --- a/backend/src/plugins/Cases/caseIcons.ts +++ b/backend/src/plugins/Cases/caseIcons.ts @@ -1,4 +1,4 @@ -import { CaseTypes } from "../../data/CaseTypes"; +import { CaseTypes } from "../../data/CaseTypes.js"; // These emoji icons are hosted on the Hangar server // If you'd like your self-hosted instance to use these icons, check #add-your-bot on that server diff --git a/backend/src/plugins/Cases/functions/createCase.ts b/backend/src/plugins/Cases/functions/createCase.ts index c68b899ff..b10a71a0d 100644 --- a/backend/src/plugins/Cases/functions/createCase.ts +++ b/backend/src/plugins/Cases/functions/createCase.ts @@ -1,10 +1,10 @@ import type { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { logger } from "../../../logger"; -import { renderUsername, resolveUser } from "../../../utils"; -import { CaseArgs, CasesPluginType } from "../types"; -import { createCaseNote } from "./createCaseNote"; -import { postCaseToCaseLogChannel } from "./postToCaseLogChannel"; +import { logger } from "../../../logger.js"; +import { renderUsername, resolveUser } from "../../../utils.js"; +import { CaseArgs, CasesPluginType } from "../types.js"; +import { createCaseNote } from "./createCaseNote.js"; +import { postCaseToCaseLogChannel } from "./postToCaseLogChannel.js"; export async function createCase(pluginData: GuildPluginData, args: CaseArgs) { const user = await resolveUser(pluginData.client, args.userId); diff --git a/backend/src/plugins/Cases/functions/createCaseNote.ts b/backend/src/plugins/Cases/functions/createCaseNote.ts index 71b113029..635c1b5eb 100644 --- a/backend/src/plugins/Cases/functions/createCaseNote.ts +++ b/backend/src/plugins/Cases/functions/createCaseNote.ts @@ -1,9 +1,9 @@ import { GuildPluginData } from "knub"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; -import { UnknownUser, renderUsername, resolveUser } from "../../../utils"; -import { CaseNoteArgs, CasesPluginType } from "../types"; -import { postCaseToCaseLogChannel } from "./postToCaseLogChannel"; -import { resolveCaseId } from "./resolveCaseId"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; +import { UnknownUser, renderUsername, resolveUser } from "../../../utils.js"; +import { CaseNoteArgs, CasesPluginType } from "../types.js"; +import { postCaseToCaseLogChannel } from "./postToCaseLogChannel.js"; +import { resolveCaseId } from "./resolveCaseId.js"; export async function createCaseNote(pluginData: GuildPluginData, args: CaseNoteArgs): Promise { const theCase = await pluginData.state.cases.find(resolveCaseId(args.caseId)); diff --git a/backend/src/plugins/Cases/functions/getCaseColor.ts b/backend/src/plugins/Cases/functions/getCaseColor.ts index 379b171dc..10c9b00fc 100644 --- a/backend/src/plugins/Cases/functions/getCaseColor.ts +++ b/backend/src/plugins/Cases/functions/getCaseColor.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { CaseTypes, CaseTypeToName } from "../../../data/CaseTypes"; -import { caseColors } from "../caseColors"; -import { CasesPluginType } from "../types"; +import { CaseTypes, CaseTypeToName } from "../../../data/CaseTypes.js"; +import { caseColors } from "../caseColors.js"; +import { CasesPluginType } from "../types.js"; export function getCaseColor(pluginData: GuildPluginData, caseType: CaseTypes) { return pluginData.config.get().case_colors?.[CaseTypeToName[caseType]] ?? caseColors[caseType]; diff --git a/backend/src/plugins/Cases/functions/getCaseEmbed.ts b/backend/src/plugins/Cases/functions/getCaseEmbed.ts index 3ce1f5907..38a092859 100644 --- a/backend/src/plugins/Cases/functions/getCaseEmbed.ts +++ b/backend/src/plugins/Cases/functions/getCaseEmbed.ts @@ -1,13 +1,13 @@ import { escapeCodeBlock, MessageCreateOptions, MessageEditOptions } from "discord.js"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { Case } from "../../../data/entities/Case"; -import { chunkMessageLines, emptyEmbedValue, messageLink } from "../../../utils"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { CasesPluginType } from "../types"; -import { getCaseColor } from "./getCaseColor"; -import { resolveCaseId } from "./resolveCaseId"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { Case } from "../../../data/entities/Case.js"; +import { chunkMessageLines, emptyEmbedValue, messageLink } from "../../../utils.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { CasesPluginType } from "../types.js"; +import { getCaseColor } from "./getCaseColor.js"; +import { resolveCaseId } from "./resolveCaseId.js"; export async function getCaseEmbed( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Cases/functions/getCaseIcon.ts b/backend/src/plugins/Cases/functions/getCaseIcon.ts index 6748a7efe..50126e776 100644 --- a/backend/src/plugins/Cases/functions/getCaseIcon.ts +++ b/backend/src/plugins/Cases/functions/getCaseIcon.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { CaseTypes, CaseTypeToName } from "../../../data/CaseTypes"; -import { caseIcons } from "../caseIcons"; -import { CasesPluginType } from "../types"; +import { CaseTypes, CaseTypeToName } from "../../../data/CaseTypes.js"; +import { caseIcons } from "../caseIcons.js"; +import { CasesPluginType } from "../types.js"; export function getCaseIcon(pluginData: GuildPluginData, caseType: CaseTypes) { return pluginData.config.get().case_icons?.[CaseTypeToName[caseType]] ?? caseIcons[caseType]; diff --git a/backend/src/plugins/Cases/functions/getCaseSummary.ts b/backend/src/plugins/Cases/functions/getCaseSummary.ts index 2f317e221..ca1a37ad6 100644 --- a/backend/src/plugins/Cases/functions/getCaseSummary.ts +++ b/backend/src/plugins/Cases/functions/getCaseSummary.ts @@ -1,12 +1,12 @@ import { GuildPluginData } from "knub"; import { splitMessageIntoChunks } from "knub/helpers"; import moment from "moment-timezone"; -import { Case } from "../../../data/entities/Case"; -import { convertDelayStringToMS, DBDateFormat, disableLinkPreviews, messageLink } from "../../../utils"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { caseAbbreviations } from "../caseAbbreviations"; -import { CasesPluginType } from "../types"; -import { getCaseIcon } from "./getCaseIcon"; +import { Case } from "../../../data/entities/Case.js"; +import { convertDelayStringToMS, DBDateFormat, disableLinkPreviews, messageLink } from "../../../utils.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { caseAbbreviations } from "../caseAbbreviations.js"; +import { CasesPluginType } from "../types.js"; +import { getCaseIcon } from "./getCaseIcon.js"; const CASE_SUMMARY_REASON_MAX_LENGTH = 300; const INCLUDE_MORE_NOTES_THRESHOLD = 20; diff --git a/backend/src/plugins/Cases/functions/getCaseTypeAmountForUserId.ts b/backend/src/plugins/Cases/functions/getCaseTypeAmountForUserId.ts index eb28584d5..cc5046db4 100644 --- a/backend/src/plugins/Cases/functions/getCaseTypeAmountForUserId.ts +++ b/backend/src/plugins/Cases/functions/getCaseTypeAmountForUserId.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { CasesPluginType } from "../types"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { CasesPluginType } from "../types.js"; export async function getCaseTypeAmountForUserId( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Cases/functions/getRecentCasesByMod.ts b/backend/src/plugins/Cases/functions/getRecentCasesByMod.ts index b9988078f..6333b1e65 100644 --- a/backend/src/plugins/Cases/functions/getRecentCasesByMod.ts +++ b/backend/src/plugins/Cases/functions/getRecentCasesByMod.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { Case } from "../../../data/entities/Case"; -import { CasesPluginType } from "../types"; +import { Case } from "../../../data/entities/Case.js"; +import { CasesPluginType } from "../types.js"; export function getRecentCasesByMod( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Cases/functions/getTotalCasesByMod.ts b/backend/src/plugins/Cases/functions/getTotalCasesByMod.ts index 5753f12e7..a2401cbc6 100644 --- a/backend/src/plugins/Cases/functions/getTotalCasesByMod.ts +++ b/backend/src/plugins/Cases/functions/getTotalCasesByMod.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { CasesPluginType } from "../types"; +import { CasesPluginType } from "../types.js"; export function getTotalCasesByMod(pluginData: GuildPluginData, modId: string): Promise { return pluginData.state.cases.getTotalCasesByModId(modId); diff --git a/backend/src/plugins/Cases/functions/postToCaseLogChannel.ts b/backend/src/plugins/Cases/functions/postToCaseLogChannel.ts index 211d18441..f6ba3709d 100644 --- a/backend/src/plugins/Cases/functions/postToCaseLogChannel.ts +++ b/backend/src/plugins/Cases/functions/postToCaseLogChannel.ts @@ -1,13 +1,13 @@ import { MessageCreateOptions, NewsChannel, RESTJSONErrorCodes, Snowflake, TextChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { Case } from "../../../data/entities/Case"; -import { isDiscordAPIError } from "../../../utils"; -import { InternalPosterPlugin } from "../../InternalPoster/InternalPosterPlugin"; -import { InternalPosterMessageResult } from "../../InternalPoster/functions/sendMessage"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { CasesPluginType } from "../types"; -import { getCaseEmbed } from "./getCaseEmbed"; -import { resolveCaseId } from "./resolveCaseId"; +import { Case } from "../../../data/entities/Case.js"; +import { isDiscordAPIError } from "../../../utils.js"; +import { InternalPosterPlugin } from "../../InternalPoster/InternalPosterPlugin.js"; +import { InternalPosterMessageResult } from "../../InternalPoster/functions/sendMessage.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { CasesPluginType } from "../types.js"; +import { getCaseEmbed } from "./getCaseEmbed.js"; +import { resolveCaseId } from "./resolveCaseId.js"; export async function postToCaseLogChannel( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Cases/functions/resolveCaseId.ts b/backend/src/plugins/Cases/functions/resolveCaseId.ts index 8d5ca13d3..f2becaaef 100644 --- a/backend/src/plugins/Cases/functions/resolveCaseId.ts +++ b/backend/src/plugins/Cases/functions/resolveCaseId.ts @@ -1,4 +1,4 @@ -import { Case } from "../../../data/entities/Case"; +import { Case } from "../../../data/entities/Case.js"; export function resolveCaseId(caseOrCaseId: Case | number): number { return caseOrCaseId instanceof Case ? caseOrCaseId.id : caseOrCaseId; diff --git a/backend/src/plugins/Cases/info.ts b/backend/src/plugins/Cases/info.ts index efa5d17ef..fa446a248 100644 --- a/backend/src/plugins/Cases/info.ts +++ b/backend/src/plugins/Cases/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; export const casesPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Cases/types.ts b/backend/src/plugins/Cases/types.ts index bcc50eedc..cb8ec1392 100644 --- a/backend/src/plugins/Cases/types.ts +++ b/backend/src/plugins/Cases/types.ts @@ -1,12 +1,12 @@ import { BasePluginType } from "knub"; import { U } from "ts-toolbelt"; import z from "zod"; -import { CaseNameToType, CaseTypes } from "../../data/CaseTypes"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildCases } from "../../data/GuildCases"; -import { GuildLogs } from "../../data/GuildLogs"; -import { keys, zBoundedCharacters, zDelayString, zSnowflake } from "../../utils"; -import { zColor } from "../../utils/zColor"; +import { CaseNameToType, CaseTypes } from "../../data/CaseTypes.js"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { keys, zBoundedCharacters, zDelayString, zSnowflake } from "../../utils.js"; +import { zColor } from "../../utils/zColor.js"; const caseKeys = keys(CaseNameToType) as U.ListOf; diff --git a/backend/src/plugins/Censor/CensorPlugin.ts b/backend/src/plugins/Censor/CensorPlugin.ts index 45e7a52e6..c95036907 100644 --- a/backend/src/plugins/Censor/CensorPlugin.ts +++ b/backend/src/plugins/Censor/CensorPlugin.ts @@ -1,11 +1,11 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { CensorPluginType, zCensorConfig } from "./types"; -import { onMessageCreate } from "./util/onMessageCreate"; -import { onMessageUpdate } from "./util/onMessageUpdate"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { CensorPluginType, zCensorConfig } from "./types.js"; +import { onMessageCreate } from "./util/onMessageCreate.js"; +import { onMessageUpdate } from "./util/onMessageUpdate.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Censor/info.ts b/backend/src/plugins/Censor/info.ts index 1c8fe33a1..888cea1de 100644 --- a/backend/src/plugins/Censor/info.ts +++ b/backend/src/plugins/Censor/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; export const censorPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Censor/types.ts b/backend/src/plugins/Censor/types.ts index c1fcd8df6..62ed38162 100644 --- a/backend/src/plugins/Censor/types.ts +++ b/backend/src/plugins/Censor/types.ts @@ -1,9 +1,9 @@ import { BasePluginType } from "knub"; import z from "zod"; -import { RegExpRunner } from "../../RegExpRunner"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { zBoundedCharacters, zRegex, zSnowflake } from "../../utils"; +import { RegExpRunner } from "../../RegExpRunner.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { zBoundedCharacters, zRegex, zSnowflake } from "../../utils.js"; export const zCensorConfig = z.strictObject({ filter_zalgo: z.boolean(), diff --git a/backend/src/plugins/Censor/util/applyFiltersToMsg.ts b/backend/src/plugins/Censor/util/applyFiltersToMsg.ts index 65ad62ede..fc363f185 100644 --- a/backend/src/plugins/Censor/util/applyFiltersToMsg.ts +++ b/backend/src/plugins/Censor/util/applyFiltersToMsg.ts @@ -1,13 +1,15 @@ import { Embed, Invite } from "discord.js"; import escapeStringRegexp from "escape-string-regexp"; import { GuildPluginData } from "knub"; -import cloneDeep from "lodash.clonedeep"; -import { allowTimeout } from "../../../RegExpRunner"; -import { ZalgoRegex } from "../../../data/Zalgo"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { getInviteCodesInString, getUrlsInString, isGuildInvite, resolveInvite, resolveMember } from "../../../utils"; -import { CensorPluginType } from "../types"; -import { censorMessage } from "./censorMessage"; +import cloneDeep from "lodash/cloneDeep.js"; +import { allowTimeout } from "../../../RegExpRunner.js"; +import { ZalgoRegex } from "../../../data/Zalgo.js"; +import { ISavedMessageEmbedData, SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { getInviteCodesInString, getUrlsInString, isGuildInvite, resolveInvite, resolveMember } from "../../../utils.js"; +import { CensorPluginType } from "../types.js"; +import { censorMessage } from "./censorMessage.js"; + +type ManipulatedEmbedData = Partial; export async function applyFiltersToMsg( pluginData: GuildPluginData, @@ -19,7 +21,7 @@ export async function applyFiltersToMsg( let messageContent = savedMessage.data.content || ""; if (savedMessage.data.attachments) messageContent += " " + JSON.stringify(savedMessage.data.attachments); if (savedMessage.data.embeds) { - const embeds = (savedMessage.data.embeds as Embed[]).map((e) => cloneDeep(e)); + const embeds = (savedMessage.data.embeds as ManipulatedEmbedData[]).map((e) => cloneDeep(e)); for (const embed of embeds) { if (embed.type === "video") { // Ignore video descriptions as they're not actually shown on the embed diff --git a/backend/src/plugins/Censor/util/censorMessage.ts b/backend/src/plugins/Censor/util/censorMessage.ts index 93889c832..653086723 100644 --- a/backend/src/plugins/Censor/util/censorMessage.ts +++ b/backend/src/plugins/Censor/util/censorMessage.ts @@ -1,10 +1,10 @@ import { GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { resolveUser } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { CensorPluginType } from "../types"; +import { LogType } from "../../../data/LogType.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { resolveUser } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { CensorPluginType } from "../types.js"; export async function censorMessage( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Censor/util/onMessageCreate.ts b/backend/src/plugins/Censor/util/onMessageCreate.ts index 482e9cff6..fa1c32129 100644 --- a/backend/src/plugins/Censor/util/onMessageCreate.ts +++ b/backend/src/plugins/Censor/util/onMessageCreate.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { messageLock } from "../../../utils/lockNameHelpers"; -import { CensorPluginType } from "../types"; -import { applyFiltersToMsg } from "./applyFiltersToMsg"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { messageLock } from "../../../utils/lockNameHelpers.js"; +import { CensorPluginType } from "../types.js"; +import { applyFiltersToMsg } from "./applyFiltersToMsg.js"; export async function onMessageCreate(pluginData: GuildPluginData, savedMessage: SavedMessage) { if (savedMessage.is_bot) return; diff --git a/backend/src/plugins/Censor/util/onMessageUpdate.ts b/backend/src/plugins/Censor/util/onMessageUpdate.ts index d17bf6b0e..5e927c7d6 100644 --- a/backend/src/plugins/Censor/util/onMessageUpdate.ts +++ b/backend/src/plugins/Censor/util/onMessageUpdate.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { messageLock } from "../../../utils/lockNameHelpers"; -import { CensorPluginType } from "../types"; -import { applyFiltersToMsg } from "./applyFiltersToMsg"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { messageLock } from "../../../utils/lockNameHelpers.js"; +import { CensorPluginType } from "../types.js"; +import { applyFiltersToMsg } from "./applyFiltersToMsg.js"; export async function onMessageUpdate(pluginData: GuildPluginData, savedMessage: SavedMessage) { if (savedMessage.is_bot) return; diff --git a/backend/src/plugins/ChannelArchiver/ChannelArchiverPlugin.ts b/backend/src/plugins/ChannelArchiver/ChannelArchiverPlugin.ts index c8373aeb7..5423a7473 100644 --- a/backend/src/plugins/ChannelArchiver/ChannelArchiverPlugin.ts +++ b/backend/src/plugins/ChannelArchiver/ChannelArchiverPlugin.ts @@ -1,8 +1,8 @@ import { guildPlugin } from "knub"; import z from "zod"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd"; -import { ChannelArchiverPluginType } from "./types"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd.js"; +import { ChannelArchiverPluginType } from "./types.js"; export const ChannelArchiverPlugin = guildPlugin()({ name: "channel_archiver", diff --git a/backend/src/plugins/ChannelArchiver/commands/ArchiveChannelCmd.ts b/backend/src/plugins/ChannelArchiver/commands/ArchiveChannelCmd.ts index e2a9a2a24..8edd19feb 100644 --- a/backend/src/plugins/ChannelArchiver/commands/ArchiveChannelCmd.ts +++ b/backend/src/plugins/ChannelArchiver/commands/ArchiveChannelCmd.ts @@ -1,11 +1,11 @@ import { Snowflake } from "discord.js"; import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { isOwner, sendErrorMessage } from "../../../pluginUtils"; -import { SECONDS, confirm, noop, renderUsername } from "../../../utils"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { rehostAttachment } from "../rehostAttachment"; -import { channelArchiverCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { isOwner, sendErrorMessage } from "../../../pluginUtils.js"; +import { SECONDS, confirm, noop, renderUsername } from "../../../utils.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { rehostAttachment } from "../rehostAttachment.js"; +import { channelArchiverCmd } from "../types.js"; const MAX_ARCHIVED_MESSAGES = 5000; const MAX_MESSAGES_PER_FETCH = 100; diff --git a/backend/src/plugins/ChannelArchiver/rehostAttachment.ts b/backend/src/plugins/ChannelArchiver/rehostAttachment.ts index 8159ddb26..18c73fa24 100644 --- a/backend/src/plugins/ChannelArchiver/rehostAttachment.ts +++ b/backend/src/plugins/ChannelArchiver/rehostAttachment.ts @@ -1,6 +1,6 @@ import { Attachment, GuildTextBasedChannel, MessageCreateOptions } from "discord.js"; import fs from "fs"; -import { downloadFile } from "../../utils"; +import { downloadFile } from "../../utils.js"; const fsp = fs.promises; const MAX_ATTACHMENT_REHOST_SIZE = 1024 * 1024 * 8; diff --git a/backend/src/plugins/CompanionChannels/CompanionChannelsPlugin.ts b/backend/src/plugins/CompanionChannels/CompanionChannelsPlugin.ts index 6ff22711b..fd6fe3f7c 100644 --- a/backend/src/plugins/CompanionChannels/CompanionChannelsPlugin.ts +++ b/backend/src/plugins/CompanionChannels/CompanionChannelsPlugin.ts @@ -1,8 +1,8 @@ import { CooldownManager, guildPlugin } from "knub"; -import { GuildLogs } from "../../data/GuildLogs"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { VoiceStateUpdateEvt } from "./events/VoiceStateUpdateEvt"; -import { CompanionChannelsPluginType, zCompanionChannelsConfig } from "./types"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { VoiceStateUpdateEvt } from "./events/VoiceStateUpdateEvt.js"; +import { CompanionChannelsPluginType, zCompanionChannelsConfig } from "./types.js"; const defaultOptions = { config: { diff --git a/backend/src/plugins/CompanionChannels/events/VoiceStateUpdateEvt.ts b/backend/src/plugins/CompanionChannels/events/VoiceStateUpdateEvt.ts index 0e73570e9..3f8b32b7c 100644 --- a/backend/src/plugins/CompanionChannels/events/VoiceStateUpdateEvt.ts +++ b/backend/src/plugins/CompanionChannels/events/VoiceStateUpdateEvt.ts @@ -1,5 +1,5 @@ -import { handleCompanionPermissions } from "../functions/handleCompanionPermissions"; -import { companionChannelsEvt } from "../types"; +import { handleCompanionPermissions } from "../functions/handleCompanionPermissions.js"; +import { companionChannelsEvt } from "../types.js"; export const VoiceStateUpdateEvt = companionChannelsEvt({ event: "voiceStateUpdate", diff --git a/backend/src/plugins/CompanionChannels/functions/getCompanionChannelOptsForVoiceChannelId.ts b/backend/src/plugins/CompanionChannels/functions/getCompanionChannelOptsForVoiceChannelId.ts index 8ecde5e79..3f4e9972f 100644 --- a/backend/src/plugins/CompanionChannels/functions/getCompanionChannelOptsForVoiceChannelId.ts +++ b/backend/src/plugins/CompanionChannels/functions/getCompanionChannelOptsForVoiceChannelId.ts @@ -1,6 +1,6 @@ import { StageChannel, VoiceChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { CompanionChannelsPluginType, TCompanionChannelOpts } from "../types"; +import { CompanionChannelsPluginType, TCompanionChannelOpts } from "../types.js"; const defaultCompanionChannelOpts: Partial = { enabled: true, diff --git a/backend/src/plugins/CompanionChannels/functions/handleCompanionPermissions.ts b/backend/src/plugins/CompanionChannels/functions/handleCompanionPermissions.ts index 6be8ffe19..3e4f08893 100644 --- a/backend/src/plugins/CompanionChannels/functions/handleCompanionPermissions.ts +++ b/backend/src/plugins/CompanionChannels/functions/handleCompanionPermissions.ts @@ -1,11 +1,11 @@ import { PermissionsBitField, Snowflake, StageChannel, TextChannel, VoiceChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { MINUTES, isDiscordAPIError } from "../../../utils"; -import { filterObject } from "../../../utils/filterObject"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { CompanionChannelsPluginType, TCompanionChannelOpts } from "../types"; -import { getCompanionChannelOptsForVoiceChannelId } from "./getCompanionChannelOptsForVoiceChannelId"; +import { LogType } from "../../../data/LogType.js"; +import { MINUTES, isDiscordAPIError } from "../../../utils.js"; +import { filterObject } from "../../../utils/filterObject.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { CompanionChannelsPluginType, TCompanionChannelOpts } from "../types.js"; +import { getCompanionChannelOptsForVoiceChannelId } from "./getCompanionChannelOptsForVoiceChannelId.js"; const ERROR_COOLDOWN_KEY = "errorCooldown"; const ERROR_COOLDOWN = 5 * MINUTES; diff --git a/backend/src/plugins/CompanionChannels/info.ts b/backend/src/plugins/CompanionChannels/info.ts index 4dcd83625..c482618b4 100644 --- a/backend/src/plugins/CompanionChannels/info.ts +++ b/backend/src/plugins/CompanionChannels/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; export const companionChannelsPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/CompanionChannels/types.ts b/backend/src/plugins/CompanionChannels/types.ts index 7cee4b3ad..e009f5602 100644 --- a/backend/src/plugins/CompanionChannels/types.ts +++ b/backend/src/plugins/CompanionChannels/types.ts @@ -1,7 +1,7 @@ import { BasePluginType, CooldownManager, guildPluginEventListener } from "knub"; import z from "zod"; -import { GuildLogs } from "../../data/GuildLogs"; -import { zBoundedCharacters, zSnowflake } from "../../utils"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { zBoundedCharacters, zSnowflake } from "../../utils.js"; export const zCompanionChannelOpts = z.strictObject({ voice_channel_ids: z.array(zSnowflake), diff --git a/backend/src/plugins/ContextMenus/ContextMenuPlugin.ts b/backend/src/plugins/ContextMenus/ContextMenuPlugin.ts index 8c6cbdaec..330b409ab 100644 --- a/backend/src/plugins/ContextMenus/ContextMenuPlugin.ts +++ b/backend/src/plugins/ContextMenus/ContextMenuPlugin.ts @@ -1,11 +1,11 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { MutesPlugin } from "../Mutes/MutesPlugin"; -import { UtilityPlugin } from "../Utility/UtilityPlugin"; -import { ContextClickedEvt } from "./events/ContextClickedEvt"; -import { ContextMenuPluginType, zContextMenusConfig } from "./types"; -import { loadAllCommands } from "./utils/loadAllCommands"; +import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { MutesPlugin } from "../Mutes/MutesPlugin.js"; +import { UtilityPlugin } from "../Utility/UtilityPlugin.js"; +import { ContextClickedEvt } from "./events/ContextClickedEvt.js"; +import { ContextMenuPluginType, zContextMenusConfig } from "./types.js"; +import { loadAllCommands } from "./utils/loadAllCommands.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/ContextMenus/actions/clean.ts b/backend/src/plugins/ContextMenus/actions/clean.ts index a9d2384b5..9278f04b7 100644 --- a/backend/src/plugins/ContextMenus/actions/clean.ts +++ b/backend/src/plugins/ContextMenus/actions/clean.ts @@ -1,9 +1,9 @@ import { ContextMenuCommandInteraction, TextChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; -import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { ContextMenuPluginType } from "../types"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; +import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { ContextMenuPluginType } from "../types.js"; export async function cleanAction( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ContextMenus/actions/mute.ts b/backend/src/plugins/ContextMenus/actions/mute.ts index 16b48a4ae..d7dc60528 100644 --- a/backend/src/plugins/ContextMenus/actions/mute.ts +++ b/backend/src/plugins/ContextMenus/actions/mute.ts @@ -1,14 +1,14 @@ import { ContextMenuCommandInteraction } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; -import { canActOn } from "../../../pluginUtils"; -import { convertDelayStringToMS } from "../../../utils"; -import { CaseArgs } from "../../Cases/types"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin"; -import { MutesPlugin } from "../../Mutes/MutesPlugin"; -import { ContextMenuPluginType } from "../types"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; +import { canActOn } from "../../../pluginUtils.js"; +import { convertDelayStringToMS } from "../../../utils.js"; +import { CaseArgs } from "../../Cases/types.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin.js"; +import { MutesPlugin } from "../../Mutes/MutesPlugin.js"; +import { ContextMenuPluginType } from "../types.js"; export async function muteAction( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ContextMenus/actions/userInfo.ts b/backend/src/plugins/ContextMenus/actions/userInfo.ts index a2d44d7ab..cb47016c6 100644 --- a/backend/src/plugins/ContextMenus/actions/userInfo.ts +++ b/backend/src/plugins/ContextMenus/actions/userInfo.ts @@ -1,7 +1,7 @@ import { ContextMenuCommandInteraction } from "discord.js"; import { GuildPluginData } from "knub"; -import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin"; -import { ContextMenuPluginType } from "../types"; +import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin.js"; +import { ContextMenuPluginType } from "../types.js"; export async function userInfoAction( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ContextMenus/events/ContextClickedEvt.ts b/backend/src/plugins/ContextMenus/events/ContextClickedEvt.ts index 98e6ab1f5..dcfdaab03 100644 --- a/backend/src/plugins/ContextMenus/events/ContextClickedEvt.ts +++ b/backend/src/plugins/ContextMenus/events/ContextClickedEvt.ts @@ -1,5 +1,5 @@ -import { contextMenuEvt } from "../types"; -import { routeContextAction } from "../utils/contextRouter"; +import { contextMenuEvt } from "../types.js"; +import { routeContextAction } from "../utils/contextRouter.js"; export const ContextClickedEvt = contextMenuEvt({ event: "interactionCreate", diff --git a/backend/src/plugins/ContextMenus/info.ts b/backend/src/plugins/ContextMenus/info.ts index 9ec03a9d8..d67eb711c 100644 --- a/backend/src/plugins/ContextMenus/info.ts +++ b/backend/src/plugins/ContextMenus/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const contextMenuPluginInfo: ZeppelinPluginInfo = { showInDocs: false, diff --git a/backend/src/plugins/ContextMenus/types.ts b/backend/src/plugins/ContextMenus/types.ts index 5dbcd9ce7..f6ff126aa 100644 --- a/backend/src/plugins/ContextMenus/types.ts +++ b/backend/src/plugins/ContextMenus/types.ts @@ -1,6 +1,6 @@ import { BasePluginType, guildPluginEventListener } from "knub"; import z from "zod"; -import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks"; +import { GuildContextMenuLinks } from "../../data/GuildContextMenuLinks.js"; export const zContextMenusConfig = z.strictObject({ can_use: z.boolean(), diff --git a/backend/src/plugins/ContextMenus/utils/contextRouter.ts b/backend/src/plugins/ContextMenus/utils/contextRouter.ts index 18b7b0640..6a8684795 100644 --- a/backend/src/plugins/ContextMenus/utils/contextRouter.ts +++ b/backend/src/plugins/ContextMenus/utils/contextRouter.ts @@ -1,7 +1,7 @@ import { ContextMenuCommandInteraction } from "discord.js"; import { GuildPluginData } from "knub"; -import { ContextMenuPluginType } from "../types"; -import { hardcodedActions } from "./hardcodedContextOptions"; +import { ContextMenuPluginType } from "../types.js"; +import { hardcodedActions } from "./hardcodedContextOptions.js"; export async function routeContextAction( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ContextMenus/utils/hardcodedContextOptions.ts b/backend/src/plugins/ContextMenus/utils/hardcodedContextOptions.ts index 84593acef..81dd48f85 100644 --- a/backend/src/plugins/ContextMenus/utils/hardcodedContextOptions.ts +++ b/backend/src/plugins/ContextMenus/utils/hardcodedContextOptions.ts @@ -1,6 +1,6 @@ -import { cleanAction } from "../actions/clean"; -import { muteAction } from "../actions/mute"; -import { userInfoAction } from "../actions/userInfo"; +import { cleanAction } from "../actions/clean.js"; +import { muteAction } from "../actions/mute.js"; +import { userInfoAction } from "../actions/userInfo.js"; export const hardcodedContext: Record = { user_muteindef: "Mute Indefinitely", diff --git a/backend/src/plugins/ContextMenus/utils/loadAllCommands.ts b/backend/src/plugins/ContextMenus/utils/loadAllCommands.ts index 97d73dfb0..e2c146d58 100644 --- a/backend/src/plugins/ContextMenus/utils/loadAllCommands.ts +++ b/backend/src/plugins/ContextMenus/utils/loadAllCommands.ts @@ -1,8 +1,8 @@ import { ApplicationCommandData, ApplicationCommandType } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin"; -import { ContextMenuPluginType } from "../types"; -import { hardcodedContext } from "./hardcodedContextOptions"; +import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin.js"; +import { ContextMenuPluginType } from "../types.js"; +import { hardcodedContext } from "./hardcodedContextOptions.js"; export async function loadAllCommands(pluginData: GuildPluginData) { const comms = await pluginData.client.application!.commands; diff --git a/backend/src/plugins/Counters/CountersPlugin.ts b/backend/src/plugins/Counters/CountersPlugin.ts index ed1b2d8a6..df3211985 100644 --- a/backend/src/plugins/Counters/CountersPlugin.ts +++ b/backend/src/plugins/Counters/CountersPlugin.ts @@ -1,24 +1,24 @@ import { EventEmitter } from "events"; import { PluginOptions, guildPlugin } from "knub"; -import { GuildCounters } from "../../data/GuildCounters"; -import { CounterTrigger, parseCounterConditionString } from "../../data/entities/CounterTrigger"; -import { makePublicFn } from "../../pluginUtils"; -import { MINUTES, convertDelayStringToMS, values } from "../../utils"; -import { AddCounterCmd } from "./commands/AddCounterCmd"; -import { CountersListCmd } from "./commands/CountersListCmd"; -import { ResetAllCounterValuesCmd } from "./commands/ResetAllCounterValuesCmd"; -import { ResetCounterCmd } from "./commands/ResetCounterCmd"; -import { SetCounterCmd } from "./commands/SetCounterCmd"; -import { ViewCounterCmd } from "./commands/ViewCounterCmd"; -import { changeCounterValue } from "./functions/changeCounterValue"; -import { counterExists } from "./functions/counterExists"; -import { decayCounter } from "./functions/decayCounter"; -import { getPrettyNameForCounter } from "./functions/getPrettyNameForCounter"; -import { getPrettyNameForCounterTrigger } from "./functions/getPrettyNameForCounterTrigger"; -import { offCounterEvent } from "./functions/offCounterEvent"; -import { onCounterEvent } from "./functions/onCounterEvent"; -import { setCounterValue } from "./functions/setCounterValue"; -import { CountersPluginType, zCountersConfig } from "./types"; +import { GuildCounters } from "../../data/GuildCounters.js"; +import { CounterTrigger, parseCounterConditionString } from "../../data/entities/CounterTrigger.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { MINUTES, convertDelayStringToMS, values } from "../../utils.js"; +import { AddCounterCmd } from "./commands/AddCounterCmd.js"; +import { CountersListCmd } from "./commands/CountersListCmd.js"; +import { ResetAllCounterValuesCmd } from "./commands/ResetAllCounterValuesCmd.js"; +import { ResetCounterCmd } from "./commands/ResetCounterCmd.js"; +import { SetCounterCmd } from "./commands/SetCounterCmd.js"; +import { ViewCounterCmd } from "./commands/ViewCounterCmd.js"; +import { changeCounterValue } from "./functions/changeCounterValue.js"; +import { counterExists } from "./functions/counterExists.js"; +import { decayCounter } from "./functions/decayCounter.js"; +import { getPrettyNameForCounter } from "./functions/getPrettyNameForCounter.js"; +import { getPrettyNameForCounterTrigger } from "./functions/getPrettyNameForCounterTrigger.js"; +import { offCounterEvent } from "./functions/offCounterEvent.js"; +import { onCounterEvent } from "./functions/onCounterEvent.js"; +import { setCounterValue } from "./functions/setCounterValue.js"; +import { CountersPluginType, zCountersConfig } from "./types.js"; const DECAY_APPLY_INTERVAL = 5 * MINUTES; diff --git a/backend/src/plugins/Counters/commands/AddCounterCmd.ts b/backend/src/plugins/Counters/commands/AddCounterCmd.ts index a71418dfc..c1ff37e71 100644 --- a/backend/src/plugins/Counters/commands/AddCounterCmd.ts +++ b/backend/src/plugins/Counters/commands/AddCounterCmd.ts @@ -1,11 +1,11 @@ import { Snowflake, TextChannel } from "discord.js"; import { guildPluginMessageCommand } from "knub"; import { waitForReply } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { UnknownUser, resolveUser } from "../../../utils"; -import { changeCounterValue } from "../functions/changeCounterValue"; -import { CountersPluginType } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { UnknownUser, resolveUser } from "../../../utils.js"; +import { changeCounterValue } from "../functions/changeCounterValue.js"; +import { CountersPluginType } from "../types.js"; export const AddCounterCmd = guildPluginMessageCommand()({ trigger: ["counters add", "counter add", "addcounter"], diff --git a/backend/src/plugins/Counters/commands/CountersListCmd.ts b/backend/src/plugins/Counters/commands/CountersListCmd.ts index 84a0a2729..396efae5f 100644 --- a/backend/src/plugins/Counters/commands/CountersListCmd.ts +++ b/backend/src/plugins/Counters/commands/CountersListCmd.ts @@ -1,8 +1,8 @@ import { guildPluginMessageCommand } from "knub"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { trimMultilineString, ucfirst } from "../../../utils"; -import { getGuildPrefix } from "../../../utils/getGuildPrefix"; -import { CountersPluginType } from "../types"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { trimMultilineString, ucfirst } from "../../../utils.js"; +import { getGuildPrefix } from "../../../utils/getGuildPrefix.js"; +import { CountersPluginType } from "../types.js"; export const CountersListCmd = guildPluginMessageCommand()({ trigger: ["counters list", "counter list", "counters"], diff --git a/backend/src/plugins/Counters/commands/ResetAllCounterValuesCmd.ts b/backend/src/plugins/Counters/commands/ResetAllCounterValuesCmd.ts index 3a44ecaa8..8b5a45205 100644 --- a/backend/src/plugins/Counters/commands/ResetAllCounterValuesCmd.ts +++ b/backend/src/plugins/Counters/commands/ResetAllCounterValuesCmd.ts @@ -1,9 +1,9 @@ import { guildPluginMessageCommand } from "knub"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { confirm, noop, trimMultilineString } from "../../../utils"; -import { resetAllCounterValues } from "../functions/resetAllCounterValues"; -import { CountersPluginType } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { confirm, noop, trimMultilineString } from "../../../utils.js"; +import { resetAllCounterValues } from "../functions/resetAllCounterValues.js"; +import { CountersPluginType } from "../types.js"; export const ResetAllCounterValuesCmd = guildPluginMessageCommand()({ trigger: ["counters reset_all"], diff --git a/backend/src/plugins/Counters/commands/ResetCounterCmd.ts b/backend/src/plugins/Counters/commands/ResetCounterCmd.ts index 00c91eb78..1d9829738 100644 --- a/backend/src/plugins/Counters/commands/ResetCounterCmd.ts +++ b/backend/src/plugins/Counters/commands/ResetCounterCmd.ts @@ -1,11 +1,11 @@ import { Snowflake, TextChannel } from "discord.js"; import { guildPluginMessageCommand } from "knub"; import { waitForReply } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { UnknownUser, resolveUser } from "../../../utils"; -import { setCounterValue } from "../functions/setCounterValue"; -import { CountersPluginType } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { UnknownUser, resolveUser } from "../../../utils.js"; +import { setCounterValue } from "../functions/setCounterValue.js"; +import { CountersPluginType } from "../types.js"; export const ResetCounterCmd = guildPluginMessageCommand()({ trigger: ["counters reset", "counter reset", "resetcounter"], diff --git a/backend/src/plugins/Counters/commands/SetCounterCmd.ts b/backend/src/plugins/Counters/commands/SetCounterCmd.ts index ba6fbc3ae..a126e32f0 100644 --- a/backend/src/plugins/Counters/commands/SetCounterCmd.ts +++ b/backend/src/plugins/Counters/commands/SetCounterCmd.ts @@ -1,11 +1,11 @@ import { Snowflake, TextChannel } from "discord.js"; import { guildPluginMessageCommand } from "knub"; import { waitForReply } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { UnknownUser, resolveUser } from "../../../utils"; -import { setCounterValue } from "../functions/setCounterValue"; -import { CountersPluginType } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { UnknownUser, resolveUser } from "../../../utils.js"; +import { setCounterValue } from "../functions/setCounterValue.js"; +import { CountersPluginType } from "../types.js"; export const SetCounterCmd = guildPluginMessageCommand()({ trigger: ["counters set", "counter set", "setcounter"], diff --git a/backend/src/plugins/Counters/commands/ViewCounterCmd.ts b/backend/src/plugins/Counters/commands/ViewCounterCmd.ts index d2715c0c3..1a26c04a3 100644 --- a/backend/src/plugins/Counters/commands/ViewCounterCmd.ts +++ b/backend/src/plugins/Counters/commands/ViewCounterCmd.ts @@ -1,10 +1,10 @@ import { Snowflake } from "discord.js"; import { guildPluginMessageCommand } from "knub"; import { waitForReply } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { resolveUser, UnknownUser } from "../../../utils"; -import { CountersPluginType } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { resolveUser, UnknownUser } from "../../../utils.js"; +import { CountersPluginType } from "../types.js"; export const ViewCounterCmd = guildPluginMessageCommand()({ trigger: ["counters view", "counter view", "viewcounter", "counter"], diff --git a/backend/src/plugins/Counters/functions/changeCounterValue.ts b/backend/src/plugins/Counters/functions/changeCounterValue.ts index 74a295f9f..6892ce651 100644 --- a/backend/src/plugins/Counters/functions/changeCounterValue.ts +++ b/backend/src/plugins/Counters/functions/changeCounterValue.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { counterIdLock } from "../../../utils/lockNameHelpers"; -import { CountersPluginType } from "../types"; -import { checkCounterTrigger } from "./checkCounterTrigger"; -import { checkReverseCounterTrigger } from "./checkReverseCounterTrigger"; +import { counterIdLock } from "../../../utils/lockNameHelpers.js"; +import { CountersPluginType } from "../types.js"; +import { checkCounterTrigger } from "./checkCounterTrigger.js"; +import { checkReverseCounterTrigger } from "./checkReverseCounterTrigger.js"; export async function changeCounterValue( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/checkAllValuesForReverseTrigger.ts b/backend/src/plugins/Counters/functions/checkAllValuesForReverseTrigger.ts index 263855dc7..8772e2253 100644 --- a/backend/src/plugins/Counters/functions/checkAllValuesForReverseTrigger.ts +++ b/backend/src/plugins/Counters/functions/checkAllValuesForReverseTrigger.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { CounterTrigger } from "../../../data/entities/CounterTrigger"; -import { CountersPluginType } from "../types"; -import { emitCounterEvent } from "./emitCounterEvent"; +import { CounterTrigger } from "../../../data/entities/CounterTrigger.js"; +import { CountersPluginType } from "../types.js"; +import { emitCounterEvent } from "./emitCounterEvent.js"; export async function checkAllValuesForReverseTrigger( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/checkAllValuesForTrigger.ts b/backend/src/plugins/Counters/functions/checkAllValuesForTrigger.ts index 0a42673fa..dedc64899 100644 --- a/backend/src/plugins/Counters/functions/checkAllValuesForTrigger.ts +++ b/backend/src/plugins/Counters/functions/checkAllValuesForTrigger.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { CounterTrigger } from "../../../data/entities/CounterTrigger"; -import { CountersPluginType } from "../types"; -import { emitCounterEvent } from "./emitCounterEvent"; +import { CounterTrigger } from "../../../data/entities/CounterTrigger.js"; +import { CountersPluginType } from "../types.js"; +import { emitCounterEvent } from "./emitCounterEvent.js"; export async function checkAllValuesForTrigger( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/checkCounterTrigger.ts b/backend/src/plugins/Counters/functions/checkCounterTrigger.ts index 8923abf5d..a123c8be1 100644 --- a/backend/src/plugins/Counters/functions/checkCounterTrigger.ts +++ b/backend/src/plugins/Counters/functions/checkCounterTrigger.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { CounterTrigger } from "../../../data/entities/CounterTrigger"; -import { CountersPluginType } from "../types"; -import { emitCounterEvent } from "./emitCounterEvent"; +import { CounterTrigger } from "../../../data/entities/CounterTrigger.js"; +import { CountersPluginType } from "../types.js"; +import { emitCounterEvent } from "./emitCounterEvent.js"; export async function checkCounterTrigger( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/checkReverseCounterTrigger.ts b/backend/src/plugins/Counters/functions/checkReverseCounterTrigger.ts index 544d4066d..6803d4f3d 100644 --- a/backend/src/plugins/Counters/functions/checkReverseCounterTrigger.ts +++ b/backend/src/plugins/Counters/functions/checkReverseCounterTrigger.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { CounterTrigger } from "../../../data/entities/CounterTrigger"; -import { CountersPluginType } from "../types"; -import { emitCounterEvent } from "./emitCounterEvent"; +import { CounterTrigger } from "../../../data/entities/CounterTrigger.js"; +import { CountersPluginType } from "../types.js"; +import { emitCounterEvent } from "./emitCounterEvent.js"; export async function checkReverseCounterTrigger( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/counterExists.ts b/backend/src/plugins/Counters/functions/counterExists.ts index 2da10460f..c2824e4d8 100644 --- a/backend/src/plugins/Counters/functions/counterExists.ts +++ b/backend/src/plugins/Counters/functions/counterExists.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { CountersPluginType } from "../types"; +import { CountersPluginType } from "../types.js"; export function counterExists(pluginData: GuildPluginData, counterName: string) { const config = pluginData.config.get(); diff --git a/backend/src/plugins/Counters/functions/decayCounter.ts b/backend/src/plugins/Counters/functions/decayCounter.ts index 0317ee8c2..880c5e2c2 100644 --- a/backend/src/plugins/Counters/functions/decayCounter.ts +++ b/backend/src/plugins/Counters/functions/decayCounter.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { counterIdLock } from "../../../utils/lockNameHelpers"; -import { CountersPluginType } from "../types"; -import { checkAllValuesForReverseTrigger } from "./checkAllValuesForReverseTrigger"; -import { checkAllValuesForTrigger } from "./checkAllValuesForTrigger"; +import { counterIdLock } from "../../../utils/lockNameHelpers.js"; +import { CountersPluginType } from "../types.js"; +import { checkAllValuesForReverseTrigger } from "./checkAllValuesForReverseTrigger.js"; +import { checkAllValuesForTrigger } from "./checkAllValuesForTrigger.js"; export async function decayCounter( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/emitCounterEvent.ts b/backend/src/plugins/Counters/functions/emitCounterEvent.ts index 30e4bfead..df575b1f0 100644 --- a/backend/src/plugins/Counters/functions/emitCounterEvent.ts +++ b/backend/src/plugins/Counters/functions/emitCounterEvent.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { CounterEvents, CountersPluginType } from "../types"; +import { CounterEvents, CountersPluginType } from "../types.js"; export function emitCounterEvent( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/getPrettyNameForCounter.ts b/backend/src/plugins/Counters/functions/getPrettyNameForCounter.ts index c9fd03429..1da142828 100644 --- a/backend/src/plugins/Counters/functions/getPrettyNameForCounter.ts +++ b/backend/src/plugins/Counters/functions/getPrettyNameForCounter.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { CountersPluginType } from "../types"; +import { CountersPluginType } from "../types.js"; export function getPrettyNameForCounter(pluginData: GuildPluginData, counterName: string) { const config = pluginData.config.get(); diff --git a/backend/src/plugins/Counters/functions/getPrettyNameForCounterTrigger.ts b/backend/src/plugins/Counters/functions/getPrettyNameForCounterTrigger.ts index 5e891c184..00a2be7d3 100644 --- a/backend/src/plugins/Counters/functions/getPrettyNameForCounterTrigger.ts +++ b/backend/src/plugins/Counters/functions/getPrettyNameForCounterTrigger.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { CountersPluginType } from "../types"; +import { CountersPluginType } from "../types.js"; export function getPrettyNameForCounterTrigger( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/offCounterEvent.ts b/backend/src/plugins/Counters/functions/offCounterEvent.ts index 08c28cffe..108c5cbcb 100644 --- a/backend/src/plugins/Counters/functions/offCounterEvent.ts +++ b/backend/src/plugins/Counters/functions/offCounterEvent.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { CounterEventEmitter, CountersPluginType } from "../types"; +import { CounterEventEmitter, CountersPluginType } from "../types.js"; export function offCounterEvent( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/onCounterEvent.ts b/backend/src/plugins/Counters/functions/onCounterEvent.ts index 1789571bf..fb4a3e01f 100644 --- a/backend/src/plugins/Counters/functions/onCounterEvent.ts +++ b/backend/src/plugins/Counters/functions/onCounterEvent.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { CounterEvents, CountersPluginType } from "../types"; +import { CounterEvents, CountersPluginType } from "../types.js"; export function onCounterEvent( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/functions/resetAllCounterValues.ts b/backend/src/plugins/Counters/functions/resetAllCounterValues.ts index c145a8767..e3eaed229 100644 --- a/backend/src/plugins/Counters/functions/resetAllCounterValues.ts +++ b/backend/src/plugins/Counters/functions/resetAllCounterValues.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { counterIdLock } from "../../../utils/lockNameHelpers"; -import { CountersPluginType } from "../types"; +import { counterIdLock } from "../../../utils/lockNameHelpers.js"; +import { CountersPluginType } from "../types.js"; export async function resetAllCounterValues(pluginData: GuildPluginData, counterName: string) { const config = pluginData.config.get(); diff --git a/backend/src/plugins/Counters/functions/setCounterValue.ts b/backend/src/plugins/Counters/functions/setCounterValue.ts index 55b6f78fd..23130ab05 100644 --- a/backend/src/plugins/Counters/functions/setCounterValue.ts +++ b/backend/src/plugins/Counters/functions/setCounterValue.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { counterIdLock } from "../../../utils/lockNameHelpers"; -import { CountersPluginType } from "../types"; -import { checkCounterTrigger } from "./checkCounterTrigger"; -import { checkReverseCounterTrigger } from "./checkReverseCounterTrigger"; +import { counterIdLock } from "../../../utils/lockNameHelpers.js"; +import { CountersPluginType } from "../types.js"; +import { checkCounterTrigger } from "./checkCounterTrigger.js"; +import { checkReverseCounterTrigger } from "./checkReverseCounterTrigger.js"; export async function setCounterValue( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Counters/info.ts b/backend/src/plugins/Counters/info.ts index f45e1a0c3..abf07c705 100644 --- a/backend/src/plugins/Counters/info.ts +++ b/backend/src/plugins/Counters/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zCountersConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zCountersConfig } from "./types.js"; export const countersPluginInfo: ZeppelinPluginInfo = { prettyName: "Counters", diff --git a/backend/src/plugins/Counters/types.ts b/backend/src/plugins/Counters/types.ts index ef322e7b2..289d06125 100644 --- a/backend/src/plugins/Counters/types.ts +++ b/backend/src/plugins/Counters/types.ts @@ -1,14 +1,14 @@ import { EventEmitter } from "events"; import { BasePluginType } from "knub"; import z from "zod"; -import { GuildCounters, MAX_COUNTER_VALUE, MIN_COUNTER_VALUE } from "../../data/GuildCounters"; +import { GuildCounters, MAX_COUNTER_VALUE, MIN_COUNTER_VALUE } from "../../data/GuildCounters.js"; import { CounterTrigger, buildCounterConditionString, getReverseCounterComparisonOp, parseCounterConditionString, -} from "../../data/entities/CounterTrigger"; -import { zBoundedCharacters, zBoundedRecord, zDelayString } from "../../utils"; +} from "../../data/entities/CounterTrigger.js"; +import { zBoundedCharacters, zBoundedRecord, zDelayString } from "../../utils.js"; import Timeout = NodeJS.Timeout; const MAX_COUNTERS = 5; diff --git a/backend/src/plugins/CustomEvents/CustomEventsPlugin.ts b/backend/src/plugins/CustomEvents/CustomEventsPlugin.ts index f85036a1a..6c0b9bf35 100644 --- a/backend/src/plugins/CustomEvents/CustomEventsPlugin.ts +++ b/backend/src/plugins/CustomEvents/CustomEventsPlugin.ts @@ -1,19 +1,19 @@ import { GuildChannel, GuildMember, User } from "discord.js"; import { guildPlugin, guildPluginMessageCommand, parseSignature } from "knub"; import { TSignature } from "knub-command-manager"; -import { commandTypes } from "../../commandTypes"; -import { TemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter"; -import { UnknownUser } from "../../utils"; -import { isScalar } from "../../utils/isScalar"; +import { commandTypes } from "../../commandTypes.js"; +import { TemplateSafeValueContainer, createTypedTemplateSafeValueContainer } from "../../templateFormatter.js"; +import { UnknownUser } from "../../utils.js"; +import { isScalar } from "../../utils/isScalar.js"; import { channelToTemplateSafeChannel, memberToTemplateSafeMember, messageToTemplateSafeMessage, userToTemplateSafeUser, -} from "../../utils/templateSafeObjects"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { runEvent } from "./functions/runEvent"; -import { CustomEventsPluginType, zCustomEventsConfig } from "./types"; +} from "../../utils/templateSafeObjects.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { runEvent } from "./functions/runEvent.js"; +import { CustomEventsPluginType, zCustomEventsConfig } from "./types.js"; const defaultOptions = { config: { diff --git a/backend/src/plugins/CustomEvents/actions/addRoleAction.ts b/backend/src/plugins/CustomEvents/actions/addRoleAction.ts index cd6476874..8a3fa477b 100644 --- a/backend/src/plugins/CustomEvents/actions/addRoleAction.ts +++ b/backend/src/plugins/CustomEvents/actions/addRoleAction.ts @@ -1,11 +1,11 @@ import { GuildPluginData } from "knub"; import z from "zod"; -import { canActOn } from "../../../pluginUtils"; -import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveMember, zSnowflake } from "../../../utils"; -import { ActionError } from "../ActionError"; -import { catchTemplateError } from "../catchTemplateError"; -import { CustomEventsPluginType, TCustomEvent } from "../types"; +import { canActOn } from "../../../pluginUtils.js"; +import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveMember, zSnowflake } from "../../../utils.js"; +import { ActionError } from "../ActionError.js"; +import { catchTemplateError } from "../catchTemplateError.js"; +import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zAddRoleAction = z.strictObject({ type: z.literal("add_role"), diff --git a/backend/src/plugins/CustomEvents/actions/createCaseAction.ts b/backend/src/plugins/CustomEvents/actions/createCaseAction.ts index a5e624fa1..29c4bc4d4 100644 --- a/backend/src/plugins/CustomEvents/actions/createCaseAction.ts +++ b/backend/src/plugins/CustomEvents/actions/createCaseAction.ts @@ -1,12 +1,12 @@ import { GuildPluginData } from "knub"; import z from "zod"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter"; -import { zBoundedCharacters, zSnowflake } from "../../../utils"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { ActionError } from "../ActionError"; -import { catchTemplateError } from "../catchTemplateError"; -import { CustomEventsPluginType, TCustomEvent } from "../types"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { zBoundedCharacters, zSnowflake } from "../../../utils.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { ActionError } from "../ActionError.js"; +import { catchTemplateError } from "../catchTemplateError.js"; +import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zCreateCaseAction = z.strictObject({ type: z.literal("create_case"), diff --git a/backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts b/backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts index 7727e3395..39984bf2b 100644 --- a/backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts +++ b/backend/src/plugins/CustomEvents/actions/makeRoleMentionableAction.ts @@ -1,10 +1,10 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import z from "zod"; -import { TemplateSafeValueContainer } from "../../../templateFormatter"; -import { convertDelayStringToMS, noop, zDelayString, zSnowflake } from "../../../utils"; -import { ActionError } from "../ActionError"; -import { CustomEventsPluginType, TCustomEvent } from "../types"; +import { TemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { convertDelayStringToMS, noop, zDelayString, zSnowflake } from "../../../utils.js"; +import { ActionError } from "../ActionError.js"; +import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zMakeRoleMentionableAction = z.strictObject({ type: z.literal("make_role_mentionable"), diff --git a/backend/src/plugins/CustomEvents/actions/makeRoleUnmentionableAction.ts b/backend/src/plugins/CustomEvents/actions/makeRoleUnmentionableAction.ts index 8dca7323f..d1fefd11b 100644 --- a/backend/src/plugins/CustomEvents/actions/makeRoleUnmentionableAction.ts +++ b/backend/src/plugins/CustomEvents/actions/makeRoleUnmentionableAction.ts @@ -1,10 +1,10 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import z from "zod"; -import { TemplateSafeValueContainer } from "../../../templateFormatter"; -import { zSnowflake } from "../../../utils"; -import { ActionError } from "../ActionError"; -import { CustomEventsPluginType, TCustomEvent } from "../types"; +import { TemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { zSnowflake } from "../../../utils.js"; +import { ActionError } from "../ActionError.js"; +import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zMakeRoleUnmentionableAction = z.strictObject({ type: z.literal("make_role_unmentionable"), diff --git a/backend/src/plugins/CustomEvents/actions/messageAction.ts b/backend/src/plugins/CustomEvents/actions/messageAction.ts index 277802657..0e17c19f4 100644 --- a/backend/src/plugins/CustomEvents/actions/messageAction.ts +++ b/backend/src/plugins/CustomEvents/actions/messageAction.ts @@ -1,11 +1,11 @@ import { Snowflake, TextChannel } from "discord.js"; import { GuildPluginData } from "knub"; import z from "zod"; -import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; -import { zBoundedCharacters, zSnowflake } from "../../../utils"; -import { ActionError } from "../ActionError"; -import { catchTemplateError } from "../catchTemplateError"; -import { CustomEventsPluginType } from "../types"; +import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; +import { zBoundedCharacters, zSnowflake } from "../../../utils.js"; +import { ActionError } from "../ActionError.js"; +import { catchTemplateError } from "../catchTemplateError.js"; +import { CustomEventsPluginType } from "../types.js"; export const zMessageAction = z.strictObject({ type: z.literal("message"), diff --git a/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts b/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts index 40adcb587..c7d25bcae 100644 --- a/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts +++ b/backend/src/plugins/CustomEvents/actions/moveToVoiceChannelAction.ts @@ -1,12 +1,12 @@ import { Snowflake, VoiceChannel } from "discord.js"; import { GuildPluginData } from "knub"; import z from "zod"; -import { canActOn } from "../../../pluginUtils"; -import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; -import { resolveMember, zSnowflake } from "../../../utils"; -import { ActionError } from "../ActionError"; -import { catchTemplateError } from "../catchTemplateError"; -import { CustomEventsPluginType, TCustomEvent } from "../types"; +import { canActOn } from "../../../pluginUtils.js"; +import { TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; +import { resolveMember, zSnowflake } from "../../../utils.js"; +import { ActionError } from "../ActionError.js"; +import { catchTemplateError } from "../catchTemplateError.js"; +import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zMoveToVoiceChannelAction = z.strictObject({ type: z.literal("move_to_vc"), diff --git a/backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts b/backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts index b2e44d93d..4c6af376e 100644 --- a/backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts +++ b/backend/src/plugins/CustomEvents/actions/setChannelPermissionOverrides.ts @@ -1,10 +1,10 @@ import { PermissionsBitField, PermissionsString, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import z from "zod"; -import { TemplateSafeValueContainer } from "../../../templateFormatter"; -import { zSnowflake } from "../../../utils"; -import { ActionError } from "../ActionError"; -import { CustomEventsPluginType, TCustomEvent } from "../types"; +import { TemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { zSnowflake } from "../../../utils.js"; +import { ActionError } from "../ActionError.js"; +import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export const zSetChannelPermissionOverridesAction = z.strictObject({ type: z.literal("set_channel_permission_overrides"), diff --git a/backend/src/plugins/CustomEvents/catchTemplateError.ts b/backend/src/plugins/CustomEvents/catchTemplateError.ts index 015a4298d..1eef8fae2 100644 --- a/backend/src/plugins/CustomEvents/catchTemplateError.ts +++ b/backend/src/plugins/CustomEvents/catchTemplateError.ts @@ -1,5 +1,5 @@ -import { TemplateParseError } from "../../templateFormatter"; -import { ActionError } from "./ActionError"; +import { TemplateParseError } from "../../templateFormatter.js"; +import { ActionError } from "./ActionError.js"; export function catchTemplateError(fn: () => Promise, errorText: string): Promise { try { diff --git a/backend/src/plugins/CustomEvents/functions/runEvent.ts b/backend/src/plugins/CustomEvents/functions/runEvent.ts index 8e38b9ab7..12c0d777b 100644 --- a/backend/src/plugins/CustomEvents/functions/runEvent.ts +++ b/backend/src/plugins/CustomEvents/functions/runEvent.ts @@ -1,16 +1,16 @@ import { Message } from "discord.js"; import { GuildPluginData } from "knub"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { TemplateSafeValueContainer } from "../../../templateFormatter"; -import { ActionError } from "../ActionError"; -import { addRoleAction } from "../actions/addRoleAction"; -import { createCaseAction } from "../actions/createCaseAction"; -import { makeRoleMentionableAction } from "../actions/makeRoleMentionableAction"; -import { makeRoleUnmentionableAction } from "../actions/makeRoleUnmentionableAction"; -import { messageAction } from "../actions/messageAction"; -import { moveToVoiceChannelAction } from "../actions/moveToVoiceChannelAction"; -import { setChannelPermissionOverridesAction } from "../actions/setChannelPermissionOverrides"; -import { CustomEventsPluginType, TCustomEvent } from "../types"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { TemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { ActionError } from "../ActionError.js"; +import { addRoleAction } from "../actions/addRoleAction.js"; +import { createCaseAction } from "../actions/createCaseAction.js"; +import { makeRoleMentionableAction } from "../actions/makeRoleMentionableAction.js"; +import { makeRoleUnmentionableAction } from "../actions/makeRoleUnmentionableAction.js"; +import { messageAction } from "../actions/messageAction.js"; +import { moveToVoiceChannelAction } from "../actions/moveToVoiceChannelAction.js"; +import { setChannelPermissionOverridesAction } from "../actions/setChannelPermissionOverrides.js"; +import { CustomEventsPluginType, TCustomEvent } from "../types.js"; export async function runEvent( pluginData: GuildPluginData, diff --git a/backend/src/plugins/CustomEvents/info.ts b/backend/src/plugins/CustomEvents/info.ts index 32db1bee3..4825cc369 100644 --- a/backend/src/plugins/CustomEvents/info.ts +++ b/backend/src/plugins/CustomEvents/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const customEventsPluginInfo: ZeppelinPluginInfo = { prettyName: "Custom events", diff --git a/backend/src/plugins/CustomEvents/types.ts b/backend/src/plugins/CustomEvents/types.ts index 6433b6d03..3c71b77f4 100644 --- a/backend/src/plugins/CustomEvents/types.ts +++ b/backend/src/plugins/CustomEvents/types.ts @@ -1,13 +1,13 @@ import { BasePluginType } from "knub"; import z from "zod"; -import { zBoundedCharacters, zBoundedRecord } from "../../utils"; -import { zAddRoleAction } from "./actions/addRoleAction"; -import { zCreateCaseAction } from "./actions/createCaseAction"; -import { zMakeRoleMentionableAction } from "./actions/makeRoleMentionableAction"; -import { zMakeRoleUnmentionableAction } from "./actions/makeRoleUnmentionableAction"; -import { zMessageAction } from "./actions/messageAction"; -import { zMoveToVoiceChannelAction } from "./actions/moveToVoiceChannelAction"; -import { zSetChannelPermissionOverridesAction } from "./actions/setChannelPermissionOverrides"; +import { zBoundedCharacters, zBoundedRecord } from "../../utils.js"; +import { zAddRoleAction } from "./actions/addRoleAction.js"; +import { zCreateCaseAction } from "./actions/createCaseAction.js"; +import { zMakeRoleMentionableAction } from "./actions/makeRoleMentionableAction.js"; +import { zMakeRoleUnmentionableAction } from "./actions/makeRoleUnmentionableAction.js"; +import { zMessageAction } from "./actions/messageAction.js"; +import { zMoveToVoiceChannelAction } from "./actions/moveToVoiceChannelAction.js"; +import { zSetChannelPermissionOverridesAction } from "./actions/setChannelPermissionOverrides.js"; const zCommandTrigger = z.strictObject({ type: z.literal("command"), diff --git a/backend/src/plugins/GuildAccessMonitor/GuildAccessMonitorPlugin.ts b/backend/src/plugins/GuildAccessMonitor/GuildAccessMonitorPlugin.ts index c0319b558..7be3ca963 100644 --- a/backend/src/plugins/GuildAccessMonitor/GuildAccessMonitorPlugin.ts +++ b/backend/src/plugins/GuildAccessMonitor/GuildAccessMonitorPlugin.ts @@ -1,9 +1,9 @@ import { Guild } from "discord.js"; import { BasePluginType, GlobalPluginData, globalPlugin, globalPluginEventListener } from "knub"; import z from "zod"; -import { AllowedGuilds } from "../../data/AllowedGuilds"; -import { Configs } from "../../data/Configs"; -import { env } from "../../env"; +import { AllowedGuilds } from "../../data/AllowedGuilds.js"; +import { Configs } from "../../data/Configs.js"; +import { env } from "../../env.js"; interface GuildAccessMonitorPluginType extends BasePluginType { state: { diff --git a/backend/src/plugins/GuildConfigReloader/GuildConfigReloaderPlugin.ts b/backend/src/plugins/GuildConfigReloader/GuildConfigReloaderPlugin.ts index 4c7954a1f..f1f69d59b 100644 --- a/backend/src/plugins/GuildConfigReloader/GuildConfigReloaderPlugin.ts +++ b/backend/src/plugins/GuildConfigReloader/GuildConfigReloaderPlugin.ts @@ -1,8 +1,8 @@ import { globalPlugin } from "knub"; import z from "zod"; -import { Configs } from "../../data/Configs"; -import { reloadChangedGuilds } from "./functions/reloadChangedGuilds"; -import { GuildConfigReloaderPluginType } from "./types"; +import { Configs } from "../../data/Configs.js"; +import { reloadChangedGuilds } from "./functions/reloadChangedGuilds.js"; +import { GuildConfigReloaderPluginType } from "./types.js"; export const GuildConfigReloaderPlugin = globalPlugin()({ name: "guild_config_reloader", diff --git a/backend/src/plugins/GuildConfigReloader/functions/reloadChangedGuilds.ts b/backend/src/plugins/GuildConfigReloader/functions/reloadChangedGuilds.ts index f18d3c45f..0f0bef790 100644 --- a/backend/src/plugins/GuildConfigReloader/functions/reloadChangedGuilds.ts +++ b/backend/src/plugins/GuildConfigReloader/functions/reloadChangedGuilds.ts @@ -1,7 +1,7 @@ import { Snowflake } from "discord.js"; import { GlobalPluginData } from "knub"; -import { SECONDS } from "../../../utils"; -import { GuildConfigReloaderPluginType } from "../types"; +import { SECONDS } from "../../../utils.js"; +import { GuildConfigReloaderPluginType } from "../types.js"; const CHECK_INTERVAL = 1 * SECONDS; diff --git a/backend/src/plugins/GuildConfigReloader/info.ts b/backend/src/plugins/GuildConfigReloader/info.ts index ac7c8c0fc..2aa6cacd7 100644 --- a/backend/src/plugins/GuildConfigReloader/info.ts +++ b/backend/src/plugins/GuildConfigReloader/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const guildConfigReloaderPluginInfo: ZeppelinPluginInfo = { prettyName: "Guild config reloader", diff --git a/backend/src/plugins/GuildConfigReloader/types.ts b/backend/src/plugins/GuildConfigReloader/types.ts index 8477d60d1..58b439c4a 100644 --- a/backend/src/plugins/GuildConfigReloader/types.ts +++ b/backend/src/plugins/GuildConfigReloader/types.ts @@ -1,5 +1,5 @@ import { BasePluginType } from "knub"; -import { Configs } from "../../data/Configs"; +import { Configs } from "../../data/Configs.js"; import Timeout = NodeJS.Timeout; export interface GuildConfigReloaderPluginType extends BasePluginType { diff --git a/backend/src/plugins/GuildInfoSaver/GuildInfoSaverPlugin.ts b/backend/src/plugins/GuildInfoSaver/GuildInfoSaverPlugin.ts index 724cd2fee..e6d2b54d1 100644 --- a/backend/src/plugins/GuildInfoSaver/GuildInfoSaverPlugin.ts +++ b/backend/src/plugins/GuildInfoSaver/GuildInfoSaverPlugin.ts @@ -1,10 +1,10 @@ import { Guild } from "discord.js"; import { guildPlugin, guildPluginEventListener } from "knub"; import z from "zod"; -import { AllowedGuilds } from "../../data/AllowedGuilds"; -import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments"; -import { MINUTES } from "../../utils"; -import { GuildInfoSaverPluginType } from "./types"; +import { AllowedGuilds } from "../../data/AllowedGuilds.js"; +import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments.js"; +import { MINUTES } from "../../utils.js"; +import { GuildInfoSaverPluginType } from "./types.js"; export const GuildInfoSaverPlugin = guildPlugin()({ name: "guild_info_saver", diff --git a/backend/src/plugins/GuildInfoSaver/info.ts b/backend/src/plugins/GuildInfoSaver/info.ts index 411e78913..362873c16 100644 --- a/backend/src/plugins/GuildInfoSaver/info.ts +++ b/backend/src/plugins/GuildInfoSaver/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const guildInfoSaverPluginInfo: ZeppelinPluginInfo = { prettyName: "Guild info saver", diff --git a/backend/src/plugins/GuildMemberCache/GuildMemberCachePlugin.ts b/backend/src/plugins/GuildMemberCache/GuildMemberCachePlugin.ts index cd24c0b80..cf5210838 100644 --- a/backend/src/plugins/GuildMemberCache/GuildMemberCachePlugin.ts +++ b/backend/src/plugins/GuildMemberCache/GuildMemberCachePlugin.ts @@ -1,16 +1,16 @@ import { guildPlugin } from "knub"; import z from "zod"; -import { GuildMemberCache } from "../../data/GuildMemberCache"; -import { makePublicFn } from "../../pluginUtils"; -import { SECONDS } from "../../utils"; -import { cancelDeletionOnMemberJoin } from "./events/cancelDeletionOnMemberJoin"; -import { removeMemberCacheOnMemberLeave } from "./events/removeMemberCacheOnMemberLeave"; -import { updateMemberCacheOnMemberUpdate } from "./events/updateMemberCacheOnMemberUpdate"; -import { updateMemberCacheOnMessage } from "./events/updateMemberCacheOnMessage"; -import { updateMemberCacheOnRoleChange } from "./events/updateMemberCacheOnRoleChange"; -import { updateMemberCacheOnVoiceStateUpdate } from "./events/updateMemberCacheOnVoiceStateUpdate"; -import { getCachedMemberData } from "./functions/getCachedMemberData"; -import { GuildMemberCachePluginType } from "./types"; +import { GuildMemberCache } from "../../data/GuildMemberCache.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { SECONDS } from "../../utils.js"; +import { cancelDeletionOnMemberJoin } from "./events/cancelDeletionOnMemberJoin.js"; +import { removeMemberCacheOnMemberLeave } from "./events/removeMemberCacheOnMemberLeave.js"; +import { updateMemberCacheOnMemberUpdate } from "./events/updateMemberCacheOnMemberUpdate.js"; +import { updateMemberCacheOnMessage } from "./events/updateMemberCacheOnMessage.js"; +import { updateMemberCacheOnRoleChange } from "./events/updateMemberCacheOnRoleChange.js"; +import { updateMemberCacheOnVoiceStateUpdate } from "./events/updateMemberCacheOnVoiceStateUpdate.js"; +import { getCachedMemberData } from "./functions/getCachedMemberData.js"; +import { GuildMemberCachePluginType } from "./types.js"; const PENDING_SAVE_INTERVAL = 30 * SECONDS; diff --git a/backend/src/plugins/GuildMemberCache/events/cancelDeletionOnMemberJoin.ts b/backend/src/plugins/GuildMemberCache/events/cancelDeletionOnMemberJoin.ts index 158922d3f..d15e49408 100644 --- a/backend/src/plugins/GuildMemberCache/events/cancelDeletionOnMemberJoin.ts +++ b/backend/src/plugins/GuildMemberCache/events/cancelDeletionOnMemberJoin.ts @@ -1,5 +1,5 @@ import { guildPluginEventListener } from "knub"; -import { GuildMemberCachePluginType } from "../types"; +import { GuildMemberCachePluginType } from "../types.js"; export const cancelDeletionOnMemberJoin = guildPluginEventListener()({ event: "guildMemberAdd", diff --git a/backend/src/plugins/GuildMemberCache/events/removeMemberCacheOnMemberLeave.ts b/backend/src/plugins/GuildMemberCache/events/removeMemberCacheOnMemberLeave.ts index 8015aa9d0..08d23ccd8 100644 --- a/backend/src/plugins/GuildMemberCache/events/removeMemberCacheOnMemberLeave.ts +++ b/backend/src/plugins/GuildMemberCache/events/removeMemberCacheOnMemberLeave.ts @@ -1,5 +1,5 @@ import { guildPluginEventListener } from "knub"; -import { GuildMemberCachePluginType } from "../types"; +import { GuildMemberCachePluginType } from "../types.js"; export const removeMemberCacheOnMemberLeave = guildPluginEventListener()({ event: "guildMemberRemove", diff --git a/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnMemberUpdate.ts b/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnMemberUpdate.ts index 9340495c7..7709902c5 100644 --- a/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnMemberUpdate.ts +++ b/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnMemberUpdate.ts @@ -1,6 +1,6 @@ import { guildPluginEventListener } from "knub"; -import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember"; -import { GuildMemberCachePluginType } from "../types"; +import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember.js"; +import { GuildMemberCachePluginType } from "../types.js"; export const updateMemberCacheOnMemberUpdate = guildPluginEventListener()({ event: "guildMemberUpdate", diff --git a/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnMessage.ts b/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnMessage.ts index 9277620d8..e7777c53d 100644 --- a/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnMessage.ts +++ b/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnMessage.ts @@ -1,6 +1,6 @@ import { guildPluginEventListener } from "knub"; -import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember"; -import { GuildMemberCachePluginType } from "../types"; +import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember.js"; +import { GuildMemberCachePluginType } from "../types.js"; export const updateMemberCacheOnMessage = guildPluginEventListener()({ event: "messageCreate", diff --git a/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnRoleChange.ts b/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnRoleChange.ts index 147cb9ab5..8f8f2abb3 100644 --- a/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnRoleChange.ts +++ b/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnRoleChange.ts @@ -1,7 +1,7 @@ import { AuditLogEvent } from "discord.js"; import { guildPluginEventListener } from "knub"; -import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember"; -import { GuildMemberCachePluginType } from "../types"; +import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember.js"; +import { GuildMemberCachePluginType } from "../types.js"; export const updateMemberCacheOnRoleChange = guildPluginEventListener()({ event: "guildAuditLogEntryCreate", diff --git a/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnVoiceStateUpdate.ts b/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnVoiceStateUpdate.ts index 377d46e65..0e7bc2125 100644 --- a/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnVoiceStateUpdate.ts +++ b/backend/src/plugins/GuildMemberCache/events/updateMemberCacheOnVoiceStateUpdate.ts @@ -1,6 +1,6 @@ import { guildPluginEventListener } from "knub"; -import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember"; -import { GuildMemberCachePluginType } from "../types"; +import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember.js"; +import { GuildMemberCachePluginType } from "../types.js"; export const updateMemberCacheOnVoiceStateUpdate = guildPluginEventListener()({ event: "voiceStateUpdate", diff --git a/backend/src/plugins/GuildMemberCache/functions/getCachedMemberData.ts b/backend/src/plugins/GuildMemberCache/functions/getCachedMemberData.ts index add7cae19..340eae919 100644 --- a/backend/src/plugins/GuildMemberCache/functions/getCachedMemberData.ts +++ b/backend/src/plugins/GuildMemberCache/functions/getCachedMemberData.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { MemberCacheItem } from "../../../data/entities/MemberCacheItem"; -import { GuildMemberCachePluginType } from "../types"; +import { MemberCacheItem } from "../../../data/entities/MemberCacheItem.js"; +import { GuildMemberCachePluginType } from "../types.js"; export function getCachedMemberData( pluginData: GuildPluginData, diff --git a/backend/src/plugins/GuildMemberCache/functions/updateMemberCacheForMember.ts b/backend/src/plugins/GuildMemberCache/functions/updateMemberCacheForMember.ts index 242ff4064..384af1a81 100644 --- a/backend/src/plugins/GuildMemberCache/functions/updateMemberCacheForMember.ts +++ b/backend/src/plugins/GuildMemberCache/functions/updateMemberCacheForMember.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { GuildMemberCachePluginType } from "../types"; +import { GuildMemberCachePluginType } from "../types.js"; export async function updateMemberCacheForMember( pluginData: GuildPluginData, diff --git a/backend/src/plugins/GuildMemberCache/info.ts b/backend/src/plugins/GuildMemberCache/info.ts index 7980a7888..290a6921b 100644 --- a/backend/src/plugins/GuildMemberCache/info.ts +++ b/backend/src/plugins/GuildMemberCache/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const guildMemberCachePluginInfo: ZeppelinPluginInfo = { prettyName: "Guild member cache", diff --git a/backend/src/plugins/GuildMemberCache/types.ts b/backend/src/plugins/GuildMemberCache/types.ts index 03f751470..e38eb6fb1 100644 --- a/backend/src/plugins/GuildMemberCache/types.ts +++ b/backend/src/plugins/GuildMemberCache/types.ts @@ -1,5 +1,5 @@ import { BasePluginType } from "knub"; -import { GuildMemberCache } from "../../data/GuildMemberCache"; +import { GuildMemberCache } from "../../data/GuildMemberCache.js"; export interface GuildMemberCachePluginType extends BasePluginType { state: { diff --git a/backend/src/plugins/InternalPoster/InternalPosterPlugin.ts b/backend/src/plugins/InternalPoster/InternalPosterPlugin.ts index ae01bb643..985608c63 100644 --- a/backend/src/plugins/InternalPoster/InternalPosterPlugin.ts +++ b/backend/src/plugins/InternalPoster/InternalPosterPlugin.ts @@ -1,11 +1,11 @@ import { PluginOptions, guildPlugin } from "knub"; import z from "zod"; -import { Queue } from "../../Queue"; -import { Webhooks } from "../../data/Webhooks"; -import { makePublicFn } from "../../pluginUtils"; -import { editMessage } from "./functions/editMessage"; -import { sendMessage } from "./functions/sendMessage"; -import { InternalPosterPluginType } from "./types"; +import { Queue } from "../../Queue.js"; +import { Webhooks } from "../../data/Webhooks.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { editMessage } from "./functions/editMessage.js"; +import { sendMessage } from "./functions/sendMessage.js"; +import { InternalPosterPluginType } from "./types.js"; const defaultOptions: PluginOptions = { config: {}, diff --git a/backend/src/plugins/InternalPoster/functions/editMessage.ts b/backend/src/plugins/InternalPoster/functions/editMessage.ts index ce250df0f..7f785817c 100644 --- a/backend/src/plugins/InternalPoster/functions/editMessage.ts +++ b/backend/src/plugins/InternalPoster/functions/editMessage.ts @@ -1,7 +1,7 @@ import { Message, MessageEditOptions, WebhookClient, WebhookMessageEditOptions } from "discord.js"; import { GuildPluginData } from "knub"; -import { isDiscordAPIError, noop } from "../../../utils"; -import { InternalPosterPluginType } from "../types"; +import { isDiscordAPIError, noop } from "../../../utils.js"; +import { InternalPosterPluginType } from "../types.js"; /** * Sends a message using a webhook or direct API requests, preferring webhooks when possible. diff --git a/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookClientForChannel.ts b/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookClientForChannel.ts index b97e2cdea..02d2e5e32 100644 --- a/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookClientForChannel.ts +++ b/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookClientForChannel.ts @@ -1,7 +1,7 @@ import { WebhookClient } from "discord.js"; import { GuildPluginData } from "knub"; -import { InternalPosterPluginType } from "../types"; -import { getOrCreateWebhookForChannel, WebhookableChannel } from "./getOrCreateWebhookForChannel"; +import { InternalPosterPluginType } from "../types.js"; +import { getOrCreateWebhookForChannel, WebhookableChannel } from "./getOrCreateWebhookForChannel.js"; export async function getOrCreateWebhookClientForChannel( pluginData: GuildPluginData, diff --git a/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookForChannel.ts b/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookForChannel.ts index d57842129..1cceafd4d 100644 --- a/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookForChannel.ts +++ b/backend/src/plugins/InternalPoster/functions/getOrCreateWebhookForChannel.ts @@ -1,7 +1,7 @@ import { GuildBasedChannel, PermissionsBitField } from "discord.js"; import { GuildPluginData } from "knub"; -import { isDiscordAPIError } from "../../../utils"; -import { InternalPosterPluginType } from "../types"; +import { isDiscordAPIError } from "../../../utils.js"; +import { InternalPosterPluginType } from "../types.js"; type WebhookInfo = [id: string, token: string]; diff --git a/backend/src/plugins/InternalPoster/functions/sendMessage.ts b/backend/src/plugins/InternalPoster/functions/sendMessage.ts index 3d4d6424c..4d8576c46 100644 --- a/backend/src/plugins/InternalPoster/functions/sendMessage.ts +++ b/backend/src/plugins/InternalPoster/functions/sendMessage.ts @@ -1,9 +1,9 @@ import { GuildTextBasedChannel, MessageCreateOptions, WebhookClient } from "discord.js"; import { GuildPluginData } from "knub"; -import { isDiscordAPIError } from "../../../utils"; -import { InternalPosterPluginType } from "../types"; -import { getOrCreateWebhookClientForChannel } from "./getOrCreateWebhookClientForChannel"; -import { channelIsWebhookable } from "./getOrCreateWebhookForChannel"; +import { isDiscordAPIError } from "../../../utils.js"; +import { InternalPosterPluginType } from "../types.js"; +import { getOrCreateWebhookClientForChannel } from "./getOrCreateWebhookClientForChannel.js"; +import { channelIsWebhookable } from "./getOrCreateWebhookForChannel.js"; export type InternalPosterMessageResult = { id: string; diff --git a/backend/src/plugins/InternalPoster/info.ts b/backend/src/plugins/InternalPoster/info.ts index 948bbbc8e..37bab5f01 100644 --- a/backend/src/plugins/InternalPoster/info.ts +++ b/backend/src/plugins/InternalPoster/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const internalPosterPluginInfo: ZeppelinPluginInfo = { prettyName: "Internal poster", diff --git a/backend/src/plugins/InternalPoster/types.ts b/backend/src/plugins/InternalPoster/types.ts index 78dabd42b..cf7473537 100644 --- a/backend/src/plugins/InternalPoster/types.ts +++ b/backend/src/plugins/InternalPoster/types.ts @@ -1,7 +1,7 @@ import { WebhookClient } from "discord.js"; import { BasePluginType } from "knub"; -import { Queue } from "../../Queue"; -import { Webhooks } from "../../data/Webhooks"; +import { Queue } from "../../Queue.js"; +import { Webhooks } from "../../data/Webhooks.js"; export interface InternalPosterPluginType extends BasePluginType { state: { diff --git a/backend/src/plugins/LocateUser/LocateUserPlugin.ts b/backend/src/plugins/LocateUser/LocateUserPlugin.ts index 3fb8f8412..ebfe611fa 100644 --- a/backend/src/plugins/LocateUser/LocateUserPlugin.ts +++ b/backend/src/plugins/LocateUser/LocateUserPlugin.ts @@ -1,14 +1,14 @@ import { PluginOptions, guildPlugin } from "knub"; -import { onGuildEvent } from "../../data/GuildEvents"; -import { GuildVCAlerts } from "../../data/GuildVCAlerts"; -import { FollowCmd } from "./commands/FollowCmd"; -import { DeleteFollowCmd, ListFollowCmd } from "./commands/ListFollowCmd"; -import { WhereCmd } from "./commands/WhereCmd"; -import { GuildBanRemoveAlertsEvt } from "./events/BanRemoveAlertsEvt"; -import { VoiceStateUpdateAlertEvt } from "./events/SendAlertsEvts"; -import { LocateUserPluginType, zLocateUserConfig } from "./types"; -import { clearExpiredAlert } from "./utils/clearExpiredAlert"; -import { fillActiveAlertsList } from "./utils/fillAlertsList"; +import { onGuildEvent } from "../../data/GuildEvents.js"; +import { GuildVCAlerts } from "../../data/GuildVCAlerts.js"; +import { FollowCmd } from "./commands/FollowCmd.js"; +import { DeleteFollowCmd, ListFollowCmd } from "./commands/ListFollowCmd.js"; +import { WhereCmd } from "./commands/WhereCmd.js"; +import { GuildBanRemoveAlertsEvt } from "./events/BanRemoveAlertsEvt.js"; +import { VoiceStateUpdateAlertEvt } from "./events/SendAlertsEvts.js"; +import { LocateUserPluginType, zLocateUserConfig } from "./types.js"; +import { clearExpiredAlert } from "./utils/clearExpiredAlert.js"; +import { fillActiveAlertsList } from "./utils/fillAlertsList.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/LocateUser/commands/FollowCmd.ts b/backend/src/plugins/LocateUser/commands/FollowCmd.ts index 1011f7712..874cbcfa0 100644 --- a/backend/src/plugins/LocateUser/commands/FollowCmd.ts +++ b/backend/src/plugins/LocateUser/commands/FollowCmd.ts @@ -1,10 +1,10 @@ import humanizeDuration from "humanize-duration"; import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { registerExpiringVCAlert } from "../../../data/loops/expiringVCAlertsLoop"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { MINUTES, SECONDS } from "../../../utils"; -import { locateUserCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { registerExpiringVCAlert } from "../../../data/loops/expiringVCAlertsLoop.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { MINUTES, SECONDS } from "../../../utils.js"; +import { locateUserCmd } from "../types.js"; export const FollowCmd = locateUserCmd({ trigger: ["follow", "f"], diff --git a/backend/src/plugins/LocateUser/commands/ListFollowCmd.ts b/backend/src/plugins/LocateUser/commands/ListFollowCmd.ts index d598d8a91..a308dcd25 100644 --- a/backend/src/plugins/LocateUser/commands/ListFollowCmd.ts +++ b/backend/src/plugins/LocateUser/commands/ListFollowCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { clearExpiringVCAlert } from "../../../data/loops/expiringVCAlertsLoop"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { createChunkedMessage, sorter } from "../../../utils"; -import { locateUserCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { clearExpiringVCAlert } from "../../../data/loops/expiringVCAlertsLoop.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { createChunkedMessage, sorter } from "../../../utils.js"; +import { locateUserCmd } from "../types.js"; export const ListFollowCmd = locateUserCmd({ trigger: ["follows", "fs"], diff --git a/backend/src/plugins/LocateUser/commands/WhereCmd.ts b/backend/src/plugins/LocateUser/commands/WhereCmd.ts index 0ff00d911..245a128a7 100644 --- a/backend/src/plugins/LocateUser/commands/WhereCmd.ts +++ b/backend/src/plugins/LocateUser/commands/WhereCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { locateUserCmd } from "../types"; -import { sendWhere } from "../utils/sendWhere"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { locateUserCmd } from "../types.js"; +import { sendWhere } from "../utils/sendWhere.js"; export const WhereCmd = locateUserCmd({ trigger: ["where", "w"], diff --git a/backend/src/plugins/LocateUser/events/BanRemoveAlertsEvt.ts b/backend/src/plugins/LocateUser/events/BanRemoveAlertsEvt.ts index aead67766..9c00f7d4f 100644 --- a/backend/src/plugins/LocateUser/events/BanRemoveAlertsEvt.ts +++ b/backend/src/plugins/LocateUser/events/BanRemoveAlertsEvt.ts @@ -1,5 +1,5 @@ -import { clearExpiringVCAlert } from "../../../data/loops/expiringVCAlertsLoop"; -import { locateUserEvt } from "../types"; +import { clearExpiringVCAlert } from "../../../data/loops/expiringVCAlertsLoop.js"; +import { locateUserEvt } from "../types.js"; export const GuildBanRemoveAlertsEvt = locateUserEvt({ event: "guildBanAdd", diff --git a/backend/src/plugins/LocateUser/events/SendAlertsEvts.ts b/backend/src/plugins/LocateUser/events/SendAlertsEvts.ts index 691afc3da..0269a57fd 100644 --- a/backend/src/plugins/LocateUser/events/SendAlertsEvts.ts +++ b/backend/src/plugins/LocateUser/events/SendAlertsEvts.ts @@ -1,6 +1,6 @@ import { Snowflake } from "discord.js"; -import { locateUserEvt } from "../types"; -import { sendAlerts } from "../utils/sendAlerts"; +import { locateUserEvt } from "../types.js"; +import { sendAlerts } from "../utils/sendAlerts.js"; export const VoiceStateUpdateAlertEvt = locateUserEvt({ event: "voiceStateUpdate", diff --git a/backend/src/plugins/LocateUser/info.ts b/backend/src/plugins/LocateUser/info.ts index 41fcf11b5..ee7cc3f76 100644 --- a/backend/src/plugins/LocateUser/info.ts +++ b/backend/src/plugins/LocateUser/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zLocateUserConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zLocateUserConfig } from "./types.js"; export const locateUserPluginInfo: ZeppelinPluginInfo = { prettyName: "Locate user", diff --git a/backend/src/plugins/LocateUser/types.ts b/backend/src/plugins/LocateUser/types.ts index 4139f4656..568249cd8 100644 --- a/backend/src/plugins/LocateUser/types.ts +++ b/backend/src/plugins/LocateUser/types.ts @@ -1,6 +1,6 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildVCAlerts } from "../../data/GuildVCAlerts"; +import { GuildVCAlerts } from "../../data/GuildVCAlerts.js"; export const zLocateUserConfig = z.strictObject({ can_where: z.boolean(), diff --git a/backend/src/plugins/LocateUser/utils/clearExpiredAlert.ts b/backend/src/plugins/LocateUser/utils/clearExpiredAlert.ts index 9683417b2..f09ae9fa4 100644 --- a/backend/src/plugins/LocateUser/utils/clearExpiredAlert.ts +++ b/backend/src/plugins/LocateUser/utils/clearExpiredAlert.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { VCAlert } from "../../../data/entities/VCAlert"; -import { LocateUserPluginType } from "../types"; -import { removeUserIdFromActiveAlerts } from "./removeUserIdFromActiveAlerts"; +import { VCAlert } from "../../../data/entities/VCAlert.js"; +import { LocateUserPluginType } from "../types.js"; +import { removeUserIdFromActiveAlerts } from "./removeUserIdFromActiveAlerts.js"; export async function clearExpiredAlert(pluginData: GuildPluginData, alert: VCAlert) { await pluginData.state.alerts.delete(alert.id); diff --git a/backend/src/plugins/LocateUser/utils/fillAlertsList.ts b/backend/src/plugins/LocateUser/utils/fillAlertsList.ts index 56e4315fc..d3b56fcfd 100644 --- a/backend/src/plugins/LocateUser/utils/fillAlertsList.ts +++ b/backend/src/plugins/LocateUser/utils/fillAlertsList.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { LocateUserPluginType } from "../types"; +import { LocateUserPluginType } from "../types.js"; export async function fillActiveAlertsList(pluginData: GuildPluginData) { const allAlerts = await pluginData.state.alerts.getAllGuildAlerts(); diff --git a/backend/src/plugins/LocateUser/utils/moveMember.ts b/backend/src/plugins/LocateUser/utils/moveMember.ts index 8d044d597..1f6ed7922 100644 --- a/backend/src/plugins/LocateUser/utils/moveMember.ts +++ b/backend/src/plugins/LocateUser/utils/moveMember.ts @@ -1,7 +1,7 @@ import { GuildMember, GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { LocateUserPluginType } from "../types"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { LocateUserPluginType } from "../types.js"; export async function moveMember( pluginData: GuildPluginData, diff --git a/backend/src/plugins/LocateUser/utils/removeUserIdFromActiveAlerts.ts b/backend/src/plugins/LocateUser/utils/removeUserIdFromActiveAlerts.ts index adfffb955..564c682a0 100644 --- a/backend/src/plugins/LocateUser/utils/removeUserIdFromActiveAlerts.ts +++ b/backend/src/plugins/LocateUser/utils/removeUserIdFromActiveAlerts.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { LocateUserPluginType } from "../types"; +import { LocateUserPluginType } from "../types.js"; export async function removeUserIdFromActiveAlerts(pluginData: GuildPluginData, userId: string) { const index = pluginData.state.usersWithAlerts.indexOf(userId); diff --git a/backend/src/plugins/LocateUser/utils/sendAlerts.ts b/backend/src/plugins/LocateUser/utils/sendAlerts.ts index 66e6a222b..78a58911c 100644 --- a/backend/src/plugins/LocateUser/utils/sendAlerts.ts +++ b/backend/src/plugins/LocateUser/utils/sendAlerts.ts @@ -1,9 +1,9 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { resolveMember } from "../../../utils"; -import { LocateUserPluginType } from "../types"; -import { moveMember } from "./moveMember"; -import { sendWhere } from "./sendWhere"; +import { resolveMember } from "../../../utils.js"; +import { LocateUserPluginType } from "../types.js"; +import { moveMember } from "./moveMember.js"; +import { sendWhere } from "./sendWhere.js"; export async function sendAlerts(pluginData: GuildPluginData, userId: string) { const triggeredAlerts = await pluginData.state.alerts.getAlertsByUserId(userId); diff --git a/backend/src/plugins/LocateUser/utils/sendWhere.ts b/backend/src/plugins/LocateUser/utils/sendWhere.ts index 7faaad80a..1c12636be 100644 --- a/backend/src/plugins/LocateUser/utils/sendWhere.ts +++ b/backend/src/plugins/LocateUser/utils/sendWhere.ts @@ -1,9 +1,9 @@ import { GuildMember, GuildTextBasedChannel, Invite, VoiceChannel } from "discord.js"; import { GuildPluginData } from "knub"; import { getInviteLink } from "knub/helpers"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { LocateUserPluginType } from "../types"; -import { createOrReuseInvite } from "./createOrReuseInvite"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { LocateUserPluginType } from "../types.js"; +import { createOrReuseInvite } from "./createOrReuseInvite.js"; export async function sendWhere( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Logs/LogsPlugin.ts b/backend/src/plugins/Logs/LogsPlugin.ts index 3bb102d7d..9fc3e1420 100644 --- a/backend/src/plugins/Logs/LogsPlugin.ts +++ b/backend/src/plugins/Logs/LogsPlugin.ts @@ -1,16 +1,16 @@ import { CooldownManager, PluginOptions, guildPlugin } from "knub"; -import DefaultLogMessages from "../../data/DefaultLogMessages.json"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildCases } from "../../data/GuildCases"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { LogType } from "../../data/LogType"; -import { logger } from "../../logger"; -import { makePublicFn } from "../../pluginUtils"; -import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners"; -import { createTypedTemplateSafeValueContainer } from "../../templateFormatter"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { LogsChannelCreateEvt, LogsChannelDeleteEvt, LogsChannelUpdateEvt } from "./events/LogsChannelModifyEvts"; +import DefaultLogMessages from "../../data/DefaultLogMessages.json" assert { type: "json" }; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { LogType } from "../../data/LogType.js"; +import { logger } from "../../logger.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners.js"; +import { createTypedTemplateSafeValueContainer } from "../../templateFormatter.js"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { LogsChannelCreateEvt, LogsChannelDeleteEvt, LogsChannelUpdateEvt } from "./events/LogsChannelModifyEvts.js"; import { LogsEmojiCreateEvt, LogsEmojiDeleteEvt, @@ -18,97 +18,97 @@ import { LogsStickerCreateEvt, LogsStickerDeleteEvt, LogsStickerUpdateEvt, -} from "./events/LogsEmojiAndStickerModifyEvts"; -import { LogsGuildMemberAddEvt } from "./events/LogsGuildMemberAddEvt"; -import { LogsGuildMemberRemoveEvt } from "./events/LogsGuildMemberRemoveEvt"; -import { LogsRoleCreateEvt, LogsRoleDeleteEvt, LogsRoleUpdateEvt } from "./events/LogsRoleModifyEvts"; +} from "./events/LogsEmojiAndStickerModifyEvts.js"; +import { LogsGuildMemberAddEvt } from "./events/LogsGuildMemberAddEvt.js"; +import { LogsGuildMemberRemoveEvt } from "./events/LogsGuildMemberRemoveEvt.js"; +import { LogsRoleCreateEvt, LogsRoleDeleteEvt, LogsRoleUpdateEvt } from "./events/LogsRoleModifyEvts.js"; import { LogsStageInstanceCreateEvt, LogsStageInstanceDeleteEvt, LogsStageInstanceUpdateEvt, -} from "./events/LogsStageInstanceModifyEvts"; -import { LogsThreadCreateEvt, LogsThreadDeleteEvt, LogsThreadUpdateEvt } from "./events/LogsThreadModifyEvts"; -import { LogsGuildMemberUpdateEvt } from "./events/LogsUserUpdateEvts"; -import { LogsVoiceStateUpdateEvt } from "./events/LogsVoiceChannelEvts"; -import { FORMAT_NO_TIMESTAMP, LogsPluginType, zLogsConfig } from "./types"; -import { getLogMessage } from "./util/getLogMessage"; -import { log } from "./util/log"; -import { onMessageDelete } from "./util/onMessageDelete"; -import { onMessageDeleteBulk } from "./util/onMessageDeleteBulk"; -import { onMessageUpdate } from "./util/onMessageUpdate"; +} from "./events/LogsStageInstanceModifyEvts.js"; +import { LogsThreadCreateEvt, LogsThreadDeleteEvt, LogsThreadUpdateEvt } from "./events/LogsThreadModifyEvts.js"; +import { LogsGuildMemberUpdateEvt } from "./events/LogsUserUpdateEvts.js"; +import { LogsVoiceStateUpdateEvt } from "./events/LogsVoiceChannelEvts.js"; +import { FORMAT_NO_TIMESTAMP, LogsPluginType, zLogsConfig } from "./types.js"; +import { getLogMessage } from "./util/getLogMessage.js"; +import { log } from "./util/log.js"; +import { onMessageDelete } from "./util/onMessageDelete.js"; +import { onMessageDeleteBulk } from "./util/onMessageDeleteBulk.js"; +import { onMessageUpdate } from "./util/onMessageUpdate.js"; import { escapeCodeBlock } from "discord.js"; -import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin"; -import { LogsGuildMemberRoleChangeEvt } from "./events/LogsGuildMemberRoleChangeEvt"; -import { logAutomodAction } from "./logFunctions/logAutomodAction"; -import { logBotAlert } from "./logFunctions/logBotAlert"; -import { logCaseCreate } from "./logFunctions/logCaseCreate"; -import { logCaseDelete } from "./logFunctions/logCaseDelete"; -import { logCaseUpdate } from "./logFunctions/logCaseUpdate"; -import { logCensor } from "./logFunctions/logCensor"; -import { logChannelCreate } from "./logFunctions/logChannelCreate"; -import { logChannelDelete } from "./logFunctions/logChannelDelete"; -import { logChannelUpdate } from "./logFunctions/logChannelUpdate"; -import { logClean } from "./logFunctions/logClean"; -import { logDmFailed } from "./logFunctions/logDmFailed"; -import { logEmojiCreate } from "./logFunctions/logEmojiCreate"; -import { logEmojiDelete } from "./logFunctions/logEmojiDelete"; -import { logEmojiUpdate } from "./logFunctions/logEmojiUpdate"; -import { logMassBan } from "./logFunctions/logMassBan"; -import { logMassMute } from "./logFunctions/logMassMute"; -import { logMassUnban } from "./logFunctions/logMassUnban"; -import { logMemberBan } from "./logFunctions/logMemberBan"; -import { logMemberForceban } from "./logFunctions/logMemberForceban"; -import { logMemberJoin } from "./logFunctions/logMemberJoin"; -import { logMemberJoinWithPriorRecords } from "./logFunctions/logMemberJoinWithPriorRecords"; -import { logMemberKick } from "./logFunctions/logMemberKick"; -import { logMemberLeave } from "./logFunctions/logMemberLeave"; -import { logMemberMute } from "./logFunctions/logMemberMute"; -import { logMemberMuteExpired } from "./logFunctions/logMemberMuteExpired"; -import { logMemberMuteRejoin } from "./logFunctions/logMemberMuteRejoin"; -import { logMemberNickChange } from "./logFunctions/logMemberNickChange"; -import { logMemberNote } from "./logFunctions/logMemberNote"; -import { logMemberRestore } from "./logFunctions/logMemberRestore"; -import { logMemberRoleAdd } from "./logFunctions/logMemberRoleAdd"; -import { logMemberRoleChanges } from "./logFunctions/logMemberRoleChanges"; -import { logMemberRoleRemove } from "./logFunctions/logMemberRoleRemove"; -import { logMemberTimedBan } from "./logFunctions/logMemberTimedBan"; -import { logMemberTimedMute } from "./logFunctions/logMemberTimedMute"; -import { logMemberTimedUnban } from "./logFunctions/logMemberTimedUnban"; -import { logMemberTimedUnmute } from "./logFunctions/logMemberTimedUnmute"; -import { logMemberUnban } from "./logFunctions/logMemberUnban"; -import { logMemberUnmute } from "./logFunctions/logMemberUnmute"; -import { logMemberWarn } from "./logFunctions/logMemberWarn"; -import { logMessageDelete } from "./logFunctions/logMessageDelete"; -import { logMessageDeleteAuto } from "./logFunctions/logMessageDeleteAuto"; -import { logMessageDeleteBare } from "./logFunctions/logMessageDeleteBare"; -import { logMessageDeleteBulk } from "./logFunctions/logMessageDeleteBulk"; -import { logMessageEdit } from "./logFunctions/logMessageEdit"; -import { logMessageSpamDetected } from "./logFunctions/logMessageSpamDetected"; -import { logOtherSpamDetected } from "./logFunctions/logOtherSpamDetected"; -import { logPostedScheduledMessage } from "./logFunctions/logPostedScheduledMessage"; -import { logRepeatedMessage } from "./logFunctions/logRepeatedMessage"; -import { logRoleCreate } from "./logFunctions/logRoleCreate"; -import { logRoleDelete } from "./logFunctions/logRoleDelete"; -import { logRoleUpdate } from "./logFunctions/logRoleUpdate"; -import { logScheduledMessage } from "./logFunctions/logScheduledMessage"; -import { logScheduledRepeatedMessage } from "./logFunctions/logScheduledRepeatedMessage"; -import { logSetAntiraidAuto } from "./logFunctions/logSetAntiraidAuto"; -import { logSetAntiraidUser } from "./logFunctions/logSetAntiraidUser"; -import { logStageInstanceCreate } from "./logFunctions/logStageInstanceCreate"; -import { logStageInstanceDelete } from "./logFunctions/logStageInstanceDelete"; -import { logStageInstanceUpdate } from "./logFunctions/logStageInstanceUpdate"; -import { logStickerCreate } from "./logFunctions/logStickerCreate"; -import { logStickerDelete } from "./logFunctions/logStickerDelete"; -import { logStickerUpdate } from "./logFunctions/logStickerUpdate"; -import { logThreadCreate } from "./logFunctions/logThreadCreate"; -import { logThreadDelete } from "./logFunctions/logThreadDelete"; -import { logThreadUpdate } from "./logFunctions/logThreadUpdate"; -import { logVoiceChannelForceDisconnect } from "./logFunctions/logVoiceChannelForceDisconnect"; -import { logVoiceChannelForceMove } from "./logFunctions/logVoiceChannelForceMove"; -import { logVoiceChannelJoin } from "./logFunctions/logVoiceChannelJoin"; -import { logVoiceChannelLeave } from "./logFunctions/logVoiceChannelLeave"; -import { logVoiceChannelMove } from "./logFunctions/logVoiceChannelMove"; +import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin.js"; +import { LogsGuildMemberRoleChangeEvt } from "./events/LogsGuildMemberRoleChangeEvt.js"; +import { logAutomodAction } from "./logFunctions/logAutomodAction.js"; +import { logBotAlert } from "./logFunctions/logBotAlert.js"; +import { logCaseCreate } from "./logFunctions/logCaseCreate.js"; +import { logCaseDelete } from "./logFunctions/logCaseDelete.js"; +import { logCaseUpdate } from "./logFunctions/logCaseUpdate.js"; +import { logCensor } from "./logFunctions/logCensor.js"; +import { logChannelCreate } from "./logFunctions/logChannelCreate.js"; +import { logChannelDelete } from "./logFunctions/logChannelDelete.js"; +import { logChannelUpdate } from "./logFunctions/logChannelUpdate.js"; +import { logClean } from "./logFunctions/logClean.js"; +import { logDmFailed } from "./logFunctions/logDmFailed.js"; +import { logEmojiCreate } from "./logFunctions/logEmojiCreate.js"; +import { logEmojiDelete } from "./logFunctions/logEmojiDelete.js"; +import { logEmojiUpdate } from "./logFunctions/logEmojiUpdate.js"; +import { logMassBan } from "./logFunctions/logMassBan.js"; +import { logMassMute } from "./logFunctions/logMassMute.js"; +import { logMassUnban } from "./logFunctions/logMassUnban.js"; +import { logMemberBan } from "./logFunctions/logMemberBan.js"; +import { logMemberForceban } from "./logFunctions/logMemberForceban.js"; +import { logMemberJoin } from "./logFunctions/logMemberJoin.js"; +import { logMemberJoinWithPriorRecords } from "./logFunctions/logMemberJoinWithPriorRecords.js"; +import { logMemberKick } from "./logFunctions/logMemberKick.js"; +import { logMemberLeave } from "./logFunctions/logMemberLeave.js"; +import { logMemberMute } from "./logFunctions/logMemberMute.js"; +import { logMemberMuteExpired } from "./logFunctions/logMemberMuteExpired.js"; +import { logMemberMuteRejoin } from "./logFunctions/logMemberMuteRejoin.js"; +import { logMemberNickChange } from "./logFunctions/logMemberNickChange.js"; +import { logMemberNote } from "./logFunctions/logMemberNote.js"; +import { logMemberRestore } from "./logFunctions/logMemberRestore.js"; +import { logMemberRoleAdd } from "./logFunctions/logMemberRoleAdd.js"; +import { logMemberRoleChanges } from "./logFunctions/logMemberRoleChanges.js"; +import { logMemberRoleRemove } from "./logFunctions/logMemberRoleRemove.js"; +import { logMemberTimedBan } from "./logFunctions/logMemberTimedBan.js"; +import { logMemberTimedMute } from "./logFunctions/logMemberTimedMute.js"; +import { logMemberTimedUnban } from "./logFunctions/logMemberTimedUnban.js"; +import { logMemberTimedUnmute } from "./logFunctions/logMemberTimedUnmute.js"; +import { logMemberUnban } from "./logFunctions/logMemberUnban.js"; +import { logMemberUnmute } from "./logFunctions/logMemberUnmute.js"; +import { logMemberWarn } from "./logFunctions/logMemberWarn.js"; +import { logMessageDelete } from "./logFunctions/logMessageDelete.js"; +import { logMessageDeleteAuto } from "./logFunctions/logMessageDeleteAuto.js"; +import { logMessageDeleteBare } from "./logFunctions/logMessageDeleteBare.js"; +import { logMessageDeleteBulk } from "./logFunctions/logMessageDeleteBulk.js"; +import { logMessageEdit } from "./logFunctions/logMessageEdit.js"; +import { logMessageSpamDetected } from "./logFunctions/logMessageSpamDetected.js"; +import { logOtherSpamDetected } from "./logFunctions/logOtherSpamDetected.js"; +import { logPostedScheduledMessage } from "./logFunctions/logPostedScheduledMessage.js"; +import { logRepeatedMessage } from "./logFunctions/logRepeatedMessage.js"; +import { logRoleCreate } from "./logFunctions/logRoleCreate.js"; +import { logRoleDelete } from "./logFunctions/logRoleDelete.js"; +import { logRoleUpdate } from "./logFunctions/logRoleUpdate.js"; +import { logScheduledMessage } from "./logFunctions/logScheduledMessage.js"; +import { logScheduledRepeatedMessage } from "./logFunctions/logScheduledRepeatedMessage.js"; +import { logSetAntiraidAuto } from "./logFunctions/logSetAntiraidAuto.js"; +import { logSetAntiraidUser } from "./logFunctions/logSetAntiraidUser.js"; +import { logStageInstanceCreate } from "./logFunctions/logStageInstanceCreate.js"; +import { logStageInstanceDelete } from "./logFunctions/logStageInstanceDelete.js"; +import { logStageInstanceUpdate } from "./logFunctions/logStageInstanceUpdate.js"; +import { logStickerCreate } from "./logFunctions/logStickerCreate.js"; +import { logStickerDelete } from "./logFunctions/logStickerDelete.js"; +import { logStickerUpdate } from "./logFunctions/logStickerUpdate.js"; +import { logThreadCreate } from "./logFunctions/logThreadCreate.js"; +import { logThreadDelete } from "./logFunctions/logThreadDelete.js"; +import { logThreadUpdate } from "./logFunctions/logThreadUpdate.js"; +import { logVoiceChannelForceDisconnect } from "./logFunctions/logVoiceChannelForceDisconnect.js"; +import { logVoiceChannelForceMove } from "./logFunctions/logVoiceChannelForceMove.js"; +import { logVoiceChannelJoin } from "./logFunctions/logVoiceChannelJoin.js"; +import { logVoiceChannelLeave } from "./logFunctions/logVoiceChannelLeave.js"; +import { logVoiceChannelMove } from "./logFunctions/logVoiceChannelMove.js"; // The `any` cast here is to prevent TypeScript from locking up from the circular dependency function getCasesPlugin(): Promise { diff --git a/backend/src/plugins/Logs/events/LogsChannelModifyEvts.ts b/backend/src/plugins/Logs/events/LogsChannelModifyEvts.ts index 79c06dcff..dfa9b4893 100644 --- a/backend/src/plugins/Logs/events/LogsChannelModifyEvts.ts +++ b/backend/src/plugins/Logs/events/LogsChannelModifyEvts.ts @@ -1,10 +1,10 @@ import { TextChannel, VoiceChannel } from "discord.js"; -import { differenceToString, getScalarDifference } from "../../../utils"; -import { filterObject } from "../../../utils/filterObject"; -import { logChannelCreate } from "../logFunctions/logChannelCreate"; -import { logChannelDelete } from "../logFunctions/logChannelDelete"; -import { logChannelUpdate } from "../logFunctions/logChannelUpdate"; -import { logsEvt } from "../types"; +import { differenceToString, getScalarDifference } from "../../../utils.js"; +import { filterObject } from "../../../utils/filterObject.js"; +import { logChannelCreate } from "../logFunctions/logChannelCreate.js"; +import { logChannelDelete } from "../logFunctions/logChannelDelete.js"; +import { logChannelUpdate } from "../logFunctions/logChannelUpdate.js"; +import { logsEvt } from "../types.js"; export const LogsChannelCreateEvt = logsEvt({ event: "channelCreate", diff --git a/backend/src/plugins/Logs/events/LogsEmojiAndStickerModifyEvts.ts b/backend/src/plugins/Logs/events/LogsEmojiAndStickerModifyEvts.ts index 414073cf1..61236ed99 100644 --- a/backend/src/plugins/Logs/events/LogsEmojiAndStickerModifyEvts.ts +++ b/backend/src/plugins/Logs/events/LogsEmojiAndStickerModifyEvts.ts @@ -1,13 +1,13 @@ import { GuildEmoji, Sticker } from "discord.js"; -import { differenceToString, getScalarDifference } from "../../../utils"; -import { filterObject } from "../../../utils/filterObject"; -import { logEmojiCreate } from "../logFunctions/logEmojiCreate"; -import { logEmojiDelete } from "../logFunctions/logEmojiDelete"; -import { logEmojiUpdate } from "../logFunctions/logEmojiUpdate"; -import { logStickerCreate } from "../logFunctions/logStickerCreate"; -import { logStickerDelete } from "../logFunctions/logStickerDelete"; -import { logStickerUpdate } from "../logFunctions/logStickerUpdate"; -import { logsEvt } from "../types"; +import { differenceToString, getScalarDifference } from "../../../utils.js"; +import { filterObject } from "../../../utils/filterObject.js"; +import { logEmojiCreate } from "../logFunctions/logEmojiCreate.js"; +import { logEmojiDelete } from "../logFunctions/logEmojiDelete.js"; +import { logEmojiUpdate } from "../logFunctions/logEmojiUpdate.js"; +import { logStickerCreate } from "../logFunctions/logStickerCreate.js"; +import { logStickerDelete } from "../logFunctions/logStickerDelete.js"; +import { logStickerUpdate } from "../logFunctions/logStickerUpdate.js"; +import { logsEvt } from "../types.js"; export const LogsEmojiCreateEvt = logsEvt({ event: "emojiCreate", diff --git a/backend/src/plugins/Logs/events/LogsGuildBanEvts.ts b/backend/src/plugins/Logs/events/LogsGuildBanEvts.ts index 1fda8b804..0b6c2558e 100644 --- a/backend/src/plugins/Logs/events/LogsGuildBanEvts.ts +++ b/backend/src/plugins/Logs/events/LogsGuildBanEvts.ts @@ -1,10 +1,10 @@ import { AuditLogEvent } from "discord.js"; -import { LogType } from "../../../data/LogType"; -import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry"; -import { logMemberBan } from "../logFunctions/logMemberBan"; -import { logMemberUnban } from "../logFunctions/logMemberUnban"; -import { logsEvt } from "../types"; -import { isLogIgnored } from "../util/isLogIgnored"; +import { LogType } from "../../../data/LogType.js"; +import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry.js"; +import { logMemberBan } from "../logFunctions/logMemberBan.js"; +import { logMemberUnban } from "../logFunctions/logMemberUnban.js"; +import { logsEvt } from "../types.js"; +import { isLogIgnored } from "../util/isLogIgnored.js"; export const LogsGuildBanAddEvt = logsEvt({ event: "guildBanAdd", diff --git a/backend/src/plugins/Logs/events/LogsGuildMemberAddEvt.ts b/backend/src/plugins/Logs/events/LogsGuildMemberAddEvt.ts index 31e3ecd0d..d792e060c 100644 --- a/backend/src/plugins/Logs/events/LogsGuildMemberAddEvt.ts +++ b/backend/src/plugins/Logs/events/LogsGuildMemberAddEvt.ts @@ -1,5 +1,5 @@ -import { logMemberJoin } from "../logFunctions/logMemberJoin"; -import { logsEvt } from "../types"; +import { logMemberJoin } from "../logFunctions/logMemberJoin.js"; +import { logsEvt } from "../types.js"; export const LogsGuildMemberAddEvt = logsEvt({ event: "guildMemberAdd", diff --git a/backend/src/plugins/Logs/events/LogsGuildMemberRemoveEvt.ts b/backend/src/plugins/Logs/events/LogsGuildMemberRemoveEvt.ts index 5c3fc9234..9a4010cbd 100644 --- a/backend/src/plugins/Logs/events/LogsGuildMemberRemoveEvt.ts +++ b/backend/src/plugins/Logs/events/LogsGuildMemberRemoveEvt.ts @@ -1,5 +1,5 @@ -import { logMemberLeave } from "../logFunctions/logMemberLeave"; -import { logsEvt } from "../types"; +import { logMemberLeave } from "../logFunctions/logMemberLeave.js"; +import { logsEvt } from "../types.js"; export const LogsGuildMemberRemoveEvt = logsEvt({ event: "guildMemberRemove", diff --git a/backend/src/plugins/Logs/events/LogsGuildMemberRoleChangeEvt.ts b/backend/src/plugins/Logs/events/LogsGuildMemberRoleChangeEvt.ts index ad1ef2d1f..2075c020a 100644 --- a/backend/src/plugins/Logs/events/LogsGuildMemberRoleChangeEvt.ts +++ b/backend/src/plugins/Logs/events/LogsGuildMemberRoleChangeEvt.ts @@ -1,9 +1,9 @@ import { APIRole, AuditLogChange, AuditLogEvent } from "discord.js"; import { guildPluginEventListener } from "knub"; -import { resolveRole } from "../../../utils"; -import { logMemberRoleAdd } from "../logFunctions/logMemberRoleAdd"; -import { logMemberRoleRemove } from "../logFunctions/logMemberRoleRemove"; -import { LogsPluginType } from "../types"; +import { resolveRole } from "../../../utils.js"; +import { logMemberRoleAdd } from "../logFunctions/logMemberRoleAdd.js"; +import { logMemberRoleRemove } from "../logFunctions/logMemberRoleRemove.js"; +import { LogsPluginType } from "../types.js"; type RoleAddChange = AuditLogChange & { key: "$add"; diff --git a/backend/src/plugins/Logs/events/LogsRoleModifyEvts.ts b/backend/src/plugins/Logs/events/LogsRoleModifyEvts.ts index c44a48941..31bae0f1e 100644 --- a/backend/src/plugins/Logs/events/LogsRoleModifyEvts.ts +++ b/backend/src/plugins/Logs/events/LogsRoleModifyEvts.ts @@ -1,10 +1,10 @@ import { Role } from "discord.js"; -import { differenceToString, getScalarDifference } from "../../../utils"; -import { filterObject } from "../../../utils/filterObject"; -import { logRoleCreate } from "../logFunctions/logRoleCreate"; -import { logRoleDelete } from "../logFunctions/logRoleDelete"; -import { logRoleUpdate } from "../logFunctions/logRoleUpdate"; -import { logsEvt } from "../types"; +import { differenceToString, getScalarDifference } from "../../../utils.js"; +import { filterObject } from "../../../utils/filterObject.js"; +import { logRoleCreate } from "../logFunctions/logRoleCreate.js"; +import { logRoleDelete } from "../logFunctions/logRoleDelete.js"; +import { logRoleUpdate } from "../logFunctions/logRoleUpdate.js"; +import { logsEvt } from "../types.js"; export const LogsRoleCreateEvt = logsEvt({ event: "roleCreate", diff --git a/backend/src/plugins/Logs/events/LogsStageInstanceModifyEvts.ts b/backend/src/plugins/Logs/events/LogsStageInstanceModifyEvts.ts index 202fee0d3..10d2960c8 100644 --- a/backend/src/plugins/Logs/events/LogsStageInstanceModifyEvts.ts +++ b/backend/src/plugins/Logs/events/LogsStageInstanceModifyEvts.ts @@ -1,10 +1,10 @@ import { StageChannel, StageInstance } from "discord.js"; -import { differenceToString, getScalarDifference } from "../../../utils"; -import { filterObject } from "../../../utils/filterObject"; -import { logStageInstanceCreate } from "../logFunctions/logStageInstanceCreate"; -import { logStageInstanceDelete } from "../logFunctions/logStageInstanceDelete"; -import { logStageInstanceUpdate } from "../logFunctions/logStageInstanceUpdate"; -import { logsEvt } from "../types"; +import { differenceToString, getScalarDifference } from "../../../utils.js"; +import { filterObject } from "../../../utils/filterObject.js"; +import { logStageInstanceCreate } from "../logFunctions/logStageInstanceCreate.js"; +import { logStageInstanceDelete } from "../logFunctions/logStageInstanceDelete.js"; +import { logStageInstanceUpdate } from "../logFunctions/logStageInstanceUpdate.js"; +import { logsEvt } from "../types.js"; export const LogsStageInstanceCreateEvt = logsEvt({ event: "stageInstanceCreate", diff --git a/backend/src/plugins/Logs/events/LogsThreadModifyEvts.ts b/backend/src/plugins/Logs/events/LogsThreadModifyEvts.ts index 2568a1bc4..71327a436 100644 --- a/backend/src/plugins/Logs/events/LogsThreadModifyEvts.ts +++ b/backend/src/plugins/Logs/events/LogsThreadModifyEvts.ts @@ -1,10 +1,10 @@ import { ThreadChannel } from "discord.js"; -import { differenceToString, getScalarDifference } from "../../../utils"; -import { filterObject } from "../../../utils/filterObject"; -import { logThreadCreate } from "../logFunctions/logThreadCreate"; -import { logThreadDelete } from "../logFunctions/logThreadDelete"; -import { logThreadUpdate } from "../logFunctions/logThreadUpdate"; -import { logsEvt } from "../types"; +import { differenceToString, getScalarDifference } from "../../../utils.js"; +import { filterObject } from "../../../utils/filterObject.js"; +import { logThreadCreate } from "../logFunctions/logThreadCreate.js"; +import { logThreadDelete } from "../logFunctions/logThreadDelete.js"; +import { logThreadUpdate } from "../logFunctions/logThreadUpdate.js"; +import { logsEvt } from "../types.js"; export const LogsThreadCreateEvt = logsEvt({ event: "threadCreate", diff --git a/backend/src/plugins/Logs/events/LogsUserUpdateEvts.ts b/backend/src/plugins/Logs/events/LogsUserUpdateEvts.ts index f5da56fcf..849647d73 100644 --- a/backend/src/plugins/Logs/events/LogsUserUpdateEvts.ts +++ b/backend/src/plugins/Logs/events/LogsUserUpdateEvts.ts @@ -1,5 +1,5 @@ -import { logMemberNickChange } from "../logFunctions/logMemberNickChange"; -import { logsEvt } from "../types"; +import { logMemberNickChange } from "../logFunctions/logMemberNickChange.js"; +import { logsEvt } from "../types.js"; export const LogsGuildMemberUpdateEvt = logsEvt({ event: "guildMemberUpdate", diff --git a/backend/src/plugins/Logs/events/LogsVoiceChannelEvts.ts b/backend/src/plugins/Logs/events/LogsVoiceChannelEvts.ts index 4b21610eb..d06577c95 100644 --- a/backend/src/plugins/Logs/events/LogsVoiceChannelEvts.ts +++ b/backend/src/plugins/Logs/events/LogsVoiceChannelEvts.ts @@ -1,7 +1,7 @@ -import { logVoiceChannelJoin } from "../logFunctions/logVoiceChannelJoin"; -import { logVoiceChannelLeave } from "../logFunctions/logVoiceChannelLeave"; -import { logVoiceChannelMove } from "../logFunctions/logVoiceChannelMove"; -import { logsEvt } from "../types"; +import { logVoiceChannelJoin } from "../logFunctions/logVoiceChannelJoin.js"; +import { logVoiceChannelLeave } from "../logFunctions/logVoiceChannelLeave.js"; +import { logVoiceChannelMove } from "../logFunctions/logVoiceChannelMove.js"; +import { logsEvt } from "../types.js"; export const LogsVoiceStateUpdateEvt = logsEvt({ event: "voiceStateUpdate", diff --git a/backend/src/plugins/Logs/info.ts b/backend/src/plugins/Logs/info.ts index 10683a03f..6d9f200ac 100644 --- a/backend/src/plugins/Logs/info.ts +++ b/backend/src/plugins/Logs/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zLogsConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zLogsConfig } from "./types.js"; export const logsPluginInfo: ZeppelinPluginInfo = { prettyName: "Logs", diff --git a/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts b/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts index bd9921c08..e18592622 100644 --- a/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts +++ b/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts @@ -1,10 +1,10 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogAutomodActionData { rule: string; diff --git a/backend/src/plugins/Logs/logFunctions/logBotAlert.ts b/backend/src/plugins/Logs/logFunctions/logBotAlert.ts index 372a7489c..135dd8db2 100644 --- a/backend/src/plugins/Logs/logFunctions/logBotAlert.ts +++ b/backend/src/plugins/Logs/logFunctions/logBotAlert.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogBotAlertData { body: string; diff --git a/backend/src/plugins/Logs/logFunctions/logCaseCreate.ts b/backend/src/plugins/Logs/logFunctions/logCaseCreate.ts index dd144a726..270887368 100644 --- a/backend/src/plugins/Logs/logFunctions/logCaseCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logCaseCreate.ts @@ -1,10 +1,10 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogCaseCreateData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logCaseDelete.ts b/backend/src/plugins/Logs/logFunctions/logCaseDelete.ts index 300348339..27998d6ea 100644 --- a/backend/src/plugins/Logs/logFunctions/logCaseDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logCaseDelete.ts @@ -1,11 +1,11 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { Case } from "../../../data/entities/Case"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { caseToTemplateSafeCase, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { Case } from "../../../data/entities/Case.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { caseToTemplateSafeCase, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogCaseDeleteData { mod: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logCaseUpdate.ts b/backend/src/plugins/Logs/logFunctions/logCaseUpdate.ts index c6499aac6..9040130bf 100644 --- a/backend/src/plugins/Logs/logFunctions/logCaseUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logCaseUpdate.ts @@ -1,10 +1,10 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogCaseUpdateData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logCensor.ts b/backend/src/plugins/Logs/logFunctions/logCensor.ts index e911a61e5..62de0f82b 100644 --- a/backend/src/plugins/Logs/logFunctions/logCensor.ts +++ b/backend/src/plugins/Logs/logFunctions/logCensor.ts @@ -1,18 +1,18 @@ import { GuildTextBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; import { deactivateMentions, disableCodeBlocks } from "knub/helpers"; -import { LogType } from "../../../data/LogType"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; +import { LogType } from "../../../data/LogType.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; import { channelToTemplateSafeChannel, savedMessageToTemplateSafeSavedMessage, userToTemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +} from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogCensorData { user: User | UnknownUser; diff --git a/backend/src/plugins/Logs/logFunctions/logChannelCreate.ts b/backend/src/plugins/Logs/logFunctions/logChannelCreate.ts index 04ab025eb..2efc81ad2 100644 --- a/backend/src/plugins/Logs/logFunctions/logChannelCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logChannelCreate.ts @@ -1,11 +1,11 @@ import { GuildBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogChannelCreateData { channel: GuildBasedChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logChannelDelete.ts b/backend/src/plugins/Logs/logFunctions/logChannelDelete.ts index 1db174e2a..b3481f9ed 100644 --- a/backend/src/plugins/Logs/logFunctions/logChannelDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logChannelDelete.ts @@ -1,11 +1,11 @@ import { GuildBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogChannelDeleteData { channel: GuildBasedChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logChannelUpdate.ts b/backend/src/plugins/Logs/logFunctions/logChannelUpdate.ts index b05f26bb6..a8e9d5bb1 100644 --- a/backend/src/plugins/Logs/logFunctions/logChannelUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logChannelUpdate.ts @@ -1,11 +1,11 @@ import { GuildBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogChannelUpdateData { oldChannel: GuildBasedChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logClean.ts b/backend/src/plugins/Logs/logFunctions/logClean.ts index 7e43f8545..00d018120 100644 --- a/backend/src/plugins/Logs/logFunctions/logClean.ts +++ b/backend/src/plugins/Logs/logFunctions/logClean.ts @@ -1,11 +1,11 @@ import { GuildTextBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogCleanData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logDmFailed.ts b/backend/src/plugins/Logs/logFunctions/logDmFailed.ts index d88ad515f..43ae6733d 100644 --- a/backend/src/plugins/Logs/logFunctions/logDmFailed.ts +++ b/backend/src/plugins/Logs/logFunctions/logDmFailed.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogDmFailedData { source: string; diff --git a/backend/src/plugins/Logs/logFunctions/logEmojiCreate.ts b/backend/src/plugins/Logs/logFunctions/logEmojiCreate.ts index 843232a0c..c9a3439d5 100644 --- a/backend/src/plugins/Logs/logFunctions/logEmojiCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logEmojiCreate.ts @@ -1,10 +1,10 @@ import { Emoji } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogEmojiCreateData { emoji: Emoji; diff --git a/backend/src/plugins/Logs/logFunctions/logEmojiDelete.ts b/backend/src/plugins/Logs/logFunctions/logEmojiDelete.ts index 6c08f2eeb..3dde59853 100644 --- a/backend/src/plugins/Logs/logFunctions/logEmojiDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logEmojiDelete.ts @@ -1,10 +1,10 @@ import { Emoji } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogEmojiDeleteData { emoji: Emoji; diff --git a/backend/src/plugins/Logs/logFunctions/logEmojiUpdate.ts b/backend/src/plugins/Logs/logFunctions/logEmojiUpdate.ts index 3d307eae1..83b628fa7 100644 --- a/backend/src/plugins/Logs/logFunctions/logEmojiUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logEmojiUpdate.ts @@ -1,10 +1,10 @@ import { Emoji } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { emojiToTemplateSafeEmoji } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogEmojiUpdateData { oldEmoji: Emoji; diff --git a/backend/src/plugins/Logs/logFunctions/logMassBan.ts b/backend/src/plugins/Logs/logFunctions/logMassBan.ts index ab19de5f4..5aac8d6ee 100644 --- a/backend/src/plugins/Logs/logFunctions/logMassBan.ts +++ b/backend/src/plugins/Logs/logFunctions/logMassBan.ts @@ -1,10 +1,10 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMassBanData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logMassMute.ts b/backend/src/plugins/Logs/logFunctions/logMassMute.ts index 06ca3ad85..5f6a11b36 100644 --- a/backend/src/plugins/Logs/logFunctions/logMassMute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMassMute.ts @@ -1,10 +1,10 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMassMuteData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logMassUnban.ts b/backend/src/plugins/Logs/logFunctions/logMassUnban.ts index 5bfdc0a3c..d68a8d9cf 100644 --- a/backend/src/plugins/Logs/logFunctions/logMassUnban.ts +++ b/backend/src/plugins/Logs/logFunctions/logMassUnban.ts @@ -1,10 +1,10 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMassUnbanData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberBan.ts b/backend/src/plugins/Logs/logFunctions/logMemberBan.ts index e4e2f5c84..d87fd9df2 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberBan.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberBan.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberBanData { mod: User | UnknownUser | null; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberForceban.ts b/backend/src/plugins/Logs/logFunctions/logMemberForceban.ts index f60c2b7ba..4aff4ab55 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberForceban.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberForceban.ts @@ -1,10 +1,10 @@ import { GuildMember, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberForcebanData { mod: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberJoin.ts b/backend/src/plugins/Logs/logFunctions/logMemberJoin.ts index 535721fbf..b73dcd7a4 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberJoin.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberJoin.ts @@ -2,11 +2,11 @@ import { GuildMember } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberJoinData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberJoinWithPriorRecords.ts b/backend/src/plugins/Logs/logFunctions/logMemberJoinWithPriorRecords.ts index 8a4eaf646..109a9ccfa 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberJoinWithPriorRecords.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberJoinWithPriorRecords.ts @@ -1,10 +1,10 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberJoinWithPriorRecordsData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberKick.ts b/backend/src/plugins/Logs/logFunctions/logMemberKick.ts index 8f080cf83..46997cb8f 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberKick.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberKick.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberKickData { mod: User | UnknownUser | null; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberLeave.ts b/backend/src/plugins/Logs/logFunctions/logMemberLeave.ts index 334360b49..60dbaaf5c 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberLeave.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberLeave.ts @@ -1,10 +1,10 @@ import { GuildMember, PartialGuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberLeaveData { member: GuildMember | PartialGuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberMute.ts b/backend/src/plugins/Logs/logFunctions/logMemberMute.ts index 202b3cdba..5e3321b5e 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberMute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberMute.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberMuteData { mod: User | UnknownUser; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberMuteExpired.ts b/backend/src/plugins/Logs/logFunctions/logMemberMuteExpired.ts index 3f3da5c6e..93f811ab1 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberMuteExpired.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberMuteExpired.ts @@ -1,15 +1,15 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; import { memberToTemplateSafeMember, TemplateSafeUnknownMember, TemplateSafeUnknownUser, -} from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +} from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberMuteExpiredData { member: GuildMember | UnknownUser; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberMuteRejoin.ts b/backend/src/plugins/Logs/logFunctions/logMemberMuteRejoin.ts index dfa26e249..e22451b73 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberMuteRejoin.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberMuteRejoin.ts @@ -1,10 +1,10 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberMuteRejoinData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberNickChange.ts b/backend/src/plugins/Logs/logFunctions/logMemberNickChange.ts index df42a503d..90ed0afbd 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberNickChange.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberNickChange.ts @@ -1,10 +1,10 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberNickChangeData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberNote.ts b/backend/src/plugins/Logs/logFunctions/logMemberNote.ts index 28c35816b..7d808b5c3 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberNote.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberNote.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberNoteData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberRestore.ts b/backend/src/plugins/Logs/logFunctions/logMemberRestore.ts index 28d83d88c..a606a70f2 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberRestore.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberRestore.ts @@ -1,10 +1,10 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberRestoreData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberRoleAdd.ts b/backend/src/plugins/Logs/logFunctions/logMemberRoleAdd.ts index 6c3fcd908..0c238eeaf 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberRoleAdd.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberRoleAdd.ts @@ -1,11 +1,11 @@ import { GuildMember, Role, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownRole } from "../../../utils"; -import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownRole } from "../../../utils.js"; +import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberRoleAddData { mod: User | null; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberRoleChanges.ts b/backend/src/plugins/Logs/logFunctions/logMemberRoleChanges.ts index 98c783c07..f2388c8eb 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberRoleChanges.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberRoleChanges.ts @@ -1,11 +1,11 @@ import { GuildMember, Role, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberRoleChangesData { mod: User | UnknownUser | null; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberRoleRemove.ts b/backend/src/plugins/Logs/logFunctions/logMemberRoleRemove.ts index 431b1cd56..8dd965ee4 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberRoleRemove.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberRoleRemove.ts @@ -1,11 +1,11 @@ import { GuildMember, Role, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownRole } from "../../../utils"; -import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownRole } from "../../../utils.js"; +import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberRoleRemoveData { mod: User | null; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberTimedBan.ts b/backend/src/plugins/Logs/logFunctions/logMemberTimedBan.ts index cf697a589..77454117c 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberTimedBan.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberTimedBan.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberTimedBanData { mod: User | UnknownUser; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberTimedMute.ts b/backend/src/plugins/Logs/logFunctions/logMemberTimedMute.ts index 66a71d794..b3a962376 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberTimedMute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberTimedMute.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberTimedMuteData { mod: User | UnknownUser; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberTimedUnban.ts b/backend/src/plugins/Logs/logFunctions/logMemberTimedUnban.ts index c56632b41..16a767884 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberTimedUnban.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberTimedUnban.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberTimedUnbanData { mod: User | UnknownUser; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberTimedUnmute.ts b/backend/src/plugins/Logs/logFunctions/logMemberTimedUnmute.ts index 3020fd694..26d9450fa 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberTimedUnmute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberTimedUnmute.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberTimedUnmuteData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberUnban.ts b/backend/src/plugins/Logs/logFunctions/logMemberUnban.ts index e8438649d..7d7631920 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberUnban.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberUnban.ts @@ -1,11 +1,11 @@ import { Snowflake, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberUnbanData { mod: User | UnknownUser | null; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberUnmute.ts b/backend/src/plugins/Logs/logFunctions/logMemberUnmute.ts index b444373c4..cbf0f74b5 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberUnmute.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberUnmute.ts @@ -1,11 +1,11 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberUnmuteData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logMemberWarn.ts b/backend/src/plugins/Logs/logFunctions/logMemberWarn.ts index e7ba09da9..51c9c277d 100644 --- a/backend/src/plugins/Logs/logFunctions/logMemberWarn.ts +++ b/backend/src/plugins/Logs/logFunctions/logMemberWarn.ts @@ -1,10 +1,10 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMemberWarnData { mod: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts b/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts index b1e6f58b5..a712c60ef 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts @@ -1,19 +1,19 @@ import { GuildTextBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { LogType } from "../../../data/LogType"; -import { ISavedMessageAttachmentData, SavedMessage } from "../../../data/entities/SavedMessage"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser, useMediaUrls } from "../../../utils"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; +import { LogType } from "../../../data/LogType.js"; +import { ISavedMessageAttachmentData, SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser, useMediaUrls } from "../../../utils.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; import { channelToTemplateSafeChannel, savedMessageToTemplateSafeSavedMessage, userToTemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { FORMAT_NO_TIMESTAMP, LogsPluginType } from "../types"; -import { log } from "../util/log"; +} from "../../../utils/templateSafeObjects.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { FORMAT_NO_TIMESTAMP, LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMessageDeleteData { user: User | UnknownUser; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDeleteAuto.ts b/backend/src/plugins/Logs/logFunctions/logMessageDeleteAuto.ts index b84a1f552..bb4a36e7d 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDeleteAuto.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDeleteAuto.ts @@ -1,17 +1,17 @@ import { GuildBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; +import { LogType } from "../../../data/LogType.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; import { channelToTemplateSafeChannel, savedMessageToTemplateSafeSavedMessage, userToTemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +} from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMessageDeleteAutoData { message: SavedMessage; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDeleteBare.ts b/backend/src/plugins/Logs/logFunctions/logMessageDeleteBare.ts index a0d9143e7..ab2579ac2 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDeleteBare.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDeleteBare.ts @@ -1,11 +1,11 @@ import { GuildTextBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMessageDeleteBareData { messageId: string; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDeleteBulk.ts b/backend/src/plugins/Logs/logFunctions/logMessageDeleteBulk.ts index 35456c2f4..109727631 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDeleteBulk.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDeleteBulk.ts @@ -1,11 +1,11 @@ import { GuildTextBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMessageDeleteBulkData { count: number; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageEdit.ts b/backend/src/plugins/Logs/logFunctions/logMessageEdit.ts index 8bef8f559..8f37aefd4 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageEdit.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageEdit.ts @@ -1,17 +1,17 @@ import { GuildTextBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { UnknownUser } from "../../../utils"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; +import { LogType } from "../../../data/LogType.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { UnknownUser } from "../../../utils.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; import { channelToTemplateSafeChannel, savedMessageToTemplateSafeSavedMessage, userToTemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +} from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMessageEditData { user: User | UnknownUser; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageSpamDetected.ts b/backend/src/plugins/Logs/logFunctions/logMessageSpamDetected.ts index 0fa55ff5d..bf185bed4 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageSpamDetected.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageSpamDetected.ts @@ -1,11 +1,11 @@ import { GuildMember, GuildTextBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogMessageSpamDetectedData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logOtherSpamDetected.ts b/backend/src/plugins/Logs/logFunctions/logOtherSpamDetected.ts index 67171ceee..9bd2fa8de 100644 --- a/backend/src/plugins/Logs/logFunctions/logOtherSpamDetected.ts +++ b/backend/src/plugins/Logs/logFunctions/logOtherSpamDetected.ts @@ -1,10 +1,10 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogOtherSpamDetectedData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logPostedScheduledMessage.ts b/backend/src/plugins/Logs/logFunctions/logPostedScheduledMessage.ts index dca4c8bf1..ed72d09d4 100644 --- a/backend/src/plugins/Logs/logFunctions/logPostedScheduledMessage.ts +++ b/backend/src/plugins/Logs/logFunctions/logPostedScheduledMessage.ts @@ -1,11 +1,11 @@ import { GuildTextBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogPostedScheduledMessageData { author: User; diff --git a/backend/src/plugins/Logs/logFunctions/logRepeatedMessage.ts b/backend/src/plugins/Logs/logFunctions/logRepeatedMessage.ts index c20227a68..1317a766c 100644 --- a/backend/src/plugins/Logs/logFunctions/logRepeatedMessage.ts +++ b/backend/src/plugins/Logs/logFunctions/logRepeatedMessage.ts @@ -1,11 +1,11 @@ import { GuildTextBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogRepeatedMessageData { author: User; diff --git a/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts b/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts index 7ceb4be76..d90acfaca 100644 --- a/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts @@ -1,10 +1,10 @@ import { Role } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogRoleCreateData { role: Role; diff --git a/backend/src/plugins/Logs/logFunctions/logRoleDelete.ts b/backend/src/plugins/Logs/logFunctions/logRoleDelete.ts index a4e6e448e..c41149a43 100644 --- a/backend/src/plugins/Logs/logFunctions/logRoleDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logRoleDelete.ts @@ -1,10 +1,10 @@ import { Role } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogRoleDeleteData { role: Role; diff --git a/backend/src/plugins/Logs/logFunctions/logRoleUpdate.ts b/backend/src/plugins/Logs/logFunctions/logRoleUpdate.ts index 7fe118b52..63f04e329 100644 --- a/backend/src/plugins/Logs/logFunctions/logRoleUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logRoleUpdate.ts @@ -1,10 +1,10 @@ import { Role } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogRoleUpdateData { oldRole: Role; diff --git a/backend/src/plugins/Logs/logFunctions/logScheduledMessage.ts b/backend/src/plugins/Logs/logFunctions/logScheduledMessage.ts index 4499ccb6b..2d8af0b55 100644 --- a/backend/src/plugins/Logs/logFunctions/logScheduledMessage.ts +++ b/backend/src/plugins/Logs/logFunctions/logScheduledMessage.ts @@ -1,11 +1,11 @@ import { GuildTextBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogScheduledMessageData { author: User; diff --git a/backend/src/plugins/Logs/logFunctions/logScheduledRepeatedMessage.ts b/backend/src/plugins/Logs/logFunctions/logScheduledRepeatedMessage.ts index d94be7b9e..2e1cbca21 100644 --- a/backend/src/plugins/Logs/logFunctions/logScheduledRepeatedMessage.ts +++ b/backend/src/plugins/Logs/logFunctions/logScheduledRepeatedMessage.ts @@ -1,11 +1,11 @@ import { GuildTextBasedChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogScheduledRepeatedMessageData { author: User; diff --git a/backend/src/plugins/Logs/logFunctions/logSetAntiraidAuto.ts b/backend/src/plugins/Logs/logFunctions/logSetAntiraidAuto.ts index 1175d23cd..492c46647 100644 --- a/backend/src/plugins/Logs/logFunctions/logSetAntiraidAuto.ts +++ b/backend/src/plugins/Logs/logFunctions/logSetAntiraidAuto.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogSetAntiraidAutoData { level: string; diff --git a/backend/src/plugins/Logs/logFunctions/logSetAntiraidUser.ts b/backend/src/plugins/Logs/logFunctions/logSetAntiraidUser.ts index cc42d701b..3c8b56858 100644 --- a/backend/src/plugins/Logs/logFunctions/logSetAntiraidUser.ts +++ b/backend/src/plugins/Logs/logFunctions/logSetAntiraidUser.ts @@ -1,10 +1,10 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogSetAntiraidUserData { level: string; diff --git a/backend/src/plugins/Logs/logFunctions/logStageInstanceCreate.ts b/backend/src/plugins/Logs/logFunctions/logStageInstanceCreate.ts index 162d24b6b..7cc10f5f0 100644 --- a/backend/src/plugins/Logs/logFunctions/logStageInstanceCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logStageInstanceCreate.ts @@ -1,11 +1,11 @@ import { StageChannel, StageInstance } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogStageInstanceCreateData { stageInstance: StageInstance; diff --git a/backend/src/plugins/Logs/logFunctions/logStageInstanceDelete.ts b/backend/src/plugins/Logs/logFunctions/logStageInstanceDelete.ts index b87de4cda..b520fc8d4 100644 --- a/backend/src/plugins/Logs/logFunctions/logStageInstanceDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logStageInstanceDelete.ts @@ -1,11 +1,11 @@ import { StageChannel, StageInstance } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogStageInstanceDeleteData { stageInstance: StageInstance; diff --git a/backend/src/plugins/Logs/logFunctions/logStageInstanceUpdate.ts b/backend/src/plugins/Logs/logFunctions/logStageInstanceUpdate.ts index 6013311f3..04679db8c 100644 --- a/backend/src/plugins/Logs/logFunctions/logStageInstanceUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logStageInstanceUpdate.ts @@ -1,11 +1,11 @@ import { StageChannel, StageInstance } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, stageToTemplateSafeStage } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogStageInstanceUpdateData { oldStageInstance: StageInstance | null; diff --git a/backend/src/plugins/Logs/logFunctions/logStickerCreate.ts b/backend/src/plugins/Logs/logFunctions/logStickerCreate.ts index 2ec980b56..4cd8dfdf7 100644 --- a/backend/src/plugins/Logs/logFunctions/logStickerCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logStickerCreate.ts @@ -1,10 +1,10 @@ import { Sticker } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogStickerCreateData { sticker: Sticker; diff --git a/backend/src/plugins/Logs/logFunctions/logStickerDelete.ts b/backend/src/plugins/Logs/logFunctions/logStickerDelete.ts index 630ab54d9..8ff9ecaa6 100644 --- a/backend/src/plugins/Logs/logFunctions/logStickerDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logStickerDelete.ts @@ -1,10 +1,10 @@ import { Sticker } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogStickerDeleteData { sticker: Sticker; diff --git a/backend/src/plugins/Logs/logFunctions/logStickerUpdate.ts b/backend/src/plugins/Logs/logFunctions/logStickerUpdate.ts index 421f0d375..568dbf922 100644 --- a/backend/src/plugins/Logs/logFunctions/logStickerUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logStickerUpdate.ts @@ -1,10 +1,10 @@ import { Sticker } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { stickerToTemplateSafeSticker } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogStickerUpdateData { oldSticker: Sticker; diff --git a/backend/src/plugins/Logs/logFunctions/logThreadCreate.ts b/backend/src/plugins/Logs/logFunctions/logThreadCreate.ts index 4b061dfe8..0e0e8397f 100644 --- a/backend/src/plugins/Logs/logFunctions/logThreadCreate.ts +++ b/backend/src/plugins/Logs/logFunctions/logThreadCreate.ts @@ -1,11 +1,11 @@ import { AnyThreadChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogThreadCreateData { thread: AnyThreadChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logThreadDelete.ts b/backend/src/plugins/Logs/logFunctions/logThreadDelete.ts index faf23dec0..03f6537ee 100644 --- a/backend/src/plugins/Logs/logFunctions/logThreadDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logThreadDelete.ts @@ -1,11 +1,11 @@ import { AnyThreadChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogThreadDeleteData { thread: AnyThreadChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logThreadUpdate.ts b/backend/src/plugins/Logs/logFunctions/logThreadUpdate.ts index 2c7591779..824175c52 100644 --- a/backend/src/plugins/Logs/logFunctions/logThreadUpdate.ts +++ b/backend/src/plugins/Logs/logFunctions/logThreadUpdate.ts @@ -1,11 +1,11 @@ import { AnyThreadChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogThreadUpdateData { oldThread: AnyThreadChannel; diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceDisconnect.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceDisconnect.ts index 075e4ac23..1cfab49e3 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceDisconnect.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceDisconnect.ts @@ -1,15 +1,15 @@ import { GuildMember, User, VoiceBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; import { channelToTemplateSafeChannel, memberToTemplateSafeMember, userToTemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +} from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogVoiceChannelForceDisconnectData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceMove.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceMove.ts index 13ef2adb7..d6b9a7d09 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceMove.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelForceMove.ts @@ -1,15 +1,15 @@ import { GuildMember, User, VoiceBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; import { channelToTemplateSafeChannel, memberToTemplateSafeMember, userToTemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +} from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogVoiceChannelForceMoveData { mod: User; diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelJoin.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelJoin.ts index a78a2f75e..576849d45 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelJoin.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelJoin.ts @@ -1,11 +1,11 @@ import { GuildMember, VoiceBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogVoiceChannelJoinData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelLeave.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelLeave.ts index 059962e95..a283434df 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelLeave.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelLeave.ts @@ -1,11 +1,11 @@ import { GuildMember, VoiceBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogVoiceChannelLeaveData { member: GuildMember; diff --git a/backend/src/plugins/Logs/logFunctions/logVoiceChannelMove.ts b/backend/src/plugins/Logs/logFunctions/logVoiceChannelMove.ts index 54026cfe9..ceead506c 100644 --- a/backend/src/plugins/Logs/logFunctions/logVoiceChannelMove.ts +++ b/backend/src/plugins/Logs/logFunctions/logVoiceChannelMove.ts @@ -1,11 +1,11 @@ import { GuildMember, VoiceBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { resolveChannelIds } from "../../../utils/resolveChannelIds"; -import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects"; -import { LogsPluginType } from "../types"; -import { log } from "../util/log"; +import { LogType } from "../../../data/LogType.js"; +import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { resolveChannelIds } from "../../../utils/resolveChannelIds.js"; +import { channelToTemplateSafeChannel, memberToTemplateSafeMember } from "../../../utils/templateSafeObjects.js"; +import { LogsPluginType } from "../types.js"; +import { log } from "../util/log.js"; export interface LogVoiceChannelMoveData { member: GuildMember; diff --git a/backend/src/plugins/Logs/types.ts b/backend/src/plugins/Logs/types.ts index 8f49afc21..95754015a 100644 --- a/backend/src/plugins/Logs/types.ts +++ b/backend/src/plugins/Logs/types.ts @@ -1,13 +1,13 @@ import { BasePluginType, CooldownManager, guildPluginEventListener } from "knub"; import { z } from "zod"; -import { RegExpRunner } from "../../RegExpRunner"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildCases } from "../../data/GuildCases"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { LogType } from "../../data/LogType"; -import { keys, zBoundedCharacters, zMessageContent, zRegex, zSnowflake } from "../../utils"; -import { MessageBuffer } from "../../utils/MessageBuffer"; +import { RegExpRunner } from "../../RegExpRunner.js"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { LogType } from "../../data/LogType.js"; +import { keys, zBoundedCharacters, zMessageContent, zRegex, zSnowflake } from "../../utils.js"; +import { MessageBuffer } from "../../utils/MessageBuffer.js"; import { TemplateSafeCase, TemplateSafeChannel, @@ -20,7 +20,7 @@ import { TemplateSafeUnknownMember, TemplateSafeUnknownUser, TemplateSafeUser, -} from "../../utils/templateSafeObjects"; +} from "../../utils/templateSafeObjects.js"; const DEFAULT_BATCH_TIME = 1000; const MIN_BATCH_TIME = 250; diff --git a/backend/src/plugins/Logs/util/getLogMessage.ts b/backend/src/plugins/Logs/util/getLogMessage.ts index 2109f2157..65d5a06cd 100644 --- a/backend/src/plugins/Logs/util/getLogMessage.ts +++ b/backend/src/plugins/Logs/util/getLogMessage.ts @@ -1,14 +1,14 @@ import { MessageCreateOptions } from "discord.js"; import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { LogType } from "../../../data/LogType"; -import { logger } from "../../../logger"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { LogType } from "../../../data/LogType.js"; +import { logger } from "../../../logger.js"; import { renderTemplate, TemplateParseError, TemplateSafeValueContainer, TypedTemplateSafeValueContainer, -} from "../../../templateFormatter"; +} from "../../../templateFormatter.js"; import { messageSummary, renderRecursively, @@ -17,15 +17,15 @@ import { verboseChannelMention, verboseUserMention, verboseUserName, -} from "../../../utils"; +} from "../../../utils.js"; import { getTemplateSafeMemberLevel, memberToTemplateSafeMember, TemplateSafeMember, TemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { FORMAT_NO_TIMESTAMP, ILogTypeData, LogsPluginType, TLogChannel } from "../types"; +} from "../../../utils/templateSafeObjects.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { FORMAT_NO_TIMESTAMP, ILogTypeData, LogsPluginType, TLogChannel } from "../types.js"; export async function getLogMessage( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Logs/util/isLogIgnored.ts b/backend/src/plugins/Logs/util/isLogIgnored.ts index 8d3e15c14..578c33b34 100644 --- a/backend/src/plugins/Logs/util/isLogIgnored.ts +++ b/backend/src/plugins/Logs/util/isLogIgnored.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { LogsPluginType } from "../types"; +import { LogType } from "../../../data/LogType.js"; +import { LogsPluginType } from "../types.js"; export function isLogIgnored( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Logs/util/log.ts b/backend/src/plugins/Logs/util/log.ts index 5a9259d64..914dfeaa2 100644 --- a/backend/src/plugins/Logs/util/log.ts +++ b/backend/src/plugins/Logs/util/log.ts @@ -1,13 +1,13 @@ import { APIEmbed, MessageMentionTypes, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { allowTimeout } from "../../../RegExpRunner"; -import { LogType } from "../../../data/LogType"; -import { TypedTemplateSafeValueContainer } from "../../../templateFormatter"; -import { MINUTES, isDiscordAPIError } from "../../../utils"; -import { MessageBuffer } from "../../../utils/MessageBuffer"; -import { InternalPosterPlugin } from "../../InternalPoster/InternalPosterPlugin"; -import { ILogTypeData, LogsPluginType, TLogChannel, TLogChannelMap } from "../types"; -import { getLogMessage } from "./getLogMessage"; +import { allowTimeout } from "../../../RegExpRunner.js"; +import { LogType } from "../../../data/LogType.js"; +import { TypedTemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { MINUTES, isDiscordAPIError } from "../../../utils.js"; +import { MessageBuffer } from "../../../utils/MessageBuffer.js"; +import { InternalPosterPlugin } from "../../InternalPoster/InternalPosterPlugin.js"; +import { ILogTypeData, LogsPluginType, TLogChannel, TLogChannelMap } from "../types.js"; +import { getLogMessage } from "./getLogMessage.js"; interface ExclusionData { userId?: Snowflake | null; diff --git a/backend/src/plugins/Logs/util/onMessageDelete.ts b/backend/src/plugins/Logs/util/onMessageDelete.ts index 01d911232..2d63e7e1d 100644 --- a/backend/src/plugins/Logs/util/onMessageDelete.ts +++ b/backend/src/plugins/Logs/util/onMessageDelete.ts @@ -1,12 +1,12 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { resolveUser } from "../../../utils"; -import { logMessageDelete } from "../logFunctions/logMessageDelete"; -import { logMessageDeleteBare } from "../logFunctions/logMessageDeleteBare"; -import { LogsPluginType } from "../types"; -import { isLogIgnored } from "./isLogIgnored"; +import { LogType } from "../../../data/LogType.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { resolveUser } from "../../../utils.js"; +import { logMessageDelete } from "../logFunctions/logMessageDelete.js"; +import { logMessageDeleteBare } from "../logFunctions/logMessageDeleteBare.js"; +import { LogsPluginType } from "../types.js"; +import { isLogIgnored } from "./isLogIgnored.js"; export async function onMessageDelete(pluginData: GuildPluginData, savedMessage: SavedMessage) { const user = await resolveUser(pluginData.client, savedMessage.user_id); diff --git a/backend/src/plugins/Logs/util/onMessageDeleteBulk.ts b/backend/src/plugins/Logs/util/onMessageDeleteBulk.ts index 5fc79da03..2165eb1c7 100644 --- a/backend/src/plugins/Logs/util/onMessageDeleteBulk.ts +++ b/backend/src/plugins/Logs/util/onMessageDeleteBulk.ts @@ -1,11 +1,11 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { getBaseUrl } from "../../../pluginUtils"; -import { logMessageDeleteBulk } from "../logFunctions/logMessageDeleteBulk"; -import { LogsPluginType } from "../types"; -import { isLogIgnored } from "./isLogIgnored"; +import { LogType } from "../../../data/LogType.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { getBaseUrl } from "../../../pluginUtils.js"; +import { logMessageDeleteBulk } from "../logFunctions/logMessageDeleteBulk.js"; +import { LogsPluginType } from "../types.js"; +import { isLogIgnored } from "./isLogIgnored.js"; export async function onMessageDeleteBulk(pluginData: GuildPluginData, savedMessages: SavedMessage[]) { if (isLogIgnored(pluginData, LogType.MESSAGE_DELETE, savedMessages[0].id)) { diff --git a/backend/src/plugins/Logs/util/onMessageUpdate.ts b/backend/src/plugins/Logs/util/onMessageUpdate.ts index a94b1fe6a..24b88aadd 100644 --- a/backend/src/plugins/Logs/util/onMessageUpdate.ts +++ b/backend/src/plugins/Logs/util/onMessageUpdate.ts @@ -1,10 +1,10 @@ import { EmbedData, GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import cloneDeep from "lodash.clonedeep"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { resolveUser } from "../../../utils"; -import { logMessageEdit } from "../logFunctions/logMessageEdit"; -import { LogsPluginType } from "../types"; +import cloneDeep from "lodash/cloneDeep.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { resolveUser } from "../../../utils.js"; +import { logMessageEdit } from "../logFunctions/logMessageEdit.js"; +import { LogsPluginType } from "../types.js"; export async function onMessageUpdate( pluginData: GuildPluginData, diff --git a/backend/src/plugins/MessageSaver/MessageSaverPlugin.ts b/backend/src/plugins/MessageSaver/MessageSaverPlugin.ts index 4c9609043..895c9ab19 100644 --- a/backend/src/plugins/MessageSaver/MessageSaverPlugin.ts +++ b/backend/src/plugins/MessageSaver/MessageSaverPlugin.ts @@ -1,9 +1,9 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB"; -import { SavePinsToDBCmd } from "./commands/SavePinsToDB"; -import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts"; -import { MessageSaverPluginType, zMessageSaverConfig } from "./types"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB.js"; +import { SavePinsToDBCmd } from "./commands/SavePinsToDB.js"; +import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts.js"; +import { MessageSaverPluginType, zMessageSaverConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/MessageSaver/commands/SaveMessagesToDB.ts b/backend/src/plugins/MessageSaver/commands/SaveMessagesToDB.ts index 3d2456e8b..120d4c807 100644 --- a/backend/src/plugins/MessageSaver/commands/SaveMessagesToDB.ts +++ b/backend/src/plugins/MessageSaver/commands/SaveMessagesToDB.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendSuccessMessage } from "../../../pluginUtils"; -import { saveMessagesToDB } from "../saveMessagesToDB"; -import { messageSaverCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendSuccessMessage } from "../../../pluginUtils.js"; +import { saveMessagesToDB } from "../saveMessagesToDB.js"; +import { messageSaverCmd } from "../types.js"; export const SaveMessagesToDBCmd = messageSaverCmd({ trigger: "save_messages_to_db", diff --git a/backend/src/plugins/MessageSaver/commands/SavePinsToDB.ts b/backend/src/plugins/MessageSaver/commands/SavePinsToDB.ts index e81c73fee..67be1bb82 100644 --- a/backend/src/plugins/MessageSaver/commands/SavePinsToDB.ts +++ b/backend/src/plugins/MessageSaver/commands/SavePinsToDB.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendSuccessMessage } from "../../../pluginUtils"; -import { saveMessagesToDB } from "../saveMessagesToDB"; -import { messageSaverCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendSuccessMessage } from "../../../pluginUtils.js"; +import { saveMessagesToDB } from "../saveMessagesToDB.js"; +import { messageSaverCmd } from "../types.js"; export const SavePinsToDBCmd = messageSaverCmd({ trigger: "save_pins_to_db", diff --git a/backend/src/plugins/MessageSaver/events/SaveMessagesEvts.ts b/backend/src/plugins/MessageSaver/events/SaveMessagesEvts.ts index 594e2b53f..66baac568 100644 --- a/backend/src/plugins/MessageSaver/events/SaveMessagesEvts.ts +++ b/backend/src/plugins/MessageSaver/events/SaveMessagesEvts.ts @@ -1,5 +1,5 @@ import { Message, MessageType } from "discord.js"; -import { messageSaverEvt } from "../types"; +import { messageSaverEvt } from "../types.js"; const AFFECTED_MESSAGE_TYPES: MessageType[] = [MessageType.Default, MessageType.Reply, MessageType.ChatInputCommand]; diff --git a/backend/src/plugins/MessageSaver/info.ts b/backend/src/plugins/MessageSaver/info.ts index e71c5430c..2a9b9bda8 100644 --- a/backend/src/plugins/MessageSaver/info.ts +++ b/backend/src/plugins/MessageSaver/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const messageSaverPluginInfo: ZeppelinPluginInfo = { prettyName: "Message saver", diff --git a/backend/src/plugins/MessageSaver/saveMessagesToDB.ts b/backend/src/plugins/MessageSaver/saveMessagesToDB.ts index 750ab632d..01aa85cbe 100644 --- a/backend/src/plugins/MessageSaver/saveMessagesToDB.ts +++ b/backend/src/plugins/MessageSaver/saveMessagesToDB.ts @@ -1,6 +1,6 @@ import { GuildTextBasedChannel, Message } from "discord.js"; import { GuildPluginData } from "knub"; -import { MessageSaverPluginType } from "./types"; +import { MessageSaverPluginType } from "./types.js"; export async function saveMessagesToDB( pluginData: GuildPluginData, diff --git a/backend/src/plugins/MessageSaver/types.ts b/backend/src/plugins/MessageSaver/types.ts index f42fa2c3e..52d7e86b2 100644 --- a/backend/src/plugins/MessageSaver/types.ts +++ b/backend/src/plugins/MessageSaver/types.ts @@ -1,6 +1,6 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; export const zMessageSaverConfig = z.strictObject({ can_manage: z.boolean(), diff --git a/backend/src/plugins/ModActions/ModActionsPlugin.ts b/backend/src/plugins/ModActions/ModActionsPlugin.ts index 2e92961f5..aa379acb7 100644 --- a/backend/src/plugins/ModActions/ModActionsPlugin.ts +++ b/backend/src/plugins/ModActions/ModActionsPlugin.ts @@ -1,53 +1,53 @@ import { Message } from "discord.js"; import { EventEmitter } from "events"; import { guildPlugin } from "knub"; -import { Queue } from "../../Queue"; -import { GuildCases } from "../../data/GuildCases"; -import { onGuildEvent } from "../../data/GuildEvents"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildMutes } from "../../data/GuildMutes"; -import { GuildTempbans } from "../../data/GuildTempbans"; -import { makePublicFn, mapToPublicFn } from "../../pluginUtils"; -import { MINUTES } from "../../utils"; -import { CasesPlugin } from "../Cases/CasesPlugin"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { MutesPlugin } from "../Mutes/MutesPlugin"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { AddCaseCmd } from "./commands/AddCaseCmd"; -import { BanCmd } from "./commands/BanCmd"; -import { CaseCmd } from "./commands/CaseCmd"; -import { CasesModCmd } from "./commands/CasesModCmd"; -import { CasesUserCmd } from "./commands/CasesUserCmd"; -import { DeleteCaseCmd } from "./commands/DeleteCaseCmd"; -import { ForcebanCmd } from "./commands/ForcebanCmd"; -import { ForcemuteCmd } from "./commands/ForcemuteCmd"; -import { ForceUnmuteCmd } from "./commands/ForceunmuteCmd"; -import { HideCaseCmd } from "./commands/HideCaseCmd"; -import { KickCmd } from "./commands/KickCmd"; -import { MassbanCmd } from "./commands/MassBanCmd"; -import { MassunbanCmd } from "./commands/MassUnbanCmd"; -import { MassmuteCmd } from "./commands/MassmuteCmd"; -import { MuteCmd } from "./commands/MuteCmd"; -import { NoteCmd } from "./commands/NoteCmd"; -import { SoftbanCmd } from "./commands/SoftbanCommand"; -import { UnbanCmd } from "./commands/UnbanCmd"; -import { UnhideCaseCmd } from "./commands/UnhideCaseCmd"; -import { UnmuteCmd } from "./commands/UnmuteCmd"; -import { UpdateCmd } from "./commands/UpdateCmd"; -import { WarnCmd } from "./commands/WarnCmd"; -import { AuditLogEvents } from "./events/AuditLogEvents"; -import { CreateBanCaseOnManualBanEvt } from "./events/CreateBanCaseOnManualBanEvt"; -import { CreateUnbanCaseOnManualUnbanEvt } from "./events/CreateUnbanCaseOnManualUnbanEvt"; -import { PostAlertOnMemberJoinEvt } from "./events/PostAlertOnMemberJoinEvt"; -import { banUserId } from "./functions/banUserId"; -import { clearTempban } from "./functions/clearTempban"; -import { hasMutePermission } from "./functions/hasMutePerm"; -import { kickMember } from "./functions/kickMember"; -import { offModActionsEvent } from "./functions/offModActionsEvent"; -import { onModActionsEvent } from "./functions/onModActionsEvent"; -import { updateCase } from "./functions/updateCase"; -import { warnMember } from "./functions/warnMember"; -import { ModActionsPluginType, zModActionsConfig } from "./types"; +import { Queue } from "../../Queue.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { onGuildEvent } from "../../data/GuildEvents.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildMutes } from "../../data/GuildMutes.js"; +import { GuildTempbans } from "../../data/GuildTempbans.js"; +import { makePublicFn, mapToPublicFn } from "../../pluginUtils.js"; +import { MINUTES } from "../../utils.js"; +import { CasesPlugin } from "../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { MutesPlugin } from "../Mutes/MutesPlugin.js"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { AddCaseCmd } from "./commands/AddCaseCmd.js"; +import { BanCmd } from "./commands/BanCmd.js"; +import { CaseCmd } from "./commands/CaseCmd.js"; +import { CasesModCmd } from "./commands/CasesModCmd.js"; +import { CasesUserCmd } from "./commands/CasesUserCmd.js"; +import { DeleteCaseCmd } from "./commands/DeleteCaseCmd.js"; +import { ForcebanCmd } from "./commands/ForcebanCmd.js"; +import { ForcemuteCmd } from "./commands/ForcemuteCmd.js"; +import { ForceUnmuteCmd } from "./commands/ForceunmuteCmd.js"; +import { HideCaseCmd } from "./commands/HideCaseCmd.js"; +import { KickCmd } from "./commands/KickCmd.js"; +import { MassbanCmd } from "./commands/MassBanCmd.js"; +import { MassunbanCmd } from "./commands/MassUnbanCmd.js"; +import { MassmuteCmd } from "./commands/MassmuteCmd.js"; +import { MuteCmd } from "./commands/MuteCmd.js"; +import { NoteCmd } from "./commands/NoteCmd.js"; +import { SoftbanCmd } from "./commands/SoftbanCommand.js"; +import { UnbanCmd } from "./commands/UnbanCmd.js"; +import { UnhideCaseCmd } from "./commands/UnhideCaseCmd.js"; +import { UnmuteCmd } from "./commands/UnmuteCmd.js"; +import { UpdateCmd } from "./commands/UpdateCmd.js"; +import { WarnCmd } from "./commands/WarnCmd.js"; +import { AuditLogEvents } from "./events/AuditLogEvents.js"; +import { CreateBanCaseOnManualBanEvt } from "./events/CreateBanCaseOnManualBanEvt.js"; +import { CreateUnbanCaseOnManualUnbanEvt } from "./events/CreateUnbanCaseOnManualUnbanEvt.js"; +import { PostAlertOnMemberJoinEvt } from "./events/PostAlertOnMemberJoinEvt.js"; +import { banUserId } from "./functions/banUserId.js"; +import { clearTempban } from "./functions/clearTempban.js"; +import { hasMutePermission } from "./functions/hasMutePerm.js"; +import { kickMember } from "./functions/kickMember.js"; +import { offModActionsEvent } from "./functions/offModActionsEvent.js"; +import { onModActionsEvent } from "./functions/onModActionsEvent.js"; +import { updateCase } from "./functions/updateCase.js"; +import { warnMember } from "./functions/warnMember.js"; +import { ModActionsPluginType, zModActionsConfig } from "./types.js"; const defaultOptions = { config: { diff --git a/backend/src/plugins/ModActions/commands/AddCaseCmd.ts b/backend/src/plugins/ModActions/commands/AddCaseCmd.ts index 3f8b9dfc5..cba64f780 100644 --- a/backend/src/plugins/ModActions/commands/AddCaseCmd.ts +++ b/backend/src/plugins/ModActions/commands/AddCaseCmd.ts @@ -1,12 +1,12 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { Case } from "../../../data/entities/Case"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { renderUsername, resolveMember, resolveUser } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { Case } from "../../../data/entities/Case.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { renderUsername, resolveMember, resolveUser } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/BanCmd.ts b/backend/src/plugins/ModActions/commands/BanCmd.ts index 3e66e8a20..d3c5c7456 100644 --- a/backend/src/plugins/ModActions/commands/BanCmd.ts +++ b/backend/src/plugins/ModActions/commands/BanCmd.ts @@ -1,19 +1,19 @@ import humanizeDuration from "humanize-duration"; import { getMemberLevel } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop"; -import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { renderUsername, resolveMember, resolveUser } from "../../../utils"; -import { banLock } from "../../../utils/lockNameHelpers"; -import { waitForButtonConfirm } from "../../../utils/waitForInteraction"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { banUserId } from "../functions/banUserId"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { isBanned } from "../functions/isBanned"; -import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop.js"; +import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { renderUsername, resolveMember, resolveUser } from "../../../utils.js"; +import { banLock } from "../../../utils/lockNameHelpers.js"; +import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { banUserId } from "../functions/banUserId.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { isBanned } from "../functions/isBanned.js"; +import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/CaseCmd.ts b/backend/src/plugins/ModActions/commands/CaseCmd.ts index d3d8ce95b..3a906df6a 100644 --- a/backend/src/plugins/ModActions/commands/CaseCmd.ts +++ b/backend/src/plugins/ModActions/commands/CaseCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { modActionsCmd } from "../types.js"; export const CaseCmd = modActionsCmd({ trigger: "case", diff --git a/backend/src/plugins/ModActions/commands/CasesModCmd.ts b/backend/src/plugins/ModActions/commands/CasesModCmd.ts index 306c1ad14..ab585ef8d 100644 --- a/backend/src/plugins/ModActions/commands/CasesModCmd.ts +++ b/backend/src/plugins/ModActions/commands/CasesModCmd.ts @@ -1,12 +1,12 @@ import { APIEmbed } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { UnknownUser, emptyEmbedValue, renderUsername, resolveMember, resolveUser, trimLines } from "../../../utils"; -import { asyncMap } from "../../../utils/async"; -import { createPaginatedMessage } from "../../../utils/createPaginatedMessage"; -import { getGuildPrefix } from "../../../utils/getGuildPrefix"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { UnknownUser, emptyEmbedValue, renderUsername, resolveMember, resolveUser, trimLines } from "../../../utils.js"; +import { asyncMap } from "../../../utils/async.js"; +import { createPaginatedMessage } from "../../../utils/createPaginatedMessage.js"; +import { getGuildPrefix } from "../../../utils/getGuildPrefix.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.userId({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/CasesUserCmd.ts b/backend/src/plugins/ModActions/commands/CasesUserCmd.ts index 08e586c81..d45ffb633 100644 --- a/backend/src/plugins/ModActions/commands/CasesUserCmd.ts +++ b/backend/src/plugins/ModActions/commands/CasesUserCmd.ts @@ -1,13 +1,13 @@ import { APIEmbed, User } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { UnknownUser, chunkArray, emptyEmbedValue, renderUsername, resolveMember, resolveUser } from "../../../utils"; -import { asyncMap } from "../../../utils/async"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { UnknownUser, chunkArray, emptyEmbedValue, renderUsername, resolveMember, resolveUser } from "../../../utils.js"; +import { asyncMap } from "../../../utils/async.js"; import { createPaginatedMessage } from "../../../utils/createPaginatedMessage.js"; -import { getGuildPrefix } from "../../../utils/getGuildPrefix"; -import { modActionsCmd } from "../types"; +import { getGuildPrefix } from "../../../utils/getGuildPrefix.js"; +import { modActionsCmd } from "../types.js"; const opts = { expand: ct.bool({ option: true, isSwitch: true, shortcut: "e" }), diff --git a/backend/src/plugins/ModActions/commands/DeleteCaseCmd.ts b/backend/src/plugins/ModActions/commands/DeleteCaseCmd.ts index c107791df..82b91d853 100644 --- a/backend/src/plugins/ModActions/commands/DeleteCaseCmd.ts +++ b/backend/src/plugins/ModActions/commands/DeleteCaseCmd.ts @@ -1,12 +1,12 @@ import { helpers } from "knub"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { Case } from "../../../data/entities/Case"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { SECONDS, renderUsername, trimLines } from "../../../utils"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { Case } from "../../../data/entities/Case.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { SECONDS, renderUsername, trimLines } from "../../../utils.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { modActionsCmd } from "../types.js"; export const DeleteCaseCmd = modActionsCmd({ trigger: ["delete_case", "deletecase"], diff --git a/backend/src/plugins/ModActions/commands/ForcebanCmd.ts b/backend/src/plugins/ModActions/commands/ForcebanCmd.ts index 4ddef1544..c51487e48 100644 --- a/backend/src/plugins/ModActions/commands/ForcebanCmd.ts +++ b/backend/src/plugins/ModActions/commands/ForcebanCmd.ts @@ -1,15 +1,15 @@ import { Snowflake } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { LogType } from "../../../data/LogType"; -import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { DAYS, MINUTES, resolveMember, resolveUser } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { ignoreEvent } from "../functions/ignoreEvent"; -import { isBanned } from "../functions/isBanned"; -import { IgnoredEventType, modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { DAYS, MINUTES, resolveMember, resolveUser } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { ignoreEvent } from "../functions/ignoreEvent.js"; +import { isBanned } from "../functions/isBanned.js"; +import { IgnoredEventType, modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/ForcemuteCmd.ts b/backend/src/plugins/ModActions/commands/ForcemuteCmd.ts index 18fe12280..c1363fc32 100644 --- a/backend/src/plugins/ModActions/commands/ForcemuteCmd.ts +++ b/backend/src/plugins/ModActions/commands/ForcemuteCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendErrorMessage } from "../../../pluginUtils"; -import { resolveMember, resolveUser } from "../../../utils"; -import { actualMuteUserCmd } from "../functions/actualMuteUserCmd"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendErrorMessage } from "../../../pluginUtils.js"; +import { resolveMember, resolveUser } from "../../../utils.js"; +import { actualMuteUserCmd } from "../functions/actualMuteUserCmd.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/ForceunmuteCmd.ts b/backend/src/plugins/ModActions/commands/ForceunmuteCmd.ts index 8ce0ce14f..6b60791a7 100644 --- a/backend/src/plugins/ModActions/commands/ForceunmuteCmd.ts +++ b/backend/src/plugins/ModActions/commands/ForceunmuteCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendErrorMessage } from "../../../pluginUtils"; -import { resolveMember, resolveUser } from "../../../utils"; -import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendErrorMessage } from "../../../pluginUtils.js"; +import { resolveMember, resolveUser } from "../../../utils.js"; +import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/HideCaseCmd.ts b/backend/src/plugins/ModActions/commands/HideCaseCmd.ts index 38337d85f..790b1feb2 100644 --- a/backend/src/plugins/ModActions/commands/HideCaseCmd.ts +++ b/backend/src/plugins/ModActions/commands/HideCaseCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { modActionsCmd } from "../types.js"; export const HideCaseCmd = modActionsCmd({ trigger: ["hide", "hidecase", "hide_case"], diff --git a/backend/src/plugins/ModActions/commands/KickCmd.ts b/backend/src/plugins/ModActions/commands/KickCmd.ts index 080294d00..335288447 100644 --- a/backend/src/plugins/ModActions/commands/KickCmd.ts +++ b/backend/src/plugins/ModActions/commands/KickCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { actualKickMemberCmd } from "../functions/actualKickMemberCmd"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { actualKickMemberCmd } from "../functions/actualKickMemberCmd.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/MassBanCmd.ts b/backend/src/plugins/ModActions/commands/MassBanCmd.ts index d31aadd7a..8f4fdccb5 100644 --- a/backend/src/plugins/ModActions/commands/MassBanCmd.ts +++ b/backend/src/plugins/ModActions/commands/MassBanCmd.ts @@ -1,17 +1,17 @@ import { Snowflake } from "discord.js"; import { waitForReply } from "knub/helpers"; import { performance } from "perf_hooks"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { LogType } from "../../../data/LogType"; -import { humanizeDurationShort } from "../../../humanizeDurationShort"; -import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { DAYS, MINUTES, SECONDS, noop } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { ignoreEvent } from "../functions/ignoreEvent"; -import { IgnoredEventType, modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { humanizeDurationShort } from "../../../humanizeDurationShort.js"; +import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { DAYS, MINUTES, SECONDS, noop } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { ignoreEvent } from "../functions/ignoreEvent.js"; +import { IgnoredEventType, modActionsCmd } from "../types.js"; export const MassbanCmd = modActionsCmd({ trigger: "massban", diff --git a/backend/src/plugins/ModActions/commands/MassUnbanCmd.ts b/backend/src/plugins/ModActions/commands/MassUnbanCmd.ts index c5ce37acb..dfe19f677 100644 --- a/backend/src/plugins/ModActions/commands/MassUnbanCmd.ts +++ b/backend/src/plugins/ModActions/commands/MassUnbanCmd.ts @@ -1,15 +1,15 @@ import { Snowflake } from "discord.js"; import { waitForReply } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { LogType } from "../../../data/LogType"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { ignoreEvent } from "../functions/ignoreEvent"; -import { isBanned } from "../functions/isBanned"; -import { IgnoredEventType, modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { ignoreEvent } from "../functions/ignoreEvent.js"; +import { isBanned } from "../functions/isBanned.js"; +import { IgnoredEventType, modActionsCmd } from "../types.js"; export const MassunbanCmd = modActionsCmd({ trigger: "massunban", diff --git a/backend/src/plugins/ModActions/commands/MassmuteCmd.ts b/backend/src/plugins/ModActions/commands/MassmuteCmd.ts index a62c029e6..4cb264852 100644 --- a/backend/src/plugins/ModActions/commands/MassmuteCmd.ts +++ b/backend/src/plugins/ModActions/commands/MassmuteCmd.ts @@ -1,13 +1,13 @@ import { Snowflake } from "discord.js"; import { waitForReply } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { LogType } from "../../../data/LogType"; -import { logger } from "../../../logger"; -import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { logger } from "../../../logger.js"; +import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { modActionsCmd } from "../types.js"; export const MassmuteCmd = modActionsCmd({ trigger: "massmute", diff --git a/backend/src/plugins/ModActions/commands/MuteCmd.ts b/backend/src/plugins/ModActions/commands/MuteCmd.ts index f824fca3e..bfefcec65 100644 --- a/backend/src/plugins/ModActions/commands/MuteCmd.ts +++ b/backend/src/plugins/ModActions/commands/MuteCmd.ts @@ -1,10 +1,10 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendErrorMessage } from "../../../pluginUtils"; -import { resolveMember, resolveUser } from "../../../utils"; -import { waitForButtonConfirm } from "../../../utils/waitForInteraction"; -import { actualMuteUserCmd } from "../functions/actualMuteUserCmd"; -import { isBanned } from "../functions/isBanned"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendErrorMessage } from "../../../pluginUtils.js"; +import { resolveMember, resolveUser } from "../../../utils.js"; +import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js"; +import { actualMuteUserCmd } from "../functions/actualMuteUserCmd.js"; +import { isBanned } from "../functions/isBanned.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/NoteCmd.ts b/backend/src/plugins/ModActions/commands/NoteCmd.ts index edb2202dc..7f3f92190 100644 --- a/backend/src/plugins/ModActions/commands/NoteCmd.ts +++ b/backend/src/plugins/ModActions/commands/NoteCmd.ts @@ -1,11 +1,11 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { renderUsername, resolveUser } from "../../../utils"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { renderUsername, resolveUser } from "../../../utils.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { modActionsCmd } from "../types.js"; export const NoteCmd = modActionsCmd({ trigger: "note", diff --git a/backend/src/plugins/ModActions/commands/SoftbanCommand.ts b/backend/src/plugins/ModActions/commands/SoftbanCommand.ts index 9bbb64150..d59c63c15 100644 --- a/backend/src/plugins/ModActions/commands/SoftbanCommand.ts +++ b/backend/src/plugins/ModActions/commands/SoftbanCommand.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { trimPluginDescription } from "../../../utils"; -import { actualKickMemberCmd } from "../functions/actualKickMemberCmd"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { trimPluginDescription } from "../../../utils.js"; +import { actualKickMemberCmd } from "../functions/actualKickMemberCmd.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/UnbanCmd.ts b/backend/src/plugins/ModActions/commands/UnbanCmd.ts index 53363ee02..1a5a96b81 100644 --- a/backend/src/plugins/ModActions/commands/UnbanCmd.ts +++ b/backend/src/plugins/ModActions/commands/UnbanCmd.ts @@ -1,15 +1,15 @@ import { Snowflake } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { LogType } from "../../../data/LogType"; -import { clearExpiringTempban } from "../../../data/loops/expiringTempbansLoop"; -import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { resolveUser } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { ignoreEvent } from "../functions/ignoreEvent"; -import { IgnoredEventType, modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { clearExpiringTempban } from "../../../data/loops/expiringTempbansLoop.js"; +import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { resolveUser } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { ignoreEvent } from "../functions/ignoreEvent.js"; +import { IgnoredEventType, modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/UnhideCaseCmd.ts b/backend/src/plugins/ModActions/commands/UnhideCaseCmd.ts index 9fe9e2088..0b47595dc 100644 --- a/backend/src/plugins/ModActions/commands/UnhideCaseCmd.ts +++ b/backend/src/plugins/ModActions/commands/UnhideCaseCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { modActionsCmd } from "../types.js"; export const UnhideCaseCmd = modActionsCmd({ trigger: ["unhide", "unhidecase", "unhide_case"], diff --git a/backend/src/plugins/ModActions/commands/UnmuteCmd.ts b/backend/src/plugins/ModActions/commands/UnmuteCmd.ts index 55c84631d..06c500036 100644 --- a/backend/src/plugins/ModActions/commands/UnmuteCmd.ts +++ b/backend/src/plugins/ModActions/commands/UnmuteCmd.ts @@ -1,11 +1,11 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin"; -import { canActOn, sendErrorMessage } from "../../../pluginUtils"; -import { resolveMember, resolveUser } from "../../../utils"; -import { waitForButtonConfirm } from "../../../utils/waitForInteraction"; -import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd"; -import { isBanned } from "../functions/isBanned"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin.js"; +import { canActOn, sendErrorMessage } from "../../../pluginUtils.js"; +import { resolveMember, resolveUser } from "../../../utils.js"; +import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js"; +import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd.js"; +import { isBanned } from "../functions/isBanned.js"; +import { modActionsCmd } from "../types.js"; const opts = { mod: ct.member({ option: true }), diff --git a/backend/src/plugins/ModActions/commands/UpdateCmd.ts b/backend/src/plugins/ModActions/commands/UpdateCmd.ts index 3310522e1..72e46fde2 100644 --- a/backend/src/plugins/ModActions/commands/UpdateCmd.ts +++ b/backend/src/plugins/ModActions/commands/UpdateCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { updateCase } from "../functions/updateCase"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { updateCase } from "../functions/updateCase.js"; +import { modActionsCmd } from "../types.js"; export const UpdateCmd = modActionsCmd({ trigger: ["update", "reason"], diff --git a/backend/src/plugins/ModActions/commands/WarnCmd.ts b/backend/src/plugins/ModActions/commands/WarnCmd.ts index 218eeaf3e..1fcad2d93 100644 --- a/backend/src/plugins/ModActions/commands/WarnCmd.ts +++ b/backend/src/plugins/ModActions/commands/WarnCmd.ts @@ -1,14 +1,14 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { errorMessage, renderUsername, resolveMember, resolveUser } from "../../../utils"; -import { waitForButtonConfirm } from "../../../utils/waitForInteraction"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments"; -import { isBanned } from "../functions/isBanned"; -import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs"; -import { warnMember } from "../functions/warnMember"; -import { modActionsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { errorMessage, renderUsername, resolveMember, resolveUser } from "../../../utils.js"; +import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js"; +import { isBanned } from "../functions/isBanned.js"; +import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs.js"; +import { warnMember } from "../functions/warnMember.js"; +import { modActionsCmd } from "../types.js"; export const WarnCmd = modActionsCmd({ trigger: "warn", diff --git a/backend/src/plugins/ModActions/events/AuditLogEvents.ts b/backend/src/plugins/ModActions/events/AuditLogEvents.ts index a66328b94..fbade396b 100644 --- a/backend/src/plugins/ModActions/events/AuditLogEvents.ts +++ b/backend/src/plugins/ModActions/events/AuditLogEvents.ts @@ -1,9 +1,9 @@ import { AuditLogChange, AuditLogEvent } from "discord.js"; import moment from "moment-timezone"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { resolveUser } from "../../../utils"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { modActionsEvt } from "../types"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { resolveUser } from "../../../utils.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { modActionsEvt } from "../types.js"; export const AuditLogEvents = modActionsEvt({ event: "guildAuditLogEntryCreate", diff --git a/backend/src/plugins/ModActions/events/CreateBanCaseOnManualBanEvt.ts b/backend/src/plugins/ModActions/events/CreateBanCaseOnManualBanEvt.ts index 237454ba5..8e2ffd450 100644 --- a/backend/src/plugins/ModActions/events/CreateBanCaseOnManualBanEvt.ts +++ b/backend/src/plugins/ModActions/events/CreateBanCaseOnManualBanEvt.ts @@ -1,14 +1,14 @@ import { AuditLogEvent, User } from "discord.js"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { Case } from "../../../data/entities/Case"; -import { UnknownUser, resolveUser } from "../../../utils"; -import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { clearIgnoredEvents } from "../functions/clearIgnoredEvents"; -import { isEventIgnored } from "../functions/isEventIgnored"; -import { IgnoredEventType, modActionsEvt } from "../types"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { Case } from "../../../data/entities/Case.js"; +import { UnknownUser, resolveUser } from "../../../utils.js"; +import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { clearIgnoredEvents } from "../functions/clearIgnoredEvents.js"; +import { isEventIgnored } from "../functions/isEventIgnored.js"; +import { IgnoredEventType, modActionsEvt } from "../types.js"; /** * Create a BAN case automatically when a user is banned manually. diff --git a/backend/src/plugins/ModActions/events/CreateKickCaseOnManualKickEvt.ts b/backend/src/plugins/ModActions/events/CreateKickCaseOnManualKickEvt.ts index 0f8409109..2d698426f 100644 --- a/backend/src/plugins/ModActions/events/CreateKickCaseOnManualKickEvt.ts +++ b/backend/src/plugins/ModActions/events/CreateKickCaseOnManualKickEvt.ts @@ -1,14 +1,14 @@ import { AuditLogEvent, User } from "discord.js"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { Case } from "../../../data/entities/Case"; -import { logger } from "../../../logger"; -import { UnknownUser, resolveUser } from "../../../utils"; -import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { clearIgnoredEvents } from "../functions/clearIgnoredEvents"; -import { isEventIgnored } from "../functions/isEventIgnored"; -import { IgnoredEventType, modActionsEvt } from "../types"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { Case } from "../../../data/entities/Case.js"; +import { logger } from "../../../logger.js"; +import { UnknownUser, resolveUser } from "../../../utils.js"; +import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { clearIgnoredEvents } from "../functions/clearIgnoredEvents.js"; +import { isEventIgnored } from "../functions/isEventIgnored.js"; +import { IgnoredEventType, modActionsEvt } from "../types.js"; /** * Create a KICK case automatically when a user is kicked manually. diff --git a/backend/src/plugins/ModActions/events/CreateUnbanCaseOnManualUnbanEvt.ts b/backend/src/plugins/ModActions/events/CreateUnbanCaseOnManualUnbanEvt.ts index 9400c732b..2ccf03989 100644 --- a/backend/src/plugins/ModActions/events/CreateUnbanCaseOnManualUnbanEvt.ts +++ b/backend/src/plugins/ModActions/events/CreateUnbanCaseOnManualUnbanEvt.ts @@ -1,13 +1,13 @@ import { AuditLogEvent, User } from "discord.js"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { Case } from "../../../data/entities/Case"; -import { UnknownUser, resolveUser } from "../../../utils"; -import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { clearIgnoredEvents } from "../functions/clearIgnoredEvents"; -import { isEventIgnored } from "../functions/isEventIgnored"; -import { IgnoredEventType, modActionsEvt } from "../types"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { Case } from "../../../data/entities/Case.js"; +import { UnknownUser, resolveUser } from "../../../utils.js"; +import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { clearIgnoredEvents } from "../functions/clearIgnoredEvents.js"; +import { isEventIgnored } from "../functions/isEventIgnored.js"; +import { IgnoredEventType, modActionsEvt } from "../types.js"; /** * Create an UNBAN case automatically when a user is unbanned manually. diff --git a/backend/src/plugins/ModActions/events/PostAlertOnMemberJoinEvt.ts b/backend/src/plugins/ModActions/events/PostAlertOnMemberJoinEvt.ts index 82e395474..37be3a3e6 100644 --- a/backend/src/plugins/ModActions/events/PostAlertOnMemberJoinEvt.ts +++ b/backend/src/plugins/ModActions/events/PostAlertOnMemberJoinEvt.ts @@ -1,8 +1,8 @@ import { PermissionsBitField, Snowflake, TextChannel } from "discord.js"; -import { renderUsername, resolveMember } from "../../../utils"; -import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { modActionsEvt } from "../types"; +import { renderUsername, resolveMember } from "../../../utils.js"; +import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { modActionsEvt } from "../types.js"; /** * Show an alert if a member with prior notes joins the server diff --git a/backend/src/plugins/ModActions/functions/actualKickMemberCmd.ts b/backend/src/plugins/ModActions/functions/actualKickMemberCmd.ts index a755ee08d..c0b9fb53f 100644 --- a/backend/src/plugins/ModActions/functions/actualKickMemberCmd.ts +++ b/backend/src/plugins/ModActions/functions/actualKickMemberCmd.ts @@ -1,15 +1,15 @@ import { GuildMember, GuildTextBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; import { hasPermission } from "knub/helpers"; -import { LogType } from "../../../data/LogType"; -import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { DAYS, SECONDS, errorMessage, renderUsername, resolveMember, resolveUser } from "../../../utils"; -import { IgnoredEventType, ModActionsPluginType } from "../types"; -import { formatReasonWithAttachments } from "./formatReasonWithAttachments"; -import { ignoreEvent } from "./ignoreEvent"; -import { isBanned } from "./isBanned"; -import { kickMember } from "./kickMember"; -import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs"; +import { LogType } from "../../../data/LogType.js"; +import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { DAYS, SECONDS, errorMessage, renderUsername, resolveMember, resolveUser } from "../../../utils.js"; +import { IgnoredEventType, ModActionsPluginType } from "../types.js"; +import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js"; +import { ignoreEvent } from "./ignoreEvent.js"; +import { isBanned } from "./isBanned.js"; +import { kickMember } from "./kickMember.js"; +import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs.js"; export async function actualKickMemberCmd( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/actualMuteUserCmd.ts b/backend/src/plugins/ModActions/functions/actualMuteUserCmd.ts index 2f1084107..2eac70ef3 100644 --- a/backend/src/plugins/ModActions/functions/actualMuteUserCmd.ts +++ b/backend/src/plugins/ModActions/functions/actualMuteUserCmd.ts @@ -1,15 +1,15 @@ import { GuildMember, GuildTextBasedChannel, Message, User } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; -import { logger } from "../../../logger"; -import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { UnknownUser, asSingleLine, isDiscordAPIError, renderUsername } from "../../../utils"; -import { MutesPlugin } from "../../Mutes/MutesPlugin"; -import { MuteResult } from "../../Mutes/types"; -import { ModActionsPluginType } from "../types"; -import { formatReasonWithAttachments } from "./formatReasonWithAttachments"; -import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; +import { logger } from "../../../logger.js"; +import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { UnknownUser, asSingleLine, isDiscordAPIError, renderUsername } from "../../../utils.js"; +import { MutesPlugin } from "../../Mutes/MutesPlugin.js"; +import { MuteResult } from "../../Mutes/types.js"; +import { ModActionsPluginType } from "../types.js"; +import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js"; +import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs.js"; /** * The actual function run by both !mute and !forcemute. diff --git a/backend/src/plugins/ModActions/functions/actualUnmuteUserCmd.ts b/backend/src/plugins/ModActions/functions/actualUnmuteUserCmd.ts index 5b28aee75..d4e931008 100644 --- a/backend/src/plugins/ModActions/functions/actualUnmuteUserCmd.ts +++ b/backend/src/plugins/ModActions/functions/actualUnmuteUserCmd.ts @@ -1,11 +1,11 @@ import { GuildMember, Message, User } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; -import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin"; -import { UnknownUser, asSingleLine, renderUsername } from "../../../utils"; -import { ModActionsPluginType } from "../types"; -import { formatReasonWithAttachments } from "./formatReasonWithAttachments"; +import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin.js"; +import { UnknownUser, asSingleLine, renderUsername } from "../../../utils.js"; +import { ModActionsPluginType } from "../types.js"; +import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js"; export async function actualUnmuteCmd( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/banUserId.ts b/backend/src/plugins/ModActions/functions/banUserId.ts index 65686c815..2ac01af31 100644 --- a/backend/src/plugins/ModActions/functions/banUserId.ts +++ b/backend/src/plugins/ModActions/functions/banUserId.ts @@ -1,11 +1,11 @@ import { DiscordAPIError, Snowflake } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { LogType } from "../../../data/LogType"; -import { registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop"; -import { logger } from "../../../logger"; -import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop.js"; +import { logger } from "../../../logger.js"; +import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; import { DAYS, SECONDS, @@ -15,13 +15,13 @@ import { resolveMember, resolveUser, ucfirst, -} from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { BanOptions, BanResult, IgnoredEventType, ModActionsPluginType } from "../types"; -import { getDefaultContactMethods } from "./getDefaultContactMethods"; -import { ignoreEvent } from "./ignoreEvent"; +} from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { BanOptions, BanResult, IgnoredEventType, ModActionsPluginType } from "../types.js"; +import { getDefaultContactMethods } from "./getDefaultContactMethods.js"; +import { ignoreEvent } from "./ignoreEvent.js"; /** * Ban the specified user id, whether or not they're actually on the server at the time. Generates a case. diff --git a/backend/src/plugins/ModActions/functions/clearIgnoredEvents.ts b/backend/src/plugins/ModActions/functions/clearIgnoredEvents.ts index c16dabcf6..561d2cc1a 100644 --- a/backend/src/plugins/ModActions/functions/clearIgnoredEvents.ts +++ b/backend/src/plugins/ModActions/functions/clearIgnoredEvents.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { IgnoredEventType, ModActionsPluginType } from "../types"; +import { IgnoredEventType, ModActionsPluginType } from "../types.js"; export function clearIgnoredEvents( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/clearTempban.ts b/backend/src/plugins/ModActions/functions/clearTempban.ts index 1133d6516..e0962e9ca 100644 --- a/backend/src/plugins/ModActions/functions/clearTempban.ts +++ b/backend/src/plugins/ModActions/functions/clearTempban.ts @@ -2,17 +2,17 @@ import { Snowflake } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { LogType } from "../../../data/LogType"; -import { Tempban } from "../../../data/entities/Tempban"; -import { logger } from "../../../logger"; -import { resolveUser } from "../../../utils"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { IgnoredEventType, ModActionsPluginType } from "../types"; -import { formatReasonWithAttachments } from "./formatReasonWithAttachments"; -import { ignoreEvent } from "./ignoreEvent"; -import { isBanned } from "./isBanned"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { Tempban } from "../../../data/entities/Tempban.js"; +import { logger } from "../../../logger.js"; +import { resolveUser } from "../../../utils.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { IgnoredEventType, ModActionsPluginType } from "../types.js"; +import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js"; +import { ignoreEvent } from "./ignoreEvent.js"; +import { isBanned } from "./isBanned.js"; export async function clearTempban(pluginData: GuildPluginData, tempban: Tempban) { if (!(await isBanned(pluginData, tempban.user_id))) { diff --git a/backend/src/plugins/ModActions/functions/getDefaultContactMethods.ts b/backend/src/plugins/ModActions/functions/getDefaultContactMethods.ts index a94a848a0..438dba230 100644 --- a/backend/src/plugins/ModActions/functions/getDefaultContactMethods.ts +++ b/backend/src/plugins/ModActions/functions/getDefaultContactMethods.ts @@ -1,7 +1,7 @@ import { Snowflake, TextChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { UserNotificationMethod } from "../../../utils"; -import { ModActionsPluginType } from "../types"; +import { UserNotificationMethod } from "../../../utils.js"; +import { ModActionsPluginType } from "../types.js"; export function getDefaultContactMethods( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/hasMutePerm.ts b/backend/src/plugins/ModActions/functions/hasMutePerm.ts index b26edd4d2..be3096ee2 100644 --- a/backend/src/plugins/ModActions/functions/hasMutePerm.ts +++ b/backend/src/plugins/ModActions/functions/hasMutePerm.ts @@ -1,6 +1,6 @@ import { GuildMember, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { ModActionsPluginType } from "../types"; +import { ModActionsPluginType } from "../types.js"; export async function hasMutePermission( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/ignoreEvent.ts b/backend/src/plugins/ModActions/functions/ignoreEvent.ts index 71c25362c..c3392ebab 100644 --- a/backend/src/plugins/ModActions/functions/ignoreEvent.ts +++ b/backend/src/plugins/ModActions/functions/ignoreEvent.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { SECONDS } from "../../../utils"; -import { IgnoredEventType, ModActionsPluginType } from "../types"; -import { clearIgnoredEvents } from "./clearIgnoredEvents"; +import { SECONDS } from "../../../utils.js"; +import { IgnoredEventType, ModActionsPluginType } from "../types.js"; +import { clearIgnoredEvents } from "./clearIgnoredEvents.js"; const DEFAULT_TIMEOUT = 15 * SECONDS; diff --git a/backend/src/plugins/ModActions/functions/isBanned.ts b/backend/src/plugins/ModActions/functions/isBanned.ts index 50dc4823c..5623b9595 100644 --- a/backend/src/plugins/ModActions/functions/isBanned.ts +++ b/backend/src/plugins/ModActions/functions/isBanned.ts @@ -1,9 +1,9 @@ import { PermissionsBitField, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { SECONDS, isDiscordAPIError, isDiscordHTTPError, sleep } from "../../../utils"; -import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { ModActionsPluginType } from "../types"; +import { SECONDS, isDiscordAPIError, isDiscordHTTPError, sleep } from "../../../utils.js"; +import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { ModActionsPluginType } from "../types.js"; export async function isBanned( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/isEventIgnored.ts b/backend/src/plugins/ModActions/functions/isEventIgnored.ts index 8ec27baf5..a49c5f111 100644 --- a/backend/src/plugins/ModActions/functions/isEventIgnored.ts +++ b/backend/src/plugins/ModActions/functions/isEventIgnored.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { IgnoredEventType, ModActionsPluginType } from "../types"; +import { IgnoredEventType, ModActionsPluginType } from "../types.js"; export function isEventIgnored( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/kickMember.ts b/backend/src/plugins/ModActions/functions/kickMember.ts index 6dc26e35a..eddf802e8 100644 --- a/backend/src/plugins/ModActions/functions/kickMember.ts +++ b/backend/src/plugins/ModActions/functions/kickMember.ts @@ -1,15 +1,15 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { LogType } from "../../../data/LogType"; -import { renderTemplate, TemplateParseError, TemplateSafeValueContainer } from "../../../templateFormatter"; -import { createUserNotificationError, notifyUser, resolveUser, ucfirst, UserNotificationResult } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { IgnoredEventType, KickOptions, KickResult, ModActionsPluginType } from "../types"; -import { getDefaultContactMethods } from "./getDefaultContactMethods"; -import { ignoreEvent } from "./ignoreEvent"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { renderTemplate, TemplateParseError, TemplateSafeValueContainer } from "../../../templateFormatter.js"; +import { createUserNotificationError, notifyUser, resolveUser, ucfirst, UserNotificationResult } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { IgnoredEventType, KickOptions, KickResult, ModActionsPluginType } from "../types.js"; +import { getDefaultContactMethods } from "./getDefaultContactMethods.js"; +import { ignoreEvent } from "./ignoreEvent.js"; /** * Kick the specified server member. Generates a case. diff --git a/backend/src/plugins/ModActions/functions/offModActionsEvent.ts b/backend/src/plugins/ModActions/functions/offModActionsEvent.ts index 798fa7339..845e965fd 100644 --- a/backend/src/plugins/ModActions/functions/offModActionsEvent.ts +++ b/backend/src/plugins/ModActions/functions/offModActionsEvent.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { ModActionsEvents, ModActionsPluginType } from "../types"; +import { ModActionsEvents, ModActionsPluginType } from "../types.js"; export function offModActionsEvent( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/onModActionsEvent.ts b/backend/src/plugins/ModActions/functions/onModActionsEvent.ts index e1219bad7..7bd5c5480 100644 --- a/backend/src/plugins/ModActions/functions/onModActionsEvent.ts +++ b/backend/src/plugins/ModActions/functions/onModActionsEvent.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { ModActionsEvents, ModActionsPluginType } from "../types"; +import { ModActionsEvents, ModActionsPluginType } from "../types.js"; export function onModActionsEvent( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/functions/readContactMethodsFromArgs.ts b/backend/src/plugins/ModActions/functions/readContactMethodsFromArgs.ts index a95033333..efa3b8bc6 100644 --- a/backend/src/plugins/ModActions/functions/readContactMethodsFromArgs.ts +++ b/backend/src/plugins/ModActions/functions/readContactMethodsFromArgs.ts @@ -1,5 +1,5 @@ import { GuildTextBasedChannel } from "discord.js"; -import { disableUserNotificationStrings, UserNotificationMethod } from "../../../utils"; +import { disableUserNotificationStrings, UserNotificationMethod } from "../../../utils.js"; export function readContactMethodsFromArgs(args: { notify?: string; diff --git a/backend/src/plugins/ModActions/functions/updateCase.ts b/backend/src/plugins/ModActions/functions/updateCase.ts index c19c9d065..721c083c0 100644 --- a/backend/src/plugins/ModActions/functions/updateCase.ts +++ b/backend/src/plugins/ModActions/functions/updateCase.ts @@ -1,10 +1,10 @@ import { Message } from "discord.js"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { Case } from "../../../data/entities/Case"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { formatReasonWithAttachments } from "./formatReasonWithAttachments"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { Case } from "../../../data/entities/Case.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js"; export async function updateCase(pluginData, msg: Message, args) { let theCase: Case | undefined; diff --git a/backend/src/plugins/ModActions/functions/warnMember.ts b/backend/src/plugins/ModActions/functions/warnMember.ts index 9aba15f47..056e26db0 100644 --- a/backend/src/plugins/ModActions/functions/warnMember.ts +++ b/backend/src/plugins/ModActions/functions/warnMember.ts @@ -1,14 +1,14 @@ import { GuildMember, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; -import { UserNotificationResult, createUserNotificationError, notifyUser, resolveUser, ucfirst } from "../../../utils"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { waitForButtonConfirm } from "../../../utils/waitForInteraction"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { ModActionsPluginType, WarnOptions, WarnResult } from "../types"; -import { getDefaultContactMethods } from "./getDefaultContactMethods"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; +import { UserNotificationResult, createUserNotificationError, notifyUser, resolveUser, ucfirst } from "../../../utils.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { ModActionsPluginType, WarnOptions, WarnResult } from "../types.js"; +import { getDefaultContactMethods } from "./getDefaultContactMethods.js"; export async function warnMember( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ModActions/info.ts b/backend/src/plugins/ModActions/info.ts index 96e20de66..736de0cef 100644 --- a/backend/src/plugins/ModActions/info.ts +++ b/backend/src/plugins/ModActions/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zModActionsConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zModActionsConfig } from "./types.js"; export const modActionsPluginInfo: ZeppelinPluginInfo = { prettyName: "Mod actions", diff --git a/backend/src/plugins/ModActions/types.ts b/backend/src/plugins/ModActions/types.ts index fbe7890a7..51044fd35 100644 --- a/backend/src/plugins/ModActions/types.ts +++ b/backend/src/plugins/ModActions/types.ts @@ -2,14 +2,14 @@ import { GuildTextBasedChannel } from "discord.js"; import { EventEmitter } from "events"; import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { Queue } from "../../Queue"; -import { GuildCases } from "../../data/GuildCases"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildMutes } from "../../data/GuildMutes"; -import { GuildTempbans } from "../../data/GuildTempbans"; -import { Case } from "../../data/entities/Case"; -import { UserNotificationMethod, UserNotificationResult } from "../../utils"; -import { CaseArgs } from "../Cases/types"; +import { Queue } from "../../Queue.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildMutes } from "../../data/GuildMutes.js"; +import { GuildTempbans } from "../../data/GuildTempbans.js"; +import { Case } from "../../data/entities/Case.js"; +import { UserNotificationMethod, UserNotificationResult } from "../../utils.js"; +import { CaseArgs } from "../Cases/types.js"; export const zModActionsConfig = z.strictObject({ dm_on_warn: z.boolean(), diff --git a/backend/src/plugins/Mutes/MutesPlugin.ts b/backend/src/plugins/Mutes/MutesPlugin.ts index db8548bea..7bd47d72e 100644 --- a/backend/src/plugins/Mutes/MutesPlugin.ts +++ b/backend/src/plugins/Mutes/MutesPlugin.ts @@ -1,29 +1,29 @@ import { GuildMember, Snowflake } from "discord.js"; import { EventEmitter } from "events"; import { guildPlugin } from "knub"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildCases } from "../../data/GuildCases"; -import { onGuildEvent } from "../../data/GuildEvents"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildMutes } from "../../data/GuildMutes"; -import { makePublicFn } from "../../pluginUtils"; -import { CasesPlugin } from "../Cases/CasesPlugin"; -import { LogsPlugin } from "../Logs/LogsPlugin"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { onGuildEvent } from "../../data/GuildEvents.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildMutes } from "../../data/GuildMutes.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { CasesPlugin } from "../Cases/CasesPlugin.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin.js"; -import { ClearBannedMutesCmd } from "./commands/ClearBannedMutesCmd"; -import { ClearMutesCmd } from "./commands/ClearMutesCmd"; -import { ClearMutesWithoutRoleCmd } from "./commands/ClearMutesWithoutRoleCmd"; -import { MutesCmd } from "./commands/MutesCmd"; -import { ClearActiveMuteOnMemberBanEvt } from "./events/ClearActiveMuteOnMemberBanEvt"; -import { ReapplyActiveMuteOnJoinEvt } from "./events/ReapplyActiveMuteOnJoinEvt"; -import { RegisterManualTimeoutsEvt } from "./events/RegisterManualTimeoutsEvt"; -import { clearMute } from "./functions/clearMute"; -import { muteUser } from "./functions/muteUser"; -import { offMutesEvent } from "./functions/offMutesEvent"; -import { onMutesEvent } from "./functions/onMutesEvent"; -import { renewTimeoutMute } from "./functions/renewTimeoutMute"; -import { unmuteUser } from "./functions/unmuteUser"; -import { MutesPluginType, zMutesConfig } from "./types"; +import { ClearBannedMutesCmd } from "./commands/ClearBannedMutesCmd.js"; +import { ClearMutesCmd } from "./commands/ClearMutesCmd.js"; +import { ClearMutesWithoutRoleCmd } from "./commands/ClearMutesWithoutRoleCmd.js"; +import { MutesCmd } from "./commands/MutesCmd.js"; +import { ClearActiveMuteOnMemberBanEvt } from "./events/ClearActiveMuteOnMemberBanEvt.js"; +import { ReapplyActiveMuteOnJoinEvt } from "./events/ReapplyActiveMuteOnJoinEvt.js"; +import { RegisterManualTimeoutsEvt } from "./events/RegisterManualTimeoutsEvt.js"; +import { clearMute } from "./functions/clearMute.js"; +import { muteUser } from "./functions/muteUser.js"; +import { offMutesEvent } from "./functions/offMutesEvent.js"; +import { onMutesEvent } from "./functions/onMutesEvent.js"; +import { renewTimeoutMute } from "./functions/renewTimeoutMute.js"; +import { unmuteUser } from "./functions/unmuteUser.js"; +import { MutesPluginType, zMutesConfig } from "./types.js"; const defaultOptions = { config: { diff --git a/backend/src/plugins/Mutes/commands/ClearBannedMutesCmd.ts b/backend/src/plugins/Mutes/commands/ClearBannedMutesCmd.ts index 29f9dc287..1c37b3689 100644 --- a/backend/src/plugins/Mutes/commands/ClearBannedMutesCmd.ts +++ b/backend/src/plugins/Mutes/commands/ClearBannedMutesCmd.ts @@ -1,6 +1,6 @@ import { Snowflake } from "discord.js"; -import { sendSuccessMessage } from "../../../pluginUtils"; -import { mutesCmd } from "../types"; +import { sendSuccessMessage } from "../../../pluginUtils.js"; +import { mutesCmd } from "../types.js"; export const ClearBannedMutesCmd = mutesCmd({ trigger: "clear_banned_mutes", diff --git a/backend/src/plugins/Mutes/commands/ClearMutesCmd.ts b/backend/src/plugins/Mutes/commands/ClearMutesCmd.ts index 3021a7a71..be5ffa134 100644 --- a/backend/src/plugins/Mutes/commands/ClearMutesCmd.ts +++ b/backend/src/plugins/Mutes/commands/ClearMutesCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { mutesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { mutesCmd } from "../types.js"; export const ClearMutesCmd = mutesCmd({ trigger: "clear_mutes", diff --git a/backend/src/plugins/Mutes/commands/ClearMutesWithoutRoleCmd.ts b/backend/src/plugins/Mutes/commands/ClearMutesWithoutRoleCmd.ts index 0dbef291e..b65c97abe 100644 --- a/backend/src/plugins/Mutes/commands/ClearMutesWithoutRoleCmd.ts +++ b/backend/src/plugins/Mutes/commands/ClearMutesWithoutRoleCmd.ts @@ -1,7 +1,7 @@ import { Snowflake } from "discord.js"; -import { sendSuccessMessage } from "../../../pluginUtils"; -import { resolveMember } from "../../../utils"; -import { mutesCmd } from "../types"; +import { sendSuccessMessage } from "../../../pluginUtils.js"; +import { resolveMember } from "../../../utils.js"; +import { mutesCmd } from "../types.js"; export const ClearMutesWithoutRoleCmd = mutesCmd({ trigger: "clear_mutes_without_role", diff --git a/backend/src/plugins/Mutes/commands/MutesCmd.ts b/backend/src/plugins/Mutes/commands/MutesCmd.ts index 5000218c4..d599edd44 100644 --- a/backend/src/plugins/Mutes/commands/MutesCmd.ts +++ b/backend/src/plugins/Mutes/commands/MutesCmd.ts @@ -7,11 +7,11 @@ import { Snowflake, } from "discord.js"; import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { humanizeDurationShort } from "../../../humanizeDurationShort"; -import { getBaseUrl } from "../../../pluginUtils"; -import { DBDateFormat, MINUTES, renderUsername, resolveMember } from "../../../utils"; -import { IMuteWithDetails, mutesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { humanizeDurationShort } from "../../../humanizeDurationShort.js"; +import { getBaseUrl } from "../../../pluginUtils.js"; +import { DBDateFormat, MINUTES, renderUsername, resolveMember } from "../../../utils.js"; +import { IMuteWithDetails, mutesCmd } from "../types.js"; export const MutesCmd = mutesCmd({ trigger: "mutes", diff --git a/backend/src/plugins/Mutes/events/ClearActiveMuteOnMemberBanEvt.ts b/backend/src/plugins/Mutes/events/ClearActiveMuteOnMemberBanEvt.ts index 94604dcd6..dab16d254 100644 --- a/backend/src/plugins/Mutes/events/ClearActiveMuteOnMemberBanEvt.ts +++ b/backend/src/plugins/Mutes/events/ClearActiveMuteOnMemberBanEvt.ts @@ -1,4 +1,4 @@ -import { mutesEvt } from "../types"; +import { mutesEvt } from "../types.js"; /** * Clear active mute from the member if the member is banned diff --git a/backend/src/plugins/Mutes/events/ClearActiveMuteOnRoleRemovalEvt.ts b/backend/src/plugins/Mutes/events/ClearActiveMuteOnRoleRemovalEvt.ts index da6e24e5b..0f9b52044 100644 --- a/backend/src/plugins/Mutes/events/ClearActiveMuteOnRoleRemovalEvt.ts +++ b/backend/src/plugins/Mutes/events/ClearActiveMuteOnRoleRemovalEvt.ts @@ -1,5 +1,5 @@ -import { memberHasMutedRole } from "../functions/memberHasMutedRole"; -import { mutesEvt } from "../types"; +import { memberHasMutedRole } from "../functions/memberHasMutedRole.js"; +import { mutesEvt } from "../types.js"; /** * Clear active mute if the mute role is removed manually diff --git a/backend/src/plugins/Mutes/events/ReapplyActiveMuteOnJoinEvt.ts b/backend/src/plugins/Mutes/events/ReapplyActiveMuteOnJoinEvt.ts index 6db4f27ca..914eb7138 100644 --- a/backend/src/plugins/Mutes/events/ReapplyActiveMuteOnJoinEvt.ts +++ b/backend/src/plugins/Mutes/events/ReapplyActiveMuteOnJoinEvt.ts @@ -1,10 +1,10 @@ import moment from "moment-timezone"; -import { MuteTypes } from "../../../data/MuteTypes"; +import { MuteTypes } from "../../../data/MuteTypes.js"; import { noop } from "../../../utils.js"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { getTimeoutExpiryTime } from "../functions/getTimeoutExpiryTime"; -import { mutesEvt } from "../types"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { getTimeoutExpiryTime } from "../functions/getTimeoutExpiryTime.js"; +import { mutesEvt } from "../types.js"; /** * Reapply active mutes on join diff --git a/backend/src/plugins/Mutes/events/RegisterManualTimeoutsEvt.ts b/backend/src/plugins/Mutes/events/RegisterManualTimeoutsEvt.ts index 52c5a7cfa..f627d4797 100644 --- a/backend/src/plugins/Mutes/events/RegisterManualTimeoutsEvt.ts +++ b/backend/src/plugins/Mutes/events/RegisterManualTimeoutsEvt.ts @@ -1,8 +1,8 @@ import { AuditLogChange, AuditLogEvent } from "discord.js"; import moment from "moment-timezone"; -import { MuteTypes } from "../../../data/MuteTypes"; -import { resolveUser } from "../../../utils"; -import { mutesEvt } from "../types"; +import { MuteTypes } from "../../../data/MuteTypes.js"; +import { resolveUser } from "../../../utils.js"; +import { mutesEvt } from "../types.js"; export const RegisterManualTimeoutsEvt = mutesEvt({ event: "guildAuditLogEntryCreate", diff --git a/backend/src/plugins/Mutes/functions/clearMute.ts b/backend/src/plugins/Mutes/functions/clearMute.ts index f96068c75..712788b8d 100644 --- a/backend/src/plugins/Mutes/functions/clearMute.ts +++ b/backend/src/plugins/Mutes/functions/clearMute.ts @@ -1,13 +1,13 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { MuteTypes } from "../../../data/MuteTypes"; -import { Mute } from "../../../data/entities/Mute"; -import { clearExpiringMute } from "../../../data/loops/expiringMutesLoop"; -import { resolveMember, verboseUserMention } from "../../../utils"; -import { memberRolesLock } from "../../../utils/lockNameHelpers"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { MutesPluginType } from "../types"; +import { MuteTypes } from "../../../data/MuteTypes.js"; +import { Mute } from "../../../data/entities/Mute.js"; +import { clearExpiringMute } from "../../../data/loops/expiringMutesLoop.js"; +import { resolveMember, verboseUserMention } from "../../../utils.js"; +import { memberRolesLock } from "../../../utils/lockNameHelpers.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { MutesPluginType } from "../types.js"; export async function clearMute( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Mutes/functions/getDefaultMuteType.ts b/backend/src/plugins/Mutes/functions/getDefaultMuteType.ts index b58333fd7..3e72b37fa 100644 --- a/backend/src/plugins/Mutes/functions/getDefaultMuteType.ts +++ b/backend/src/plugins/Mutes/functions/getDefaultMuteType.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { MuteTypes } from "../../../data/MuteTypes"; -import { MutesPluginType } from "../types"; +import { MuteTypes } from "../../../data/MuteTypes.js"; +import { MutesPluginType } from "../types.js"; export function getDefaultMuteType(pluginData: GuildPluginData): MuteTypes { const muteRole = pluginData.config.get().mute_role; diff --git a/backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts b/backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts index 28f760b9e..8cad67a57 100644 --- a/backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts +++ b/backend/src/plugins/Mutes/functions/getTimeoutExpiryTime.ts @@ -1,4 +1,4 @@ -import { MAX_TIMEOUT_DURATION } from "../../../data/Mutes"; +import { MAX_TIMEOUT_DURATION } from "../../../data/Mutes.js"; /** * Since timeouts have a limited duration (max 28d) but we support mutes longer than that, diff --git a/backend/src/plugins/Mutes/functions/memberHasMutedRole.ts b/backend/src/plugins/Mutes/functions/memberHasMutedRole.ts index 2790285aa..d6f23cef4 100644 --- a/backend/src/plugins/Mutes/functions/memberHasMutedRole.ts +++ b/backend/src/plugins/Mutes/functions/memberHasMutedRole.ts @@ -1,6 +1,6 @@ import { GuildMember, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { MutesPluginType } from "../types"; +import { MutesPluginType } from "../types.js"; export function memberHasMutedRole(pluginData: GuildPluginData, member: GuildMember): boolean { const muteRole = pluginData.config.get().mute_role; diff --git a/backend/src/plugins/Mutes/functions/muteUser.ts b/backend/src/plugins/Mutes/functions/muteUser.ts index fcc273076..e57ae7623 100644 --- a/backend/src/plugins/Mutes/functions/muteUser.ts +++ b/backend/src/plugins/Mutes/functions/muteUser.ts @@ -1,15 +1,15 @@ import { Snowflake } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { AddMuteParams } from "../../../data/GuildMutes"; -import { MuteTypes } from "../../../data/MuteTypes"; -import { Case } from "../../../data/entities/Case"; -import { Mute } from "../../../data/entities/Mute"; -import { registerExpiringMute } from "../../../data/loops/expiringMutesLoop"; -import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin"; -import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { AddMuteParams } from "../../../data/GuildMutes.js"; +import { MuteTypes } from "../../../data/MuteTypes.js"; +import { Case } from "../../../data/entities/Case.js"; +import { Mute } from "../../../data/entities/Mute.js"; +import { registerExpiringMute } from "../../../data/loops/expiringMutesLoop.js"; +import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin.js"; +import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; import { UserNotificationMethod, UserNotificationResult, @@ -18,14 +18,14 @@ import { resolveMember, resolveUser, ucfirst, -} from "../../../utils"; -import { muteLock } from "../../../utils/lockNameHelpers"; -import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { MuteOptions, MutesPluginType } from "../types"; -import { getDefaultMuteType } from "./getDefaultMuteType"; -import { getTimeoutExpiryTime } from "./getTimeoutExpiryTime"; +} from "../../../utils.js"; +import { muteLock } from "../../../utils/lockNameHelpers.js"; +import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { MuteOptions, MutesPluginType } from "../types.js"; +import { getDefaultMuteType } from "./getDefaultMuteType.js"; +import { getTimeoutExpiryTime } from "./getTimeoutExpiryTime.js"; /** * TODO: Clean up this function diff --git a/backend/src/plugins/Mutes/functions/offMutesEvent.ts b/backend/src/plugins/Mutes/functions/offMutesEvent.ts index e48f0d469..232f1a658 100644 --- a/backend/src/plugins/Mutes/functions/offMutesEvent.ts +++ b/backend/src/plugins/Mutes/functions/offMutesEvent.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { MutesEvents, MutesPluginType } from "../types"; +import { MutesEvents, MutesPluginType } from "../types.js"; export function offMutesEvent( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Mutes/functions/onMutesEvent.ts b/backend/src/plugins/Mutes/functions/onMutesEvent.ts index 71f13ba4e..8c41f1940 100644 --- a/backend/src/plugins/Mutes/functions/onMutesEvent.ts +++ b/backend/src/plugins/Mutes/functions/onMutesEvent.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { MutesEvents, MutesPluginType } from "../types"; +import { MutesEvents, MutesPluginType } from "../types.js"; export function onMutesEvent( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Mutes/functions/renewTimeoutMute.ts b/backend/src/plugins/Mutes/functions/renewTimeoutMute.ts index 8363cf9f4..fa5855132 100644 --- a/backend/src/plugins/Mutes/functions/renewTimeoutMute.ts +++ b/backend/src/plugins/Mutes/functions/renewTimeoutMute.ts @@ -1,11 +1,11 @@ import { PermissionFlagsBits } from "discord.js"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { MAX_TIMEOUT_DURATION } from "../../../data/Mutes"; -import { Mute } from "../../../data/entities/Mute"; -import { DBDateFormat, noop, resolveMember } from "../../../utils"; +import { MAX_TIMEOUT_DURATION } from "../../../data/Mutes.js"; +import { Mute } from "../../../data/entities/Mute.js"; +import { DBDateFormat, noop, resolveMember } from "../../../utils.js"; import { LogsPlugin } from "../../Logs/LogsPlugin.js"; -import { MutesPluginType } from "../types"; +import { MutesPluginType } from "../types.js"; export async function renewTimeoutMute(pluginData: GuildPluginData, mute: Mute) { const me = diff --git a/backend/src/plugins/Mutes/functions/unmuteUser.ts b/backend/src/plugins/Mutes/functions/unmuteUser.ts index 4c81a52de..a5624f0a4 100644 --- a/backend/src/plugins/Mutes/functions/unmuteUser.ts +++ b/backend/src/plugins/Mutes/functions/unmuteUser.ts @@ -1,19 +1,19 @@ import { Snowflake } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { AddMuteParams } from "../../../data/GuildMutes"; -import { MuteTypes } from "../../../data/MuteTypes"; -import { Mute } from "../../../data/entities/Mute"; -import { noop, resolveMember, resolveUser } from "../../../utils"; -import { CasesPlugin } from "../../Cases/CasesPlugin"; -import { CaseArgs } from "../../Cases/types"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { MutesPluginType, UnmuteResult } from "../types"; -import { clearMute } from "./clearMute"; -import { getDefaultMuteType } from "./getDefaultMuteType"; -import { getTimeoutExpiryTime } from "./getTimeoutExpiryTime"; -import { memberHasMutedRole } from "./memberHasMutedRole"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { AddMuteParams } from "../../../data/GuildMutes.js"; +import { MuteTypes } from "../../../data/MuteTypes.js"; +import { Mute } from "../../../data/entities/Mute.js"; +import { noop, resolveMember, resolveUser } from "../../../utils.js"; +import { CasesPlugin } from "../../Cases/CasesPlugin.js"; +import { CaseArgs } from "../../Cases/types.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { MutesPluginType, UnmuteResult } from "../types.js"; +import { clearMute } from "./clearMute.js"; +import { getDefaultMuteType } from "./getDefaultMuteType.js"; +import { getTimeoutExpiryTime } from "./getTimeoutExpiryTime.js"; +import { memberHasMutedRole } from "./memberHasMutedRole.js"; export async function unmuteUser( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Mutes/info.ts b/backend/src/plugins/Mutes/info.ts index 0918e233d..6654afed3 100644 --- a/backend/src/plugins/Mutes/info.ts +++ b/backend/src/plugins/Mutes/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zMutesConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zMutesConfig } from "./types.js"; export const mutesPluginInfo: ZeppelinPluginInfo = { prettyName: "Mutes", diff --git a/backend/src/plugins/Mutes/types.ts b/backend/src/plugins/Mutes/types.ts index e1f266a94..3bbc9d99f 100644 --- a/backend/src/plugins/Mutes/types.ts +++ b/backend/src/plugins/Mutes/types.ts @@ -2,14 +2,14 @@ import { GuildMember } from "discord.js"; import { EventEmitter } from "events"; import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildCases } from "../../data/GuildCases"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildMutes } from "../../data/GuildMutes"; -import { Case } from "../../data/entities/Case"; -import { Mute } from "../../data/entities/Mute"; -import { UserNotificationMethod, UserNotificationResult, zSnowflake } from "../../utils"; -import { CaseArgs } from "../Cases/types"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildMutes } from "../../data/GuildMutes.js"; +import { Case } from "../../data/entities/Case.js"; +import { Mute } from "../../data/entities/Mute.js"; +import { UserNotificationMethod, UserNotificationResult, zSnowflake } from "../../utils.js"; +import { CaseArgs } from "../Cases/types.js"; export const zMutesConfig = z.strictObject({ mute_role: zSnowflake.nullable(), diff --git a/backend/src/plugins/NameHistory/NameHistoryPlugin.ts b/backend/src/plugins/NameHistory/NameHistoryPlugin.ts index ee226f3ed..770ce446e 100644 --- a/backend/src/plugins/NameHistory/NameHistoryPlugin.ts +++ b/backend/src/plugins/NameHistory/NameHistoryPlugin.ts @@ -1,9 +1,9 @@ import { PluginOptions, guildPlugin } from "knub"; -import { Queue } from "../../Queue"; -import { GuildNicknameHistory } from "../../data/GuildNicknameHistory"; -import { UsernameHistory } from "../../data/UsernameHistory"; -import { NamesCmd } from "./commands/NamesCmd"; -import { NameHistoryPluginType, zNameHistoryConfig } from "./types"; +import { Queue } from "../../Queue.js"; +import { GuildNicknameHistory } from "../../data/GuildNicknameHistory.js"; +import { UsernameHistory } from "../../data/UsernameHistory.js"; +import { NamesCmd } from "./commands/NamesCmd.js"; +import { NameHistoryPluginType, zNameHistoryConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/NameHistory/commands/NamesCmd.ts b/backend/src/plugins/NameHistory/commands/NamesCmd.ts index da8ba48ab..ce1ccaadf 100644 --- a/backend/src/plugins/NameHistory/commands/NamesCmd.ts +++ b/backend/src/plugins/NameHistory/commands/NamesCmd.ts @@ -1,12 +1,12 @@ import { Snowflake } from "discord.js"; import { createChunkedMessage, disableCodeBlocks } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { MAX_NICKNAME_ENTRIES_PER_USER } from "../../../data/GuildNicknameHistory"; -import { MAX_USERNAME_ENTRIES_PER_USER } from "../../../data/UsernameHistory"; -import { NICKNAME_RETENTION_PERIOD } from "../../../data/cleanup/nicknames"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { DAYS, renderUsername } from "../../../utils"; -import { nameHistoryCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { MAX_NICKNAME_ENTRIES_PER_USER } from "../../../data/GuildNicknameHistory.js"; +import { MAX_USERNAME_ENTRIES_PER_USER } from "../../../data/UsernameHistory.js"; +import { NICKNAME_RETENTION_PERIOD } from "../../../data/cleanup/nicknames.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { DAYS, renderUsername } from "../../../utils.js"; +import { nameHistoryCmd } from "../types.js"; export const NamesCmd = nameHistoryCmd({ trigger: "names", diff --git a/backend/src/plugins/NameHistory/events/UpdateNameEvts.ts b/backend/src/plugins/NameHistory/events/UpdateNameEvts.ts index 0d6446633..5bdbd4963 100644 --- a/backend/src/plugins/NameHistory/events/UpdateNameEvts.ts +++ b/backend/src/plugins/NameHistory/events/UpdateNameEvts.ts @@ -1,5 +1,5 @@ -import { nameHistoryEvt } from "../types"; -import { updateNickname } from "../updateNickname"; +import { nameHistoryEvt } from "../types.js"; +import { updateNickname } from "../updateNickname.js"; export const ChannelJoinEvt = nameHistoryEvt({ event: "voiceStateUpdate", diff --git a/backend/src/plugins/NameHistory/info.ts b/backend/src/plugins/NameHistory/info.ts index b67742d51..985652dd6 100644 --- a/backend/src/plugins/NameHistory/info.ts +++ b/backend/src/plugins/NameHistory/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zNameHistoryConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zNameHistoryConfig } from "./types.js"; export const nameHistoryPluginInfo: ZeppelinPluginInfo = { prettyName: "Name history", diff --git a/backend/src/plugins/NameHistory/types.ts b/backend/src/plugins/NameHistory/types.ts index 70101b539..708a15f2a 100644 --- a/backend/src/plugins/NameHistory/types.ts +++ b/backend/src/plugins/NameHistory/types.ts @@ -1,8 +1,8 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { Queue } from "../../Queue"; -import { GuildNicknameHistory } from "../../data/GuildNicknameHistory"; -import { UsernameHistory } from "../../data/UsernameHistory"; +import { Queue } from "../../Queue.js"; +import { GuildNicknameHistory } from "../../data/GuildNicknameHistory.js"; +import { UsernameHistory } from "../../data/UsernameHistory.js"; export const zNameHistoryConfig = z.strictObject({ can_view: z.boolean(), diff --git a/backend/src/plugins/NameHistory/updateNickname.ts b/backend/src/plugins/NameHistory/updateNickname.ts index e843ae3b7..2eebad1e3 100644 --- a/backend/src/plugins/NameHistory/updateNickname.ts +++ b/backend/src/plugins/NameHistory/updateNickname.ts @@ -1,6 +1,6 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; -import { NameHistoryPluginType } from "./types"; +import { NameHistoryPluginType } from "./types.js"; export async function updateNickname(pluginData: GuildPluginData, member: GuildMember) { if (!member) return; diff --git a/backend/src/plugins/Persist/PersistPlugin.ts b/backend/src/plugins/Persist/PersistPlugin.ts index 760ecc264..7d9a5d6e9 100644 --- a/backend/src/plugins/Persist/PersistPlugin.ts +++ b/backend/src/plugins/Persist/PersistPlugin.ts @@ -1,11 +1,11 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildPersistedData } from "../../data/GuildPersistedData"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin"; -import { LoadDataEvt } from "./events/LoadDataEvt"; -import { StoreDataEvt } from "./events/StoreDataEvt"; -import { PersistPluginType, zPersistConfig } from "./types"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildPersistedData } from "../../data/GuildPersistedData.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin.js"; +import { LoadDataEvt } from "./events/LoadDataEvt.js"; +import { StoreDataEvt } from "./events/StoreDataEvt.js"; +import { PersistPluginType, zPersistConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Persist/events/LoadDataEvt.ts b/backend/src/plugins/Persist/events/LoadDataEvt.ts index 3fb1dcdb7..799483a5c 100644 --- a/backend/src/plugins/Persist/events/LoadDataEvt.ts +++ b/backend/src/plugins/Persist/events/LoadDataEvt.ts @@ -1,14 +1,14 @@ import { GuildMember, PermissionFlagsBits } from "discord.js"; import { GuildPluginData } from "knub"; -import intersection from "lodash.intersection"; -import { PersistedData } from "../../../data/entities/PersistedData"; -import { SECONDS } from "../../../utils"; -import { canAssignRole } from "../../../utils/canAssignRole"; -import { getMissingPermissions } from "../../../utils/getMissingPermissions"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { PersistPluginType, persistEvt } from "../types"; +import intersection from "lodash/intersection.js"; +import { PersistedData } from "../../../data/entities/PersistedData.js"; +import { SECONDS } from "../../../utils.js"; +import { canAssignRole } from "../../../utils/canAssignRole.js"; +import { getMissingPermissions } from "../../../utils/getMissingPermissions.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { PersistPluginType, persistEvt } from "../types.js"; const p = PermissionFlagsBits; diff --git a/backend/src/plugins/Persist/events/StoreDataEvt.ts b/backend/src/plugins/Persist/events/StoreDataEvt.ts index 9385c2795..e8380cad2 100644 --- a/backend/src/plugins/Persist/events/StoreDataEvt.ts +++ b/backend/src/plugins/Persist/events/StoreDataEvt.ts @@ -1,5 +1,5 @@ -import { PersistedData } from "../../../data/entities/PersistedData"; -import { persistEvt } from "../types"; +import { PersistedData } from "../../../data/entities/PersistedData.js"; +import { persistEvt } from "../types.js"; export const StoreDataEvt = persistEvt({ event: "guildMemberRemove", diff --git a/backend/src/plugins/Persist/info.ts b/backend/src/plugins/Persist/info.ts index 0fc6f9b19..122b3eeb7 100644 --- a/backend/src/plugins/Persist/info.ts +++ b/backend/src/plugins/Persist/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zPersistConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zPersistConfig } from "./types.js"; export const persistPluginInfo: ZeppelinPluginInfo = { prettyName: "Persist", diff --git a/backend/src/plugins/Persist/types.ts b/backend/src/plugins/Persist/types.ts index 4f42faa97..6ce5d1df9 100644 --- a/backend/src/plugins/Persist/types.ts +++ b/backend/src/plugins/Persist/types.ts @@ -1,8 +1,8 @@ import { BasePluginType, guildPluginEventListener } from "knub"; import z from "zod"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildPersistedData } from "../../data/GuildPersistedData"; -import { zSnowflake } from "../../utils"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildPersistedData } from "../../data/GuildPersistedData.js"; +import { zSnowflake } from "../../utils.js"; export const zPersistConfig = z.strictObject({ persisted_roles: z.array(zSnowflake), diff --git a/backend/src/plugins/Phisherman/PhishermanPlugin.ts b/backend/src/plugins/Phisherman/PhishermanPlugin.ts index a51962354..3e1b4a50e 100644 --- a/backend/src/plugins/Phisherman/PhishermanPlugin.ts +++ b/backend/src/plugins/Phisherman/PhishermanPlugin.ts @@ -1,8 +1,8 @@ import { PluginOptions, guildPlugin } from "knub"; -import { hasPhishermanMasterAPIKey, phishermanApiKeyIsValid } from "../../data/Phisherman"; -import { makePublicFn } from "../../pluginUtils"; -import { getDomainInfo } from "./functions/getDomainInfo"; -import { PhishermanPluginType, zPhishermanConfig } from "./types"; +import { hasPhishermanMasterAPIKey, phishermanApiKeyIsValid } from "../../data/Phisherman.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { getDomainInfo } from "./functions/getDomainInfo.js"; +import { PhishermanPluginType, zPhishermanConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Phisherman/functions/getDomainInfo.ts b/backend/src/plugins/Phisherman/functions/getDomainInfo.ts index 2714ec01b..f29131947 100644 --- a/backend/src/plugins/Phisherman/functions/getDomainInfo.ts +++ b/backend/src/plugins/Phisherman/functions/getDomainInfo.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { getPhishermanDomainInfo, phishermanDomainIsSafe, trackPhishermanCaughtDomain } from "../../../data/Phisherman"; -import { PhishermanDomainInfo } from "../../../data/types/phisherman"; -import { PhishermanPluginType } from "../types"; +import { getPhishermanDomainInfo, phishermanDomainIsSafe, trackPhishermanCaughtDomain } from "../../../data/Phisherman.js"; +import { PhishermanDomainInfo } from "../../../data/types/phisherman.js"; +import { PhishermanPluginType } from "../types.js"; export async function getDomainInfo( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Phisherman/info.ts b/backend/src/plugins/Phisherman/info.ts index 04c4c4a04..88922112f 100644 --- a/backend/src/plugins/Phisherman/info.ts +++ b/backend/src/plugins/Phisherman/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zPhishermanConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zPhishermanConfig } from "./types.js"; export const phishermanPluginInfo: ZeppelinPluginInfo = { prettyName: "Phisherman", diff --git a/backend/src/plugins/PingableRoles/PingableRolesPlugin.ts b/backend/src/plugins/PingableRoles/PingableRolesPlugin.ts index 68dbcd2e3..6f75e747a 100644 --- a/backend/src/plugins/PingableRoles/PingableRolesPlugin.ts +++ b/backend/src/plugins/PingableRoles/PingableRolesPlugin.ts @@ -1,8 +1,8 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildPingableRoles } from "../../data/GuildPingableRoles"; -import { PingableRoleDisableCmd } from "./commands/PingableRoleDisableCmd"; -import { PingableRoleEnableCmd } from "./commands/PingableRoleEnableCmd"; -import { PingableRolesPluginType, zPingableRolesConfig } from "./types"; +import { GuildPingableRoles } from "../../data/GuildPingableRoles.js"; +import { PingableRoleDisableCmd } from "./commands/PingableRoleDisableCmd.js"; +import { PingableRoleEnableCmd } from "./commands/PingableRoleEnableCmd.js"; +import { PingableRolesPluginType, zPingableRolesConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/PingableRoles/commands/PingableRoleDisableCmd.ts b/backend/src/plugins/PingableRoles/commands/PingableRoleDisableCmd.ts index 41709ffcc..e27cd1465 100644 --- a/backend/src/plugins/PingableRoles/commands/PingableRoleDisableCmd.ts +++ b/backend/src/plugins/PingableRoles/commands/PingableRoleDisableCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { pingableRolesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { pingableRolesCmd } from "../types.js"; export const PingableRoleDisableCmd = pingableRolesCmd({ trigger: ["pingable_role disable", "pingable_role d"], diff --git a/backend/src/plugins/PingableRoles/commands/PingableRoleEnableCmd.ts b/backend/src/plugins/PingableRoles/commands/PingableRoleEnableCmd.ts index 30077e091..6c12d7a5f 100644 --- a/backend/src/plugins/PingableRoles/commands/PingableRoleEnableCmd.ts +++ b/backend/src/plugins/PingableRoles/commands/PingableRoleEnableCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { pingableRolesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { pingableRolesCmd } from "../types.js"; export const PingableRoleEnableCmd = pingableRolesCmd({ trigger: "pingable_role", diff --git a/backend/src/plugins/PingableRoles/events/ChangePingableEvts.ts b/backend/src/plugins/PingableRoles/events/ChangePingableEvts.ts index f91b72647..1c97695a8 100644 --- a/backend/src/plugins/PingableRoles/events/ChangePingableEvts.ts +++ b/backend/src/plugins/PingableRoles/events/ChangePingableEvts.ts @@ -1,7 +1,7 @@ -import { pingableRolesEvt } from "../types"; -import { disablePingableRoles } from "../utils/disablePingableRoles"; -import { enablePingableRoles } from "../utils/enablePingableRoles"; -import { getPingableRolesForChannel } from "../utils/getPingableRolesForChannel"; +import { pingableRolesEvt } from "../types.js"; +import { disablePingableRoles } from "../utils/disablePingableRoles.js"; +import { enablePingableRoles } from "../utils/enablePingableRoles.js"; +import { getPingableRolesForChannel } from "../utils/getPingableRolesForChannel.js"; const TIMEOUT = 10 * 1000; diff --git a/backend/src/plugins/PingableRoles/info.ts b/backend/src/plugins/PingableRoles/info.ts index 1282eb4cd..f0823fc82 100644 --- a/backend/src/plugins/PingableRoles/info.ts +++ b/backend/src/plugins/PingableRoles/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zPingableRolesConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zPingableRolesConfig } from "./types.js"; export const pingableRolesPluginInfo: ZeppelinPluginInfo = { prettyName: "Pingable roles", diff --git a/backend/src/plugins/PingableRoles/types.ts b/backend/src/plugins/PingableRoles/types.ts index 3bd6faa80..d2e009883 100644 --- a/backend/src/plugins/PingableRoles/types.ts +++ b/backend/src/plugins/PingableRoles/types.ts @@ -1,7 +1,7 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildPingableRoles } from "../../data/GuildPingableRoles"; -import { PingableRole } from "../../data/entities/PingableRole"; +import { GuildPingableRoles } from "../../data/GuildPingableRoles.js"; +import { PingableRole } from "../../data/entities/PingableRole.js"; export const zPingableRolesConfig = z.strictObject({ can_manage: z.boolean(), diff --git a/backend/src/plugins/PingableRoles/utils/disablePingableRoles.ts b/backend/src/plugins/PingableRoles/utils/disablePingableRoles.ts index b417ecdf6..a4ea15d52 100644 --- a/backend/src/plugins/PingableRoles/utils/disablePingableRoles.ts +++ b/backend/src/plugins/PingableRoles/utils/disablePingableRoles.ts @@ -1,7 +1,7 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { PingableRole } from "../../../data/entities/PingableRole"; -import { PingableRolesPluginType } from "../types"; +import { PingableRole } from "../../../data/entities/PingableRole.js"; +import { PingableRolesPluginType } from "../types.js"; export function disablePingableRoles( pluginData: GuildPluginData, diff --git a/backend/src/plugins/PingableRoles/utils/enablePingableRoles.ts b/backend/src/plugins/PingableRoles/utils/enablePingableRoles.ts index 7aec4df47..a4dc26348 100644 --- a/backend/src/plugins/PingableRoles/utils/enablePingableRoles.ts +++ b/backend/src/plugins/PingableRoles/utils/enablePingableRoles.ts @@ -1,7 +1,7 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { PingableRole } from "../../../data/entities/PingableRole"; -import { PingableRolesPluginType } from "../types"; +import { PingableRole } from "../../../data/entities/PingableRole.js"; +import { PingableRolesPluginType } from "../types.js"; export function enablePingableRoles( pluginData: GuildPluginData, diff --git a/backend/src/plugins/PingableRoles/utils/getPingableRolesForChannel.ts b/backend/src/plugins/PingableRoles/utils/getPingableRolesForChannel.ts index 96b6b2288..6949edf1c 100644 --- a/backend/src/plugins/PingableRoles/utils/getPingableRolesForChannel.ts +++ b/backend/src/plugins/PingableRoles/utils/getPingableRolesForChannel.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { PingableRole } from "../../../data/entities/PingableRole"; -import { PingableRolesPluginType } from "../types"; +import { PingableRole } from "../../../data/entities/PingableRole.js"; +import { PingableRolesPluginType } from "../types.js"; export async function getPingableRolesForChannel( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Post/PostPlugin.ts b/backend/src/plugins/Post/PostPlugin.ts index 0deb881b7..f843179d0 100644 --- a/backend/src/plugins/Post/PostPlugin.ts +++ b/backend/src/plugins/Post/PostPlugin.ts @@ -1,19 +1,19 @@ import { PluginOptions, guildPlugin } from "knub"; -import { onGuildEvent } from "../../data/GuildEvents"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { GuildScheduledPosts } from "../../data/GuildScheduledPosts"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { EditCmd } from "./commands/EditCmd"; -import { EditEmbedCmd } from "./commands/EditEmbedCmd"; -import { PostCmd } from "./commands/PostCmd"; -import { PostEmbedCmd } from "./commands/PostEmbedCmd"; -import { ScheduledPostsDeleteCmd } from "./commands/ScheduledPostsDeleteCmd"; -import { ScheduledPostsListCmd } from "./commands/ScheduledPostsListCmd"; -import { ScheduledPostsShowCmd } from "./commands/ScheduledPostsShowCmd"; -import { PostPluginType, zPostConfig } from "./types"; -import { postScheduledPost } from "./util/postScheduledPost"; +import { onGuildEvent } from "../../data/GuildEvents.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { GuildScheduledPosts } from "../../data/GuildScheduledPosts.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { EditCmd } from "./commands/EditCmd.js"; +import { EditEmbedCmd } from "./commands/EditEmbedCmd.js"; +import { PostCmd } from "./commands/PostCmd.js"; +import { PostEmbedCmd } from "./commands/PostEmbedCmd.js"; +import { ScheduledPostsDeleteCmd } from "./commands/ScheduledPostsDeleteCmd.js"; +import { ScheduledPostsListCmd } from "./commands/ScheduledPostsListCmd.js"; +import { ScheduledPostsShowCmd } from "./commands/ScheduledPostsShowCmd.js"; +import { PostPluginType, zPostConfig } from "./types.js"; +import { postScheduledPost } from "./util/postScheduledPost.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Post/commands/EditCmd.ts b/backend/src/plugins/Post/commands/EditCmd.ts index 47ae07d7a..9568da19d 100644 --- a/backend/src/plugins/Post/commands/EditCmd.ts +++ b/backend/src/plugins/Post/commands/EditCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { postCmd } from "../types"; -import { formatContent } from "../util/formatContent"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { postCmd } from "../types.js"; +import { formatContent } from "../util/formatContent.js"; export const EditCmd = postCmd({ trigger: "edit", diff --git a/backend/src/plugins/Post/commands/EditEmbedCmd.ts b/backend/src/plugins/Post/commands/EditEmbedCmd.ts index 2ac364f15..2e69d9152 100644 --- a/backend/src/plugins/Post/commands/EditEmbedCmd.ts +++ b/backend/src/plugins/Post/commands/EditEmbedCmd.ts @@ -1,11 +1,11 @@ import { APIEmbed } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { isValidEmbed, trimLines } from "../../../utils"; -import { parseColor } from "../../../utils/parseColor"; -import { rgbToInt } from "../../../utils/rgbToInt"; -import { postCmd } from "../types"; -import { formatContent } from "../util/formatContent"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { isValidEmbed, trimLines } from "../../../utils.js"; +import { parseColor } from "../../../utils/parseColor.js"; +import { rgbToInt } from "../../../utils/rgbToInt.js"; +import { postCmd } from "../types.js"; +import { formatContent } from "../util/formatContent.js"; export const EditEmbedCmd = postCmd({ trigger: "edit_embed", diff --git a/backend/src/plugins/Post/commands/PostCmd.ts b/backend/src/plugins/Post/commands/PostCmd.ts index 4a1f3a4a1..65fc007b5 100644 --- a/backend/src/plugins/Post/commands/PostCmd.ts +++ b/backend/src/plugins/Post/commands/PostCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { postCmd } from "../types"; -import { actualPostCmd } from "../util/actualPostCmd"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { postCmd } from "../types.js"; +import { actualPostCmd } from "../util/actualPostCmd.js"; export const PostCmd = postCmd({ trigger: "post", diff --git a/backend/src/plugins/Post/commands/PostEmbedCmd.ts b/backend/src/plugins/Post/commands/PostEmbedCmd.ts index e605402b0..0b0405240 100644 --- a/backend/src/plugins/Post/commands/PostEmbedCmd.ts +++ b/backend/src/plugins/Post/commands/PostEmbedCmd.ts @@ -1,12 +1,12 @@ import { APIEmbed } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { isValidEmbed, trimLines } from "../../../utils"; -import { parseColor } from "../../../utils/parseColor"; -import { rgbToInt } from "../../../utils/rgbToInt"; -import { postCmd } from "../types"; -import { actualPostCmd } from "../util/actualPostCmd"; -import { formatContent } from "../util/formatContent"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { isValidEmbed, trimLines } from "../../../utils.js"; +import { parseColor } from "../../../utils/parseColor.js"; +import { rgbToInt } from "../../../utils/rgbToInt.js"; +import { postCmd } from "../types.js"; +import { actualPostCmd } from "../util/actualPostCmd.js"; +import { formatContent } from "../util/formatContent.js"; export const PostEmbedCmd = postCmd({ trigger: "post_embed", diff --git a/backend/src/plugins/Post/commands/ScheduledPostsDeleteCmd.ts b/backend/src/plugins/Post/commands/ScheduledPostsDeleteCmd.ts index 78becae89..732ca1f82 100644 --- a/backend/src/plugins/Post/commands/ScheduledPostsDeleteCmd.ts +++ b/backend/src/plugins/Post/commands/ScheduledPostsDeleteCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { clearUpcomingScheduledPost } from "../../../data/loops/upcomingScheduledPostsLoop"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { sorter } from "../../../utils"; -import { postCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { clearUpcomingScheduledPost } from "../../../data/loops/upcomingScheduledPostsLoop.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { sorter } from "../../../utils.js"; +import { postCmd } from "../types.js"; export const ScheduledPostsDeleteCmd = postCmd({ trigger: ["scheduled_posts delete", "scheduled_posts d"], diff --git a/backend/src/plugins/Post/commands/ScheduledPostsListCmd.ts b/backend/src/plugins/Post/commands/ScheduledPostsListCmd.ts index c118440f6..99f935978 100644 --- a/backend/src/plugins/Post/commands/ScheduledPostsListCmd.ts +++ b/backend/src/plugins/Post/commands/ScheduledPostsListCmd.ts @@ -1,9 +1,9 @@ import { escapeCodeBlock } from "discord.js"; import humanizeDuration from "humanize-duration"; import moment from "moment-timezone"; -import { createChunkedMessage, DBDateFormat, deactivateMentions, sorter, trimLines } from "../../../utils"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { postCmd } from "../types"; +import { createChunkedMessage, DBDateFormat, deactivateMentions, sorter, trimLines } from "../../../utils.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { postCmd } from "../types.js"; const SCHEDULED_POST_PREVIEW_TEXT_LENGTH = 50; diff --git a/backend/src/plugins/Post/commands/ScheduledPostsShowCmd.ts b/backend/src/plugins/Post/commands/ScheduledPostsShowCmd.ts index 990bfbaee..6fbd17be6 100644 --- a/backend/src/plugins/Post/commands/ScheduledPostsShowCmd.ts +++ b/backend/src/plugins/Post/commands/ScheduledPostsShowCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { sorter } from "../../../utils"; -import { postCmd } from "../types"; -import { postMessage } from "../util/postMessage"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { sorter } from "../../../utils.js"; +import { postCmd } from "../types.js"; +import { postMessage } from "../util/postMessage.js"; export const ScheduledPostsShowCmd = postCmd({ trigger: ["scheduled_posts", "scheduled_posts show"], diff --git a/backend/src/plugins/Post/info.ts b/backend/src/plugins/Post/info.ts index f55fd8735..94b309412 100644 --- a/backend/src/plugins/Post/info.ts +++ b/backend/src/plugins/Post/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zPostConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zPostConfig } from "./types.js"; export const postPluginInfo: ZeppelinPluginInfo = { prettyName: "Post", diff --git a/backend/src/plugins/Post/types.ts b/backend/src/plugins/Post/types.ts index e0ec7d2c9..1c758b9c1 100644 --- a/backend/src/plugins/Post/types.ts +++ b/backend/src/plugins/Post/types.ts @@ -1,8 +1,8 @@ import { BasePluginType, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { GuildScheduledPosts } from "../../data/GuildScheduledPosts"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { GuildScheduledPosts } from "../../data/GuildScheduledPosts.js"; export const zPostConfig = z.strictObject({ can_post: z.boolean(), diff --git a/backend/src/plugins/Post/util/actualPostCmd.ts b/backend/src/plugins/Post/util/actualPostCmd.ts index 29c3d5ecb..93f7ac5cf 100644 --- a/backend/src/plugins/Post/util/actualPostCmd.ts +++ b/backend/src/plugins/Post/util/actualPostCmd.ts @@ -2,14 +2,14 @@ import { GuildTextBasedChannel, Message } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { registerUpcomingScheduledPost } from "../../../data/loops/upcomingScheduledPostsLoop"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { DBDateFormat, MINUTES, StrictMessageContent, errorMessage, renderUsername } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { PostPluginType } from "../types"; -import { parseScheduleTime } from "./parseScheduleTime"; -import { postMessage } from "./postMessage"; +import { registerUpcomingScheduledPost } from "../../../data/loops/upcomingScheduledPostsLoop.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { DBDateFormat, MINUTES, StrictMessageContent, errorMessage, renderUsername } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { PostPluginType } from "../types.js"; +import { parseScheduleTime } from "./parseScheduleTime.js"; +import { postMessage } from "./postMessage.js"; const MIN_REPEAT_TIME = 5 * MINUTES; const MAX_REPEAT_TIME = Math.pow(2, 32); diff --git a/backend/src/plugins/Post/util/parseScheduleTime.ts b/backend/src/plugins/Post/util/parseScheduleTime.ts index 5f5325e5e..8ac87fa1c 100644 --- a/backend/src/plugins/Post/util/parseScheduleTime.ts +++ b/backend/src/plugins/Post/util/parseScheduleTime.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; import moment, { Moment } from "moment-timezone"; -import { convertDelayStringToMS } from "../../../utils"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; +import { convertDelayStringToMS } from "../../../utils.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; // TODO: Extract out of the Post plugin, use everywhere with a date input export async function parseScheduleTime( diff --git a/backend/src/plugins/Post/util/postMessage.ts b/backend/src/plugins/Post/util/postMessage.ts index e4b4c1e65..673aa833c 100644 --- a/backend/src/plugins/Post/util/postMessage.ts +++ b/backend/src/plugins/Post/util/postMessage.ts @@ -1,9 +1,9 @@ import { Attachment, GuildTextBasedChannel, Message, MessageCreateOptions } from "discord.js"; import fs from "fs"; import { GuildPluginData } from "knub"; -import { downloadFile } from "../../../utils"; -import { PostPluginType } from "../types"; -import { formatContent } from "./formatContent"; +import { downloadFile } from "../../../utils.js"; +import { PostPluginType } from "../types.js"; +import { formatContent } from "./formatContent.js"; const fsp = fs.promises; diff --git a/backend/src/plugins/Post/util/postScheduledPost.ts b/backend/src/plugins/Post/util/postScheduledPost.ts index e4a3e1e06..7ffe62f31 100644 --- a/backend/src/plugins/Post/util/postScheduledPost.ts +++ b/backend/src/plugins/Post/util/postScheduledPost.ts @@ -1,13 +1,13 @@ import { Snowflake, User } from "discord.js"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { ScheduledPost } from "../../../data/entities/ScheduledPost"; -import { registerUpcomingScheduledPost } from "../../../data/loops/upcomingScheduledPostsLoop"; -import { logger } from "../../../logger"; -import { DBDateFormat, verboseChannelMention, verboseUserMention } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { PostPluginType } from "../types"; -import { postMessage } from "./postMessage"; +import { ScheduledPost } from "../../../data/entities/ScheduledPost.js"; +import { registerUpcomingScheduledPost } from "../../../data/loops/upcomingScheduledPostsLoop.js"; +import { logger } from "../../../logger.js"; +import { DBDateFormat, verboseChannelMention, verboseUserMention } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { PostPluginType } from "../types.js"; +import { postMessage } from "./postMessage.js"; export async function postScheduledPost(pluginData: GuildPluginData, post: ScheduledPost) { // First, update the scheduled post or delete it from the database *before* we try posting it. diff --git a/backend/src/plugins/ReactionRoles/ReactionRolesPlugin.ts b/backend/src/plugins/ReactionRoles/ReactionRolesPlugin.ts index 8622b3b91..a3fc731c5 100644 --- a/backend/src/plugins/ReactionRoles/ReactionRolesPlugin.ts +++ b/backend/src/plugins/ReactionRoles/ReactionRolesPlugin.ts @@ -1,14 +1,14 @@ import { PluginOptions, guildPlugin } from "knub"; -import { Queue } from "../../Queue"; -import { GuildReactionRoles } from "../../data/GuildReactionRoles"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { ClearReactionRolesCmd } from "./commands/ClearReactionRolesCmd"; -import { InitReactionRolesCmd } from "./commands/InitReactionRolesCmd"; -import { RefreshReactionRolesCmd } from "./commands/RefreshReactionRolesCmd"; -import { AddReactionRoleEvt } from "./events/AddReactionRoleEvt"; -import { MessageDeletedEvt } from "./events/MessageDeletedEvt"; -import { ReactionRolesPluginType, zReactionRolesConfig } from "./types"; +import { Queue } from "../../Queue.js"; +import { GuildReactionRoles } from "../../data/GuildReactionRoles.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { ClearReactionRolesCmd } from "./commands/ClearReactionRolesCmd.js"; +import { InitReactionRolesCmd } from "./commands/InitReactionRolesCmd.js"; +import { RefreshReactionRolesCmd } from "./commands/RefreshReactionRolesCmd.js"; +import { AddReactionRoleEvt } from "./events/AddReactionRoleEvt.js"; +import { MessageDeletedEvt } from "./events/MessageDeletedEvt.js"; +import { ReactionRolesPluginType, zReactionRolesConfig } from "./types.js"; const MIN_AUTO_REFRESH = 1000 * 60 * 15; // 15min minimum, let's not abuse the API diff --git a/backend/src/plugins/ReactionRoles/commands/ClearReactionRolesCmd.ts b/backend/src/plugins/ReactionRoles/commands/ClearReactionRolesCmd.ts index ff88b1948..09401a9d6 100644 --- a/backend/src/plugins/ReactionRoles/commands/ClearReactionRolesCmd.ts +++ b/backend/src/plugins/ReactionRoles/commands/ClearReactionRolesCmd.ts @@ -1,8 +1,8 @@ import { Message } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { isDiscordAPIError } from "../../../utils"; -import { reactionRolesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { isDiscordAPIError } from "../../../utils.js"; +import { reactionRolesCmd } from "../types.js"; export const ClearReactionRolesCmd = reactionRolesCmd({ trigger: "reaction_roles clear", diff --git a/backend/src/plugins/ReactionRoles/commands/InitReactionRolesCmd.ts b/backend/src/plugins/ReactionRoles/commands/InitReactionRolesCmd.ts index fefc166e5..949e773b5 100644 --- a/backend/src/plugins/ReactionRoles/commands/InitReactionRolesCmd.ts +++ b/backend/src/plugins/ReactionRoles/commands/InitReactionRolesCmd.ts @@ -1,10 +1,10 @@ import { Snowflake } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { canUseEmoji, isDiscordAPIError, isValidEmoji, noop, trimPluginDescription } from "../../../utils"; -import { canReadChannel } from "../../../utils/canReadChannel"; -import { TReactionRolePair, reactionRolesCmd } from "../types"; -import { applyReactionRoleReactionsToMessage } from "../util/applyReactionRoleReactionsToMessage"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { canUseEmoji, isDiscordAPIError, isValidEmoji, noop, trimPluginDescription } from "../../../utils.js"; +import { canReadChannel } from "../../../utils/canReadChannel.js"; +import { TReactionRolePair, reactionRolesCmd } from "../types.js"; +import { applyReactionRoleReactionsToMessage } from "../util/applyReactionRoleReactionsToMessage.js"; const CLEAR_ROLES_EMOJI = "❌"; diff --git a/backend/src/plugins/ReactionRoles/commands/RefreshReactionRolesCmd.ts b/backend/src/plugins/ReactionRoles/commands/RefreshReactionRolesCmd.ts index 3a55f6ba7..f222e742e 100644 --- a/backend/src/plugins/ReactionRoles/commands/RefreshReactionRolesCmd.ts +++ b/backend/src/plugins/ReactionRoles/commands/RefreshReactionRolesCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { reactionRolesCmd } from "../types"; -import { refreshReactionRoles } from "../util/refreshReactionRoles"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { reactionRolesCmd } from "../types.js"; +import { refreshReactionRoles } from "../util/refreshReactionRoles.js"; export const RefreshReactionRolesCmd = reactionRolesCmd({ trigger: "reaction_roles refresh", diff --git a/backend/src/plugins/ReactionRoles/events/AddReactionRoleEvt.ts b/backend/src/plugins/ReactionRoles/events/AddReactionRoleEvt.ts index 324405b39..155fffb2e 100644 --- a/backend/src/plugins/ReactionRoles/events/AddReactionRoleEvt.ts +++ b/backend/src/plugins/ReactionRoles/events/AddReactionRoleEvt.ts @@ -1,7 +1,7 @@ import { Message } from "discord.js"; -import { noop, resolveMember, sleep } from "../../../utils"; -import { reactionRolesEvt } from "../types"; -import { addMemberPendingRoleChange } from "../util/addMemberPendingRoleChange"; +import { noop, resolveMember, sleep } from "../../../utils.js"; +import { reactionRolesEvt } from "../types.js"; +import { addMemberPendingRoleChange } from "../util/addMemberPendingRoleChange.js"; const CLEAR_ROLES_EMOJI = "❌"; diff --git a/backend/src/plugins/ReactionRoles/events/MessageDeletedEvt.ts b/backend/src/plugins/ReactionRoles/events/MessageDeletedEvt.ts index f75195c31..58e48bfdf 100644 --- a/backend/src/plugins/ReactionRoles/events/MessageDeletedEvt.ts +++ b/backend/src/plugins/ReactionRoles/events/MessageDeletedEvt.ts @@ -1,4 +1,4 @@ -import { reactionRolesEvt } from "../types"; +import { reactionRolesEvt } from "../types.js"; export const MessageDeletedEvt = reactionRolesEvt({ event: "messageDelete", diff --git a/backend/src/plugins/ReactionRoles/info.ts b/backend/src/plugins/ReactionRoles/info.ts index 2ceebe5d6..6cc21dd38 100644 --- a/backend/src/plugins/ReactionRoles/info.ts +++ b/backend/src/plugins/ReactionRoles/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zReactionRolesConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zReactionRolesConfig } from "./types.js"; export const reactionRolesPluginInfo: ZeppelinPluginInfo = { prettyName: "Reaction roles", diff --git a/backend/src/plugins/ReactionRoles/types.ts b/backend/src/plugins/ReactionRoles/types.ts index b955c6fa2..5090d1812 100644 --- a/backend/src/plugins/ReactionRoles/types.ts +++ b/backend/src/plugins/ReactionRoles/types.ts @@ -1,8 +1,8 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { Queue } from "../../Queue"; -import { GuildReactionRoles } from "../../data/GuildReactionRoles"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; +import { Queue } from "../../Queue.js"; +import { GuildReactionRoles } from "../../data/GuildReactionRoles.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; export const zReactionRolesConfig = z.strictObject({ auto_refresh_interval: z.number(), diff --git a/backend/src/plugins/ReactionRoles/util/addMemberPendingRoleChange.ts b/backend/src/plugins/ReactionRoles/util/addMemberPendingRoleChange.ts index 8f25a0ae7..d239f7d78 100644 --- a/backend/src/plugins/ReactionRoles/util/addMemberPendingRoleChange.ts +++ b/backend/src/plugins/ReactionRoles/util/addMemberPendingRoleChange.ts @@ -1,9 +1,9 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { logger } from "../../../logger"; -import { renderUsername, resolveMember } from "../../../utils"; -import { memberRolesLock } from "../../../utils/lockNameHelpers"; -import { PendingMemberRoleChanges, ReactionRolesPluginType, RoleChangeMode } from "../types"; +import { logger } from "../../../logger.js"; +import { renderUsername, resolveMember } from "../../../utils.js"; +import { memberRolesLock } from "../../../utils/lockNameHelpers.js"; +import { PendingMemberRoleChanges, ReactionRolesPluginType, RoleChangeMode } from "../types.js"; const ROLE_CHANGE_BATCH_DEBOUNCE_TIME = 1500; diff --git a/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts b/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts index 5d1b3a37f..9c5094ed0 100644 --- a/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts +++ b/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts @@ -1,9 +1,9 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { ReactionRole } from "../../../data/entities/ReactionRole"; -import { isDiscordAPIError, sleep } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { ReactionRolesPluginType } from "../types"; +import { ReactionRole } from "../../../data/entities/ReactionRole.js"; +import { isDiscordAPIError, sleep } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { ReactionRolesPluginType } from "../types.js"; const CLEAR_ROLES_EMOJI = "❌"; diff --git a/backend/src/plugins/ReactionRoles/util/autoRefreshLoop.ts b/backend/src/plugins/ReactionRoles/util/autoRefreshLoop.ts index 90b12578a..f28cb5f38 100644 --- a/backend/src/plugins/ReactionRoles/util/autoRefreshLoop.ts +++ b/backend/src/plugins/ReactionRoles/util/autoRefreshLoop.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { ReactionRolesPluginType } from "../types"; -import { runAutoRefresh } from "./runAutoRefresh"; +import { ReactionRolesPluginType } from "../types.js"; +import { runAutoRefresh } from "./runAutoRefresh.js"; export async function autoRefreshLoop(pluginData: GuildPluginData, interval: number) { pluginData.state.autoRefreshTimeout = setTimeout(async () => { diff --git a/backend/src/plugins/ReactionRoles/util/refreshReactionRoles.ts b/backend/src/plugins/ReactionRoles/util/refreshReactionRoles.ts index 1cb3ff80e..de61e85ac 100644 --- a/backend/src/plugins/ReactionRoles/util/refreshReactionRoles.ts +++ b/backend/src/plugins/ReactionRoles/util/refreshReactionRoles.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { ReactionRolesPluginType } from "../types"; -import { applyReactionRoleReactionsToMessage } from "./applyReactionRoleReactionsToMessage"; +import { ReactionRolesPluginType } from "../types.js"; +import { applyReactionRoleReactionsToMessage } from "./applyReactionRoleReactionsToMessage.js"; export async function refreshReactionRoles( pluginData: GuildPluginData, diff --git a/backend/src/plugins/ReactionRoles/util/runAutoRefresh.ts b/backend/src/plugins/ReactionRoles/util/runAutoRefresh.ts index c1d2b42af..9a6dc4463 100644 --- a/backend/src/plugins/ReactionRoles/util/runAutoRefresh.ts +++ b/backend/src/plugins/ReactionRoles/util/runAutoRefresh.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { ReactionRolesPluginType } from "../types"; -import { refreshReactionRoles } from "./refreshReactionRoles"; +import { ReactionRolesPluginType } from "../types.js"; +import { refreshReactionRoles } from "./refreshReactionRoles.js"; export async function runAutoRefresh(pluginData: GuildPluginData) { // Refresh reaction roles on all reaction role messages diff --git a/backend/src/plugins/Reminders/RemindersPlugin.ts b/backend/src/plugins/Reminders/RemindersPlugin.ts index d43961c33..dc317bd77 100644 --- a/backend/src/plugins/Reminders/RemindersPlugin.ts +++ b/backend/src/plugins/Reminders/RemindersPlugin.ts @@ -1,12 +1,12 @@ import { PluginOptions, guildPlugin } from "knub"; -import { onGuildEvent } from "../../data/GuildEvents"; -import { GuildReminders } from "../../data/GuildReminders"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { RemindCmd } from "./commands/RemindCmd"; -import { RemindersCmd } from "./commands/RemindersCmd"; -import { RemindersDeleteCmd } from "./commands/RemindersDeleteCmd"; -import { postReminder } from "./functions/postReminder"; -import { RemindersPluginType, zRemindersConfig } from "./types"; +import { onGuildEvent } from "../../data/GuildEvents.js"; +import { GuildReminders } from "../../data/GuildReminders.js"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { RemindCmd } from "./commands/RemindCmd.js"; +import { RemindersCmd } from "./commands/RemindersCmd.js"; +import { RemindersDeleteCmd } from "./commands/RemindersDeleteCmd.js"; +import { postReminder } from "./functions/postReminder.js"; +import { RemindersPluginType, zRemindersConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Reminders/commands/RemindCmd.ts b/backend/src/plugins/Reminders/commands/RemindCmd.ts index c46557710..136a5c30a 100644 --- a/backend/src/plugins/Reminders/commands/RemindCmd.ts +++ b/backend/src/plugins/Reminders/commands/RemindCmd.ts @@ -1,11 +1,11 @@ import humanizeDuration from "humanize-duration"; import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { registerUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { convertDelayStringToMS, messageLink } from "../../../utils"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { remindersCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { registerUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { convertDelayStringToMS, messageLink } from "../../../utils.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { remindersCmd } from "../types.js"; export const RemindCmd = remindersCmd({ trigger: ["remind", "remindme", "reminder"], diff --git a/backend/src/plugins/Reminders/commands/RemindersCmd.ts b/backend/src/plugins/Reminders/commands/RemindersCmd.ts index ce914a344..04ef41255 100644 --- a/backend/src/plugins/Reminders/commands/RemindersCmd.ts +++ b/backend/src/plugins/Reminders/commands/RemindersCmd.ts @@ -1,9 +1,9 @@ import humanizeDuration from "humanize-duration"; import moment from "moment-timezone"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { createChunkedMessage, DBDateFormat, sorter } from "../../../utils"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { remindersCmd } from "../types"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { createChunkedMessage, DBDateFormat, sorter } from "../../../utils.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { remindersCmd } from "../types.js"; export const RemindersCmd = remindersCmd({ trigger: "reminders", diff --git a/backend/src/plugins/Reminders/commands/RemindersDeleteCmd.ts b/backend/src/plugins/Reminders/commands/RemindersDeleteCmd.ts index 25713a4fc..bd53a8f4f 100644 --- a/backend/src/plugins/Reminders/commands/RemindersDeleteCmd.ts +++ b/backend/src/plugins/Reminders/commands/RemindersDeleteCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { clearUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { sorter } from "../../../utils"; -import { remindersCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { clearUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { sorter } from "../../../utils.js"; +import { remindersCmd } from "../types.js"; export const RemindersDeleteCmd = remindersCmd({ trigger: ["reminders delete", "reminders d"], diff --git a/backend/src/plugins/Reminders/functions/postReminder.ts b/backend/src/plugins/Reminders/functions/postReminder.ts index 86afbf08f..6726b5d44 100644 --- a/backend/src/plugins/Reminders/functions/postReminder.ts +++ b/backend/src/plugins/Reminders/functions/postReminder.ts @@ -2,9 +2,9 @@ import { HTTPError, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import { disableLinkPreviews } from "knub/helpers"; import moment from "moment-timezone"; -import { Reminder } from "../../../data/entities/Reminder"; -import { DBDateFormat } from "../../../utils"; -import { RemindersPluginType } from "../types"; +import { Reminder } from "../../../data/entities/Reminder.js"; +import { DBDateFormat } from "../../../utils.js"; +import { RemindersPluginType } from "../types.js"; export async function postReminder(pluginData: GuildPluginData, reminder: Reminder) { const channel = pluginData.guild.channels.cache.get(reminder.channel_id as Snowflake); diff --git a/backend/src/plugins/Reminders/info.ts b/backend/src/plugins/Reminders/info.ts index 0110d36fa..02f04cace 100644 --- a/backend/src/plugins/Reminders/info.ts +++ b/backend/src/plugins/Reminders/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zRemindersConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zRemindersConfig } from "./types.js"; export const remindersPluginInfo: ZeppelinPluginInfo = { prettyName: "Reminders", diff --git a/backend/src/plugins/Reminders/types.ts b/backend/src/plugins/Reminders/types.ts index 4356fac0d..ae0daf24f 100644 --- a/backend/src/plugins/Reminders/types.ts +++ b/backend/src/plugins/Reminders/types.ts @@ -1,6 +1,6 @@ import { BasePluginType, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildReminders } from "../../data/GuildReminders"; +import { GuildReminders } from "../../data/GuildReminders.js"; export const zRemindersConfig = z.strictObject({ can_use: z.boolean(), diff --git a/backend/src/plugins/RoleButtons/RoleButtonsPlugin.ts b/backend/src/plugins/RoleButtons/RoleButtonsPlugin.ts index d7f9111ac..44b537b02 100644 --- a/backend/src/plugins/RoleButtons/RoleButtonsPlugin.ts +++ b/backend/src/plugins/RoleButtons/RoleButtonsPlugin.ts @@ -1,11 +1,11 @@ import { guildPlugin } from "knub"; -import { GuildRoleButtons } from "../../data/GuildRoleButtons"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin"; -import { resetButtonsCmd } from "./commands/resetButtons"; -import { onButtonInteraction } from "./events/buttonInteraction"; -import { applyAllRoleButtons } from "./functions/applyAllRoleButtons"; -import { RoleButtonsPluginType, zRoleButtonsConfig } from "./types"; +import { GuildRoleButtons } from "../../data/GuildRoleButtons.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin.js"; +import { resetButtonsCmd } from "./commands/resetButtons.js"; +import { onButtonInteraction } from "./events/buttonInteraction.js"; +import { applyAllRoleButtons } from "./functions/applyAllRoleButtons.js"; +import { RoleButtonsPluginType, zRoleButtonsConfig } from "./types.js"; export const RoleButtonsPlugin = guildPlugin()({ name: "role_buttons", diff --git a/backend/src/plugins/RoleButtons/commands/resetButtons.ts b/backend/src/plugins/RoleButtons/commands/resetButtons.ts index cca8e643d..122820d44 100644 --- a/backend/src/plugins/RoleButtons/commands/resetButtons.ts +++ b/backend/src/plugins/RoleButtons/commands/resetButtons.ts @@ -1,8 +1,8 @@ import { guildPluginMessageCommand } from "knub"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { applyAllRoleButtons } from "../functions/applyAllRoleButtons"; -import { RoleButtonsPluginType } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { applyAllRoleButtons } from "../functions/applyAllRoleButtons.js"; +import { RoleButtonsPluginType } from "../types.js"; export const resetButtonsCmd = guildPluginMessageCommand()({ trigger: "role_buttons reset", diff --git a/backend/src/plugins/RoleButtons/events/buttonInteraction.ts b/backend/src/plugins/RoleButtons/events/buttonInteraction.ts index bc8c76320..f8973d051 100644 --- a/backend/src/plugins/RoleButtons/events/buttonInteraction.ts +++ b/backend/src/plugins/RoleButtons/events/buttonInteraction.ts @@ -1,10 +1,10 @@ import { GuildMember } from "discord.js"; import { guildPluginEventListener } from "knub"; -import { SECONDS } from "../../../utils"; -import { parseCustomId } from "../../../utils/parseCustomId"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { getAllRolesInButtons } from "../functions/getAllRolesInButtons"; -import { RoleButtonsPluginType, TRoleButtonOption } from "../types"; +import { SECONDS } from "../../../utils.js"; +import { parseCustomId } from "../../../utils/parseCustomId.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { getAllRolesInButtons } from "../functions/getAllRolesInButtons.js"; +import { RoleButtonsPluginType, TRoleButtonOption } from "../types.js"; const ROLE_BUTTON_CD = 5 * SECONDS; diff --git a/backend/src/plugins/RoleButtons/functions/applyAllRoleButtons.ts b/backend/src/plugins/RoleButtons/functions/applyAllRoleButtons.ts index bb50f3d50..fb456cd33 100644 --- a/backend/src/plugins/RoleButtons/functions/applyAllRoleButtons.ts +++ b/backend/src/plugins/RoleButtons/functions/applyAllRoleButtons.ts @@ -1,7 +1,7 @@ import { createHash } from "crypto"; import { GuildPluginData } from "knub"; -import { RoleButtonsPluginType } from "../types"; -import { applyRoleButtons } from "./applyRoleButtons"; +import { RoleButtonsPluginType } from "../types.js"; +import { applyRoleButtons } from "./applyRoleButtons.js"; export async function applyAllRoleButtons(pluginData: GuildPluginData) { const savedRoleButtons = await pluginData.state.roleButtons.getSavedRoleButtons(); diff --git a/backend/src/plugins/RoleButtons/functions/applyRoleButtons.ts b/backend/src/plugins/RoleButtons/functions/applyRoleButtons.ts index 3570ebd0f..12d8bc3dd 100644 --- a/backend/src/plugins/RoleButtons/functions/applyRoleButtons.ts +++ b/backend/src/plugins/RoleButtons/functions/applyRoleButtons.ts @@ -1,9 +1,9 @@ import { Message, MessageCreateOptions, MessageEditOptions } from "discord.js"; import { GuildPluginData } from "knub"; -import { RoleButtonsItem } from "../../../data/entities/RoleButtonsItem"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleButtonsPluginType, TRoleButtonsConfigItem } from "../types"; -import { createButtonComponents } from "./createButtonComponents"; +import { RoleButtonsItem } from "../../../data/entities/RoleButtonsItem.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleButtonsPluginType, TRoleButtonsConfigItem } from "../types.js"; +import { createButtonComponents } from "./createButtonComponents.js"; export async function applyRoleButtons( pluginData: GuildPluginData, diff --git a/backend/src/plugins/RoleButtons/functions/createButtonComponents.ts b/backend/src/plugins/RoleButtons/functions/createButtonComponents.ts index e41d87bce..8b56d3a95 100644 --- a/backend/src/plugins/RoleButtons/functions/createButtonComponents.ts +++ b/backend/src/plugins/RoleButtons/functions/createButtonComponents.ts @@ -1,7 +1,7 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"; -import { buildCustomId } from "../../../utils/buildCustomId"; -import { TRoleButtonsConfigItem } from "../types"; -import { TooManyComponentsError } from "./TooManyComponentsError"; +import { buildCustomId } from "../../../utils/buildCustomId.js"; +import { TRoleButtonsConfigItem } from "../types.js"; +import { TooManyComponentsError } from "./TooManyComponentsError.js"; import { convertButtonStyleStringToEnum } from "./convertButtonStyleStringToEnum.js"; export function createButtonComponents(configItem: TRoleButtonsConfigItem): Array> { diff --git a/backend/src/plugins/RoleButtons/functions/getAllRolesInButtons.ts b/backend/src/plugins/RoleButtons/functions/getAllRolesInButtons.ts index c55c59907..38b82baa3 100644 --- a/backend/src/plugins/RoleButtons/functions/getAllRolesInButtons.ts +++ b/backend/src/plugins/RoleButtons/functions/getAllRolesInButtons.ts @@ -1,4 +1,4 @@ -import { TRoleButtonsConfigItem } from "../types"; +import { TRoleButtonsConfigItem } from "../types.js"; // This function will be more complex in the future when the plugin supports select menus + sub-menus export function getAllRolesInButtons(buttons: TRoleButtonsConfigItem): string[] { diff --git a/backend/src/plugins/RoleButtons/info.ts b/backend/src/plugins/RoleButtons/info.ts index f729d0061..7eaedabaa 100644 --- a/backend/src/plugins/RoleButtons/info.ts +++ b/backend/src/plugins/RoleButtons/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zRoleButtonsConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zRoleButtonsConfig } from "./types.js"; export const roleButtonsPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/RoleButtons/types.ts b/backend/src/plugins/RoleButtons/types.ts index 95e46f79c..142b82e74 100644 --- a/backend/src/plugins/RoleButtons/types.ts +++ b/backend/src/plugins/RoleButtons/types.ts @@ -1,10 +1,10 @@ import { ButtonStyle } from "discord.js"; import { BasePluginType } from "knub"; import z from "zod"; -import { GuildRoleButtons } from "../../data/GuildRoleButtons"; -import { zBoundedCharacters, zBoundedRecord, zMessageContent, zSnowflake } from "../../utils"; -import { TooManyComponentsError } from "./functions/TooManyComponentsError"; -import { createButtonComponents } from "./functions/createButtonComponents"; +import { GuildRoleButtons } from "../../data/GuildRoleButtons.js"; +import { zBoundedCharacters, zBoundedRecord, zMessageContent, zSnowflake } from "../../utils.js"; +import { TooManyComponentsError } from "./functions/TooManyComponentsError.js"; +import { createButtonComponents } from "./functions/createButtonComponents.js"; const zRoleButtonOption = z.strictObject({ role_id: zSnowflake, diff --git a/backend/src/plugins/RoleManager/RoleManagerPlugin.ts b/backend/src/plugins/RoleManager/RoleManagerPlugin.ts index a4430bfed..5137326f4 100644 --- a/backend/src/plugins/RoleManager/RoleManagerPlugin.ts +++ b/backend/src/plugins/RoleManager/RoleManagerPlugin.ts @@ -1,13 +1,13 @@ import { guildPlugin } from "knub"; -import { GuildRoleQueue } from "../../data/GuildRoleQueue"; -import { makePublicFn } from "../../pluginUtils"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { addPriorityRole } from "./functions/addPriorityRole"; -import { addRole } from "./functions/addRole"; -import { removePriorityRole } from "./functions/removePriorityRole"; -import { removeRole } from "./functions/removeRole"; -import { runRoleAssignmentLoop } from "./functions/runRoleAssignmentLoop"; -import { RoleManagerPluginType, zRoleManagerConfig } from "./types"; +import { GuildRoleQueue } from "../../data/GuildRoleQueue.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { addPriorityRole } from "./functions/addPriorityRole.js"; +import { addRole } from "./functions/addRole.js"; +import { removePriorityRole } from "./functions/removePriorityRole.js"; +import { removeRole } from "./functions/removeRole.js"; +import { runRoleAssignmentLoop } from "./functions/runRoleAssignmentLoop.js"; +import { RoleManagerPluginType, zRoleManagerConfig } from "./types.js"; export const RoleManagerPlugin = guildPlugin()({ name: "role_manager", diff --git a/backend/src/plugins/RoleManager/functions/addPriorityRole.ts b/backend/src/plugins/RoleManager/functions/addPriorityRole.ts index 2c9534f6a..5f46a0cad 100644 --- a/backend/src/plugins/RoleManager/functions/addPriorityRole.ts +++ b/backend/src/plugins/RoleManager/functions/addPriorityRole.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { PRIORITY_ROLE_PRIORITY } from "../constants"; -import { RoleManagerPluginType } from "../types"; -import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop"; +import { PRIORITY_ROLE_PRIORITY } from "../constants.js"; +import { RoleManagerPluginType } from "../types.js"; +import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop.js"; export async function addPriorityRole( pluginData: GuildPluginData, diff --git a/backend/src/plugins/RoleManager/functions/addRole.ts b/backend/src/plugins/RoleManager/functions/addRole.ts index 02f6d4a35..eab1f0035 100644 --- a/backend/src/plugins/RoleManager/functions/addRole.ts +++ b/backend/src/plugins/RoleManager/functions/addRole.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { RoleManagerPluginType } from "../types"; -import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop"; +import { RoleManagerPluginType } from "../types.js"; +import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop.js"; export async function addRole(pluginData: GuildPluginData, userId: string, roleId: string) { await pluginData.state.roleQueue.addQueueItem(userId, roleId, true); diff --git a/backend/src/plugins/RoleManager/functions/removePriorityRole.ts b/backend/src/plugins/RoleManager/functions/removePriorityRole.ts index 4192a7624..ac40c3ba2 100644 --- a/backend/src/plugins/RoleManager/functions/removePriorityRole.ts +++ b/backend/src/plugins/RoleManager/functions/removePriorityRole.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { PRIORITY_ROLE_PRIORITY } from "../constants"; -import { RoleManagerPluginType } from "../types"; -import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop"; +import { PRIORITY_ROLE_PRIORITY } from "../constants.js"; +import { RoleManagerPluginType } from "../types.js"; +import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop.js"; export async function removePriorityRole( pluginData: GuildPluginData, diff --git a/backend/src/plugins/RoleManager/functions/removeRole.ts b/backend/src/plugins/RoleManager/functions/removeRole.ts index 2a2b6070d..713afdedf 100644 --- a/backend/src/plugins/RoleManager/functions/removeRole.ts +++ b/backend/src/plugins/RoleManager/functions/removeRole.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { RoleManagerPluginType } from "../types"; -import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop"; +import { RoleManagerPluginType } from "../types.js"; +import { runRoleAssignmentLoop } from "./runRoleAssignmentLoop.js"; export async function removeRole(pluginData: GuildPluginData, userId: string, roleId: string) { await pluginData.state.roleQueue.addQueueItem(userId, roleId, false); diff --git a/backend/src/plugins/RoleManager/functions/runRoleAssignmentLoop.ts b/backend/src/plugins/RoleManager/functions/runRoleAssignmentLoop.ts index 3ed71eefd..a36998061 100644 --- a/backend/src/plugins/RoleManager/functions/runRoleAssignmentLoop.ts +++ b/backend/src/plugins/RoleManager/functions/runRoleAssignmentLoop.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; -import { logger } from "../../../logger"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPluginType } from "../types"; +import { logger } from "../../../logger.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPluginType } from "../types.js"; const ROLE_ASSIGNMENTS_PER_BATCH = 10; diff --git a/backend/src/plugins/RoleManager/info.ts b/backend/src/plugins/RoleManager/info.ts index 985a61116..7bc9571e1 100644 --- a/backend/src/plugins/RoleManager/info.ts +++ b/backend/src/plugins/RoleManager/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const roleManagerPluginInfo: ZeppelinPluginInfo = { prettyName: "Role manager", diff --git a/backend/src/plugins/RoleManager/types.ts b/backend/src/plugins/RoleManager/types.ts index 51ba30808..1954d9943 100644 --- a/backend/src/plugins/RoleManager/types.ts +++ b/backend/src/plugins/RoleManager/types.ts @@ -1,6 +1,6 @@ import { BasePluginType } from "knub"; import z from "zod"; -import { GuildRoleQueue } from "../../data/GuildRoleQueue"; +import { GuildRoleQueue } from "../../data/GuildRoleQueue.js"; export const zRoleManagerConfig = z.strictObject({}); diff --git a/backend/src/plugins/Roles/RolesPlugin.ts b/backend/src/plugins/Roles/RolesPlugin.ts index 89b3b6c90..cfd94ee27 100644 --- a/backend/src/plugins/Roles/RolesPlugin.ts +++ b/backend/src/plugins/Roles/RolesPlugin.ts @@ -1,12 +1,12 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildLogs } from "../../data/GuildLogs"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin"; -import { AddRoleCmd } from "./commands/AddRoleCmd"; -import { MassAddRoleCmd } from "./commands/MassAddRoleCmd"; -import { MassRemoveRoleCmd } from "./commands/MassRemoveRoleCmd"; -import { RemoveRoleCmd } from "./commands/RemoveRoleCmd"; -import { RolesPluginType, zRolesConfig } from "./types"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin.js"; +import { AddRoleCmd } from "./commands/AddRoleCmd.js"; +import { MassAddRoleCmd } from "./commands/MassAddRoleCmd.js"; +import { MassRemoveRoleCmd } from "./commands/MassRemoveRoleCmd.js"; +import { RemoveRoleCmd } from "./commands/RemoveRoleCmd.js"; +import { RolesPluginType, zRolesConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Roles/commands/AddRoleCmd.ts b/backend/src/plugins/Roles/commands/AddRoleCmd.ts index ccd64325e..9581e087e 100644 --- a/backend/src/plugins/Roles/commands/AddRoleCmd.ts +++ b/backend/src/plugins/Roles/commands/AddRoleCmd.ts @@ -1,10 +1,10 @@ import { GuildChannel } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { resolveRoleId, verboseUserMention } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { rolesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { resolveRoleId, verboseUserMention } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { rolesCmd } from "../types.js"; export const AddRoleCmd = rolesCmd({ trigger: "addrole", diff --git a/backend/src/plugins/Roles/commands/MassAddRoleCmd.ts b/backend/src/plugins/Roles/commands/MassAddRoleCmd.ts index 9030e45c5..ae7f8b8f1 100644 --- a/backend/src/plugins/Roles/commands/MassAddRoleCmd.ts +++ b/backend/src/plugins/Roles/commands/MassAddRoleCmd.ts @@ -1,11 +1,11 @@ import { GuildMember } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { logger } from "../../../logger"; -import { canActOn, sendErrorMessage } from "../../../pluginUtils"; -import { resolveMember, resolveRoleId, successMessage } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { rolesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { logger } from "../../../logger.js"; +import { canActOn, sendErrorMessage } from "../../../pluginUtils.js"; +import { resolveMember, resolveRoleId, successMessage } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { rolesCmd } from "../types.js"; export const MassAddRoleCmd = rolesCmd({ trigger: "massaddrole", diff --git a/backend/src/plugins/Roles/commands/MassRemoveRoleCmd.ts b/backend/src/plugins/Roles/commands/MassRemoveRoleCmd.ts index de4591b44..f00c78135 100644 --- a/backend/src/plugins/Roles/commands/MassRemoveRoleCmd.ts +++ b/backend/src/plugins/Roles/commands/MassRemoveRoleCmd.ts @@ -1,10 +1,10 @@ import { GuildMember } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendErrorMessage } from "../../../pluginUtils"; -import { resolveMember, resolveRoleId, successMessage } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { rolesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendErrorMessage } from "../../../pluginUtils.js"; +import { resolveMember, resolveRoleId, successMessage } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { rolesCmd } from "../types.js"; export const MassRemoveRoleCmd = rolesCmd({ trigger: "massremoverole", diff --git a/backend/src/plugins/Roles/commands/RemoveRoleCmd.ts b/backend/src/plugins/Roles/commands/RemoveRoleCmd.ts index 8cd6f3064..2677be8c4 100644 --- a/backend/src/plugins/Roles/commands/RemoveRoleCmd.ts +++ b/backend/src/plugins/Roles/commands/RemoveRoleCmd.ts @@ -1,10 +1,10 @@ import { GuildChannel } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { resolveRoleId, verboseUserMention } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin"; -import { rolesCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { resolveRoleId, verboseUserMention } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RoleManagerPlugin } from "../../RoleManager/RoleManagerPlugin.js"; +import { rolesCmd } from "../types.js"; export const RemoveRoleCmd = rolesCmd({ trigger: "removerole", diff --git a/backend/src/plugins/Roles/info.ts b/backend/src/plugins/Roles/info.ts index cb8765843..d946bf4fa 100644 --- a/backend/src/plugins/Roles/info.ts +++ b/backend/src/plugins/Roles/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zRolesConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zRolesConfig } from "./types.js"; export const rolesPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Roles/types.ts b/backend/src/plugins/Roles/types.ts index caf55b769..2a0d4cc73 100644 --- a/backend/src/plugins/Roles/types.ts +++ b/backend/src/plugins/Roles/types.ts @@ -1,6 +1,6 @@ import { BasePluginType, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildLogs } from "../../data/GuildLogs"; +import { GuildLogs } from "../../data/GuildLogs.js"; export const zRolesConfig = z.strictObject({ can_assign: z.boolean(), diff --git a/backend/src/plugins/SelfGrantableRoles/SelfGrantableRolesPlugin.ts b/backend/src/plugins/SelfGrantableRoles/SelfGrantableRolesPlugin.ts index 9a9e770c9..e01b2f8f6 100644 --- a/backend/src/plugins/SelfGrantableRoles/SelfGrantableRolesPlugin.ts +++ b/backend/src/plugins/SelfGrantableRoles/SelfGrantableRolesPlugin.ts @@ -1,8 +1,8 @@ import { CooldownManager, PluginOptions, guildPlugin } from "knub"; -import { RoleAddCmd } from "./commands/RoleAddCmd"; -import { RoleHelpCmd } from "./commands/RoleHelpCmd"; -import { RoleRemoveCmd } from "./commands/RoleRemoveCmd"; -import { SelfGrantableRolesPluginType, zSelfGrantableRolesConfig } from "./types"; +import { RoleAddCmd } from "./commands/RoleAddCmd.js"; +import { RoleHelpCmd } from "./commands/RoleHelpCmd.js"; +import { RoleRemoveCmd } from "./commands/RoleRemoveCmd.js"; +import { SelfGrantableRolesPluginType, zSelfGrantableRolesConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts b/backend/src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts index ce8a3a734..ee0c98ab7 100644 --- a/backend/src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts +++ b/backend/src/plugins/SelfGrantableRoles/commands/RoleAddCmd.ts @@ -1,12 +1,12 @@ import { Role, Snowflake } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { memberRolesLock } from "../../../utils/lockNameHelpers"; -import { selfGrantableRolesCmd } from "../types"; -import { findMatchingRoles } from "../util/findMatchingRoles"; -import { getApplyingEntries } from "../util/getApplyingEntries"; -import { normalizeRoleNames } from "../util/normalizeRoleNames"; -import { splitRoleNames } from "../util/splitRoleNames"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { memberRolesLock } from "../../../utils/lockNameHelpers.js"; +import { selfGrantableRolesCmd } from "../types.js"; +import { findMatchingRoles } from "../util/findMatchingRoles.js"; +import { getApplyingEntries } from "../util/getApplyingEntries.js"; +import { normalizeRoleNames } from "../util/normalizeRoleNames.js"; +import { splitRoleNames } from "../util/splitRoleNames.js"; export const RoleAddCmd = selfGrantableRolesCmd({ trigger: ["role", "role add"], diff --git a/backend/src/plugins/SelfGrantableRoles/commands/RoleHelpCmd.ts b/backend/src/plugins/SelfGrantableRoles/commands/RoleHelpCmd.ts index b1bf6899f..5eb2d661d 100644 --- a/backend/src/plugins/SelfGrantableRoles/commands/RoleHelpCmd.ts +++ b/backend/src/plugins/SelfGrantableRoles/commands/RoleHelpCmd.ts @@ -1,6 +1,6 @@ -import { asSingleLine, trimLines } from "../../../utils"; -import { selfGrantableRolesCmd } from "../types"; -import { getApplyingEntries } from "../util/getApplyingEntries"; +import { asSingleLine, trimLines } from "../../../utils.js"; +import { selfGrantableRolesCmd } from "../types.js"; +import { getApplyingEntries } from "../util/getApplyingEntries.js"; export const RoleHelpCmd = selfGrantableRolesCmd({ trigger: ["role help", "role"], diff --git a/backend/src/plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts b/backend/src/plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts index 007aa4596..aaec79e82 100644 --- a/backend/src/plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts +++ b/backend/src/plugins/SelfGrantableRoles/commands/RoleRemoveCmd.ts @@ -1,12 +1,12 @@ import { Snowflake } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { memberRolesLock } from "../../../utils/lockNameHelpers"; -import { selfGrantableRolesCmd } from "../types"; -import { findMatchingRoles } from "../util/findMatchingRoles"; -import { getApplyingEntries } from "../util/getApplyingEntries"; -import { normalizeRoleNames } from "../util/normalizeRoleNames"; -import { splitRoleNames } from "../util/splitRoleNames"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { memberRolesLock } from "../../../utils/lockNameHelpers.js"; +import { selfGrantableRolesCmd } from "../types.js"; +import { findMatchingRoles } from "../util/findMatchingRoles.js"; +import { getApplyingEntries } from "../util/getApplyingEntries.js"; +import { normalizeRoleNames } from "../util/normalizeRoleNames.js"; +import { splitRoleNames } from "../util/splitRoleNames.js"; export const RoleRemoveCmd = selfGrantableRolesCmd({ trigger: "role remove", diff --git a/backend/src/plugins/SelfGrantableRoles/info.ts b/backend/src/plugins/SelfGrantableRoles/info.ts index e6b9db28a..40b6d4515 100644 --- a/backend/src/plugins/SelfGrantableRoles/info.ts +++ b/backend/src/plugins/SelfGrantableRoles/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zSelfGrantableRolesConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zSelfGrantableRolesConfig } from "./types.js"; export const selfGrantableRolesPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/SelfGrantableRoles/types.ts b/backend/src/plugins/SelfGrantableRoles/types.ts index e3c7a7867..edfb7e1c3 100644 --- a/backend/src/plugins/SelfGrantableRoles/types.ts +++ b/backend/src/plugins/SelfGrantableRoles/types.ts @@ -1,6 +1,6 @@ import { BasePluginType, CooldownManager, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { zBoundedCharacters, zBoundedRecord } from "../../utils"; +import { zBoundedCharacters, zBoundedRecord } from "../../utils.js"; const zRoleMap = z.record( zBoundedCharacters(1, 100), diff --git a/backend/src/plugins/SelfGrantableRoles/util/findMatchingRoles.ts b/backend/src/plugins/SelfGrantableRoles/util/findMatchingRoles.ts index 42a6dd34b..ad82419ae 100644 --- a/backend/src/plugins/SelfGrantableRoles/util/findMatchingRoles.ts +++ b/backend/src/plugins/SelfGrantableRoles/util/findMatchingRoles.ts @@ -1,4 +1,4 @@ -import { TSelfGrantableRoleEntry } from "../types"; +import { TSelfGrantableRoleEntry } from "../types.js"; export function findMatchingRoles(roleNames: string[], entries: TSelfGrantableRoleEntry[]): string[] { const aliasToRoleId = entries.reduce((map, entry) => { diff --git a/backend/src/plugins/SelfGrantableRoles/util/getApplyingEntries.ts b/backend/src/plugins/SelfGrantableRoles/util/getApplyingEntries.ts index 25482d1c0..c0aea14b2 100644 --- a/backend/src/plugins/SelfGrantableRoles/util/getApplyingEntries.ts +++ b/backend/src/plugins/SelfGrantableRoles/util/getApplyingEntries.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { SelfGrantableRolesPluginType, TSelfGrantableRoleEntry } from "../types"; +import { SelfGrantableRolesPluginType, TSelfGrantableRoleEntry } from "../types.js"; export async function getApplyingEntries( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Slowmode/SlowmodePlugin.ts b/backend/src/plugins/Slowmode/SlowmodePlugin.ts index 8e97adb14..34d066999 100644 --- a/backend/src/plugins/Slowmode/SlowmodePlugin.ts +++ b/backend/src/plugins/Slowmode/SlowmodePlugin.ts @@ -1,17 +1,17 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { GuildSlowmodes } from "../../data/GuildSlowmodes"; -import { SECONDS } from "../../utils"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { SlowmodeClearCmd } from "./commands/SlowmodeClearCmd"; -import { SlowmodeDisableCmd } from "./commands/SlowmodeDisableCmd"; -import { SlowmodeGetCmd } from "./commands/SlowmodeGetCmd"; -import { SlowmodeListCmd } from "./commands/SlowmodeListCmd"; -import { SlowmodeSetCmd } from "./commands/SlowmodeSetCmd"; -import { SlowmodePluginType, zSlowmodeConfig } from "./types"; -import { clearExpiredSlowmodes } from "./util/clearExpiredSlowmodes"; -import { onMessageCreate } from "./util/onMessageCreate"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { GuildSlowmodes } from "../../data/GuildSlowmodes.js"; +import { SECONDS } from "../../utils.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { SlowmodeClearCmd } from "./commands/SlowmodeClearCmd.js"; +import { SlowmodeDisableCmd } from "./commands/SlowmodeDisableCmd.js"; +import { SlowmodeGetCmd } from "./commands/SlowmodeGetCmd.js"; +import { SlowmodeListCmd } from "./commands/SlowmodeListCmd.js"; +import { SlowmodeSetCmd } from "./commands/SlowmodeSetCmd.js"; +import { SlowmodePluginType, zSlowmodeConfig } from "./types.js"; +import { clearExpiredSlowmodes } from "./util/clearExpiredSlowmodes.js"; +import { onMessageCreate } from "./util/onMessageCreate.js"; const BOT_SLOWMODE_CLEAR_INTERVAL = 60 * SECONDS; diff --git a/backend/src/plugins/Slowmode/commands/SlowmodeClearCmd.ts b/backend/src/plugins/Slowmode/commands/SlowmodeClearCmd.ts index fd133c3a6..cf2cff3df 100644 --- a/backend/src/plugins/Slowmode/commands/SlowmodeClearCmd.ts +++ b/backend/src/plugins/Slowmode/commands/SlowmodeClearCmd.ts @@ -1,12 +1,12 @@ import { ChannelType, escapeInlineCode } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { asSingleLine, renderUsername } from "../../../utils"; -import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { BOT_SLOWMODE_CLEAR_PERMISSIONS } from "../requiredPermissions"; -import { slowmodeCmd } from "../types"; -import { clearBotSlowmodeFromUserId } from "../util/clearBotSlowmodeFromUserId"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { asSingleLine, renderUsername } from "../../../utils.js"; +import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { BOT_SLOWMODE_CLEAR_PERMISSIONS } from "../requiredPermissions.js"; +import { slowmodeCmd } from "../types.js"; +import { clearBotSlowmodeFromUserId } from "../util/clearBotSlowmodeFromUserId.js"; export const SlowmodeClearCmd = slowmodeCmd({ trigger: ["slowmode clear", "slowmode c"], diff --git a/backend/src/plugins/Slowmode/commands/SlowmodeDisableCmd.ts b/backend/src/plugins/Slowmode/commands/SlowmodeDisableCmd.ts index 1889c559a..011bf065a 100644 --- a/backend/src/plugins/Slowmode/commands/SlowmodeDisableCmd.ts +++ b/backend/src/plugins/Slowmode/commands/SlowmodeDisableCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { slowmodeCmd } from "../types"; -import { actualDisableSlowmodeCmd } from "../util/actualDisableSlowmodeCmd"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { slowmodeCmd } from "../types.js"; +import { actualDisableSlowmodeCmd } from "../util/actualDisableSlowmodeCmd.js"; export const SlowmodeDisableCmd = slowmodeCmd({ trigger: ["slowmode disable", "slowmode d"], diff --git a/backend/src/plugins/Slowmode/commands/SlowmodeGetCmd.ts b/backend/src/plugins/Slowmode/commands/SlowmodeGetCmd.ts index 9583d433b..e98160b49 100644 --- a/backend/src/plugins/Slowmode/commands/SlowmodeGetCmd.ts +++ b/backend/src/plugins/Slowmode/commands/SlowmodeGetCmd.ts @@ -1,6 +1,6 @@ import humanizeDuration from "humanize-duration"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { slowmodeCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { slowmodeCmd } from "../types.js"; export const SlowmodeGetCmd = slowmodeCmd({ trigger: "slowmode", diff --git a/backend/src/plugins/Slowmode/commands/SlowmodeListCmd.ts b/backend/src/plugins/Slowmode/commands/SlowmodeListCmd.ts index 0fe32f843..043d7d5a1 100644 --- a/backend/src/plugins/Slowmode/commands/SlowmodeListCmd.ts +++ b/backend/src/plugins/Slowmode/commands/SlowmodeListCmd.ts @@ -1,8 +1,8 @@ import { GuildChannel, TextChannel } from "discord.js"; import humanizeDuration from "humanize-duration"; import { createChunkedMessage } from "knub/helpers"; -import { errorMessage } from "../../../utils"; -import { slowmodeCmd } from "../types"; +import { errorMessage } from "../../../utils.js"; +import { slowmodeCmd } from "../types.js"; export const SlowmodeListCmd = slowmodeCmd({ trigger: ["slowmode list", "slowmode l", "slowmodes"], diff --git a/backend/src/plugins/Slowmode/commands/SlowmodeSetCmd.ts b/backend/src/plugins/Slowmode/commands/SlowmodeSetCmd.ts index 44d5c1118..82ebec82e 100644 --- a/backend/src/plugins/Slowmode/commands/SlowmodeSetCmd.ts +++ b/backend/src/plugins/Slowmode/commands/SlowmodeSetCmd.ts @@ -1,14 +1,14 @@ import { escapeInlineCode, PermissionsBitField } from "discord.js"; import humanizeDuration from "humanize-duration"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { asSingleLine, DAYS, HOURS, MINUTES } from "../../../utils"; -import { getMissingPermissions } from "../../../utils/getMissingPermissions"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { BOT_SLOWMODE_PERMISSIONS, NATIVE_SLOWMODE_PERMISSIONS } from "../requiredPermissions"; -import { slowmodeCmd } from "../types"; -import { actualDisableSlowmodeCmd } from "../util/actualDisableSlowmodeCmd"; -import { disableBotSlowmodeForChannel } from "../util/disableBotSlowmodeForChannel"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { asSingleLine, DAYS, HOURS, MINUTES } from "../../../utils.js"; +import { getMissingPermissions } from "../../../utils/getMissingPermissions.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { BOT_SLOWMODE_PERMISSIONS, NATIVE_SLOWMODE_PERMISSIONS } from "../requiredPermissions.js"; +import { slowmodeCmd } from "../types.js"; +import { actualDisableSlowmodeCmd } from "../util/actualDisableSlowmodeCmd.js"; +import { disableBotSlowmodeForChannel } from "../util/disableBotSlowmodeForChannel.js"; const MAX_NATIVE_SLOWMODE = 6 * HOURS; // 6 hours const MAX_BOT_SLOWMODE = DAYS * 365 * 100; // 100 years diff --git a/backend/src/plugins/Slowmode/info.ts b/backend/src/plugins/Slowmode/info.ts index 4dc4de79d..b223b39cd 100644 --- a/backend/src/plugins/Slowmode/info.ts +++ b/backend/src/plugins/Slowmode/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zSlowmodeConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zSlowmodeConfig } from "./types.js"; export const slowmodePluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Slowmode/types.ts b/backend/src/plugins/Slowmode/types.ts index 7c8d5b566..acdd611a8 100644 --- a/backend/src/plugins/Slowmode/types.ts +++ b/backend/src/plugins/Slowmode/types.ts @@ -1,9 +1,9 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { GuildSlowmodes } from "../../data/GuildSlowmodes"; -import { SlowmodeChannel } from "../../data/entities/SlowmodeChannel"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { GuildSlowmodes } from "../../data/GuildSlowmodes.js"; +import { SlowmodeChannel } from "../../data/entities/SlowmodeChannel.js"; export const zSlowmodeConfig = z.strictObject({ use_native_slowmode: z.boolean(), diff --git a/backend/src/plugins/Slowmode/util/actualDisableSlowmodeCmd.ts b/backend/src/plugins/Slowmode/util/actualDisableSlowmodeCmd.ts index 2bc00bed1..d669f05ad 100644 --- a/backend/src/plugins/Slowmode/util/actualDisableSlowmodeCmd.ts +++ b/backend/src/plugins/Slowmode/util/actualDisableSlowmodeCmd.ts @@ -1,10 +1,10 @@ import { Message } from "discord.js"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { noop } from "../../../utils"; -import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { BOT_SLOWMODE_DISABLE_PERMISSIONS } from "../requiredPermissions"; -import { disableBotSlowmodeForChannel } from "./disableBotSlowmodeForChannel"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { noop } from "../../../utils.js"; +import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { BOT_SLOWMODE_DISABLE_PERMISSIONS } from "../requiredPermissions.js"; +import { disableBotSlowmodeForChannel } from "./disableBotSlowmodeForChannel.js"; export async function actualDisableSlowmodeCmd(msg: Message, args, pluginData) { const botSlowmode = await pluginData.state.slowmodes.getChannelSlowmode(args.channel.id); diff --git a/backend/src/plugins/Slowmode/util/applyBotSlowmodeToUserId.ts b/backend/src/plugins/Slowmode/util/applyBotSlowmodeToUserId.ts index ebfd653d3..d9e7dddff 100644 --- a/backend/src/plugins/Slowmode/util/applyBotSlowmodeToUserId.ts +++ b/backend/src/plugins/Slowmode/util/applyBotSlowmodeToUserId.ts @@ -1,10 +1,10 @@ import { GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { logger } from "../../../logger"; -import { UnknownUser, isDiscordAPIError, verboseChannelMention, verboseUserMention } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { SlowmodePluginType } from "../types"; +import { LogType } from "../../../data/LogType.js"; +import { logger } from "../../../logger.js"; +import { UnknownUser, isDiscordAPIError, verboseChannelMention, verboseUserMention } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { SlowmodePluginType } from "../types.js"; export async function applyBotSlowmodeToUserId( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Slowmode/util/clearBotSlowmodeFromUserId.ts b/backend/src/plugins/Slowmode/util/clearBotSlowmodeFromUserId.ts index f76c924a4..beb5d8ac4 100644 --- a/backend/src/plugins/Slowmode/util/clearBotSlowmodeFromUserId.ts +++ b/backend/src/plugins/Slowmode/util/clearBotSlowmodeFromUserId.ts @@ -1,7 +1,7 @@ import { AnyThreadChannel, GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { LogType } from "../../../data/LogType"; -import { SlowmodePluginType } from "../types"; +import { LogType } from "../../../data/LogType.js"; +import { SlowmodePluginType } from "../types.js"; export async function clearBotSlowmodeFromUserId( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Slowmode/util/clearExpiredSlowmodes.ts b/backend/src/plugins/Slowmode/util/clearExpiredSlowmodes.ts index d2f840faa..8e27b23cb 100644 --- a/backend/src/plugins/Slowmode/util/clearExpiredSlowmodes.ts +++ b/backend/src/plugins/Slowmode/util/clearExpiredSlowmodes.ts @@ -1,10 +1,10 @@ import { GuildChannel, Snowflake, TextChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { logger } from "../../../logger"; -import { UnknownUser, verboseChannelMention, verboseUserMention } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { SlowmodePluginType } from "../types"; -import { clearBotSlowmodeFromUserId } from "./clearBotSlowmodeFromUserId"; +import { logger } from "../../../logger.js"; +import { UnknownUser, verboseChannelMention, verboseUserMention } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { SlowmodePluginType } from "../types.js"; +import { clearBotSlowmodeFromUserId } from "./clearBotSlowmodeFromUserId.js"; export async function clearExpiredSlowmodes(pluginData: GuildPluginData) { const expiredSlowmodeUsers = await pluginData.state.slowmodes.getExpiredSlowmodeUsers(); diff --git a/backend/src/plugins/Slowmode/util/disableBotSlowmodeForChannel.ts b/backend/src/plugins/Slowmode/util/disableBotSlowmodeForChannel.ts index d32929017..0187504b9 100644 --- a/backend/src/plugins/Slowmode/util/disableBotSlowmodeForChannel.ts +++ b/backend/src/plugins/Slowmode/util/disableBotSlowmodeForChannel.ts @@ -1,7 +1,7 @@ import { AnyThreadChannel, GuildTextBasedChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { SlowmodePluginType } from "../types"; -import { clearBotSlowmodeFromUserId } from "./clearBotSlowmodeFromUserId"; +import { SlowmodePluginType } from "../types.js"; +import { clearBotSlowmodeFromUserId } from "./clearBotSlowmodeFromUserId.js"; export async function disableBotSlowmodeForChannel( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Slowmode/util/onMessageCreate.ts b/backend/src/plugins/Slowmode/util/onMessageCreate.ts index a83c315bc..17c723a6b 100644 --- a/backend/src/plugins/Slowmode/util/onMessageCreate.ts +++ b/backend/src/plugins/Slowmode/util/onMessageCreate.ts @@ -1,16 +1,16 @@ import { ChannelType, GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { SlowmodeChannel } from "../../../data/entities/SlowmodeChannel"; -import { hasPermission } from "../../../pluginUtils"; -import { resolveMember } from "../../../utils"; -import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions"; -import { messageLock } from "../../../utils/lockNameHelpers"; -import { missingPermissionError } from "../../../utils/missingPermissionError"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { BOT_SLOWMODE_PERMISSIONS } from "../requiredPermissions"; -import { SlowmodePluginType } from "../types"; -import { applyBotSlowmodeToUserId } from "./applyBotSlowmodeToUserId"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { SlowmodeChannel } from "../../../data/entities/SlowmodeChannel.js"; +import { hasPermission } from "../../../pluginUtils.js"; +import { resolveMember } from "../../../utils.js"; +import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions.js"; +import { messageLock } from "../../../utils/lockNameHelpers.js"; +import { missingPermissionError } from "../../../utils/missingPermissionError.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { BOT_SLOWMODE_PERMISSIONS } from "../requiredPermissions.js"; +import { SlowmodePluginType } from "../types.js"; +import { applyBotSlowmodeToUserId } from "./applyBotSlowmodeToUserId.js"; export async function onMessageCreate(pluginData: GuildPluginData, msg: SavedMessage) { if (msg.is_bot) return; diff --git a/backend/src/plugins/Spam/SpamPlugin.ts b/backend/src/plugins/Spam/SpamPlugin.ts index b4d27ae3e..c4df1eda5 100644 --- a/backend/src/plugins/Spam/SpamPlugin.ts +++ b/backend/src/plugins/Spam/SpamPlugin.ts @@ -1,13 +1,13 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildMutes } from "../../data/GuildMutes"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { SpamVoiceStateUpdateEvt } from "./events/SpamVoiceEvt"; -import { SpamPluginType, zSpamConfig } from "./types"; -import { clearOldRecentActions } from "./util/clearOldRecentActions"; -import { onMessageCreate } from "./util/onMessageCreate"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildMutes } from "../../data/GuildMutes.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { SpamVoiceStateUpdateEvt } from "./events/SpamVoiceEvt.js"; +import { SpamPluginType, zSpamConfig } from "./types.js"; +import { clearOldRecentActions } from "./util/clearOldRecentActions.js"; +import { onMessageCreate } from "./util/onMessageCreate.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Spam/events/SpamVoiceEvt.ts b/backend/src/plugins/Spam/events/SpamVoiceEvt.ts index ea354a98c..81f8d6979 100644 --- a/backend/src/plugins/Spam/events/SpamVoiceEvt.ts +++ b/backend/src/plugins/Spam/events/SpamVoiceEvt.ts @@ -1,5 +1,5 @@ -import { RecentActionType, spamEvt } from "../types"; -import { logAndDetectOtherSpam } from "../util/logAndDetectOtherSpam"; +import { RecentActionType, spamEvt } from "../types.js"; +import { logAndDetectOtherSpam } from "../util/logAndDetectOtherSpam.js"; export const SpamVoiceStateUpdateEvt = spamEvt({ event: "voiceStateUpdate", diff --git a/backend/src/plugins/Spam/info.ts b/backend/src/plugins/Spam/info.ts index 757fc2947..7b3bac6a9 100644 --- a/backend/src/plugins/Spam/info.ts +++ b/backend/src/plugins/Spam/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zSpamConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zSpamConfig } from "./types.js"; export const spamPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Spam/types.ts b/backend/src/plugins/Spam/types.ts index 7017b113d..ea7b24061 100644 --- a/backend/src/plugins/Spam/types.ts +++ b/backend/src/plugins/Spam/types.ts @@ -1,10 +1,10 @@ import { BasePluginType, guildPluginEventListener } from "knub"; import z from "zod"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildMutes } from "../../data/GuildMutes"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { zSnowflake } from "../../utils"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildMutes } from "../../data/GuildMutes.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { zSnowflake } from "../../utils.js"; const zBaseSingleSpamConfig = z.strictObject({ interval: z.number(), diff --git a/backend/src/plugins/Spam/util/addRecentAction.ts b/backend/src/plugins/Spam/util/addRecentAction.ts index 418702a87..ee80cc8b1 100644 --- a/backend/src/plugins/Spam/util/addRecentAction.ts +++ b/backend/src/plugins/Spam/util/addRecentAction.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { RecentActionType, SpamPluginType } from "../types"; +import { RecentActionType, SpamPluginType } from "../types.js"; export function addRecentAction( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Spam/util/clearOldRecentActions.ts b/backend/src/plugins/Spam/util/clearOldRecentActions.ts index 1c0857b3b..fc858285e 100644 --- a/backend/src/plugins/Spam/util/clearOldRecentActions.ts +++ b/backend/src/plugins/Spam/util/clearOldRecentActions.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { SpamPluginType } from "../types"; +import { SpamPluginType } from "../types.js"; const MAX_INTERVAL = 300; diff --git a/backend/src/plugins/Spam/util/clearRecentUserActions.ts b/backend/src/plugins/Spam/util/clearRecentUserActions.ts index f4fab9146..151b2b705 100644 --- a/backend/src/plugins/Spam/util/clearRecentUserActions.ts +++ b/backend/src/plugins/Spam/util/clearRecentUserActions.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { RecentActionType, SpamPluginType } from "../types"; +import { RecentActionType, SpamPluginType } from "../types.js"; export function clearRecentUserActions( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Spam/util/getRecentActionCount.ts b/backend/src/plugins/Spam/util/getRecentActionCount.ts index 5b0b0aeff..17bcf9be4 100644 --- a/backend/src/plugins/Spam/util/getRecentActionCount.ts +++ b/backend/src/plugins/Spam/util/getRecentActionCount.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { RecentActionType, SpamPluginType } from "../types"; +import { RecentActionType, SpamPluginType } from "../types.js"; export function getRecentActionCount( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Spam/util/getRecentActions.ts b/backend/src/plugins/Spam/util/getRecentActions.ts index de652a28f..4492a642d 100644 --- a/backend/src/plugins/Spam/util/getRecentActions.ts +++ b/backend/src/plugins/Spam/util/getRecentActions.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { RecentActionType, SpamPluginType } from "../types"; +import { RecentActionType, SpamPluginType } from "../types.js"; export function getRecentActions( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts b/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts index b2a464322..cbdbc8a9b 100644 --- a/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts +++ b/backend/src/plugins/Spam/util/logAndDetectMessageSpam.ts @@ -1,22 +1,22 @@ import { GuildTextBasedChannel, Snowflake, TextChannel } from "discord.js"; import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { LogType } from "../../../data/LogType"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { logger } from "../../../logger"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin"; -import { MuteResult } from "../../../plugins/Mutes/types"; -import { DBDateFormat, convertDelayStringToMS, noop, resolveMember, trimLines } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RecentActionType, SpamPluginType, TBaseSingleSpamConfig } from "../types"; -import { addRecentAction } from "./addRecentAction"; -import { clearRecentUserActions } from "./clearRecentUserActions"; -import { getRecentActionCount } from "./getRecentActionCount"; -import { getRecentActions } from "./getRecentActions"; -import { saveSpamArchives } from "./saveSpamArchives"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { logger } from "../../../logger.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin.js"; +import { MuteResult } from "../../../plugins/Mutes/types.js"; +import { DBDateFormat, convertDelayStringToMS, noop, resolveMember, trimLines } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RecentActionType, SpamPluginType, TBaseSingleSpamConfig } from "../types.js"; +import { addRecentAction } from "./addRecentAction.js"; +import { clearRecentUserActions } from "./clearRecentUserActions.js"; +import { getRecentActionCount } from "./getRecentActionCount.js"; +import { getRecentActions } from "./getRecentActions.js"; +import { saveSpamArchives } from "./saveSpamArchives.js"; export async function logAndDetectMessageSpam( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts b/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts index 3a339b5f0..bb82af68f 100644 --- a/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts +++ b/backend/src/plugins/Spam/util/logAndDetectOtherSpam.ts @@ -1,14 +1,14 @@ import { GuildPluginData } from "knub"; -import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError"; -import { CaseTypes } from "../../../data/CaseTypes"; -import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin"; -import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin"; -import { convertDelayStringToMS, resolveMember } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { RecentActionType, SpamPluginType } from "../types"; -import { addRecentAction } from "./addRecentAction"; -import { clearRecentUserActions } from "./clearRecentUserActions"; -import { getRecentActionCount } from "./getRecentActionCount"; +import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js"; +import { CaseTypes } from "../../../data/CaseTypes.js"; +import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; +import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin.js"; +import { convertDelayStringToMS, resolveMember } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { RecentActionType, SpamPluginType } from "../types.js"; +import { addRecentAction } from "./addRecentAction.js"; +import { clearRecentUserActions } from "./clearRecentUserActions.js"; +import { getRecentActionCount } from "./getRecentActionCount.js"; export async function logAndDetectOtherSpam( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Spam/util/logCensor.ts b/backend/src/plugins/Spam/util/logCensor.ts index 1b09c16e0..13c024ef7 100644 --- a/backend/src/plugins/Spam/util/logCensor.ts +++ b/backend/src/plugins/Spam/util/logCensor.ts @@ -1,8 +1,8 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { RecentActionType, SpamPluginType } from "../types"; -import { logAndDetectMessageSpam } from "./logAndDetectMessageSpam"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { RecentActionType, SpamPluginType } from "../types.js"; +import { logAndDetectMessageSpam } from "./logAndDetectMessageSpam.js"; export async function logCensor(pluginData: GuildPluginData, savedMessage: SavedMessage) { const member = pluginData.guild.members.cache.get(savedMessage.user_id as Snowflake); diff --git a/backend/src/plugins/Spam/util/onMessageCreate.ts b/backend/src/plugins/Spam/util/onMessageCreate.ts index 769fe50d1..0a72de9c9 100644 --- a/backend/src/plugins/Spam/util/onMessageCreate.ts +++ b/backend/src/plugins/Spam/util/onMessageCreate.ts @@ -1,9 +1,9 @@ import { Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { getEmojiInString, getRoleMentions, getUrlsInString, getUserMentions } from "../../../utils"; -import { RecentActionType, SpamPluginType } from "../types"; -import { logAndDetectMessageSpam } from "./logAndDetectMessageSpam"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { getEmojiInString, getRoleMentions, getUrlsInString, getUserMentions } from "../../../utils.js"; +import { RecentActionType, SpamPluginType } from "../types.js"; +import { logAndDetectMessageSpam } from "./logAndDetectMessageSpam.js"; export async function onMessageCreate(pluginData: GuildPluginData, savedMessage: SavedMessage) { if (savedMessage.is_bot) return; diff --git a/backend/src/plugins/Spam/util/saveSpamArchives.ts b/backend/src/plugins/Spam/util/saveSpamArchives.ts index d6d062a1b..8e5b261e3 100644 --- a/backend/src/plugins/Spam/util/saveSpamArchives.ts +++ b/backend/src/plugins/Spam/util/saveSpamArchives.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { getBaseUrl } from "../../../pluginUtils"; -import { SpamPluginType } from "../types"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { getBaseUrl } from "../../../pluginUtils.js"; +import { SpamPluginType } from "../types.js"; const SPAM_ARCHIVE_EXPIRY_DAYS = 90; diff --git a/backend/src/plugins/Starboard/StarboardPlugin.ts b/backend/src/plugins/Starboard/StarboardPlugin.ts index 7e12102c0..17d6a051c 100644 --- a/backend/src/plugins/Starboard/StarboardPlugin.ts +++ b/backend/src/plugins/Starboard/StarboardPlugin.ts @@ -1,12 +1,12 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { GuildStarboardMessages } from "../../data/GuildStarboardMessages"; -import { GuildStarboardReactions } from "../../data/GuildStarboardReactions"; -import { MigratePinsCmd } from "./commands/MigratePinsCmd"; -import { StarboardReactionAddEvt } from "./events/StarboardReactionAddEvt"; -import { StarboardReactionRemoveAllEvt, StarboardReactionRemoveEvt } from "./events/StarboardReactionRemoveEvts"; -import { StarboardPluginType, zStarboardConfig } from "./types"; -import { onMessageDelete } from "./util/onMessageDelete"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { GuildStarboardMessages } from "../../data/GuildStarboardMessages.js"; +import { GuildStarboardReactions } from "../../data/GuildStarboardReactions.js"; +import { MigratePinsCmd } from "./commands/MigratePinsCmd.js"; +import { StarboardReactionAddEvt } from "./events/StarboardReactionAddEvt.js"; +import { StarboardReactionRemoveAllEvt, StarboardReactionRemoveEvt } from "./events/StarboardReactionRemoveEvts.js"; +import { StarboardPluginType, zStarboardConfig } from "./types.js"; +import { onMessageDelete } from "./util/onMessageDelete.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Starboard/commands/MigratePinsCmd.ts b/backend/src/plugins/Starboard/commands/MigratePinsCmd.ts index 7fba02418..66e702346 100644 --- a/backend/src/plugins/Starboard/commands/MigratePinsCmd.ts +++ b/backend/src/plugins/Starboard/commands/MigratePinsCmd.ts @@ -1,8 +1,8 @@ import { Snowflake, TextChannel } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { starboardCmd } from "../types"; -import { saveMessageToStarboard } from "../util/saveMessageToStarboard"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { starboardCmd } from "../types.js"; +import { saveMessageToStarboard } from "../util/saveMessageToStarboard.js"; export const MigratePinsCmd = starboardCmd({ trigger: "starboard migrate_pins", diff --git a/backend/src/plugins/Starboard/events/StarboardReactionAddEvt.ts b/backend/src/plugins/Starboard/events/StarboardReactionAddEvt.ts index 45b7e731b..a8e761e8f 100644 --- a/backend/src/plugins/Starboard/events/StarboardReactionAddEvt.ts +++ b/backend/src/plugins/Starboard/events/StarboardReactionAddEvt.ts @@ -1,9 +1,9 @@ import { Message, Snowflake, TextChannel } from "discord.js"; -import { noop, resolveMember } from "../../../utils"; -import { allStarboardsLock } from "../../../utils/lockNameHelpers"; -import { starboardEvt } from "../types"; -import { saveMessageToStarboard } from "../util/saveMessageToStarboard"; -import { updateStarboardMessageStarCount } from "../util/updateStarboardMessageStarCount"; +import { noop, resolveMember } from "../../../utils.js"; +import { allStarboardsLock } from "../../../utils/lockNameHelpers.js"; +import { starboardEvt } from "../types.js"; +import { saveMessageToStarboard } from "../util/saveMessageToStarboard.js"; +import { updateStarboardMessageStarCount } from "../util/updateStarboardMessageStarCount.js"; export const StarboardReactionAddEvt = starboardEvt({ event: "messageReactionAdd", diff --git a/backend/src/plugins/Starboard/events/StarboardReactionRemoveEvts.ts b/backend/src/plugins/Starboard/events/StarboardReactionRemoveEvts.ts index 203c4bdeb..bb6946201 100644 --- a/backend/src/plugins/Starboard/events/StarboardReactionRemoveEvts.ts +++ b/backend/src/plugins/Starboard/events/StarboardReactionRemoveEvts.ts @@ -1,5 +1,5 @@ -import { allStarboardsLock } from "../../../utils/lockNameHelpers"; -import { starboardEvt } from "../types"; +import { allStarboardsLock } from "../../../utils/lockNameHelpers.js"; +import { starboardEvt } from "../types.js"; export const StarboardReactionRemoveEvt = starboardEvt({ event: "messageReactionRemove", diff --git a/backend/src/plugins/Starboard/info.ts b/backend/src/plugins/Starboard/info.ts index fffe701fd..bc51d9619 100644 --- a/backend/src/plugins/Starboard/info.ts +++ b/backend/src/plugins/Starboard/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zStarboardConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zStarboardConfig } from "./types.js"; export const starboardPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Starboard/types.ts b/backend/src/plugins/Starboard/types.ts index bb8845fe2..7ab61559c 100644 --- a/backend/src/plugins/Starboard/types.ts +++ b/backend/src/plugins/Starboard/types.ts @@ -1,9 +1,9 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { GuildStarboardMessages } from "../../data/GuildStarboardMessages"; -import { GuildStarboardReactions } from "../../data/GuildStarboardReactions"; -import { zBoundedRecord, zSnowflake } from "../../utils"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { GuildStarboardMessages } from "../../data/GuildStarboardMessages.js"; +import { GuildStarboardReactions } from "../../data/GuildStarboardReactions.js"; +import { zBoundedRecord, zSnowflake } from "../../utils.js"; const zStarboardOpts = z.strictObject({ channel_id: zSnowflake, diff --git a/backend/src/plugins/Starboard/util/createStarboardEmbedFromMessage.ts b/backend/src/plugins/Starboard/util/createStarboardEmbedFromMessage.ts index 93ba4dfd4..91d4a52dd 100644 --- a/backend/src/plugins/Starboard/util/createStarboardEmbedFromMessage.ts +++ b/backend/src/plugins/Starboard/util/createStarboardEmbedFromMessage.ts @@ -1,6 +1,6 @@ import { GuildChannel, Message } from "discord.js"; import path from "path"; -import { EMPTY_CHAR, EmbedWith, renderUsername } from "../../../utils"; +import { EMPTY_CHAR, EmbedWith, renderUsername } from "../../../utils.js"; const imageAttachmentExtensions = ["jpeg", "jpg", "png", "gif", "webp"]; const audioAttachmentExtensions = ["wav", "mp3", "m4a"]; diff --git a/backend/src/plugins/Starboard/util/createStarboardPseudoFooterForMessage.ts b/backend/src/plugins/Starboard/util/createStarboardPseudoFooterForMessage.ts index 49d2cdde9..913c5ff1a 100644 --- a/backend/src/plugins/Starboard/util/createStarboardPseudoFooterForMessage.ts +++ b/backend/src/plugins/Starboard/util/createStarboardPseudoFooterForMessage.ts @@ -1,6 +1,6 @@ import { EmbedField, Message } from "discord.js"; -import { EMPTY_CHAR, messageLink } from "../../../utils"; -import { TStarboardOpts } from "../types"; +import { EMPTY_CHAR, messageLink } from "../../../utils.js"; +import { TStarboardOpts } from "../types.js"; export function createStarboardPseudoFooterForMessage( starboard: TStarboardOpts, diff --git a/backend/src/plugins/Starboard/util/onMessageDelete.ts b/backend/src/plugins/Starboard/util/onMessageDelete.ts index fb6c7f2ee..9c3ff0b1e 100644 --- a/backend/src/plugins/Starboard/util/onMessageDelete.ts +++ b/backend/src/plugins/Starboard/util/onMessageDelete.ts @@ -1,8 +1,8 @@ import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { StarboardPluginType } from "../types"; -import { removeMessageFromStarboard } from "./removeMessageFromStarboard"; -import { removeMessageFromStarboardMessages } from "./removeMessageFromStarboardMessages"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { StarboardPluginType } from "../types.js"; +import { removeMessageFromStarboard } from "./removeMessageFromStarboard.js"; +import { removeMessageFromStarboardMessages } from "./removeMessageFromStarboardMessages.js"; export async function onMessageDelete(pluginData: GuildPluginData, msg: SavedMessage) { // Deleted source message diff --git a/backend/src/plugins/Starboard/util/removeMessageFromStarboard.ts b/backend/src/plugins/Starboard/util/removeMessageFromStarboard.ts index cb62432ee..d5cb68a74 100644 --- a/backend/src/plugins/Starboard/util/removeMessageFromStarboard.ts +++ b/backend/src/plugins/Starboard/util/removeMessageFromStarboard.ts @@ -1,8 +1,8 @@ import { ChannelType } from "discord.js"; import { GuildPluginData } from "knub"; -import { StarboardMessage } from "../../../data/entities/StarboardMessage"; -import { noop } from "../../../utils"; -import { StarboardPluginType } from "../types"; +import { StarboardMessage } from "../../../data/entities/StarboardMessage.js"; +import { noop } from "../../../utils.js"; +import { StarboardPluginType } from "../types.js"; export async function removeMessageFromStarboard( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Starboard/util/removeMessageFromStarboardMessages.ts b/backend/src/plugins/Starboard/util/removeMessageFromStarboardMessages.ts index 698b7b09f..33f0206f2 100644 --- a/backend/src/plugins/Starboard/util/removeMessageFromStarboardMessages.ts +++ b/backend/src/plugins/Starboard/util/removeMessageFromStarboardMessages.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { StarboardPluginType } from "../types"; +import { StarboardPluginType } from "../types.js"; export async function removeMessageFromStarboardMessages( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Starboard/util/saveMessageToStarboard.ts b/backend/src/plugins/Starboard/util/saveMessageToStarboard.ts index af6147050..1f5c7c9eb 100644 --- a/backend/src/plugins/Starboard/util/saveMessageToStarboard.ts +++ b/backend/src/plugins/Starboard/util/saveMessageToStarboard.ts @@ -1,8 +1,8 @@ import { APIEmbed, Message, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { StarboardPluginType, TStarboardOpts } from "../types"; -import { createStarboardEmbedFromMessage } from "./createStarboardEmbedFromMessage"; -import { createStarboardPseudoFooterForMessage } from "./createStarboardPseudoFooterForMessage"; +import { StarboardPluginType, TStarboardOpts } from "../types.js"; +import { createStarboardEmbedFromMessage } from "./createStarboardEmbedFromMessage.js"; +import { createStarboardPseudoFooterForMessage } from "./createStarboardPseudoFooterForMessage.js"; export async function saveMessageToStarboard( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Starboard/util/updateStarboardMessageStarCount.ts b/backend/src/plugins/Starboard/util/updateStarboardMessageStarCount.ts index 04f6002cb..0d313546e 100644 --- a/backend/src/plugins/Starboard/util/updateStarboardMessageStarCount.ts +++ b/backend/src/plugins/Starboard/util/updateStarboardMessageStarCount.ts @@ -1,6 +1,6 @@ import { Message } from "discord.js"; -import { TStarboardOpts } from "../types"; -import { createStarboardPseudoFooterForMessage } from "./createStarboardPseudoFooterForMessage"; +import { TStarboardOpts } from "../types.js"; +import { createStarboardPseudoFooterForMessage } from "./createStarboardPseudoFooterForMessage.js"; import Timeout = NodeJS.Timeout; const DEBOUNCE_DELAY = 1000; diff --git a/backend/src/plugins/Tags/TagsPlugin.ts b/backend/src/plugins/Tags/TagsPlugin.ts index 09379d6d8..303a13dc2 100644 --- a/backend/src/plugins/Tags/TagsPlugin.ts +++ b/backend/src/plugins/Tags/TagsPlugin.ts @@ -2,24 +2,24 @@ import { Snowflake } from "discord.js"; import humanizeDuration from "humanize-duration"; import { PluginOptions, guildPlugin } from "knub"; import moment from "moment-timezone"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { GuildTags } from "../../data/GuildTags"; -import { makePublicFn } from "../../pluginUtils"; -import { convertDelayStringToMS } from "../../utils"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { TagCreateCmd } from "./commands/TagCreateCmd"; -import { TagDeleteCmd } from "./commands/TagDeleteCmd"; -import { TagEvalCmd } from "./commands/TagEvalCmd"; -import { TagListCmd } from "./commands/TagListCmd"; -import { TagSourceCmd } from "./commands/TagSourceCmd"; -import { TagsPluginType, zTagsConfig } from "./types"; -import { findTagByName } from "./util/findTagByName"; -import { onMessageCreate } from "./util/onMessageCreate"; -import { onMessageDelete } from "./util/onMessageDelete"; -import { renderTagBody } from "./util/renderTagBody"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { GuildTags } from "../../data/GuildTags.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { convertDelayStringToMS } from "../../utils.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { TagCreateCmd } from "./commands/TagCreateCmd.js"; +import { TagDeleteCmd } from "./commands/TagDeleteCmd.js"; +import { TagEvalCmd } from "./commands/TagEvalCmd.js"; +import { TagListCmd } from "./commands/TagListCmd.js"; +import { TagSourceCmd } from "./commands/TagSourceCmd.js"; +import { TagsPluginType, zTagsConfig } from "./types.js"; +import { findTagByName } from "./util/findTagByName.js"; +import { onMessageCreate } from "./util/onMessageCreate.js"; +import { onMessageDelete } from "./util/onMessageDelete.js"; +import { renderTagBody } from "./util/renderTagBody.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Tags/commands/TagCreateCmd.ts b/backend/src/plugins/Tags/commands/TagCreateCmd.ts index 10c81e87d..64ed24864 100644 --- a/backend/src/plugins/Tags/commands/TagCreateCmd.ts +++ b/backend/src/plugins/Tags/commands/TagCreateCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { TemplateParseError, parseTemplate } from "../../../templateFormatter"; -import { tagsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { TemplateParseError, parseTemplate } from "../../../templateFormatter.js"; +import { tagsCmd } from "../types.js"; export const TagCreateCmd = tagsCmd({ trigger: "tag", diff --git a/backend/src/plugins/Tags/commands/TagDeleteCmd.ts b/backend/src/plugins/Tags/commands/TagDeleteCmd.ts index 47cb623d5..0a711c76e 100644 --- a/backend/src/plugins/Tags/commands/TagDeleteCmd.ts +++ b/backend/src/plugins/Tags/commands/TagDeleteCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { tagsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { tagsCmd } from "../types.js"; export const TagDeleteCmd = tagsCmd({ trigger: "tag delete", diff --git a/backend/src/plugins/Tags/commands/TagEvalCmd.ts b/backend/src/plugins/Tags/commands/TagEvalCmd.ts index 3515ef745..4af424a04 100644 --- a/backend/src/plugins/Tags/commands/TagEvalCmd.ts +++ b/backend/src/plugins/Tags/commands/TagEvalCmd.ts @@ -1,11 +1,11 @@ import { MessageCreateOptions } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { logger } from "../../../logger"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { TemplateParseError } from "../../../templateFormatter"; -import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { tagsCmd } from "../types"; -import { renderTagBody } from "../util/renderTagBody"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { logger } from "../../../logger.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { TemplateParseError } from "../../../templateFormatter.js"; +import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { tagsCmd } from "../types.js"; +import { renderTagBody } from "../util/renderTagBody.js"; export const TagEvalCmd = tagsCmd({ trigger: "tag eval", diff --git a/backend/src/plugins/Tags/commands/TagListCmd.ts b/backend/src/plugins/Tags/commands/TagListCmd.ts index 008a22a16..02132f95a 100644 --- a/backend/src/plugins/Tags/commands/TagListCmd.ts +++ b/backend/src/plugins/Tags/commands/TagListCmd.ts @@ -1,7 +1,7 @@ import escapeStringRegexp from "escape-string-regexp"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { createChunkedMessage } from "../../../utils"; -import { tagsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { createChunkedMessage } from "../../../utils.js"; +import { tagsCmd } from "../types.js"; export const TagListCmd = tagsCmd({ trigger: ["tag list", "tags", "taglist"], diff --git a/backend/src/plugins/Tags/commands/TagSourceCmd.ts b/backend/src/plugins/Tags/commands/TagSourceCmd.ts index 9e0e5cefe..58729226c 100644 --- a/backend/src/plugins/Tags/commands/TagSourceCmd.ts +++ b/backend/src/plugins/Tags/commands/TagSourceCmd.ts @@ -1,7 +1,7 @@ import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { tagsCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { tagsCmd } from "../types.js"; export const TagSourceCmd = tagsCmd({ trigger: "tag", diff --git a/backend/src/plugins/Tags/info.ts b/backend/src/plugins/Tags/info.ts index 5f9c5fbaf..0b7b7b125 100644 --- a/backend/src/plugins/Tags/info.ts +++ b/backend/src/plugins/Tags/info.ts @@ -1,7 +1,7 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { TemplateFunctions } from "./templateFunctions"; -import { TemplateFunction, zTagsConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { TemplateFunctions } from "./templateFunctions.js"; +import { TemplateFunction, zTagsConfig } from "./types.js"; export const tagsPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Tags/templateFunctions.ts b/backend/src/plugins/Tags/templateFunctions.ts index 67a490690..4f50cd85c 100644 --- a/backend/src/plugins/Tags/templateFunctions.ts +++ b/backend/src/plugins/Tags/templateFunctions.ts @@ -1,4 +1,4 @@ -import { TemplateFunction } from "./types"; +import { TemplateFunction } from "./types.js"; // TODO: Generate this dynamically, lmao export const TemplateFunctions: TemplateFunction[] = [ diff --git a/backend/src/plugins/Tags/types.ts b/backend/src/plugins/Tags/types.ts index 5ff7e9c7c..3043c3b7d 100644 --- a/backend/src/plugins/Tags/types.ts +++ b/backend/src/plugins/Tags/types.ts @@ -1,10 +1,10 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { GuildTags } from "../../data/GuildTags"; -import { zEmbedInput } from "../../utils"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { GuildTags } from "../../data/GuildTags.js"; +import { zEmbedInput } from "../../utils.js"; export const zTag = z.union([z.string(), zEmbedInput]); export type TTag = z.infer; diff --git a/backend/src/plugins/Tags/util/findTagByName.ts b/backend/src/plugins/Tags/util/findTagByName.ts index 98fafc3f3..4184b2fd7 100644 --- a/backend/src/plugins/Tags/util/findTagByName.ts +++ b/backend/src/plugins/Tags/util/findTagByName.ts @@ -1,5 +1,5 @@ import { ExtendedMatchParams, GuildPluginData } from "knub"; -import { TTag, TagsPluginType } from "../types"; +import { TTag, TagsPluginType } from "../types.js"; export async function findTagByName( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Tags/util/matchAndRenderTagFromString.ts b/backend/src/plugins/Tags/util/matchAndRenderTagFromString.ts index 8e90fe82f..6b2fadc21 100644 --- a/backend/src/plugins/Tags/util/matchAndRenderTagFromString.ts +++ b/backend/src/plugins/Tags/util/matchAndRenderTagFromString.ts @@ -1,9 +1,9 @@ import { GuildMember } from "discord.js"; import escapeStringRegexp from "escape-string-regexp"; import { ExtendedMatchParams, GuildPluginData } from "knub"; -import { StrictMessageContent } from "../../../utils"; -import { TTagCategory, TagsPluginType } from "../types"; -import { renderTagFromString } from "./renderTagFromString"; +import { StrictMessageContent } from "../../../utils.js"; +import { TTagCategory, TagsPluginType } from "../types.js"; +import { renderTagFromString } from "./renderTagFromString.js"; interface BaseResult { renderedContent: StrictMessageContent; diff --git a/backend/src/plugins/Tags/util/onMessageCreate.ts b/backend/src/plugins/Tags/util/onMessageCreate.ts index f06d3282b..89c8708d1 100644 --- a/backend/src/plugins/Tags/util/onMessageCreate.ts +++ b/backend/src/plugins/Tags/util/onMessageCreate.ts @@ -1,12 +1,12 @@ import { Snowflake, TextChannel } from "discord.js"; import { GuildPluginData } from "knub"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { convertDelayStringToMS, resolveMember, zStrictMessageContent } from "../../../utils"; -import { erisAllowedMentionsToDjsMentionOptions } from "../../../utils/erisAllowedMentionsToDjsMentionOptions"; -import { messageIsEmpty } from "../../../utils/messageIsEmpty"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { TagsPluginType } from "../types"; -import { matchAndRenderTagFromString } from "./matchAndRenderTagFromString"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { convertDelayStringToMS, resolveMember, zStrictMessageContent } from "../../../utils.js"; +import { erisAllowedMentionsToDjsMentionOptions } from "../../../utils/erisAllowedMentionsToDjsMentionOptions.js"; +import { messageIsEmpty } from "../../../utils/messageIsEmpty.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { TagsPluginType } from "../types.js"; +import { matchAndRenderTagFromString } from "./matchAndRenderTagFromString.js"; export async function onMessageCreate(pluginData: GuildPluginData, msg: SavedMessage) { if (msg.is_bot) return; diff --git a/backend/src/plugins/Tags/util/onMessageDelete.ts b/backend/src/plugins/Tags/util/onMessageDelete.ts index cf0728eb3..927b12617 100644 --- a/backend/src/plugins/Tags/util/onMessageDelete.ts +++ b/backend/src/plugins/Tags/util/onMessageDelete.ts @@ -1,5 +1,5 @@ import { guildPluginEventListener } from "knub"; -import { noop } from "../../../utils"; +import { noop } from "../../../utils.js"; export const onMessageDelete = guildPluginEventListener({ event: "messageDelete", diff --git a/backend/src/plugins/Tags/util/renderTagBody.ts b/backend/src/plugins/Tags/util/renderTagBody.ts index e75a12cfc..4298580b2 100644 --- a/backend/src/plugins/Tags/util/renderTagBody.ts +++ b/backend/src/plugins/Tags/util/renderTagBody.ts @@ -1,8 +1,8 @@ import { ExtendedMatchParams, GuildPluginData } from "knub"; -import { TemplateSafeValue, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; -import { StrictMessageContent, renderRecursively } from "../../../utils"; -import { TTag, TagsPluginType } from "../types"; -import { findTagByName } from "./findTagByName"; +import { TemplateSafeValue, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; +import { StrictMessageContent, renderRecursively } from "../../../utils.js"; +import { TTag, TagsPluginType } from "../types.js"; +import { findTagByName } from "./findTagByName.js"; const MAX_TAG_FN_CALLS = 25; diff --git a/backend/src/plugins/Tags/util/renderTagFromString.ts b/backend/src/plugins/Tags/util/renderTagFromString.ts index 103067775..24f0e19b1 100644 --- a/backend/src/plugins/Tags/util/renderTagFromString.ts +++ b/backend/src/plugins/Tags/util/renderTagFromString.ts @@ -1,13 +1,13 @@ import { GuildMember } from "discord.js"; import { GuildPluginData } from "knub"; import { parseArguments } from "knub-command-manager"; -import { logger } from "../../../logger"; -import { TemplateParseError } from "../../../templateFormatter"; -import { StrictMessageContent, validateAndParseMessageContent } from "../../../utils"; -import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { TTag, TagsPluginType } from "../types"; -import { renderTagBody } from "./renderTagBody"; +import { logger } from "../../../logger.js"; +import { TemplateParseError } from "../../../templateFormatter.js"; +import { StrictMessageContent, validateAndParseMessageContent } from "../../../utils.js"; +import { memberToTemplateSafeMember, userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { TTag, TagsPluginType } from "../types.js"; +import { renderTagBody } from "./renderTagBody.js"; export async function renderTagFromString( pluginData: GuildPluginData, diff --git a/backend/src/plugins/TimeAndDate/TimeAndDatePlugin.ts b/backend/src/plugins/TimeAndDate/TimeAndDatePlugin.ts index 78dd8fa08..4f83b65de 100644 --- a/backend/src/plugins/TimeAndDate/TimeAndDatePlugin.ts +++ b/backend/src/plugins/TimeAndDate/TimeAndDatePlugin.ts @@ -1,16 +1,16 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildMemberTimezones } from "../../data/GuildMemberTimezones"; -import { makePublicFn } from "../../pluginUtils"; -import { ResetTimezoneCmd } from "./commands/ResetTimezoneCmd"; -import { SetTimezoneCmd } from "./commands/SetTimezoneCmd"; -import { ViewTimezoneCmd } from "./commands/ViewTimezoneCmd"; -import { defaultDateFormats } from "./defaultDateFormats"; -import { getDateFormat } from "./functions/getDateFormat"; -import { getGuildTz } from "./functions/getGuildTz"; -import { getMemberTz } from "./functions/getMemberTz"; -import { inGuildTz } from "./functions/inGuildTz"; -import { inMemberTz } from "./functions/inMemberTz"; -import { TimeAndDatePluginType, zTimeAndDateConfig } from "./types"; +import { GuildMemberTimezones } from "../../data/GuildMemberTimezones.js"; +import { makePublicFn } from "../../pluginUtils.js"; +import { ResetTimezoneCmd } from "./commands/ResetTimezoneCmd.js"; +import { SetTimezoneCmd } from "./commands/SetTimezoneCmd.js"; +import { ViewTimezoneCmd } from "./commands/ViewTimezoneCmd.js"; +import { defaultDateFormats } from "./defaultDateFormats.js"; +import { getDateFormat } from "./functions/getDateFormat.js"; +import { getGuildTz } from "./functions/getGuildTz.js"; +import { getMemberTz } from "./functions/getMemberTz.js"; +import { inGuildTz } from "./functions/inGuildTz.js"; +import { inMemberTz } from "./functions/inMemberTz.js"; +import { TimeAndDatePluginType, zTimeAndDateConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/TimeAndDate/commands/ResetTimezoneCmd.ts b/backend/src/plugins/TimeAndDate/commands/ResetTimezoneCmd.ts index db59965a4..665161a80 100644 --- a/backend/src/plugins/TimeAndDate/commands/ResetTimezoneCmd.ts +++ b/backend/src/plugins/TimeAndDate/commands/ResetTimezoneCmd.ts @@ -1,6 +1,6 @@ -import { sendSuccessMessage } from "../../../pluginUtils"; -import { getGuildTz } from "../functions/getGuildTz"; -import { timeAndDateCmd } from "../types"; +import { sendSuccessMessage } from "../../../pluginUtils.js"; +import { getGuildTz } from "../functions/getGuildTz.js"; +import { timeAndDateCmd } from "../types.js"; export const ResetTimezoneCmd = timeAndDateCmd({ trigger: "timezone reset", diff --git a/backend/src/plugins/TimeAndDate/commands/SetTimezoneCmd.ts b/backend/src/plugins/TimeAndDate/commands/SetTimezoneCmd.ts index 90d00b3bb..ef316fb8e 100644 --- a/backend/src/plugins/TimeAndDate/commands/SetTimezoneCmd.ts +++ b/backend/src/plugins/TimeAndDate/commands/SetTimezoneCmd.ts @@ -1,9 +1,9 @@ import { escapeInlineCode } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { trimLines } from "../../../utils"; -import { parseFuzzyTimezone } from "../../../utils/parseFuzzyTimezone"; -import { timeAndDateCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { trimLines } from "../../../utils.js"; +import { parseFuzzyTimezone } from "../../../utils/parseFuzzyTimezone.js"; +import { timeAndDateCmd } from "../types.js"; export const SetTimezoneCmd = timeAndDateCmd({ trigger: "timezone", diff --git a/backend/src/plugins/TimeAndDate/commands/ViewTimezoneCmd.ts b/backend/src/plugins/TimeAndDate/commands/ViewTimezoneCmd.ts index 86585abd0..62f12a697 100644 --- a/backend/src/plugins/TimeAndDate/commands/ViewTimezoneCmd.ts +++ b/backend/src/plugins/TimeAndDate/commands/ViewTimezoneCmd.ts @@ -1,5 +1,5 @@ -import { getGuildTz } from "../functions/getGuildTz"; -import { timeAndDateCmd } from "../types"; +import { getGuildTz } from "../functions/getGuildTz.js"; +import { timeAndDateCmd } from "../types.js"; export const ViewTimezoneCmd = timeAndDateCmd({ trigger: "timezone", diff --git a/backend/src/plugins/TimeAndDate/functions/getDateFormat.ts b/backend/src/plugins/TimeAndDate/functions/getDateFormat.ts index d420ab262..13290bcf6 100644 --- a/backend/src/plugins/TimeAndDate/functions/getDateFormat.ts +++ b/backend/src/plugins/TimeAndDate/functions/getDateFormat.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { defaultDateFormats } from "../defaultDateFormats"; -import { TimeAndDatePluginType } from "../types"; +import { defaultDateFormats } from "../defaultDateFormats.js"; +import { TimeAndDatePluginType } from "../types.js"; export function getDateFormat( pluginData: GuildPluginData, diff --git a/backend/src/plugins/TimeAndDate/functions/getGuildTz.ts b/backend/src/plugins/TimeAndDate/functions/getGuildTz.ts index 922c7c88c..a29074f58 100644 --- a/backend/src/plugins/TimeAndDate/functions/getGuildTz.ts +++ b/backend/src/plugins/TimeAndDate/functions/getGuildTz.ts @@ -1,5 +1,5 @@ import { GuildPluginData } from "knub"; -import { TimeAndDatePluginType } from "../types"; +import { TimeAndDatePluginType } from "../types.js"; export function getGuildTz(pluginData: GuildPluginData) { return pluginData.config.get().timezone; diff --git a/backend/src/plugins/TimeAndDate/functions/getMemberTz.ts b/backend/src/plugins/TimeAndDate/functions/getMemberTz.ts index 8194a5baa..9363a1a2a 100644 --- a/backend/src/plugins/TimeAndDate/functions/getMemberTz.ts +++ b/backend/src/plugins/TimeAndDate/functions/getMemberTz.ts @@ -1,6 +1,6 @@ import { GuildPluginData } from "knub"; -import { TimeAndDatePluginType } from "../types"; -import { getGuildTz } from "./getGuildTz"; +import { TimeAndDatePluginType } from "../types.js"; +import { getGuildTz } from "./getGuildTz.js"; export async function getMemberTz(pluginData: GuildPluginData, memberId: string) { const memberTz = await pluginData.state.memberTimezones.get(memberId); diff --git a/backend/src/plugins/TimeAndDate/functions/inGuildTz.ts b/backend/src/plugins/TimeAndDate/functions/inGuildTz.ts index d19a6d68d..1b17fba11 100644 --- a/backend/src/plugins/TimeAndDate/functions/inGuildTz.ts +++ b/backend/src/plugins/TimeAndDate/functions/inGuildTz.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { TimeAndDatePluginType } from "../types"; -import { getGuildTz } from "./getGuildTz"; +import { TimeAndDatePluginType } from "../types.js"; +import { getGuildTz } from "./getGuildTz.js"; export function inGuildTz(pluginData: GuildPluginData, input?: moment.Moment | number) { let momentObj: moment.Moment; diff --git a/backend/src/plugins/TimeAndDate/functions/inMemberTz.ts b/backend/src/plugins/TimeAndDate/functions/inMemberTz.ts index 37ec7ca36..16682ef54 100644 --- a/backend/src/plugins/TimeAndDate/functions/inMemberTz.ts +++ b/backend/src/plugins/TimeAndDate/functions/inMemberTz.ts @@ -1,7 +1,7 @@ import { GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { TimeAndDatePluginType } from "../types"; -import { getMemberTz } from "./getMemberTz"; +import { TimeAndDatePluginType } from "../types.js"; +import { getMemberTz } from "./getMemberTz.js"; export async function inMemberTz( pluginData: GuildPluginData, diff --git a/backend/src/plugins/TimeAndDate/info.ts b/backend/src/plugins/TimeAndDate/info.ts index 22441d32f..3ce217e6a 100644 --- a/backend/src/plugins/TimeAndDate/info.ts +++ b/backend/src/plugins/TimeAndDate/info.ts @@ -1,6 +1,6 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { trimPluginDescription } from "../../utils"; -import { zTimeAndDateConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { trimPluginDescription } from "../../utils.js"; +import { zTimeAndDateConfig } from "./types.js"; export const timeAndDatePluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/TimeAndDate/types.ts b/backend/src/plugins/TimeAndDate/types.ts index 7a942518c..e829228bc 100644 --- a/backend/src/plugins/TimeAndDate/types.ts +++ b/backend/src/plugins/TimeAndDate/types.ts @@ -1,10 +1,10 @@ import { BasePluginType, guildPluginMessageCommand } from "knub"; import { U } from "ts-toolbelt"; import z from "zod"; -import { GuildMemberTimezones } from "../../data/GuildMemberTimezones"; -import { keys } from "../../utils"; -import { zValidTimezone } from "../../utils/zValidTimezone"; -import { defaultDateFormats } from "./defaultDateFormats"; +import { GuildMemberTimezones } from "../../data/GuildMemberTimezones.js"; +import { keys } from "../../utils.js"; +import { zValidTimezone } from "../../utils/zValidTimezone.js"; +import { defaultDateFormats } from "./defaultDateFormats.js"; const zDateFormatKeys = z.enum(keys(defaultDateFormats) as U.ListOf); diff --git a/backend/src/plugins/UsernameSaver/UsernameSaverPlugin.ts b/backend/src/plugins/UsernameSaver/UsernameSaverPlugin.ts index b731bd278..fe38fd13b 100644 --- a/backend/src/plugins/UsernameSaver/UsernameSaverPlugin.ts +++ b/backend/src/plugins/UsernameSaver/UsernameSaverPlugin.ts @@ -1,8 +1,8 @@ import { guildPlugin } from "knub"; -import { Queue } from "../../Queue"; -import { UsernameHistory } from "../../data/UsernameHistory"; -import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts"; -import { UsernameSaverPluginType, zUsernameSaverConfig } from "./types"; +import { Queue } from "../../Queue.js"; +import { UsernameHistory } from "../../data/UsernameHistory.js"; +import { MessageCreateUpdateUsernameEvt, VoiceChannelJoinUpdateUsernameEvt } from "./events/UpdateUsernameEvts.js"; +import { UsernameSaverPluginType, zUsernameSaverConfig } from "./types.js"; export const UsernameSaverPlugin = guildPlugin()({ name: "username_saver", diff --git a/backend/src/plugins/UsernameSaver/events/UpdateUsernameEvts.ts b/backend/src/plugins/UsernameSaver/events/UpdateUsernameEvts.ts index 093dbce7b..805b8a73b 100644 --- a/backend/src/plugins/UsernameSaver/events/UpdateUsernameEvts.ts +++ b/backend/src/plugins/UsernameSaver/events/UpdateUsernameEvts.ts @@ -1,5 +1,5 @@ -import { usernameSaverEvt } from "../types"; -import { updateUsername } from "../updateUsername"; +import { usernameSaverEvt } from "../types.js"; +import { updateUsername } from "../updateUsername.js"; export const MessageCreateUpdateUsernameEvt = usernameSaverEvt({ event: "messageCreate", diff --git a/backend/src/plugins/UsernameSaver/info.ts b/backend/src/plugins/UsernameSaver/info.ts index 4a9b5bbad..7f9afb5f2 100644 --- a/backend/src/plugins/UsernameSaver/info.ts +++ b/backend/src/plugins/UsernameSaver/info.ts @@ -1,4 +1,4 @@ -import { ZeppelinPluginInfo } from "../../types"; +import { ZeppelinPluginInfo } from "../../types.js"; export const usernameSaverPluginInfo: ZeppelinPluginInfo = { showInDocs: false, diff --git a/backend/src/plugins/UsernameSaver/types.ts b/backend/src/plugins/UsernameSaver/types.ts index 16d6e3424..4828db6e5 100644 --- a/backend/src/plugins/UsernameSaver/types.ts +++ b/backend/src/plugins/UsernameSaver/types.ts @@ -1,7 +1,7 @@ import { BasePluginType, guildPluginEventListener } from "knub"; import z from "zod"; -import { Queue } from "../../Queue"; -import { UsernameHistory } from "../../data/UsernameHistory"; +import { Queue } from "../../Queue.js"; +import { UsernameHistory } from "../../data/UsernameHistory.js"; export const zUsernameSaverConfig = z.strictObject({}); diff --git a/backend/src/plugins/UsernameSaver/updateUsername.ts b/backend/src/plugins/UsernameSaver/updateUsername.ts index ed0fb73fe..f067f1689 100644 --- a/backend/src/plugins/UsernameSaver/updateUsername.ts +++ b/backend/src/plugins/UsernameSaver/updateUsername.ts @@ -1,7 +1,7 @@ import { User } from "discord.js"; import { GuildPluginData } from "knub"; -import { renderUsername } from "../../utils"; -import { UsernameSaverPluginType } from "./types"; +import { renderUsername } from "../../utils.js"; +import { UsernameSaverPluginType } from "./types.js"; export async function updateUsername(pluginData: GuildPluginData, user: User) { if (!user) return; diff --git a/backend/src/plugins/Utility/UtilityPlugin.ts b/backend/src/plugins/Utility/UtilityPlugin.ts index 0b44fca5c..23433f439 100644 --- a/backend/src/plugins/Utility/UtilityPlugin.ts +++ b/backend/src/plugins/Utility/UtilityPlugin.ts @@ -1,47 +1,47 @@ import { Snowflake } from "discord.js"; import { PluginOptions, guildPlugin } from "knub"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildCases } from "../../data/GuildCases"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { Supporters } from "../../data/Supporters"; -import { makePublicFn, sendSuccessMessage } from "../../pluginUtils"; -import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { ModActionsPlugin } from "../ModActions/ModActionsPlugin"; -import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; -import { AboutCmd } from "./commands/AboutCmd"; -import { AvatarCmd } from "./commands/AvatarCmd"; -import { BanSearchCmd } from "./commands/BanSearchCmd"; -import { ChannelInfoCmd } from "./commands/ChannelInfoCmd"; -import { CleanCmd, cleanCmd } from "./commands/CleanCmd"; -import { ContextCmd } from "./commands/ContextCmd"; -import { EmojiInfoCmd } from "./commands/EmojiInfoCmd"; -import { HelpCmd } from "./commands/HelpCmd"; -import { InfoCmd } from "./commands/InfoCmd"; -import { InviteInfoCmd } from "./commands/InviteInfoCmd"; -import { JumboCmd } from "./commands/JumboCmd"; -import { LevelCmd } from "./commands/LevelCmd"; -import { MessageInfoCmd } from "./commands/MessageInfoCmd"; -import { NicknameCmd } from "./commands/NicknameCmd"; -import { NicknameResetCmd } from "./commands/NicknameResetCmd"; -import { PingCmd } from "./commands/PingCmd"; -import { ReloadGuildCmd } from "./commands/ReloadGuildCmd"; -import { RoleInfoCmd } from "./commands/RoleInfoCmd"; -import { RolesCmd } from "./commands/RolesCmd"; -import { SearchCmd } from "./commands/SearchCmd"; -import { ServerInfoCmd } from "./commands/ServerInfoCmd"; -import { SnowflakeInfoCmd } from "./commands/SnowflakeInfoCmd"; -import { SourceCmd } from "./commands/SourceCmd"; -import { UserInfoCmd } from "./commands/UserInfoCmd"; -import { VcdisconnectCmd } from "./commands/VcdisconnectCmd"; -import { VcmoveAllCmd, VcmoveCmd } from "./commands/VcmoveCmd"; -import { AutoJoinThreadEvt, AutoJoinThreadSyncEvt } from "./events/AutoJoinThreadEvt"; -import { getUserInfoEmbed } from "./functions/getUserInfoEmbed"; -import { hasPermission } from "./functions/hasPermission"; -import { activeReloads } from "./guildReloads"; -import { refreshMembersIfNeeded } from "./refreshMembers"; -import { UtilityPluginType, zUtilityConfig } from "./types"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { Supporters } from "../../data/Supporters.js"; +import { makePublicFn, sendSuccessMessage } from "../../pluginUtils.js"; +import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { ModActionsPlugin } from "../ModActions/ModActionsPlugin.js"; +import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js"; +import { AboutCmd } from "./commands/AboutCmd.js"; +import { AvatarCmd } from "./commands/AvatarCmd.js"; +import { BanSearchCmd } from "./commands/BanSearchCmd.js"; +import { ChannelInfoCmd } from "./commands/ChannelInfoCmd.js"; +import { CleanCmd, cleanCmd } from "./commands/CleanCmd.js"; +import { ContextCmd } from "./commands/ContextCmd.js"; +import { EmojiInfoCmd } from "./commands/EmojiInfoCmd.js"; +import { HelpCmd } from "./commands/HelpCmd.js"; +import { InfoCmd } from "./commands/InfoCmd.js"; +import { InviteInfoCmd } from "./commands/InviteInfoCmd.js"; +import { JumboCmd } from "./commands/JumboCmd.js"; +import { LevelCmd } from "./commands/LevelCmd.js"; +import { MessageInfoCmd } from "./commands/MessageInfoCmd.js"; +import { NicknameCmd } from "./commands/NicknameCmd.js"; +import { NicknameResetCmd } from "./commands/NicknameResetCmd.js"; +import { PingCmd } from "./commands/PingCmd.js"; +import { ReloadGuildCmd } from "./commands/ReloadGuildCmd.js"; +import { RoleInfoCmd } from "./commands/RoleInfoCmd.js"; +import { RolesCmd } from "./commands/RolesCmd.js"; +import { SearchCmd } from "./commands/SearchCmd.js"; +import { ServerInfoCmd } from "./commands/ServerInfoCmd.js"; +import { SnowflakeInfoCmd } from "./commands/SnowflakeInfoCmd.js"; +import { SourceCmd } from "./commands/SourceCmd.js"; +import { UserInfoCmd } from "./commands/UserInfoCmd.js"; +import { VcdisconnectCmd } from "./commands/VcdisconnectCmd.js"; +import { VcmoveAllCmd, VcmoveCmd } from "./commands/VcmoveCmd.js"; +import { AutoJoinThreadEvt, AutoJoinThreadSyncEvt } from "./events/AutoJoinThreadEvt.js"; +import { getUserInfoEmbed } from "./functions/getUserInfoEmbed.js"; +import { hasPermission } from "./functions/hasPermission.js"; +import { activeReloads } from "./guildReloads.js"; +import { refreshMembersIfNeeded } from "./refreshMembers.js"; +import { UtilityPluginType, zUtilityConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/Utility/commands/AboutCmd.ts b/backend/src/plugins/Utility/commands/AboutCmd.ts index d4188ad70..6de194715 100644 --- a/backend/src/plugins/Utility/commands/AboutCmd.ts +++ b/backend/src/plugins/Utility/commands/AboutCmd.ts @@ -1,13 +1,13 @@ import { APIEmbed, GuildChannel } from "discord.js"; import humanizeDuration from "humanize-duration"; import LCL from "last-commit-log"; -import { shuffle } from "lodash"; +import shuffle from "lodash/shuffle.js"; import moment from "moment-timezone"; -import { rootDir } from "../../../paths"; -import { getCurrentUptime } from "../../../uptime"; -import { resolveMember, sorter } from "../../../utils"; -import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; -import { utilityCmd } from "../types"; +import { rootDir } from "../../../paths.js"; +import { getCurrentUptime } from "../../../uptime.js"; +import { resolveMember, sorter } from "../../../utils.js"; +import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; +import { utilityCmd } from "../types.js"; export const AboutCmd = utilityCmd({ trigger: "about", diff --git a/backend/src/plugins/Utility/commands/AvatarCmd.ts b/backend/src/plugins/Utility/commands/AvatarCmd.ts index e4ba07d57..246287594 100644 --- a/backend/src/plugins/Utility/commands/AvatarCmd.ts +++ b/backend/src/plugins/Utility/commands/AvatarCmd.ts @@ -1,8 +1,8 @@ import { APIEmbed, ImageFormat } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { UnknownUser, renderUsername } from "../../../utils"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { UnknownUser, renderUsername } from "../../../utils.js"; +import { utilityCmd } from "../types.js"; export const AvatarCmd = utilityCmd({ trigger: ["avatar", "av"], diff --git a/backend/src/plugins/Utility/commands/BanSearchCmd.ts b/backend/src/plugins/Utility/commands/BanSearchCmd.ts index 25d60fb49..eb8051bcf 100644 --- a/backend/src/plugins/Utility/commands/BanSearchCmd.ts +++ b/backend/src/plugins/Utility/commands/BanSearchCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { archiveSearch, displaySearch, SearchType } from "../search"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { archiveSearch, displaySearch, SearchType } from "../search.js"; +import { utilityCmd } from "../types.js"; // Separate from BanSearchCmd to avoid a circular reference from ./search.ts export const banSearchSignature = { diff --git a/backend/src/plugins/Utility/commands/ChannelInfoCmd.ts b/backend/src/plugins/Utility/commands/ChannelInfoCmd.ts index bbef9bcf7..4a7617a6f 100644 --- a/backend/src/plugins/Utility/commands/ChannelInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/ChannelInfoCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const ChannelInfoCmd = utilityCmd({ trigger: ["channel", "channelinfo"], diff --git a/backend/src/plugins/Utility/commands/CleanCmd.ts b/backend/src/plugins/Utility/commands/CleanCmd.ts index 18d4efa2e..683f28f21 100644 --- a/backend/src/plugins/Utility/commands/CleanCmd.ts +++ b/backend/src/plugins/Utility/commands/CleanCmd.ts @@ -1,15 +1,15 @@ import { Message, Snowflake, TextChannel, User } from "discord.js"; import { GuildPluginData } from "knub"; -import { allowTimeout } from "../../../RegExpRunner"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { LogType } from "../../../data/LogType"; -import { SavedMessage } from "../../../data/entities/SavedMessage"; -import { humanizeDurationShort } from "../../../humanizeDurationShort"; -import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { ModActionsPlugin } from "../../../plugins/ModActions/ModActionsPlugin"; -import { DAYS, SECONDS, chunkArray, getInviteCodesInString, noop } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { UtilityPluginType, utilityCmd } from "../types"; +import { allowTimeout } from "../../../RegExpRunner.js"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { LogType } from "../../../data/LogType.js"; +import { SavedMessage } from "../../../data/entities/SavedMessage.js"; +import { humanizeDurationShort } from "../../../humanizeDurationShort.js"; +import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { ModActionsPlugin } from "../../../plugins/ModActions/ModActionsPlugin.js"; +import { DAYS, SECONDS, chunkArray, getInviteCodesInString, noop } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { UtilityPluginType, utilityCmd } from "../types.js"; const MAX_CLEAN_COUNT = 300; const MAX_CLEAN_TIME = 1 * DAYS; diff --git a/backend/src/plugins/Utility/commands/ContextCmd.ts b/backend/src/plugins/Utility/commands/ContextCmd.ts index ceec44076..efc4297df 100644 --- a/backend/src/plugins/Utility/commands/ContextCmd.ts +++ b/backend/src/plugins/Utility/commands/ContextCmd.ts @@ -1,9 +1,9 @@ import { Snowflake, TextChannel } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { messageLink } from "../../../utils"; -import { canReadChannel } from "../../../utils/canReadChannel"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { messageLink } from "../../../utils.js"; +import { canReadChannel } from "../../../utils/canReadChannel.js"; +import { utilityCmd } from "../types.js"; export const ContextCmd = utilityCmd({ trigger: "context", diff --git a/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts b/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts index 5c89f3ebe..b4227f06b 100644 --- a/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/EmojiInfoCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { getCustomEmojiId } from "../functions/getCustomEmojiId"; -import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { getCustomEmojiId } from "../functions/getCustomEmojiId.js"; +import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const EmojiInfoCmd = utilityCmd({ trigger: ["emoji", "emojiinfo"], diff --git a/backend/src/plugins/Utility/commands/HelpCmd.ts b/backend/src/plugins/Utility/commands/HelpCmd.ts index 7e3391fdc..a1be304b1 100644 --- a/backend/src/plugins/Utility/commands/HelpCmd.ts +++ b/backend/src/plugins/Utility/commands/HelpCmd.ts @@ -1,7 +1,7 @@ import { LoadedGuildPlugin, PluginCommandDefinition } from "knub"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { createChunkedMessage } from "../../../utils"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { createChunkedMessage } from "../../../utils.js"; +import { utilityCmd } from "../types.js"; export const HelpCmd = utilityCmd({ trigger: "help", diff --git a/backend/src/plugins/Utility/commands/InfoCmd.ts b/backend/src/plugins/Utility/commands/InfoCmd.ts index 62f89bd69..519f0f6a3 100644 --- a/backend/src/plugins/Utility/commands/InfoCmd.ts +++ b/backend/src/plugins/Utility/commands/InfoCmd.ts @@ -1,21 +1,21 @@ import { Snowflake } from "discord.js"; import { getChannelId, getRoleId } from "knub/helpers"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { isValidSnowflake, noop, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils"; -import { canReadChannel } from "../../../utils/canReadChannel"; -import { resolveMessageTarget } from "../../../utils/resolveMessageTarget"; -import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed"; -import { getCustomEmojiId } from "../functions/getCustomEmojiId"; -import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed"; -import { getGuildPreview } from "../functions/getGuildPreview"; -import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed"; -import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed"; -import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed"; -import { getServerInfoEmbed } from "../functions/getServerInfoEmbed"; -import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed"; -import { getUserInfoEmbed } from "../functions/getUserInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { isValidSnowflake, noop, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils.js"; +import { canReadChannel } from "../../../utils/canReadChannel.js"; +import { resolveMessageTarget } from "../../../utils/resolveMessageTarget.js"; +import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed.js"; +import { getCustomEmojiId } from "../functions/getCustomEmojiId.js"; +import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed.js"; +import { getGuildPreview } from "../functions/getGuildPreview.js"; +import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed.js"; +import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed.js"; +import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed.js"; +import { getServerInfoEmbed } from "../functions/getServerInfoEmbed.js"; +import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed.js"; +import { getUserInfoEmbed } from "../functions/getUserInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const InfoCmd = utilityCmd({ trigger: "info", diff --git a/backend/src/plugins/Utility/commands/InviteInfoCmd.ts b/backend/src/plugins/Utility/commands/InviteInfoCmd.ts index df34123ab..53324d0e2 100644 --- a/backend/src/plugins/Utility/commands/InviteInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/InviteInfoCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { parseInviteCodeInput } from "../../../utils"; -import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { parseInviteCodeInput } from "../../../utils.js"; +import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const InviteInfoCmd = utilityCmd({ trigger: ["invite", "inviteinfo"], diff --git a/backend/src/plugins/Utility/commands/JumboCmd.ts b/backend/src/plugins/Utility/commands/JumboCmd.ts index 3dd1d30a5..4c29b9a27 100644 --- a/backend/src/plugins/Utility/commands/JumboCmd.ts +++ b/backend/src/plugins/Utility/commands/JumboCmd.ts @@ -2,10 +2,10 @@ import photon from "@silvia-odwyer/photon-node"; import { AttachmentBuilder } from "discord.js"; import fs from "fs"; import twemoji from "twemoji"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { downloadFile, isEmoji, SECONDS } from "../../../utils"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { downloadFile, isEmoji, SECONDS } from "../../../utils.js"; +import { utilityCmd } from "../types.js"; const fsp = fs.promises; diff --git a/backend/src/plugins/Utility/commands/LevelCmd.ts b/backend/src/plugins/Utility/commands/LevelCmd.ts index 5830f66a8..9542dd8b1 100644 --- a/backend/src/plugins/Utility/commands/LevelCmd.ts +++ b/backend/src/plugins/Utility/commands/LevelCmd.ts @@ -1,7 +1,7 @@ import { helpers } from "knub"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { renderUsername } from "../../../utils"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { renderUsername } from "../../../utils.js"; +import { utilityCmd } from "../types.js"; const { getMemberLevel } = helpers; diff --git a/backend/src/plugins/Utility/commands/MessageInfoCmd.ts b/backend/src/plugins/Utility/commands/MessageInfoCmd.ts index 19164ca49..7ca935f4a 100644 --- a/backend/src/plugins/Utility/commands/MessageInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/MessageInfoCmd.ts @@ -1,8 +1,8 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { canReadChannel } from "../../../utils/canReadChannel"; -import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { canReadChannel } from "../../../utils/canReadChannel.js"; +import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const MessageInfoCmd = utilityCmd({ trigger: ["message", "messageinfo"], diff --git a/backend/src/plugins/Utility/commands/NicknameCmd.ts b/backend/src/plugins/Utility/commands/NicknameCmd.ts index 9821ef328..3a33b2770 100644 --- a/backend/src/plugins/Utility/commands/NicknameCmd.ts +++ b/backend/src/plugins/Utility/commands/NicknameCmd.ts @@ -1,8 +1,8 @@ import { escapeBold } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendSuccessMessage } from "../../../pluginUtils"; -import { errorMessage } from "../../../utils"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendSuccessMessage } from "../../../pluginUtils.js"; +import { errorMessage } from "../../../utils.js"; +import { utilityCmd } from "../types.js"; export const NicknameCmd = utilityCmd({ trigger: ["nickname", "nick"], diff --git a/backend/src/plugins/Utility/commands/NicknameResetCmd.ts b/backend/src/plugins/Utility/commands/NicknameResetCmd.ts index f86a33c93..b43ef78f0 100644 --- a/backend/src/plugins/Utility/commands/NicknameResetCmd.ts +++ b/backend/src/plugins/Utility/commands/NicknameResetCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendSuccessMessage } from "../../../pluginUtils"; -import { errorMessage } from "../../../utils"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendSuccessMessage } from "../../../pluginUtils.js"; +import { errorMessage } from "../../../utils.js"; +import { utilityCmd } from "../types.js"; export const NicknameResetCmd = utilityCmd({ trigger: ["nickname reset", "nick reset"], diff --git a/backend/src/plugins/Utility/commands/PingCmd.ts b/backend/src/plugins/Utility/commands/PingCmd.ts index 0777cdc9c..e41665ebf 100644 --- a/backend/src/plugins/Utility/commands/PingCmd.ts +++ b/backend/src/plugins/Utility/commands/PingCmd.ts @@ -1,7 +1,7 @@ import { Message } from "discord.js"; import { performance } from "perf_hooks"; -import { noop, trimLines } from "../../../utils"; -import { utilityCmd } from "../types"; +import { noop, trimLines } from "../../../utils.js"; +import { utilityCmd } from "../types.js"; export const PingCmd = utilityCmd({ trigger: ["ping", "pong"], diff --git a/backend/src/plugins/Utility/commands/ReloadGuildCmd.ts b/backend/src/plugins/Utility/commands/ReloadGuildCmd.ts index 2b8b2f329..3c00eda70 100644 --- a/backend/src/plugins/Utility/commands/ReloadGuildCmd.ts +++ b/backend/src/plugins/Utility/commands/ReloadGuildCmd.ts @@ -1,6 +1,6 @@ import { TextChannel } from "discord.js"; -import { activeReloads } from "../guildReloads"; -import { utilityCmd } from "../types"; +import { activeReloads } from "../guildReloads.js"; +import { utilityCmd } from "../types.js"; export const ReloadGuildCmd = utilityCmd({ trigger: "reload_guild", diff --git a/backend/src/plugins/Utility/commands/RoleInfoCmd.ts b/backend/src/plugins/Utility/commands/RoleInfoCmd.ts index 6f540b4b1..76070deb3 100644 --- a/backend/src/plugins/Utility/commands/RoleInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/RoleInfoCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const RoleInfoCmd = utilityCmd({ trigger: ["roleinfo"], diff --git a/backend/src/plugins/Utility/commands/RolesCmd.ts b/backend/src/plugins/Utility/commands/RolesCmd.ts index 86c095544..82a2e2c1e 100644 --- a/backend/src/plugins/Utility/commands/RolesCmd.ts +++ b/backend/src/plugins/Utility/commands/RolesCmd.ts @@ -1,9 +1,9 @@ import { Role } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { chunkArray, sorter, trimLines } from "../../../utils"; -import { refreshMembersIfNeeded } from "../refreshMembers"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { chunkArray, sorter, trimLines } from "../../../utils.js"; +import { refreshMembersIfNeeded } from "../refreshMembers.js"; +import { utilityCmd } from "../types.js"; export const RolesCmd = utilityCmd({ trigger: "roles", diff --git a/backend/src/plugins/Utility/commands/SearchCmd.ts b/backend/src/plugins/Utility/commands/SearchCmd.ts index fb4d2ad1c..7856728f7 100644 --- a/backend/src/plugins/Utility/commands/SearchCmd.ts +++ b/backend/src/plugins/Utility/commands/SearchCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { archiveSearch, displaySearch, SearchType } from "../search"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { archiveSearch, displaySearch, SearchType } from "../search.js"; +import { utilityCmd } from "../types.js"; // Separate from SearchCmd to avoid a circular reference from ./search.ts export const searchCmdSignature = { diff --git a/backend/src/plugins/Utility/commands/ServerInfoCmd.ts b/backend/src/plugins/Utility/commands/ServerInfoCmd.ts index 9d1d4ed66..bb19a20fb 100644 --- a/backend/src/plugins/Utility/commands/ServerInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/ServerInfoCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { getServerInfoEmbed } from "../functions/getServerInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { getServerInfoEmbed } from "../functions/getServerInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const ServerInfoCmd = utilityCmd({ trigger: ["server", "serverinfo"], diff --git a/backend/src/plugins/Utility/commands/SnowflakeInfoCmd.ts b/backend/src/plugins/Utility/commands/SnowflakeInfoCmd.ts index bf0e859fc..459847464 100644 --- a/backend/src/plugins/Utility/commands/SnowflakeInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/SnowflakeInfoCmd.ts @@ -1,6 +1,6 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const SnowflakeInfoCmd = utilityCmd({ trigger: ["snowflake", "snowflakeinfo"], diff --git a/backend/src/plugins/Utility/commands/SourceCmd.ts b/backend/src/plugins/Utility/commands/SourceCmd.ts index 54c246473..b02f18dda 100644 --- a/backend/src/plugins/Utility/commands/SourceCmd.ts +++ b/backend/src/plugins/Utility/commands/SourceCmd.ts @@ -1,8 +1,8 @@ import moment from "moment-timezone"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { getBaseUrl, sendErrorMessage } from "../../../pluginUtils"; -import { canReadChannel } from "../../../utils/canReadChannel"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { getBaseUrl, sendErrorMessage } from "../../../pluginUtils.js"; +import { canReadChannel } from "../../../utils/canReadChannel.js"; +import { utilityCmd } from "../types.js"; export const SourceCmd = utilityCmd({ trigger: "source", diff --git a/backend/src/plugins/Utility/commands/UserInfoCmd.ts b/backend/src/plugins/Utility/commands/UserInfoCmd.ts index d796bf364..f180a9b57 100644 --- a/backend/src/plugins/Utility/commands/UserInfoCmd.ts +++ b/backend/src/plugins/Utility/commands/UserInfoCmd.ts @@ -1,7 +1,7 @@ -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { sendErrorMessage } from "../../../pluginUtils"; -import { getUserInfoEmbed } from "../functions/getUserInfoEmbed"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { sendErrorMessage } from "../../../pluginUtils.js"; +import { getUserInfoEmbed } from "../functions/getUserInfoEmbed.js"; +import { utilityCmd } from "../types.js"; export const UserInfoCmd = utilityCmd({ trigger: ["user", "userinfo", "whois"], diff --git a/backend/src/plugins/Utility/commands/VcdisconnectCmd.ts b/backend/src/plugins/Utility/commands/VcdisconnectCmd.ts index b6863599b..c8a5d3209 100644 --- a/backend/src/plugins/Utility/commands/VcdisconnectCmd.ts +++ b/backend/src/plugins/Utility/commands/VcdisconnectCmd.ts @@ -1,9 +1,9 @@ import { VoiceChannel } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { renderUsername } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { renderUsername } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { utilityCmd } from "../types.js"; export const VcdisconnectCmd = utilityCmd({ trigger: ["vcdisconnect", "vcdisc", "vcdc", "vckick", "vck"], diff --git a/backend/src/plugins/Utility/commands/VcmoveCmd.ts b/backend/src/plugins/Utility/commands/VcmoveCmd.ts index 259c60b5a..0ccc57244 100644 --- a/backend/src/plugins/Utility/commands/VcmoveCmd.ts +++ b/backend/src/plugins/Utility/commands/VcmoveCmd.ts @@ -1,9 +1,9 @@ import { ChannelType, Snowflake, VoiceChannel } from "discord.js"; -import { commandTypeHelpers as ct } from "../../../commandTypes"; -import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils"; -import { channelMentionRegex, isSnowflake, renderUsername, simpleClosestStringMatch } from "../../../utils"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { utilityCmd } from "../types"; +import { commandTypeHelpers as ct } from "../../../commandTypes.js"; +import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; +import { channelMentionRegex, isSnowflake, renderUsername, simpleClosestStringMatch } from "../../../utils.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { utilityCmd } from "../types.js"; export const VcmoveCmd = utilityCmd({ trigger: "vcmove", diff --git a/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts b/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts index 7dddcedf7..c61d2a6cf 100644 --- a/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts +++ b/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts @@ -1,4 +1,4 @@ -import { utilityEvt } from "../types"; +import { utilityEvt } from "../types.js"; export const AutoJoinThreadEvt = utilityEvt({ event: "threadCreate", diff --git a/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts b/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts index befd1467f..5c0cd3347 100644 --- a/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts @@ -1,8 +1,8 @@ import { APIEmbed, ChannelType, Snowflake, StageChannel, VoiceChannel } from "discord.js"; import humanizeDuration from "humanize-duration"; import { GuildPluginData } from "knub"; -import { EmbedWith, MINUTES, formatNumber, preEmbedPadding, trimLines, verboseUserMention } from "../../../utils"; -import { UtilityPluginType } from "../types"; +import { EmbedWith, MINUTES, formatNumber, preEmbedPadding, trimLines, verboseUserMention } from "../../../utils.js"; +import { UtilityPluginType } from "../types.js"; const TEXT_CHANNEL_ICON = "https://cdn.discordapp.com/attachments/740650744830623756/740656843545772062/text-channel.png"; diff --git a/backend/src/plugins/Utility/functions/getEmojiInfoEmbed.ts b/backend/src/plugins/Utility/functions/getEmojiInfoEmbed.ts index 01001e2de..b4e68404d 100644 --- a/backend/src/plugins/Utility/functions/getEmojiInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getEmojiInfoEmbed.ts @@ -1,7 +1,7 @@ import { APIEmbed } from "discord.js"; import { GuildPluginData } from "knub"; -import { EmbedWith, preEmbedPadding, trimLines } from "../../../utils"; -import { UtilityPluginType } from "../types"; +import { EmbedWith, preEmbedPadding, trimLines } from "../../../utils.js"; +import { UtilityPluginType } from "../types.js"; export async function getEmojiInfoEmbed( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Utility/functions/getGuildPreview.ts b/backend/src/plugins/Utility/functions/getGuildPreview.ts index 6ead2537c..d82f1dee8 100644 --- a/backend/src/plugins/Utility/functions/getGuildPreview.ts +++ b/backend/src/plugins/Utility/functions/getGuildPreview.ts @@ -1,5 +1,5 @@ import { Client, GuildPreview, Snowflake } from "discord.js"; -import { MINUTES, memoize } from "../../../utils"; +import { MINUTES, memoize } from "../../../utils.js"; /** * Memoized getGuildPreview diff --git a/backend/src/plugins/Utility/functions/getInviteInfoEmbed.ts b/backend/src/plugins/Utility/functions/getInviteInfoEmbed.ts index b844b937d..a990dd500 100644 --- a/backend/src/plugins/Utility/functions/getInviteInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getInviteInfoEmbed.ts @@ -11,9 +11,9 @@ import { renderUsername, resolveInvite, trimLines, -} from "../../../utils"; -import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp"; -import { UtilityPluginType } from "../types"; +} from "../../../utils.js"; +import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp.js"; +import { UtilityPluginType } from "../types.js"; export async function getInviteInfoEmbed( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Utility/functions/getMessageInfoEmbed.ts b/backend/src/plugins/Utility/functions/getMessageInfoEmbed.ts index 34a89fe65..f003080f3 100644 --- a/backend/src/plugins/Utility/functions/getMessageInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getMessageInfoEmbed.ts @@ -8,8 +8,8 @@ import { renderUsername, trimEmptyLines, trimLines, -} from "../../../utils"; -import { UtilityPluginType } from "../types"; +} from "../../../utils.js"; +import { UtilityPluginType } from "../types.js"; const MESSAGE_ICON = "https://cdn.discordapp.com/attachments/740650744830623756/740685652152025088/message.png"; diff --git a/backend/src/plugins/Utility/functions/getRoleInfoEmbed.ts b/backend/src/plugins/Utility/functions/getRoleInfoEmbed.ts index dd19d9b2a..9c27cefe1 100644 --- a/backend/src/plugins/Utility/functions/getRoleInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getRoleInfoEmbed.ts @@ -1,8 +1,8 @@ import { APIEmbed, PermissionFlagsBits, Role } from "discord.js"; import { GuildPluginData } from "knub"; -import { EmbedWith, preEmbedPadding, trimLines } from "../../../utils"; +import { EmbedWith, preEmbedPadding, trimLines } from "../../../utils.js"; import { PERMISSION_NAMES } from "../../../utils/permissionNames.js"; -import { UtilityPluginType } from "../types"; +import { UtilityPluginType } from "../types.js"; const MENTION_ICON = "https://cdn.discordapp.com/attachments/705009450855039042/839284872152481792/mention.png"; diff --git a/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts index fa7368a68..f223563d0 100644 --- a/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts @@ -11,10 +11,10 @@ import { resolveInvite, resolveUser, trimLines, -} from "../../../utils"; -import { idToTimestamp } from "../../../utils/idToTimestamp"; -import { UtilityPluginType } from "../types"; -import { getGuildPreview } from "./getGuildPreview"; +} from "../../../utils.js"; +import { idToTimestamp } from "../../../utils/idToTimestamp.js"; +import { UtilityPluginType } from "../types.js"; +import { getGuildPreview } from "./getGuildPreview.js"; const prettifyFeature = (feature: string): string => `\`${feature diff --git a/backend/src/plugins/Utility/functions/getSnowflakeInfoEmbed.ts b/backend/src/plugins/Utility/functions/getSnowflakeInfoEmbed.ts index 8449ba74d..18ac73895 100644 --- a/backend/src/plugins/Utility/functions/getSnowflakeInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getSnowflakeInfoEmbed.ts @@ -1,6 +1,6 @@ import { APIEmbed } from "discord.js"; -import { EmbedWith, preEmbedPadding } from "../../../utils"; -import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp"; +import { EmbedWith, preEmbedPadding } from "../../../utils.js"; +import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp.js"; const SNOWFLAKE_ICON = "https://cdn.discordapp.com/attachments/740650744830623756/742020790471491668/snowflake.png"; diff --git a/backend/src/plugins/Utility/functions/getUserInfoEmbed.ts b/backend/src/plugins/Utility/functions/getUserInfoEmbed.ts index 395dcfbf3..30f95ee52 100644 --- a/backend/src/plugins/Utility/functions/getUserInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getUserInfoEmbed.ts @@ -1,6 +1,6 @@ import { APIEmbed } from "discord.js"; import { GuildPluginData } from "knub"; -import { CaseTypes } from "../../../data/CaseTypes"; +import { CaseTypes } from "../../../data/CaseTypes.js"; import { EmbedWith, messageLink, @@ -12,8 +12,8 @@ import { trimEmptyLines, trimLines, UnknownUser, -} from "../../../utils"; -import { UtilityPluginType } from "../types"; +} from "../../../utils.js"; +import { UtilityPluginType } from "../types.js"; const MAX_ROLES_TO_DISPLAY = 15; diff --git a/backend/src/plugins/Utility/functions/hasPermission.ts b/backend/src/plugins/Utility/functions/hasPermission.ts index 919d28f7e..ebefe2036 100644 --- a/backend/src/plugins/Utility/functions/hasPermission.ts +++ b/backend/src/plugins/Utility/functions/hasPermission.ts @@ -1,6 +1,6 @@ import { GuildMember, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { UtilityPluginType } from "../types"; +import { UtilityPluginType } from "../types.js"; export async function hasPermission( pluginData: GuildPluginData, diff --git a/backend/src/plugins/Utility/info.ts b/backend/src/plugins/Utility/info.ts index 1cedf4b10..9fea0438d 100644 --- a/backend/src/plugins/Utility/info.ts +++ b/backend/src/plugins/Utility/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zUtilityConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zUtilityConfig } from "./types.js"; export const utilityPluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/Utility/refreshMembers.ts b/backend/src/plugins/Utility/refreshMembers.ts index aa4920d66..6bf47b9e1 100644 --- a/backend/src/plugins/Utility/refreshMembers.ts +++ b/backend/src/plugins/Utility/refreshMembers.ts @@ -1,5 +1,5 @@ import { Guild } from "discord.js"; -import { HOURS, noop } from "../../utils"; +import { HOURS, noop } from "../../utils.js"; const MEMBER_REFRESH_FREQUENCY = 1 * HOURS; // How often to do a full member refresh when using commands that need it const memberRefreshLog = new Map }>(); diff --git a/backend/src/plugins/Utility/search.ts b/backend/src/plugins/Utility/search.ts index 4f5d08ef0..f362ee1b7 100644 --- a/backend/src/plugins/Utility/search.ts +++ b/backend/src/plugins/Utility/search.ts @@ -12,8 +12,8 @@ import { import escapeStringRegexp from "escape-string-regexp"; import { ArgsFromSignatureOrArray, GuildPluginData } from "knub"; import moment from "moment-timezone"; -import { RegExpRunner, allowTimeout } from "../../RegExpRunner"; -import { getBaseUrl, sendErrorMessage } from "../../pluginUtils"; +import { RegExpRunner, allowTimeout } from "../../RegExpRunner.js"; +import { getBaseUrl, sendErrorMessage } from "../../pluginUtils.js"; import { InvalidRegexError, MINUTES, @@ -22,14 +22,14 @@ import { renderUsername, sorter, trimLines, -} from "../../utils"; -import { asyncFilter } from "../../utils/async"; -import { hasDiscordPermissions } from "../../utils/hasDiscordPermissions"; -import { banSearchSignature } from "./commands/BanSearchCmd"; -import { searchCmdSignature } from "./commands/SearchCmd"; -import { getUserInfoEmbed } from "./functions/getUserInfoEmbed"; -import { refreshMembersIfNeeded } from "./refreshMembers"; -import { UtilityPluginType } from "./types"; +} from "../../utils.js"; +import { asyncFilter } from "../../utils/async.js"; +import { hasDiscordPermissions } from "../../utils/hasDiscordPermissions.js"; +import { banSearchSignature } from "./commands/BanSearchCmd.js"; +import { searchCmdSignature } from "./commands/SearchCmd.js"; +import { getUserInfoEmbed } from "./functions/getUserInfoEmbed.js"; +import { refreshMembersIfNeeded } from "./refreshMembers.js"; +import { UtilityPluginType } from "./types.js"; import Timeout = NodeJS.Timeout; const SEARCH_RESULTS_PER_PAGE = 15; diff --git a/backend/src/plugins/Utility/types.ts b/backend/src/plugins/Utility/types.ts index 77b3d8acd..466eb6f98 100644 --- a/backend/src/plugins/Utility/types.ts +++ b/backend/src/plugins/Utility/types.ts @@ -1,11 +1,11 @@ import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub"; import z from "zod"; -import { RegExpRunner } from "../../RegExpRunner"; -import { GuildArchives } from "../../data/GuildArchives"; -import { GuildCases } from "../../data/GuildCases"; -import { GuildLogs } from "../../data/GuildLogs"; -import { GuildSavedMessages } from "../../data/GuildSavedMessages"; -import { Supporters } from "../../data/Supporters"; +import { RegExpRunner } from "../../RegExpRunner.js"; +import { GuildArchives } from "../../data/GuildArchives.js"; +import { GuildCases } from "../../data/GuildCases.js"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; +import { Supporters } from "../../data/Supporters.js"; export const zUtilityConfig = z.strictObject({ can_roles: z.boolean(), diff --git a/backend/src/plugins/WelcomeMessage/WelcomeMessagePlugin.ts b/backend/src/plugins/WelcomeMessage/WelcomeMessagePlugin.ts index a8fb9261e..7848393a4 100644 --- a/backend/src/plugins/WelcomeMessage/WelcomeMessagePlugin.ts +++ b/backend/src/plugins/WelcomeMessage/WelcomeMessagePlugin.ts @@ -1,8 +1,8 @@ import { PluginOptions, guildPlugin } from "knub"; -import { GuildLogs } from "../../data/GuildLogs"; -import { LogsPlugin } from "../Logs/LogsPlugin"; -import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt"; -import { WelcomeMessagePluginType, zWelcomeMessageConfig } from "./types"; +import { GuildLogs } from "../../data/GuildLogs.js"; +import { LogsPlugin } from "../Logs/LogsPlugin.js"; +import { SendWelcomeMessageEvt } from "./events/SendWelcomeMessageEvt.js"; +import { WelcomeMessagePluginType, zWelcomeMessageConfig } from "./types.js"; const defaultOptions: PluginOptions = { config: { diff --git a/backend/src/plugins/WelcomeMessage/events/SendWelcomeMessageEvt.ts b/backend/src/plugins/WelcomeMessage/events/SendWelcomeMessageEvt.ts index 879b99cdc..df983f0e1 100644 --- a/backend/src/plugins/WelcomeMessage/events/SendWelcomeMessageEvt.ts +++ b/backend/src/plugins/WelcomeMessage/events/SendWelcomeMessageEvt.ts @@ -1,14 +1,14 @@ import { Snowflake, TextChannel } from "discord.js"; -import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter"; -import { createChunkedMessage, verboseChannelMention, verboseUserMention } from "../../../utils"; -import { sendDM } from "../../../utils/sendDM"; +import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; +import { createChunkedMessage, verboseChannelMention, verboseUserMention } from "../../../utils.js"; +import { sendDM } from "../../../utils/sendDM.js"; import { guildToTemplateSafeGuild, memberToTemplateSafeMember, userToTemplateSafeUser, -} from "../../../utils/templateSafeObjects"; -import { LogsPlugin } from "../../Logs/LogsPlugin"; -import { welcomeMessageEvt } from "../types"; +} from "../../../utils/templateSafeObjects.js"; +import { LogsPlugin } from "../../Logs/LogsPlugin.js"; +import { welcomeMessageEvt } from "../types.js"; export const SendWelcomeMessageEvt = welcomeMessageEvt({ event: "guildMemberAdd", diff --git a/backend/src/plugins/WelcomeMessage/info.ts b/backend/src/plugins/WelcomeMessage/info.ts index b1e394b83..a8a4c3398 100644 --- a/backend/src/plugins/WelcomeMessage/info.ts +++ b/backend/src/plugins/WelcomeMessage/info.ts @@ -1,5 +1,5 @@ -import { ZeppelinPluginInfo } from "../../types"; -import { zWelcomeMessageConfig } from "./types"; +import { ZeppelinPluginInfo } from "../../types.js"; +import { zWelcomeMessageConfig } from "./types.js"; export const welcomeMessagePluginInfo: ZeppelinPluginInfo = { showInDocs: true, diff --git a/backend/src/plugins/WelcomeMessage/types.ts b/backend/src/plugins/WelcomeMessage/types.ts index 25e9afb16..05bd3354c 100644 --- a/backend/src/plugins/WelcomeMessage/types.ts +++ b/backend/src/plugins/WelcomeMessage/types.ts @@ -1,6 +1,6 @@ import { BasePluginType, guildPluginEventListener } from "knub"; import z from "zod"; -import { GuildLogs } from "../../data/GuildLogs"; +import { GuildLogs } from "../../data/GuildLogs.js"; export const zWelcomeMessageConfig = z.strictObject({ send_dm: z.boolean(), diff --git a/backend/src/plugins/availablePlugins.ts b/backend/src/plugins/availablePlugins.ts index 3e7dd2cd8..3a7fd60b5 100644 --- a/backend/src/plugins/availablePlugins.ts +++ b/backend/src/plugins/availablePlugins.ts @@ -1,43 +1,43 @@ import { GlobalPluginBlueprint, GuildPluginBlueprint } from "knub"; -import { AutoDeletePlugin } from "./AutoDelete/AutoDeletePlugin"; -import { AutoReactionsPlugin } from "./AutoReactions/AutoReactionsPlugin"; -import { AutomodPlugin } from "./Automod/AutomodPlugin"; -import { BotControlPlugin } from "./BotControl/BotControlPlugin"; -import { CasesPlugin } from "./Cases/CasesPlugin"; -import { CensorPlugin } from "./Censor/CensorPlugin"; -import { ChannelArchiverPlugin } from "./ChannelArchiver/ChannelArchiverPlugin"; -import { CompanionChannelsPlugin } from "./CompanionChannels/CompanionChannelsPlugin"; -import { ContextMenuPlugin } from "./ContextMenus/ContextMenuPlugin"; -import { CountersPlugin } from "./Counters/CountersPlugin"; -import { CustomEventsPlugin } from "./CustomEvents/CustomEventsPlugin"; -import { GuildAccessMonitorPlugin } from "./GuildAccessMonitor/GuildAccessMonitorPlugin"; -import { GuildConfigReloaderPlugin } from "./GuildConfigReloader/GuildConfigReloaderPlugin"; -import { GuildInfoSaverPlugin } from "./GuildInfoSaver/GuildInfoSaverPlugin"; -import { InternalPosterPlugin } from "./InternalPoster/InternalPosterPlugin"; -import { LocateUserPlugin } from "./LocateUser/LocateUserPlugin"; -import { LogsPlugin } from "./Logs/LogsPlugin"; -import { MessageSaverPlugin } from "./MessageSaver/MessageSaverPlugin"; -import { ModActionsPlugin } from "./ModActions/ModActionsPlugin"; -import { MutesPlugin } from "./Mutes/MutesPlugin"; -import { NameHistoryPlugin } from "./NameHistory/NameHistoryPlugin"; -import { PersistPlugin } from "./Persist/PersistPlugin"; -import { PhishermanPlugin } from "./Phisherman/PhishermanPlugin"; -import { PingableRolesPlugin } from "./PingableRoles/PingableRolesPlugin"; -import { PostPlugin } from "./Post/PostPlugin"; -import { ReactionRolesPlugin } from "./ReactionRoles/ReactionRolesPlugin"; -import { RemindersPlugin } from "./Reminders/RemindersPlugin"; -import { RoleButtonsPlugin } from "./RoleButtons/RoleButtonsPlugin"; -import { RoleManagerPlugin } from "./RoleManager/RoleManagerPlugin"; -import { RolesPlugin } from "./Roles/RolesPlugin"; -import { SelfGrantableRolesPlugin } from "./SelfGrantableRoles/SelfGrantableRolesPlugin"; -import { SlowmodePlugin } from "./Slowmode/SlowmodePlugin"; -import { SpamPlugin } from "./Spam/SpamPlugin"; -import { StarboardPlugin } from "./Starboard/StarboardPlugin"; -import { TagsPlugin } from "./Tags/TagsPlugin"; -import { TimeAndDatePlugin } from "./TimeAndDate/TimeAndDatePlugin"; -import { UsernameSaverPlugin } from "./UsernameSaver/UsernameSaverPlugin"; -import { UtilityPlugin } from "./Utility/UtilityPlugin"; -import { WelcomeMessagePlugin } from "./WelcomeMessage/WelcomeMessagePlugin"; +import { AutoDeletePlugin } from "./AutoDelete/AutoDeletePlugin.js"; +import { AutoReactionsPlugin } from "./AutoReactions/AutoReactionsPlugin.js"; +import { AutomodPlugin } from "./Automod/AutomodPlugin.js"; +import { BotControlPlugin } from "./BotControl/BotControlPlugin.js"; +import { CasesPlugin } from "./Cases/CasesPlugin.js"; +import { CensorPlugin } from "./Censor/CensorPlugin.js"; +import { ChannelArchiverPlugin } from "./ChannelArchiver/ChannelArchiverPlugin.js"; +import { CompanionChannelsPlugin } from "./CompanionChannels/CompanionChannelsPlugin.js"; +import { ContextMenuPlugin } from "./ContextMenus/ContextMenuPlugin.js"; +import { CountersPlugin } from "./Counters/CountersPlugin.js"; +import { CustomEventsPlugin } from "./CustomEvents/CustomEventsPlugin.js"; +import { GuildAccessMonitorPlugin } from "./GuildAccessMonitor/GuildAccessMonitorPlugin.js"; +import { GuildConfigReloaderPlugin } from "./GuildConfigReloader/GuildConfigReloaderPlugin.js"; +import { GuildInfoSaverPlugin } from "./GuildInfoSaver/GuildInfoSaverPlugin.js"; +import { InternalPosterPlugin } from "./InternalPoster/InternalPosterPlugin.js"; +import { LocateUserPlugin } from "./LocateUser/LocateUserPlugin.js"; +import { LogsPlugin } from "./Logs/LogsPlugin.js"; +import { MessageSaverPlugin } from "./MessageSaver/MessageSaverPlugin.js"; +import { ModActionsPlugin } from "./ModActions/ModActionsPlugin.js"; +import { MutesPlugin } from "./Mutes/MutesPlugin.js"; +import { NameHistoryPlugin } from "./NameHistory/NameHistoryPlugin.js"; +import { PersistPlugin } from "./Persist/PersistPlugin.js"; +import { PhishermanPlugin } from "./Phisherman/PhishermanPlugin.js"; +import { PingableRolesPlugin } from "./PingableRoles/PingableRolesPlugin.js"; +import { PostPlugin } from "./Post/PostPlugin.js"; +import { ReactionRolesPlugin } from "./ReactionRoles/ReactionRolesPlugin.js"; +import { RemindersPlugin } from "./Reminders/RemindersPlugin.js"; +import { RoleButtonsPlugin } from "./RoleButtons/RoleButtonsPlugin.js"; +import { RoleManagerPlugin } from "./RoleManager/RoleManagerPlugin.js"; +import { RolesPlugin } from "./Roles/RolesPlugin.js"; +import { SelfGrantableRolesPlugin } from "./SelfGrantableRoles/SelfGrantableRolesPlugin.js"; +import { SlowmodePlugin } from "./Slowmode/SlowmodePlugin.js"; +import { SpamPlugin } from "./Spam/SpamPlugin.js"; +import { StarboardPlugin } from "./Starboard/StarboardPlugin.js"; +import { TagsPlugin } from "./Tags/TagsPlugin.js"; +import { TimeAndDatePlugin } from "./TimeAndDate/TimeAndDatePlugin.js"; +import { UsernameSaverPlugin } from "./UsernameSaver/UsernameSaverPlugin.js"; +import { UtilityPlugin } from "./Utility/UtilityPlugin.js"; +import { WelcomeMessagePlugin } from "./WelcomeMessage/WelcomeMessagePlugin.js"; // prettier-ignore export const guildPlugins: Array> = [ diff --git a/backend/src/plugins/pluginInfo.ts b/backend/src/plugins/pluginInfo.ts index 0d9305b22..58dbc34fa 100644 --- a/backend/src/plugins/pluginInfo.ts +++ b/backend/src/plugins/pluginInfo.ts @@ -1,74 +1,74 @@ -import { ZeppelinPluginInfo } from "../types"; -import { AutoDeletePlugin } from "./AutoDelete/AutoDeletePlugin"; -import { autoDeletePluginInfo } from "./AutoDelete/info"; -import { AutoReactionsPlugin } from "./AutoReactions/AutoReactionsPlugin"; -import { autoReactionsInfo } from "./AutoReactions/info"; -import { AutomodPlugin } from "./Automod/AutomodPlugin"; -import { automodPluginInfo } from "./Automod/info"; -import { CasesPlugin } from "./Cases/CasesPlugin"; -import { casesPluginInfo } from "./Cases/info"; -import { CensorPlugin } from "./Censor/CensorPlugin"; -import { censorPluginInfo } from "./Censor/info"; -import { CompanionChannelsPlugin } from "./CompanionChannels/CompanionChannelsPlugin"; -import { companionChannelsPluginInfo } from "./CompanionChannels/info"; -import { ContextMenuPlugin } from "./ContextMenus/ContextMenuPlugin"; -import { contextMenuPluginInfo } from "./ContextMenus/info"; -import { CountersPlugin } from "./Counters/CountersPlugin"; -import { countersPluginInfo } from "./Counters/info"; -import { CustomEventsPlugin } from "./CustomEvents/CustomEventsPlugin"; -import { customEventsPluginInfo } from "./CustomEvents/info"; -import { GuildInfoSaverPlugin } from "./GuildInfoSaver/GuildInfoSaverPlugin"; -import { guildInfoSaverPluginInfo } from "./GuildInfoSaver/info"; -import { InternalPosterPlugin } from "./InternalPoster/InternalPosterPlugin"; -import { internalPosterPluginInfo } from "./InternalPoster/info"; -import { LocateUserPlugin } from "./LocateUser/LocateUserPlugin"; -import { locateUserPluginInfo } from "./LocateUser/info"; -import { LogsPlugin } from "./Logs/LogsPlugin"; -import { logsPluginInfo } from "./Logs/info"; -import { MessageSaverPlugin } from "./MessageSaver/MessageSaverPlugin"; -import { messageSaverPluginInfo } from "./MessageSaver/info"; -import { ModActionsPlugin } from "./ModActions/ModActionsPlugin"; -import { modActionsPluginInfo } from "./ModActions/info"; -import { MutesPlugin } from "./Mutes/MutesPlugin"; -import { mutesPluginInfo } from "./Mutes/info"; -import { NameHistoryPlugin } from "./NameHistory/NameHistoryPlugin"; -import { nameHistoryPluginInfo } from "./NameHistory/info"; -import { PersistPlugin } from "./Persist/PersistPlugin"; -import { persistPluginInfo } from "./Persist/info"; -import { PhishermanPlugin } from "./Phisherman/PhishermanPlugin"; -import { phishermanPluginInfo } from "./Phisherman/info"; -import { PingableRolesPlugin } from "./PingableRoles/PingableRolesPlugin"; -import { pingableRolesPluginInfo } from "./PingableRoles/info"; -import { PostPlugin } from "./Post/PostPlugin"; -import { postPluginInfo } from "./Post/info"; -import { ReactionRolesPlugin } from "./ReactionRoles/ReactionRolesPlugin"; -import { reactionRolesPluginInfo } from "./ReactionRoles/info"; -import { RemindersPlugin } from "./Reminders/RemindersPlugin"; -import { remindersPluginInfo } from "./Reminders/info"; -import { RoleButtonsPlugin } from "./RoleButtons/RoleButtonsPlugin"; -import { roleButtonsPluginInfo } from "./RoleButtons/info"; -import { RoleManagerPlugin } from "./RoleManager/RoleManagerPlugin"; -import { roleManagerPluginInfo } from "./RoleManager/info"; -import { RolesPlugin } from "./Roles/RolesPlugin"; -import { rolesPluginInfo } from "./Roles/info"; -import { SelfGrantableRolesPlugin } from "./SelfGrantableRoles/SelfGrantableRolesPlugin"; -import { selfGrantableRolesPluginInfo } from "./SelfGrantableRoles/info"; -import { SlowmodePlugin } from "./Slowmode/SlowmodePlugin"; -import { slowmodePluginInfo } from "./Slowmode/info"; -import { SpamPlugin } from "./Spam/SpamPlugin"; -import { spamPluginInfo } from "./Spam/info"; -import { StarboardPlugin } from "./Starboard/StarboardPlugin"; -import { starboardPluginInfo } from "./Starboard/info"; -import { TagsPlugin } from "./Tags/TagsPlugin"; -import { tagsPluginInfo } from "./Tags/info"; -import { TimeAndDatePlugin } from "./TimeAndDate/TimeAndDatePlugin"; -import { timeAndDatePluginInfo } from "./TimeAndDate/info"; -import { UsernameSaverPlugin } from "./UsernameSaver/UsernameSaverPlugin"; -import { usernameSaverPluginInfo } from "./UsernameSaver/info"; -import { UtilityPlugin } from "./Utility/UtilityPlugin"; -import { utilityPluginInfo } from "./Utility/info"; -import { WelcomeMessagePlugin } from "./WelcomeMessage/WelcomeMessagePlugin"; -import { welcomeMessagePluginInfo } from "./WelcomeMessage/info"; +import { ZeppelinPluginInfo } from "../types.js"; +import { AutoDeletePlugin } from "./AutoDelete/AutoDeletePlugin.js"; +import { autoDeletePluginInfo } from "./AutoDelete/info.js"; +import { AutoReactionsPlugin } from "./AutoReactions/AutoReactionsPlugin.js"; +import { autoReactionsInfo } from "./AutoReactions/info.js"; +import { AutomodPlugin } from "./Automod/AutomodPlugin.js"; +import { automodPluginInfo } from "./Automod/info.js"; +import { CasesPlugin } from "./Cases/CasesPlugin.js"; +import { casesPluginInfo } from "./Cases/info.js"; +import { CensorPlugin } from "./Censor/CensorPlugin.js"; +import { censorPluginInfo } from "./Censor/info.js"; +import { CompanionChannelsPlugin } from "./CompanionChannels/CompanionChannelsPlugin.js"; +import { companionChannelsPluginInfo } from "./CompanionChannels/info.js"; +import { ContextMenuPlugin } from "./ContextMenus/ContextMenuPlugin.js"; +import { contextMenuPluginInfo } from "./ContextMenus/info.js"; +import { CountersPlugin } from "./Counters/CountersPlugin.js"; +import { countersPluginInfo } from "./Counters/info.js"; +import { CustomEventsPlugin } from "./CustomEvents/CustomEventsPlugin.js"; +import { customEventsPluginInfo } from "./CustomEvents/info.js"; +import { GuildInfoSaverPlugin } from "./GuildInfoSaver/GuildInfoSaverPlugin.js"; +import { guildInfoSaverPluginInfo } from "./GuildInfoSaver/info.js"; +import { InternalPosterPlugin } from "./InternalPoster/InternalPosterPlugin.js"; +import { internalPosterPluginInfo } from "./InternalPoster/info.js"; +import { LocateUserPlugin } from "./LocateUser/LocateUserPlugin.js"; +import { locateUserPluginInfo } from "./LocateUser/info.js"; +import { LogsPlugin } from "./Logs/LogsPlugin.js"; +import { logsPluginInfo } from "./Logs/info.js"; +import { MessageSaverPlugin } from "./MessageSaver/MessageSaverPlugin.js"; +import { messageSaverPluginInfo } from "./MessageSaver/info.js"; +import { ModActionsPlugin } from "./ModActions/ModActionsPlugin.js"; +import { modActionsPluginInfo } from "./ModActions/info.js"; +import { MutesPlugin } from "./Mutes/MutesPlugin.js"; +import { mutesPluginInfo } from "./Mutes/info.js"; +import { NameHistoryPlugin } from "./NameHistory/NameHistoryPlugin.js"; +import { nameHistoryPluginInfo } from "./NameHistory/info.js"; +import { PersistPlugin } from "./Persist/PersistPlugin.js"; +import { persistPluginInfo } from "./Persist/info.js"; +import { PhishermanPlugin } from "./Phisherman/PhishermanPlugin.js"; +import { phishermanPluginInfo } from "./Phisherman/info.js"; +import { PingableRolesPlugin } from "./PingableRoles/PingableRolesPlugin.js"; +import { pingableRolesPluginInfo } from "./PingableRoles/info.js"; +import { PostPlugin } from "./Post/PostPlugin.js"; +import { postPluginInfo } from "./Post/info.js"; +import { ReactionRolesPlugin } from "./ReactionRoles/ReactionRolesPlugin.js"; +import { reactionRolesPluginInfo } from "./ReactionRoles/info.js"; +import { RemindersPlugin } from "./Reminders/RemindersPlugin.js"; +import { remindersPluginInfo } from "./Reminders/info.js"; +import { RoleButtonsPlugin } from "./RoleButtons/RoleButtonsPlugin.js"; +import { roleButtonsPluginInfo } from "./RoleButtons/info.js"; +import { RoleManagerPlugin } from "./RoleManager/RoleManagerPlugin.js"; +import { roleManagerPluginInfo } from "./RoleManager/info.js"; +import { RolesPlugin } from "./Roles/RolesPlugin.js"; +import { rolesPluginInfo } from "./Roles/info.js"; +import { SelfGrantableRolesPlugin } from "./SelfGrantableRoles/SelfGrantableRolesPlugin.js"; +import { selfGrantableRolesPluginInfo } from "./SelfGrantableRoles/info.js"; +import { SlowmodePlugin } from "./Slowmode/SlowmodePlugin.js"; +import { slowmodePluginInfo } from "./Slowmode/info.js"; +import { SpamPlugin } from "./Spam/SpamPlugin.js"; +import { spamPluginInfo } from "./Spam/info.js"; +import { StarboardPlugin } from "./Starboard/StarboardPlugin.js"; +import { starboardPluginInfo } from "./Starboard/info.js"; +import { TagsPlugin } from "./Tags/TagsPlugin.js"; +import { tagsPluginInfo } from "./Tags/info.js"; +import { TimeAndDatePlugin } from "./TimeAndDate/TimeAndDatePlugin.js"; +import { timeAndDatePluginInfo } from "./TimeAndDate/info.js"; +import { UsernameSaverPlugin } from "./UsernameSaver/UsernameSaverPlugin.js"; +import { usernameSaverPluginInfo } from "./UsernameSaver/info.js"; +import { UtilityPlugin } from "./Utility/UtilityPlugin.js"; +import { utilityPluginInfo } from "./Utility/info.js"; +import { WelcomeMessagePlugin } from "./WelcomeMessage/WelcomeMessagePlugin.js"; +import { welcomeMessagePluginInfo } from "./WelcomeMessage/info.js"; export const guildPluginInfo: Record = { [AutoDeletePlugin.name]: autoDeletePluginInfo, diff --git a/backend/src/regExpRunners.ts b/backend/src/regExpRunners.ts index 0395a11c1..9ad535473 100644 --- a/backend/src/regExpRunners.ts +++ b/backend/src/regExpRunners.ts @@ -1,4 +1,4 @@ -import { RegExpRunner } from "./RegExpRunner"; +import { RegExpRunner } from "./RegExpRunner.js"; interface RunnerInfo { users: number; diff --git a/backend/src/restCallStats.ts b/backend/src/restCallStats.ts index a6d5c8eaa..9af6230b5 100644 --- a/backend/src/restCallStats.ts +++ b/backend/src/restCallStats.ts @@ -1,4 +1,4 @@ -import { sorter } from "./utils"; +import { sorter } from "./utils.js"; Error.stackTraceLimit = Infinity; diff --git a/backend/src/staff.ts b/backend/src/staff.ts index 6950ee33a..c11d6d30e 100644 --- a/backend/src/staff.ts +++ b/backend/src/staff.ts @@ -1,4 +1,4 @@ -import { env } from "./env"; +import { env } from "./env.js"; /** * Zeppelin staff have full access to the dashboard diff --git a/backend/src/templateFormatter.test.ts b/backend/src/templateFormatter.test.ts index 1713f8393..f906e054c 100644 --- a/backend/src/templateFormatter.test.ts +++ b/backend/src/templateFormatter.test.ts @@ -1,5 +1,5 @@ import test from "ava"; -import { parseTemplate, renderParsedTemplate, renderTemplate, TemplateSafeValueContainer } from "./templateFormatter"; +import { parseTemplate, renderParsedTemplate, renderTemplate, TemplateSafeValueContainer } from "./templateFormatter.js"; test("Parses plain string templates correctly", (t) => { const result = parseTemplate("foo bar baz"); diff --git a/backend/src/templateFormatter.ts b/backend/src/templateFormatter.ts index 299efb2e5..db053d3ee 100644 --- a/backend/src/templateFormatter.ts +++ b/backend/src/templateFormatter.ts @@ -1,5 +1,5 @@ import seedrandom from "seedrandom"; -import { get, has } from "./utils"; +import { get, has } from "./utils.js"; const TEMPLATE_CACHE_SIZE = 200; const templateCache: Map = new Map(); diff --git a/backend/src/threadsSignalFix.ts b/backend/src/threadsSignalFix.ts index 86f530679..46ffce824 100644 --- a/backend/src/threadsSignalFix.ts +++ b/backend/src/threadsSignalFix.ts @@ -6,7 +6,7 @@ * - This is imported as early as possible to avoid removing our own signal handlers */ import "threads"; -import { env } from "./env"; +import { env } from "./env.js"; if (!env.DEBUG) { process.removeAllListeners("SIGINT"); process.removeAllListeners("SIGTERM"); diff --git a/backend/src/types.ts b/backend/src/types.ts index b9c2e4d80..9b7dc4f41 100644 --- a/backend/src/types.ts +++ b/backend/src/types.ts @@ -1,6 +1,6 @@ import { BaseConfig, Knub } from "knub"; import z, { ZodTypeAny } from "zod"; -import { zSnowflake } from "./utils"; +import { zSnowflake } from "./utils.js"; export interface ZeppelinGuildConfig extends BaseConfig { success_emoji?: string; diff --git a/backend/src/utils.test.ts b/backend/src/utils.test.ts index 461be47be..2c1627d6a 100644 --- a/backend/src/utils.test.ts +++ b/backend/src/utils.test.ts @@ -1,7 +1,7 @@ import test from "ava"; import z from "zod"; -import { convertDelayStringToMS, convertMSToDelayString, getUrlsInString, zAllowedMentions } from "./utils"; -import { ErisAllowedMentionFormat } from "./utils/erisAllowedMentionsToDjsMentionOptions"; +import { convertDelayStringToMS, convertMSToDelayString, getUrlsInString, zAllowedMentions } from "./utils.js"; +import { ErisAllowedMentionFormat } from "./utils/erisAllowedMentionsToDjsMentionOptions.js"; type AssertEquals = TActual extends TExpected ? true : false; diff --git a/backend/src/utils.ts b/backend/src/utils.ts index ca0503e44..b898fbe4e 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -29,18 +29,18 @@ import emojiRegex from "emoji-regex"; import fs from "fs"; import https from "https"; import humanizeDuration from "humanize-duration"; -import { isEqual } from "lodash"; +import isEqual from "lodash/isEqual.js"; import { performance } from "perf_hooks"; -import tlds from "tlds"; +import tlds from "tlds" assert { type: "json" }; import tmp from "tmp"; import { URL } from "url"; import { z, ZodEffects, ZodError, ZodRecord, ZodString } from "zod"; -import { ISavedMessageAttachmentData, SavedMessage } from "./data/entities/SavedMessage"; -import { getProfiler } from "./profiler"; -import { SimpleCache } from "./SimpleCache"; -import { sendDM } from "./utils/sendDM"; -import { Brand } from "./utils/typeUtils"; -import { waitForButtonConfirm } from "./utils/waitForInteraction"; +import { ISavedMessageAttachmentData, SavedMessage } from "./data/entities/SavedMessage.js"; +import { getProfiler } from "./profiler.js"; +import { SimpleCache } from "./SimpleCache.js"; +import { sendDM } from "./utils/sendDM.js"; +import { Brand } from "./utils/typeUtils.js"; +import { waitForButtonConfirm } from "./utils/waitForInteraction.js"; const fsp = fs.promises; diff --git a/backend/src/utils/MessageBuffer.ts b/backend/src/utils/MessageBuffer.ts index ea0a0a0e1..ab1380df9 100644 --- a/backend/src/utils/MessageBuffer.ts +++ b/backend/src/utils/MessageBuffer.ts @@ -1,5 +1,5 @@ -import { StrictMessageContent } from "../utils"; -import { calculateEmbedSize } from "./calculateEmbedSize"; +import { StrictMessageContent } from "../utils.js"; +import { calculateEmbedSize } from "./calculateEmbedSize.js"; import Timeout = NodeJS.Timeout; type ConsumeFn = (part: StrictMessageContent) => void; diff --git a/backend/src/utils/async.ts b/backend/src/utils/async.ts index 4c8e9bf2d..988f30724 100644 --- a/backend/src/utils/async.ts +++ b/backend/src/utils/async.ts @@ -1,4 +1,4 @@ -import { Awaitable } from "./typeUtils"; +import { Awaitable } from "./typeUtils.js"; export async function asyncReduce( arr: T[], diff --git a/backend/src/utils/canAssignRole.ts b/backend/src/utils/canAssignRole.ts index 96ec92e43..caa7a791c 100644 --- a/backend/src/utils/canAssignRole.ts +++ b/backend/src/utils/canAssignRole.ts @@ -1,6 +1,6 @@ import { Guild, GuildMember, PermissionsBitField, Role, Snowflake } from "discord.js"; -import { getMissingPermissions } from "./getMissingPermissions"; -import { hasDiscordPermissions } from "./hasDiscordPermissions"; +import { getMissingPermissions } from "./getMissingPermissions.js"; +import { hasDiscordPermissions } from "./hasDiscordPermissions.js"; export function canAssignRole(guild: Guild, member: GuildMember, roleId: string) { if (getMissingPermissions(member.permissions, PermissionsBitField.Flags.ManageRoles)) { diff --git a/backend/src/utils/canReadChannel.ts b/backend/src/utils/canReadChannel.ts index 043a72d2b..c99cb672f 100644 --- a/backend/src/utils/canReadChannel.ts +++ b/backend/src/utils/canReadChannel.ts @@ -1,6 +1,6 @@ import { GuildMember, GuildTextBasedChannel } from "discord.js"; -import { getMissingChannelPermissions } from "./getMissingChannelPermissions"; -import { readChannelPermissions } from "./readChannelPermissions"; +import { getMissingChannelPermissions } from "./getMissingChannelPermissions.js"; +import { readChannelPermissions } from "./readChannelPermissions.js"; export function canReadChannel(channel: GuildTextBasedChannel, member: GuildMember) { // Not missing permissions required to read the channel = can read channel diff --git a/backend/src/utils/createPaginatedMessage.ts b/backend/src/utils/createPaginatedMessage.ts index 18e8f3d04..2f6c6fb3b 100644 --- a/backend/src/utils/createPaginatedMessage.ts +++ b/backend/src/utils/createPaginatedMessage.ts @@ -9,8 +9,8 @@ import { TextBasedChannel, User, } from "discord.js"; -import { MINUTES, noop } from "../utils"; -import { Awaitable } from "./typeUtils"; +import { MINUTES, noop } from "../utils.js"; +import { Awaitable } from "./typeUtils.js"; import Timeout = NodeJS.Timeout; export type LoadPageFn = (page: number) => Awaitable; diff --git a/backend/src/utils/crypt.test.ts b/backend/src/utils/crypt.test.ts index c9652a970..ef9cb979a 100644 --- a/backend/src/utils/crypt.test.ts +++ b/backend/src/utils/crypt.test.ts @@ -1,5 +1,5 @@ import test from "ava"; -import { decrypt, encrypt } from "./crypt"; +import { decrypt, encrypt } from "./crypt.js"; test("encrypt() followed by decrypt()", async (t) => { const original = "banana 123 👀 💕"; // Includes emojis to verify utf8 stuff works diff --git a/backend/src/utils/crypt.ts b/backend/src/utils/crypt.ts index 5d18e028a..4db9241e5 100644 --- a/backend/src/utils/crypt.ts +++ b/backend/src/utils/crypt.ts @@ -1,7 +1,7 @@ import { Pool, spawn, Worker } from "threads"; -import { env } from "../env"; -import "../threadsSignalFix"; -import { MINUTES } from "../utils"; +import { env } from "../env.js"; +import "../threadsSignalFix.js"; +import { MINUTES } from "../utils.js"; const pool = Pool(() => spawn(new Worker("./cryptWorker"), { timeout: 10 * MINUTES }), 8); diff --git a/backend/src/utils/cryptHelpers.ts b/backend/src/utils/cryptHelpers.ts index c09204362..d740dcc48 100644 --- a/backend/src/utils/cryptHelpers.ts +++ b/backend/src/utils/cryptHelpers.ts @@ -1,4 +1,4 @@ -import { decrypt, encrypt } from "./crypt"; +import { decrypt, encrypt } from "./crypt.js"; export async function encryptJson(obj: any): Promise { const serialized = JSON.stringify(obj); diff --git a/backend/src/utils/cryptWorker.ts b/backend/src/utils/cryptWorker.ts index be5e6df09..29182f0bc 100644 --- a/backend/src/utils/cryptWorker.ts +++ b/backend/src/utils/cryptWorker.ts @@ -1,5 +1,5 @@ import crypto from "crypto"; -import { expose } from "threads"; +import { expose } from "threads/worker"; const ALGORITHM = "aes-256-gcm"; diff --git a/backend/src/utils/easyProfiler.ts b/backend/src/utils/easyProfiler.ts index 289185263..d34e25710 100644 --- a/backend/src/utils/easyProfiler.ts +++ b/backend/src/utils/easyProfiler.ts @@ -1,6 +1,6 @@ import type { Knub } from "knub"; import { performance } from "perf_hooks"; -import { noop, SECONDS } from "../utils"; +import { noop, SECONDS } from "../utils.js"; type Profiler = Knub["profiler"]; diff --git a/backend/src/utils/findMatchingAuditLogEntry.ts b/backend/src/utils/findMatchingAuditLogEntry.ts index 70e8e4269..ce83010de 100644 --- a/backend/src/utils/findMatchingAuditLogEntry.ts +++ b/backend/src/utils/findMatchingAuditLogEntry.ts @@ -1,5 +1,5 @@ import { AuditLogEvent, Guild, GuildAuditLogsEntry } from "discord.js"; -import { SECONDS, sleep } from "../utils"; +import { SECONDS, sleep } from "../utils.js"; const BATCH_DEBOUNCE_TIME = 2 * SECONDS; const BATCH_FETCH_COUNT_INCREMENT = 10; diff --git a/backend/src/utils/getChunkedEmbedFields.ts b/backend/src/utils/getChunkedEmbedFields.ts index 062f62240..2f93ed677 100644 --- a/backend/src/utils/getChunkedEmbedFields.ts +++ b/backend/src/utils/getChunkedEmbedFields.ts @@ -1,5 +1,5 @@ import { EmbedField } from "discord.js"; -import { chunkMessageLines, emptyEmbedValue } from "../utils"; +import { chunkMessageLines, emptyEmbedValue } from "../utils.js"; export function getChunkedEmbedFields(name: string, value: string): EmbedField[] { const fields: EmbedField[] = []; diff --git a/backend/src/utils/getMissingChannelPermissions.ts b/backend/src/utils/getMissingChannelPermissions.ts index 25f1e9e70..2410968a8 100644 --- a/backend/src/utils/getMissingChannelPermissions.ts +++ b/backend/src/utils/getMissingChannelPermissions.ts @@ -1,5 +1,5 @@ import { GuildMember, GuildTextBasedChannel } from "discord.js"; -import { getMissingPermissions } from "./getMissingPermissions"; +import { getMissingPermissions } from "./getMissingPermissions.js"; /** * @param requiredPermissions Bitmask of required permissions diff --git a/backend/src/utils/loadYamlSafely.ts b/backend/src/utils/loadYamlSafely.ts index 8cc0d90c3..9cfb68aec 100644 --- a/backend/src/utils/loadYamlSafely.ts +++ b/backend/src/utils/loadYamlSafely.ts @@ -1,5 +1,5 @@ import yaml from "js-yaml"; -import { validateNoObjectAliases } from "./validateNoObjectAliases"; +import { validateNoObjectAliases } from "./validateNoObjectAliases.js"; /** * Loads a YAML file safely while removing object anchors/aliases (including arrays) diff --git a/backend/src/utils/lockNameHelpers.ts b/backend/src/utils/lockNameHelpers.ts index 81f3bc04f..f01553c64 100644 --- a/backend/src/utils/lockNameHelpers.ts +++ b/backend/src/utils/lockNameHelpers.ts @@ -1,5 +1,5 @@ import { GuildMember, Message, User } from "discord.js"; -import { SavedMessage } from "../data/entities/SavedMessage"; +import { SavedMessage } from "../data/entities/SavedMessage.js"; export function allStarboardsLock() { return `starboards`; diff --git a/backend/src/utils/mergeRegexes.ts b/backend/src/utils/mergeRegexes.ts index b503d12e6..0aeea143c 100644 --- a/backend/src/utils/mergeRegexes.ts +++ b/backend/src/utils/mergeRegexes.ts @@ -1,4 +1,4 @@ -import { categorize } from "./categorize"; +import { categorize } from "./categorize.js"; const hasBackreference = /(?:^|[^\\]|[\\]{2})\\\d+/; diff --git a/backend/src/utils/messageIsEmpty.ts b/backend/src/utils/messageIsEmpty.ts index 4721f7eb2..d4c20ba69 100644 --- a/backend/src/utils/messageIsEmpty.ts +++ b/backend/src/utils/messageIsEmpty.ts @@ -1,6 +1,6 @@ import { MessageCreateOptions } from "discord.js"; import { StrictMessageContent } from "../utils.js"; -import { messageHasContent } from "./messageHasContent"; +import { messageHasContent } from "./messageHasContent.js"; export function messageIsEmpty(content: string | MessageCreateOptions | StrictMessageContent): boolean { return !messageHasContent(content); diff --git a/backend/src/utils/missingPermissionError.ts b/backend/src/utils/missingPermissionError.ts index e19ecb9bb..136f7530e 100644 --- a/backend/src/utils/missingPermissionError.ts +++ b/backend/src/utils/missingPermissionError.ts @@ -1,4 +1,4 @@ -import { getPermissionNames } from "./getPermissionNames"; +import { getPermissionNames } from "./getPermissionNames.js"; export function missingPermissionError(missingPermissions: number | bigint): string { const permissionNames = getPermissionNames(missingPermissions); diff --git a/backend/src/utils/normalizeText.test.ts b/backend/src/utils/normalizeText.test.ts index cd5a139c8..549ee062c 100644 --- a/backend/src/utils/normalizeText.test.ts +++ b/backend/src/utils/normalizeText.test.ts @@ -1,5 +1,5 @@ import test from "ava"; -import { normalizeText } from "./normalizeText"; +import { normalizeText } from "./normalizeText.js"; test("Replaces special characters", (t) => { const from = "𝗧:regional_indicator_e:ᔕ7 𝗧:regional_indicator_e:ᔕ7 𝗧:regional_indicator_e:ᔕ7"; diff --git a/backend/src/utils/parseCustomId.ts b/backend/src/utils/parseCustomId.ts index b2ca10096..772da2dae 100644 --- a/backend/src/utils/parseCustomId.ts +++ b/backend/src/utils/parseCustomId.ts @@ -1,4 +1,4 @@ -import { logger } from "../logger"; +import { logger } from "../logger.js"; const customIdFormat = /^([^:]+):\d+:(.*)$/; diff --git a/backend/src/utils/permissionNames.ts b/backend/src/utils/permissionNames.ts index ca4922de5..e888ab3c2 100644 --- a/backend/src/utils/permissionNames.ts +++ b/backend/src/utils/permissionNames.ts @@ -1,5 +1,5 @@ import type { PermissionFlagsBits } from "discord.js"; -import { EMPTY_CHAR } from "../utils"; +import { EMPTY_CHAR } from "../utils.js"; export const PERMISSION_NAMES = { AddReactions: "Add Reactions", diff --git a/backend/src/utils/resolveChannelIds.ts b/backend/src/utils/resolveChannelIds.ts index 7f3bf1383..5a282187d 100644 --- a/backend/src/utils/resolveChannelIds.ts +++ b/backend/src/utils/resolveChannelIds.ts @@ -1,7 +1,7 @@ import { CategoryChannel, Channel } from "discord.js"; -import { isDmChannel } from "./isDmChannel"; -import { isGuildChannel } from "./isGuildChannel"; -import { isThreadChannel } from "./isThreadChannel"; +import { isDmChannel } from "./isDmChannel.js"; +import { isGuildChannel } from "./isGuildChannel.js"; +import { isThreadChannel } from "./isThreadChannel.js"; type ResolvedChannelIds = { category: string | null; diff --git a/backend/src/utils/resolveMessageTarget.ts b/backend/src/utils/resolveMessageTarget.ts index 2e3258a40..cb9dccfec 100644 --- a/backend/src/utils/resolveMessageTarget.ts +++ b/backend/src/utils/resolveMessageTarget.ts @@ -1,7 +1,7 @@ import { GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; -import { getChannelIdFromMessageId } from "../data/getChannelIdFromMessageId"; -import { isSnowflake } from "../utils"; +import { getChannelIdFromMessageId } from "../data/getChannelIdFromMessageId.js"; +import { isSnowflake } from "../utils.js"; const channelAndMessageIdRegex = /^(\d+)[-/](\d+)$/; const messageLinkRegex = /^https:\/\/(?:\w+\.)?discord(?:app)?\.com\/channels\/\d+\/(\d+)\/(\d+)$/i; diff --git a/backend/src/utils/sendDM.ts b/backend/src/utils/sendDM.ts index bfcfe97e0..f1ca6fc61 100644 --- a/backend/src/utils/sendDM.ts +++ b/backend/src/utils/sendDM.ts @@ -1,6 +1,6 @@ import { MessagePayload, User } from "discord.js"; -import { logger } from "../logger"; -import { HOURS, createChunkedMessage, isDiscordAPIError } from "../utils"; +import { logger } from "../logger.js"; +import { HOURS, createChunkedMessage, isDiscordAPIError } from "../utils.js"; import Timeout = NodeJS.Timeout; let dmsDisabled = false; diff --git a/backend/src/utils/snowflakeToTimestamp.ts b/backend/src/utils/snowflakeToTimestamp.ts index 09494eed0..b1442235b 100644 --- a/backend/src/utils/snowflakeToTimestamp.ts +++ b/backend/src/utils/snowflakeToTimestamp.ts @@ -1,4 +1,4 @@ -import { isValidSnowflake } from "../utils"; +import { isValidSnowflake } from "../utils.js"; /** * @return Unix timestamp in milliseconds diff --git a/backend/src/utils/templateSafeObjects.ts b/backend/src/utils/templateSafeObjects.ts index 06ed04b13..3a65aa8da 100644 --- a/backend/src/utils/templateSafeObjects.ts +++ b/backend/src/utils/templateSafeObjects.ts @@ -13,20 +13,20 @@ import { User, } from "discord.js"; import { GuildPluginData } from "knub"; -import { Case } from "../data/entities/Case"; +import { Case } from "../data/entities/Case.js"; import { ISavedMessageAttachmentData, ISavedMessageData, ISavedMessageEmbedData, ISavedMessageStickerData, SavedMessage, -} from "../data/entities/SavedMessage"; +} from "../data/entities/SavedMessage.js"; import { TemplateSafeValueContainer, TypedTemplateSafeValueContainer, ingestDataIntoTemplateSafeValueContainer, -} from "../templateFormatter"; -import { UnknownUser, renderUsername } from "../utils"; +} from "../templateFormatter.js"; +import { UnknownUser, renderUsername } from "../utils.js"; type InputProps = Omit< { diff --git a/backend/src/utils/validateNoObjectAliases.test.ts b/backend/src/utils/validateNoObjectAliases.test.ts index b418f72bb..b56159ef6 100644 --- a/backend/src/utils/validateNoObjectAliases.test.ts +++ b/backend/src/utils/validateNoObjectAliases.test.ts @@ -1,5 +1,5 @@ import test from "ava"; -import { ObjectAliasError, validateNoObjectAliases } from "./validateNoObjectAliases"; +import { ObjectAliasError, validateNoObjectAliases } from "./validateNoObjectAliases.js"; test("validateNoObjectAliases() disallows object aliases at top level", (t) => { const obj: any = { diff --git a/backend/src/utils/waitForInteraction.ts b/backend/src/utils/waitForInteraction.ts index 261da4da3..ec44fb7c8 100644 --- a/backend/src/utils/waitForInteraction.ts +++ b/backend/src/utils/waitForInteraction.ts @@ -9,7 +9,7 @@ import { } from "discord.js"; import moment from "moment"; import { v4 as uuidv4 } from "uuid"; -import { noop } from "../utils"; +import { noop } from "../utils.js"; export async function waitForButtonConfirm( channel: GuildTextBasedChannel, diff --git a/backend/src/utils/zColor.ts b/backend/src/utils/zColor.ts index 1bc3ae924..4961b67df 100644 --- a/backend/src/utils/zColor.ts +++ b/backend/src/utils/zColor.ts @@ -1,6 +1,6 @@ import z from "zod"; -import { parseColor } from "./parseColor"; -import { rgbToInt } from "./rgbToInt"; +import { parseColor } from "./parseColor.js"; +import { rgbToInt } from "./rgbToInt.js"; export const zColor = z.string().transform((val, ctx) => { const parsedColor = parseColor(val); diff --git a/backend/src/utils/zValidTimezone.ts b/backend/src/utils/zValidTimezone.ts index b83c47c10..7757de058 100644 --- a/backend/src/utils/zValidTimezone.ts +++ b/backend/src/utils/zValidTimezone.ts @@ -1,5 +1,5 @@ import { ZodString } from "zod"; -import { isValidTimezone } from "./isValidTimezone"; +import { isValidTimezone } from "./isValidTimezone.js"; export function zValidTimezone(z: Z) { return z.refine((val) => isValidTimezone(val), { diff --git a/backend/src/validateActiveConfigs.ts b/backend/src/validateActiveConfigs.ts index f985fd142..327f97dbb 100644 --- a/backend/src/validateActiveConfigs.ts +++ b/backend/src/validateActiveConfigs.ts @@ -1,9 +1,11 @@ -import { YAMLException } from "js-yaml"; -import { validateGuildConfig } from "./configValidator"; -import { Configs } from "./data/Configs"; -import { connect, disconnect } from "./data/db"; -import { loadYamlSafely } from "./utils/loadYamlSafely"; -import { ObjectAliasError } from "./utils/validateNoObjectAliases"; +import jsYaml from "js-yaml"; +import { validateGuildConfig } from "./configValidator.js"; +import { Configs } from "./data/Configs.js"; +import { connect, disconnect } from "./data/db.js"; +import { loadYamlSafely } from "./utils/loadYamlSafely.js"; +import { ObjectAliasError } from "./utils/validateNoObjectAliases.js"; + +const YAMLException = jsYaml.YAMLException; function writeError(key: string, error: string) { const indented = error diff --git a/backend/start-dev.js b/backend/start-dev.js index 70c912f2e..186f3e95a 100644 --- a/backend/start-dev.js +++ b/backend/start-dev.js @@ -3,7 +3,7 @@ * Used with tsc-watch for restarting on watch. */ -const childProcess = require("child_process"); +import childProcess from "node:child_process"; const cmd = process.platform === "win32" ? "npm.cmd" : "npm"; diff --git a/package-lock.json b/package-lock.json index 239f9d254..236ebffb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "dashboard" ], "devDependencies": { + "@types/node": "^20.12.6", "@typescript-eslint/eslint-plugin": "^5.59.5", "@typescript-eslint/parser": "^5.59.5", "eslint": "^8.40.0", @@ -45,12 +46,7 @@ "knub": "^32.0.0-next.21", "knub-command-manager": "^9.1.0", "last-commit-log": "^2.1.0", - "lodash.chunk": "^4.2.0", - "lodash.clonedeep": "^4.5.0", - "lodash.difference": "^4.5.0", - "lodash.intersection": "^4.4.0", - "lodash.isequal": "^4.5.0", - "lodash.pick": "^4.4.0", + "lodash": "^4.17.21", "moment-timezone": "^0.5.21", "multer": "^1.4.5-lts.1", "mysql2": "^3.9.3", @@ -84,7 +80,6 @@ "@types/lodash.at": "^4.6.3", "@types/moment-timezone": "^0.5.6", "@types/multer": "^1.4.7", - "@types/node": "^18.16.3", "@types/passport": "^1.0.0", "@types/passport-oauth2": "^1.4.8", "@types/passport-strategy": "^0.2.35", @@ -98,15 +93,6 @@ "zod-to-json-schema": "^3.22.3" } }, - "backend/node_modules/@types/node": { - "version": "18.19.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.14.tgz", - "integrity": "sha512-EnQ4Us2rmOS64nHDWr0XqAD8DsO6f3XR6lf9UIIrZQpUzPVdN/oPuEzfDWNHSyXLvoGgjuEm/sPwFGSSs35Wtg==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, "backend/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -4136,9 +4122,12 @@ } }, "node_modules/@types/node": { - "version": "20.3.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", - "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==" + "version": "20.12.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.6.tgz", + "integrity": "sha512-3KurE8taB8GCvZBPngVbp0lk5CKi8M9f9k1rsADh0Evdz5SzJ+Q+Hx9uHoFGsLnLnd1xmkDQr2hVhlA0Mn0lKQ==", + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/node-forge": { "version": "1.3.11", @@ -12971,26 +12960,11 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, - "node_modules/lodash.difference": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==" - }, "node_modules/lodash.flatten": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==" }, - "node_modules/lodash.intersection": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.intersection/-/lodash.intersection-4.4.0.tgz", - "integrity": "sha512-N+L0cCfnqMv6mxXtSPeKt+IavbOBBSiAEkKyLasZ8BVcP9YXQgxLO12oPR8OyURwKV8l5vJKiE1M8aS70heuMg==" - }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" - }, "node_modules/lodash.memoize": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", @@ -13002,11 +12976,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==" - }, "node_modules/lodash.snakecase": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", @@ -21726,8 +21695,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", diff --git a/package.json b/package.json index 813142e8d..20ec76ef1 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "start-dashboard": "cd dashboard && node serve.js" }, "devDependencies": { + "@types/node": "^20.12.6", "@typescript-eslint/eslint-plugin": "^5.59.5", "@typescript-eslint/parser": "^5.59.5", "eslint": "^8.40.0", From 8ad12a91adcfa2815ca9e7ba7f0170a5b274b834 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 9 Apr 2024 21:12:35 +0300 Subject: [PATCH 05/11] refactor: remove obsolete index re-exports from /shared --- backend/src/api/guilds.ts | 2 +- backend/src/api/guilds/importExport.ts | 2 +- backend/src/api/guilds/misc.ts | 2 +- backend/src/api/permissions.ts | 2 +- backend/src/data/ApiPermissionAssignments.ts | 2 +- backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts | 2 +- .../src/plugins/BotControl/commands/AddServerFromInviteCmd.ts | 2 +- backend/src/plugins/BotControl/commands/AllowServerCmd.ts | 2 +- shared/package.json | 1 - shared/src/index.ts | 1 - 10 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 shared/src/index.ts diff --git a/backend/src/api/guilds.ts b/backend/src/api/guilds.ts index afe881b5b..87fdfee9e 100644 --- a/backend/src/api/guilds.ts +++ b/backend/src/api/guilds.ts @@ -1,4 +1,4 @@ -import { ApiPermissions } from "@zeppelinbot/shared"; +import { ApiPermissions } from "@zeppelinbot/shared/apiPermissions.js"; import express, { Request, Response } from "express"; import jsYaml from "js-yaml"; import moment from "moment-timezone"; diff --git a/backend/src/api/guilds/importExport.ts b/backend/src/api/guilds/importExport.ts index 132facff7..28db0e6a9 100644 --- a/backend/src/api/guilds/importExport.ts +++ b/backend/src/api/guilds/importExport.ts @@ -1,4 +1,4 @@ -import { ApiPermissions } from "@zeppelinbot/shared"; +import { ApiPermissions } from "@zeppelinbot/shared/apiPermissions.js"; import express, { Request, Response } from "express"; import moment from "moment-timezone"; import { z } from "zod"; diff --git a/backend/src/api/guilds/misc.ts b/backend/src/api/guilds/misc.ts index af956b6d3..3ab72dd75 100644 --- a/backend/src/api/guilds/misc.ts +++ b/backend/src/api/guilds/misc.ts @@ -1,4 +1,4 @@ -import { ApiPermissions } from "@zeppelinbot/shared"; +import { ApiPermissions } from "@zeppelinbot/shared/apiPermissions.js"; import express, { Request, Response } from "express"; import jsYaml from "js-yaml"; import moment from "moment-timezone"; diff --git a/backend/src/api/permissions.ts b/backend/src/api/permissions.ts index e58e3a8f1..6a809a007 100644 --- a/backend/src/api/permissions.ts +++ b/backend/src/api/permissions.ts @@ -1,4 +1,4 @@ -import { ApiPermissions, hasPermission, permissionArrToSet } from "@zeppelinbot/shared"; +import { ApiPermissions, hasPermission, permissionArrToSet } from "@zeppelinbot/shared/apiPermissions.js"; import { Request, Response } from "express"; import { ApiPermissionAssignments } from "../data/ApiPermissionAssignments.js"; import { isStaff } from "../staff.js"; diff --git a/backend/src/data/ApiPermissionAssignments.ts b/backend/src/data/ApiPermissionAssignments.ts index b0c1ece94..3c1ef2c6c 100644 --- a/backend/src/data/ApiPermissionAssignments.ts +++ b/backend/src/data/ApiPermissionAssignments.ts @@ -1,4 +1,4 @@ -import { ApiPermissions } from "@zeppelinbot/shared"; +import { ApiPermissions } from "@zeppelinbot/shared/apiPermissions.js"; import { Repository } from "typeorm"; import { ApiAuditLog } from "./ApiAuditLog.js"; import { BaseRepository } from "./BaseRepository.js"; diff --git a/backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts b/backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts index f0fd1f903..42cfc25d0 100644 --- a/backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts +++ b/backend/src/plugins/BotControl/commands/AddDashboardUserCmd.ts @@ -1,4 +1,4 @@ -import { ApiPermissions } from "@zeppelinbot/shared"; +import { ApiPermissions } from "@zeppelinbot/shared/apiPermissions.js"; import { commandTypeHelpers as ct } from "../../../commandTypes.js"; import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; import { renderUsername } from "../../../utils.js"; diff --git a/backend/src/plugins/BotControl/commands/AddServerFromInviteCmd.ts b/backend/src/plugins/BotControl/commands/AddServerFromInviteCmd.ts index 19a6d5715..4bda1a9df 100644 --- a/backend/src/plugins/BotControl/commands/AddServerFromInviteCmd.ts +++ b/backend/src/plugins/BotControl/commands/AddServerFromInviteCmd.ts @@ -1,4 +1,4 @@ -import { ApiPermissions } from "@zeppelinbot/shared"; +import { ApiPermissions } from "@zeppelinbot/shared/apiPermissions.js"; import moment from "moment-timezone"; import { commandTypeHelpers as ct } from "../../../commandTypes.js"; import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; diff --git a/backend/src/plugins/BotControl/commands/AllowServerCmd.ts b/backend/src/plugins/BotControl/commands/AllowServerCmd.ts index d68ee4534..6dd0751fe 100644 --- a/backend/src/plugins/BotControl/commands/AllowServerCmd.ts +++ b/backend/src/plugins/BotControl/commands/AllowServerCmd.ts @@ -1,4 +1,4 @@ -import { ApiPermissions } from "@zeppelinbot/shared"; +import { ApiPermissions } from "@zeppelinbot/shared/apiPermissions.js"; import moment from "moment-timezone"; import { commandTypeHelpers as ct } from "../../../commandTypes.js"; import { isStaffPreFilter, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js"; diff --git a/shared/package.json b/shared/package.json index 39bcb2d9f..2c76a15f1 100644 --- a/shared/package.json +++ b/shared/package.json @@ -5,7 +5,6 @@ "private": true, "type": "module", "exports": { - ".": "./dist/index.js", "./*": "./dist/*" }, "scripts": { diff --git a/shared/src/index.ts b/shared/src/index.ts deleted file mode 100644 index 3410a406f..000000000 --- a/shared/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./apiPermissions.js"; From dfb2b8227238ba82ffe646cd925dc0047b081aa1 Mon Sep 17 00:00:00 2001 From: Ruby Date: Sun, 12 May 2024 14:55:21 +0200 Subject: [PATCH 06/11] feat: pretty_name for automod --- backend/src/data/DefaultLogMessages.json | 2 +- backend/src/plugins/Automod/actions/alert.ts | 4 +++- backend/src/plugins/Automod/actions/log.ts | 3 ++- backend/src/plugins/Automod/functions/runAutomod.ts | 8 +++++++- backend/src/plugins/Automod/helpers.ts | 1 + backend/src/plugins/Automod/types.ts | 1 + backend/src/plugins/Logs/logFunctions/logAutomodAction.ts | 2 ++ 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/backend/src/data/DefaultLogMessages.json b/backend/src/data/DefaultLogMessages.json index 53534132c..ff0d12cae 100644 --- a/backend/src/data/DefaultLogMessages.json +++ b/backend/src/data/DefaultLogMessages.json @@ -86,7 +86,7 @@ "BOT_ALERT": "{timestamp} ⚠ **BOT ALERT:** {tmplEval(body)}", "DM_FAILED": "{timestamp} \uD83D\uDEA7 Failed to send DM ({source}) to {userMention(user)}", - "AUTOMOD_ACTION": "{timestamp} \uD83E\uDD16 Automod rule **{rule}** triggered by {userMention(users)}\n{matchSummary}\nActions taken: **{actionsTaken}**", + "AUTOMOD_ACTION": "{timestamp} \uD83E\uDD16 Automod rule **{if(not(prettyName), rule, prettyName)}** triggered by {userMention(users)}\n{matchSummary}\nActions taken: **{actionsTaken}**", "SET_ANTIRAID_USER": "{timestamp} ⚔ {userMention(user)} set anti-raid to **{level}**", "SET_ANTIRAID_AUTO": "{timestamp} ⚔ Anti-raid automatically set to **{level}**" } diff --git a/backend/src/plugins/Automod/actions/alert.ts b/backend/src/plugins/Automod/actions/alert.ts index d21fb4d5e..28be6ff44 100644 --- a/backend/src/plugins/Automod/actions/alert.ts +++ b/backend/src/plugins/Automod/actions/alert.ts @@ -34,7 +34,7 @@ const configSchema = z.object({ export const AlertAction = automodAction({ configSchema, - async apply({ pluginData, contexts, actionConfig, ruleName, matchResult }) { + async apply({ pluginData, contexts, actionConfig, ruleName, matchResult, prettyName }) { const channel = pluginData.guild.channels.cache.get(actionConfig.channel as Snowflake); const logs = pluginData.getPlugin(LogsPlugin); @@ -55,6 +55,7 @@ export const AlertAction = automodAction({ users: safeUsers, actionsTaken, matchSummary: matchResult.summary ?? "", + prettyName, }), ); @@ -69,6 +70,7 @@ export const AlertAction = automodAction({ text, actionsTaken, matchSummary: matchResult.summary, + prettyName, messageLink: theMessageLink, logMessage: validateAndParseMessageContent(logMessage)?.content, }), diff --git a/backend/src/plugins/Automod/actions/log.ts b/backend/src/plugins/Automod/actions/log.ts index dace25f12..f026b4879 100644 --- a/backend/src/plugins/Automod/actions/log.ts +++ b/backend/src/plugins/Automod/actions/log.ts @@ -6,13 +6,14 @@ import { automodAction } from "../helpers"; export const LogAction = automodAction({ configSchema: z.boolean().default(true), - async apply({ pluginData, contexts, ruleName, matchResult }) { + async apply({ pluginData, contexts, ruleName, matchResult, prettyName }) { const users = unique(contexts.map((c) => c.user)).filter(isTruthy); const user = users[0]; const actionsTaken = Object.keys(pluginData.config.get().rules[ruleName].actions).join(", "); pluginData.getPlugin(LogsPlugin).logAutomodAction({ rule: ruleName, + prettyName, user, users, actionsTaken, diff --git a/backend/src/plugins/Automod/functions/runAutomod.ts b/backend/src/plugins/Automod/functions/runAutomod.ts index 4ccc38dee..a0b185f73 100644 --- a/backend/src/plugins/Automod/functions/runAutomod.ts +++ b/backend/src/plugins/Automod/functions/runAutomod.ts @@ -35,6 +35,8 @@ export async function runAutomod(pluginData: GuildPluginData, }); for (const [ruleName, rule] of Object.entries(config.rules)) { + const prettyName = rule.pretty_name; + if (rule.enabled === false) continue; if ( !rule.affects_bots && @@ -100,6 +102,7 @@ export async function runAutomod(pluginData: GuildPluginData, contexts, actionConfig: true, matchResult, + prettyName, }); return; } @@ -113,7 +116,9 @@ export async function runAutomod(pluginData: GuildPluginData, triggerConfig, })) ?? ""; - matchResult.fullSummary = `Triggered automod rule **${ruleName}**\n${matchResult.summary}`.trim(); + matchResult.fullSummary = `Triggered automod rule **${prettyName ?? ruleName}**\n${ + matchResult.summary + }`.trim(); } if (profilingEnabled()) { @@ -147,6 +152,7 @@ export async function runAutomod(pluginData: GuildPluginData, contexts, actionConfig, matchResult, + prettyName, }); if (profilingEnabled()) { diff --git a/backend/src/plugins/Automod/helpers.ts b/backend/src/plugins/Automod/helpers.ts index b4b9f764d..f377a0b3b 100644 --- a/backend/src/plugins/Automod/helpers.ts +++ b/backend/src/plugins/Automod/helpers.ts @@ -59,6 +59,7 @@ type AutomodActionApplyFn = (meta: { contexts: AutomodContext[]; actionConfig: TConfigType; matchResult: AutomodTriggerMatchResult; + prettyName: string | undefined; }) => Awaitable; export interface AutomodActionBlueprint { diff --git a/backend/src/plugins/Automod/types.ts b/backend/src/plugins/Automod/types.ts index 6cf88ad65..1d58e140d 100644 --- a/backend/src/plugins/Automod/types.ts +++ b/backend/src/plugins/Automod/types.ts @@ -61,6 +61,7 @@ const zRule = z.strictObject({ } return ruleName; }), + pretty_name: z.string().optional(), presets: z.array(z.string().max(100)).max(25).default([]), affects_bots: z.boolean().default(false), affects_self: z.boolean().default(false), diff --git a/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts b/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts index 2a2fd69c5..f0a20f215 100644 --- a/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts +++ b/backend/src/plugins/Logs/logFunctions/logAutomodAction.ts @@ -8,6 +8,7 @@ import { log } from "../util/log"; interface LogAutomodActionData { rule: string; + prettyName: string | undefined; user?: User | null; users: User[]; actionsTaken: string; @@ -20,6 +21,7 @@ export function logAutomodAction(pluginData: GuildPluginData, da LogType.AUTOMOD_ACTION, createTypedTemplateSafeValueContainer({ rule: data.rule, + prettyName: data.prettyName, user: data.user ? userToTemplateSafeUser(data.user) : null, users: data.users.map((user) => userToTemplateSafeUser(user)), actionsTaken: data.actionsTaken, From db52c61df4ff30f97c49b146d31aba4510576ca2 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 19 May 2024 10:45:21 +0000 Subject: [PATCH 07/11] feat: require info.configSchema for all zeppelin plugins --- backend/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/types.ts b/backend/src/types.ts index 9b7dc4f41..253198892 100644 --- a/backend/src/types.ts +++ b/backend/src/types.ts @@ -36,11 +36,11 @@ export type TMarkdown = string; export interface ZeppelinPluginInfo { showInDocs: boolean; prettyName: string; + configSchema: ZodTypeAny; description?: TMarkdown; usageGuide?: TMarkdown; configurationGuide?: TMarkdown; legacy?: boolean; - configSchema?: ZodTypeAny; } export interface CommandInfo { From 3b0a0b311d8ea3eeea4cccbcd29de2c079decba7 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 19 May 2024 10:46:43 +0000 Subject: [PATCH 08/11] feat: add missing info.configSchemas --- backend/src/plugins/AutoDelete/info.ts | 2 ++ backend/src/plugins/AutoReactions/info.ts | 2 ++ backend/src/plugins/Automod/info.ts | 2 ++ backend/src/plugins/Cases/info.ts | 2 ++ backend/src/plugins/Censor/info.ts | 2 ++ backend/src/plugins/CompanionChannels/info.ts | 2 ++ backend/src/plugins/ContextMenus/info.ts | 2 ++ backend/src/plugins/CustomEvents/info.ts | 2 ++ backend/src/plugins/GuildConfigReloader/info.ts | 2 ++ backend/src/plugins/GuildConfigReloader/types.ts | 4 ++++ backend/src/plugins/GuildInfoSaver/info.ts | 2 ++ backend/src/plugins/GuildInfoSaver/types.ts | 4 ++++ backend/src/plugins/GuildMemberCache/info.ts | 2 ++ backend/src/plugins/GuildMemberCache/types.ts | 4 ++++ backend/src/plugins/InternalPoster/info.ts | 2 ++ backend/src/plugins/InternalPoster/types.ts | 4 ++++ backend/src/plugins/MessageSaver/info.ts | 2 ++ backend/src/plugins/RoleManager/info.ts | 2 ++ backend/src/plugins/UsernameSaver/info.ts | 2 ++ 19 files changed, 46 insertions(+) diff --git a/backend/src/plugins/AutoDelete/info.ts b/backend/src/plugins/AutoDelete/info.ts index 8a4438a30..dc4ac730a 100644 --- a/backend/src/plugins/AutoDelete/info.ts +++ b/backend/src/plugins/AutoDelete/info.ts @@ -1,8 +1,10 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zAutoDeleteConfig } from "./types.js"; export const autoDeletePluginInfo: ZeppelinPluginInfo = { showInDocs: true, prettyName: "Auto-delete", description: "Allows Zeppelin to auto-delete messages from a channel after a delay", configurationGuide: "Maximum deletion delay is currently 5 minutes", + configSchema: zAutoDeleteConfig, }; diff --git a/backend/src/plugins/AutoReactions/info.ts b/backend/src/plugins/AutoReactions/info.ts index 05a41b74a..a28175020 100644 --- a/backend/src/plugins/AutoReactions/info.ts +++ b/backend/src/plugins/AutoReactions/info.ts @@ -1,5 +1,6 @@ import { ZeppelinPluginInfo } from "../../types.js"; import { trimPluginDescription } from "../../utils.js"; +import { zAutoReactionsConfig } from "./types.js"; export const autoReactionsInfo: ZeppelinPluginInfo = { showInDocs: true, @@ -7,4 +8,5 @@ export const autoReactionsInfo: ZeppelinPluginInfo = { description: trimPluginDescription(` Allows setting up automatic reactions to all new messages on a channel `), + configSchema: zAutoReactionsConfig, }; diff --git a/backend/src/plugins/Automod/info.ts b/backend/src/plugins/Automod/info.ts index 7dd945604..5c3efeafb 100644 --- a/backend/src/plugins/Automod/info.ts +++ b/backend/src/plugins/Automod/info.ts @@ -1,9 +1,11 @@ import { ZeppelinPluginInfo } from "../../types.js"; import { trimPluginDescription } from "../../utils.js"; +import { zAutomodConfig } from "./types.js"; export const automodPluginInfo: ZeppelinPluginInfo = { showInDocs: true, prettyName: "Automod", + configSchema: zAutomodConfig, description: trimPluginDescription(` Allows specifying automated actions in response to triggers. Example use cases include word filtering and spam prevention. `), diff --git a/backend/src/plugins/Cases/info.ts b/backend/src/plugins/Cases/info.ts index fa446a248..4cda78db0 100644 --- a/backend/src/plugins/Cases/info.ts +++ b/backend/src/plugins/Cases/info.ts @@ -1,9 +1,11 @@ import { ZeppelinPluginInfo } from "../../types.js"; import { trimPluginDescription } from "../../utils.js"; +import { zCasesConfig } from "./types.js"; export const casesPluginInfo: ZeppelinPluginInfo = { showInDocs: true, prettyName: "Cases", + configSchema: zCasesConfig, description: trimPluginDescription(` This plugin contains basic configuration for cases created by other plugins `), diff --git a/backend/src/plugins/Censor/info.ts b/backend/src/plugins/Censor/info.ts index 888cea1de..3cb0cc5f5 100644 --- a/backend/src/plugins/Censor/info.ts +++ b/backend/src/plugins/Censor/info.ts @@ -1,10 +1,12 @@ import { ZeppelinPluginInfo } from "../../types.js"; import { trimPluginDescription } from "../../utils.js"; +import { zCensorConfig } from "./types.js"; export const censorPluginInfo: ZeppelinPluginInfo = { showInDocs: true, legacy: true, prettyName: "Censor", + configSchema: zCensorConfig, description: trimPluginDescription(` Censor words, tokens, links, regex, etc. For more advanced filtering, check out the Automod plugin! diff --git a/backend/src/plugins/CompanionChannels/info.ts b/backend/src/plugins/CompanionChannels/info.ts index c482618b4..d4fb78603 100644 --- a/backend/src/plugins/CompanionChannels/info.ts +++ b/backend/src/plugins/CompanionChannels/info.ts @@ -1,9 +1,11 @@ import { ZeppelinPluginInfo } from "../../types.js"; import { trimPluginDescription } from "../../utils.js"; +import { zCompanionChannelsConfig } from "./types.js"; export const companionChannelsPluginInfo: ZeppelinPluginInfo = { showInDocs: true, prettyName: "Companion channels", + configSchema: zCompanionChannelsConfig, description: trimPluginDescription(` Set up 'companion channels' between text and voice channels. Once set up, any time a user joins one of the specified voice channels, diff --git a/backend/src/plugins/ContextMenus/info.ts b/backend/src/plugins/ContextMenus/info.ts index d67eb711c..508ca811d 100644 --- a/backend/src/plugins/ContextMenus/info.ts +++ b/backend/src/plugins/ContextMenus/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zContextMenusConfig } from "./types.js"; export const contextMenuPluginInfo: ZeppelinPluginInfo = { showInDocs: false, prettyName: "Context menu", + configSchema: zContextMenusConfig, }; diff --git a/backend/src/plugins/CustomEvents/info.ts b/backend/src/plugins/CustomEvents/info.ts index 4825cc369..f9a8cec02 100644 --- a/backend/src/plugins/CustomEvents/info.ts +++ b/backend/src/plugins/CustomEvents/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zCustomEventsConfig } from "./types.js"; export const customEventsPluginInfo: ZeppelinPluginInfo = { prettyName: "Custom events", showInDocs: false, + configSchema: zCustomEventsConfig, }; diff --git a/backend/src/plugins/GuildConfigReloader/info.ts b/backend/src/plugins/GuildConfigReloader/info.ts index 2aa6cacd7..00aaa653f 100644 --- a/backend/src/plugins/GuildConfigReloader/info.ts +++ b/backend/src/plugins/GuildConfigReloader/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zGuildConfigReloaderPlugin } from "./types.js"; export const guildConfigReloaderPluginInfo: ZeppelinPluginInfo = { prettyName: "Guild config reloader", showInDocs: false, + configSchema: zGuildConfigReloaderPlugin, }; diff --git a/backend/src/plugins/GuildConfigReloader/types.ts b/backend/src/plugins/GuildConfigReloader/types.ts index 58b439c4a..15222e7dd 100644 --- a/backend/src/plugins/GuildConfigReloader/types.ts +++ b/backend/src/plugins/GuildConfigReloader/types.ts @@ -1,8 +1,12 @@ import { BasePluginType } from "knub"; import { Configs } from "../../data/Configs.js"; import Timeout = NodeJS.Timeout; +import { z } from "zod"; + +export const zGuildConfigReloaderPlugin = z.strictObject({}); export interface GuildConfigReloaderPluginType extends BasePluginType { + config: z.infer; state: { guildConfigs: Configs; unloaded: boolean; diff --git a/backend/src/plugins/GuildInfoSaver/info.ts b/backend/src/plugins/GuildInfoSaver/info.ts index 362873c16..7256e8ccd 100644 --- a/backend/src/plugins/GuildInfoSaver/info.ts +++ b/backend/src/plugins/GuildInfoSaver/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zGuildInfoSaverConfig } from "./types.js"; export const guildInfoSaverPluginInfo: ZeppelinPluginInfo = { prettyName: "Guild info saver", showInDocs: false, + configSchema: zGuildInfoSaverConfig, }; diff --git a/backend/src/plugins/GuildInfoSaver/types.ts b/backend/src/plugins/GuildInfoSaver/types.ts index 4ff63cbae..7b40ee2ab 100644 --- a/backend/src/plugins/GuildInfoSaver/types.ts +++ b/backend/src/plugins/GuildInfoSaver/types.ts @@ -1,6 +1,10 @@ import { BasePluginType } from "knub"; +import { z } from "zod"; + +export const zGuildInfoSaverConfig = z.strictObject({}); export interface GuildInfoSaverPluginType extends BasePluginType { + config: z.infer; state: { updateInterval: NodeJS.Timeout; }; diff --git a/backend/src/plugins/GuildMemberCache/info.ts b/backend/src/plugins/GuildMemberCache/info.ts index 290a6921b..8b2da421d 100644 --- a/backend/src/plugins/GuildMemberCache/info.ts +++ b/backend/src/plugins/GuildMemberCache/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zGuildMemberCacheConfig } from "./types.js"; export const guildMemberCachePluginInfo: ZeppelinPluginInfo = { prettyName: "Guild member cache", showInDocs: false, + configSchema: zGuildMemberCacheConfig, }; diff --git a/backend/src/plugins/GuildMemberCache/types.ts b/backend/src/plugins/GuildMemberCache/types.ts index e38eb6fb1..3e7a7654e 100644 --- a/backend/src/plugins/GuildMemberCache/types.ts +++ b/backend/src/plugins/GuildMemberCache/types.ts @@ -1,7 +1,11 @@ import { BasePluginType } from "knub"; import { GuildMemberCache } from "../../data/GuildMemberCache.js"; +import { z } from "zod"; + +export const zGuildMemberCacheConfig = z.strictObject({}); export interface GuildMemberCachePluginType extends BasePluginType { + config: z.infer; state: { memberCache: GuildMemberCache; saveInterval: NodeJS.Timeout; diff --git a/backend/src/plugins/InternalPoster/info.ts b/backend/src/plugins/InternalPoster/info.ts index 37bab5f01..35870b238 100644 --- a/backend/src/plugins/InternalPoster/info.ts +++ b/backend/src/plugins/InternalPoster/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zInternalPosterConfig } from "./types.js"; export const internalPosterPluginInfo: ZeppelinPluginInfo = { prettyName: "Internal poster", showInDocs: false, + configSchema: zInternalPosterConfig, }; diff --git a/backend/src/plugins/InternalPoster/types.ts b/backend/src/plugins/InternalPoster/types.ts index cf7473537..baf20d3db 100644 --- a/backend/src/plugins/InternalPoster/types.ts +++ b/backend/src/plugins/InternalPoster/types.ts @@ -2,8 +2,12 @@ import { WebhookClient } from "discord.js"; import { BasePluginType } from "knub"; import { Queue } from "../../Queue.js"; import { Webhooks } from "../../data/Webhooks.js"; +import { z } from "zod"; + +export const zInternalPosterConfig = z.strictObject({}); export interface InternalPosterPluginType extends BasePluginType { + config: z.infer; state: { queue: Queue; webhooks: Webhooks; diff --git a/backend/src/plugins/MessageSaver/info.ts b/backend/src/plugins/MessageSaver/info.ts index 2a9b9bda8..7d62a72ae 100644 --- a/backend/src/plugins/MessageSaver/info.ts +++ b/backend/src/plugins/MessageSaver/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zMessageSaverConfig } from "./types.js"; export const messageSaverPluginInfo: ZeppelinPluginInfo = { prettyName: "Message saver", showInDocs: false, + configSchema: zMessageSaverConfig, }; diff --git a/backend/src/plugins/RoleManager/info.ts b/backend/src/plugins/RoleManager/info.ts index 7bc9571e1..9b532990a 100644 --- a/backend/src/plugins/RoleManager/info.ts +++ b/backend/src/plugins/RoleManager/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zRoleManagerConfig } from "./types.js"; export const roleManagerPluginInfo: ZeppelinPluginInfo = { prettyName: "Role manager", showInDocs: false, + configSchema: zRoleManagerConfig, }; diff --git a/backend/src/plugins/UsernameSaver/info.ts b/backend/src/plugins/UsernameSaver/info.ts index 7f9afb5f2..68a65f319 100644 --- a/backend/src/plugins/UsernameSaver/info.ts +++ b/backend/src/plugins/UsernameSaver/info.ts @@ -1,6 +1,8 @@ import { ZeppelinPluginInfo } from "../../types.js"; +import { zUsernameSaverConfig } from "./types.js"; export const usernameSaverPluginInfo: ZeppelinPluginInfo = { showInDocs: false, prettyName: "Username saver", + configSchema: zUsernameSaverConfig, }; From f3d64e2adc6dbffd87ee65c7666dbc50805d1a8a Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 19 May 2024 10:47:47 +0000 Subject: [PATCH 09/11] fix: configSchema in /docs endpoint --- backend/src/api/docs.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/api/docs.ts b/backend/src/api/docs.ts index ff0723a29..cee346a07 100644 --- a/backend/src/api/docs.ts +++ b/backend/src/api/docs.ts @@ -121,8 +121,8 @@ export function initDocs(router: express.Router) { } const plugin = guildPlugins.find((p) => p.name === name)!; - const info = { ...baseInfo }; - delete info.configSchema; + const { configSchema, ...info } = baseInfo; + const formattedConfigSchema = formatZodConfigSchema(configSchema); const messageCommands = (plugin.messageCommands || []).map((cmd) => ({ trigger: cmd.trigger, @@ -134,12 +134,11 @@ export function initDocs(router: express.Router) { })); const defaultOptions = plugin.defaultOptions || {}; - const configSchema = info.configSchema && formatZodConfigSchema(info.configSchema); res.json({ name, info, - configSchema, + configSchema: formattedConfigSchema, defaultOptions, messageCommands, }); From 914efb6fccab8d73b7a05fddb9c552afaea1d6c8 Mon Sep 17 00:00:00 2001 From: rubyowo Date: Sun, 2 Jun 2024 15:21:27 +0000 Subject: [PATCH 10/11] chore: format repo (#482) Begone formatting errors --- backend/src/index.ts | 10 ++++- .../1573248462469-MoveStarboardsToConfig.ts | 39 ++++++++++++------- .../1596994103885-AddCaseNotesForeignKey.ts | 3 +- .../1597015567215-AddLogMessageIdToCases.ts | 3 +- ...597109357201-CreateMemberTimezonesTable.ts | 3 +- .../1617363975046-UpdateCounterTriggers.ts | 3 +- .../plugins/Censor/util/applyFiltersToMsg.ts | 10 ++++- .../src/plugins/GuildConfigReloader/types.ts | 2 +- backend/src/plugins/GuildMemberCache/types.ts | 2 +- backend/src/plugins/InternalPoster/types.ts | 2 +- backend/src/plugins/Logs/LogsPlugin.ts | 2 +- .../Logs/logFunctions/logMessageDelete.ts | 2 +- backend/src/plugins/Logs/types.ts | 2 +- .../src/plugins/Logs/util/getLogMessage.ts | 2 +- .../MessageSaver/MessageSaverPlugin.ts | 7 +++- .../ModActions/commands/CasesUserCmd.ts | 9 ++++- .../ModActions/functions/kickMember.ts | 8 +++- .../ModActions/functions/warnMember.ts | 8 +++- .../Phisherman/functions/getDomainInfo.ts | 6 ++- backend/src/templateFormatter.test.ts | 7 +++- backend/src/utils.ts | 6 ++- 21 files changed, 95 insertions(+), 41 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 10c196128..e74f7629a 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -44,7 +44,15 @@ import { baseGuildPlugins, globalPlugins, guildPlugins } from "./plugins/availab import { setProfiler } from "./profiler.js"; import { logRateLimit } from "./rateLimitStats.js"; import { startUptimeCounter } from "./uptime.js"; -import { MINUTES, SECONDS, errorMessage, isDiscordAPIError, isDiscordHTTPError, sleep, successMessage } from "./utils.js"; +import { + MINUTES, + SECONDS, + errorMessage, + isDiscordAPIError, + isDiscordHTTPError, + sleep, + successMessage, +} from "./utils.js"; import { DecayingCounter } from "./utils/DecayingCounter.js"; import { enableProfiling } from "./utils/easyProfiler.js"; import { loadYamlSafely } from "./utils/loadYamlSafely.js"; diff --git a/backend/src/migrations/1573248462469-MoveStarboardsToConfig.ts b/backend/src/migrations/1573248462469-MoveStarboardsToConfig.ts index e1f967b1f..881fc3e73 100644 --- a/backend/src/migrations/1573248462469-MoveStarboardsToConfig.ts +++ b/backend/src/migrations/1573248462469-MoveStarboardsToConfig.ts @@ -3,18 +3,24 @@ import { MigrationInterface, QueryRunner, Table, TableColumn } from "typeorm"; export class MoveStarboardsToConfig1573248462469 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { // Create a new column for the channel's id - await queryRunner.addColumn("starboard_messages", new TableColumn({ - name: "starboard_channel_id", - type: "bigint", - unsigned: true, - })); + await queryRunner.addColumn( + "starboard_messages", + new TableColumn({ + name: "starboard_channel_id", + type: "bigint", + unsigned: true, + }), + ); // Since we are removing the guild_id with the starboards table, we might want it here - await queryRunner.addColumn("starboard_messages", new TableColumn({ - name: "guild_id", - type: "bigint", - unsigned: true, - })); + await queryRunner.addColumn( + "starboard_messages", + new TableColumn({ + name: "guild_id", + type: "bigint", + unsigned: true, + }), + ); // Migrate the old starboard_id to the new starboard_channel_id await queryRunner.query(` @@ -43,11 +49,14 @@ export class MoveStarboardsToConfig1573248462469 implements MigrationInterface { await queryRunner.dropColumn("starboard_messages", "starboard_channel_id"); await queryRunner.dropColumn("starboard_messages", "guild_id"); - await queryRunner.addColumn("starboard_messages", new TableColumn({ - name: "starboard_id", - type: "int", - unsigned: true, - })); + await queryRunner.addColumn( + "starboard_messages", + new TableColumn({ + name: "starboard_id", + type: "int", + unsigned: true, + }), + ); await queryRunner.query(` ALTER TABLE starboard_messages diff --git a/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts b/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts index b9813a938..93d2dd5ca 100644 --- a/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts +++ b/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts @@ -1,5 +1,4 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; -import { TableForeignKey } from "typeorm"; +import { MigrationInterface, QueryRunner, TableForeignKey } from "typeorm"; export class AddCaseNotesForeignKey1596994103885 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/migrations/1597015567215-AddLogMessageIdToCases.ts b/backend/src/migrations/1597015567215-AddLogMessageIdToCases.ts index cdb0bb973..2ffae66dd 100644 --- a/backend/src/migrations/1597015567215-AddLogMessageIdToCases.ts +++ b/backend/src/migrations/1597015567215-AddLogMessageIdToCases.ts @@ -1,5 +1,4 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; -import { TableColumn } from "typeorm"; +import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; export class AddLogMessageIdToCases1597015567215 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/migrations/1597109357201-CreateMemberTimezonesTable.ts b/backend/src/migrations/1597109357201-CreateMemberTimezonesTable.ts index a826fc603..972ec533b 100644 --- a/backend/src/migrations/1597109357201-CreateMemberTimezonesTable.ts +++ b/backend/src/migrations/1597109357201-CreateMemberTimezonesTable.ts @@ -1,5 +1,4 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; -import { Table } from "typeorm"; +import { MigrationInterface, QueryRunner, Table } from "typeorm"; export class CreateMemberTimezonesTable1597109357201 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/migrations/1617363975046-UpdateCounterTriggers.ts b/backend/src/migrations/1617363975046-UpdateCounterTriggers.ts index 2eae7cfe7..359973458 100644 --- a/backend/src/migrations/1617363975046-UpdateCounterTriggers.ts +++ b/backend/src/migrations/1617363975046-UpdateCounterTriggers.ts @@ -1,5 +1,4 @@ -import { MigrationInterface, QueryRunner, TableColumn, TableIndex } from "typeorm"; -import { TableForeignKey } from "typeorm"; +import { MigrationInterface, QueryRunner, TableColumn, TableForeignKey, TableIndex } from "typeorm"; export class UpdateCounterTriggers1617363975046 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { diff --git a/backend/src/plugins/Censor/util/applyFiltersToMsg.ts b/backend/src/plugins/Censor/util/applyFiltersToMsg.ts index fc363f185..e1cf25a0c 100644 --- a/backend/src/plugins/Censor/util/applyFiltersToMsg.ts +++ b/backend/src/plugins/Censor/util/applyFiltersToMsg.ts @@ -1,11 +1,17 @@ -import { Embed, Invite } from "discord.js"; +import { Invite } from "discord.js"; import escapeStringRegexp from "escape-string-regexp"; import { GuildPluginData } from "knub"; import cloneDeep from "lodash/cloneDeep.js"; import { allowTimeout } from "../../../RegExpRunner.js"; import { ZalgoRegex } from "../../../data/Zalgo.js"; import { ISavedMessageEmbedData, SavedMessage } from "../../../data/entities/SavedMessage.js"; -import { getInviteCodesInString, getUrlsInString, isGuildInvite, resolveInvite, resolveMember } from "../../../utils.js"; +import { + getInviteCodesInString, + getUrlsInString, + isGuildInvite, + resolveInvite, + resolveMember, +} from "../../../utils.js"; import { CensorPluginType } from "../types.js"; import { censorMessage } from "./censorMessage.js"; diff --git a/backend/src/plugins/GuildConfigReloader/types.ts b/backend/src/plugins/GuildConfigReloader/types.ts index 15222e7dd..f9c0ad79e 100644 --- a/backend/src/plugins/GuildConfigReloader/types.ts +++ b/backend/src/plugins/GuildConfigReloader/types.ts @@ -1,7 +1,7 @@ import { BasePluginType } from "knub"; +import { z } from "zod"; import { Configs } from "../../data/Configs.js"; import Timeout = NodeJS.Timeout; -import { z } from "zod"; export const zGuildConfigReloaderPlugin = z.strictObject({}); diff --git a/backend/src/plugins/GuildMemberCache/types.ts b/backend/src/plugins/GuildMemberCache/types.ts index 3e7a7654e..3ad89f53b 100644 --- a/backend/src/plugins/GuildMemberCache/types.ts +++ b/backend/src/plugins/GuildMemberCache/types.ts @@ -1,6 +1,6 @@ import { BasePluginType } from "knub"; -import { GuildMemberCache } from "../../data/GuildMemberCache.js"; import { z } from "zod"; +import { GuildMemberCache } from "../../data/GuildMemberCache.js"; export const zGuildMemberCacheConfig = z.strictObject({}); diff --git a/backend/src/plugins/InternalPoster/types.ts b/backend/src/plugins/InternalPoster/types.ts index baf20d3db..c0c99c55d 100644 --- a/backend/src/plugins/InternalPoster/types.ts +++ b/backend/src/plugins/InternalPoster/types.ts @@ -1,8 +1,8 @@ import { WebhookClient } from "discord.js"; import { BasePluginType } from "knub"; +import { z } from "zod"; import { Queue } from "../../Queue.js"; import { Webhooks } from "../../data/Webhooks.js"; -import { z } from "zod"; export const zInternalPosterConfig = z.strictObject({}); diff --git a/backend/src/plugins/Logs/LogsPlugin.ts b/backend/src/plugins/Logs/LogsPlugin.ts index 9fc3e1420..d45b86dc4 100644 --- a/backend/src/plugins/Logs/LogsPlugin.ts +++ b/backend/src/plugins/Logs/LogsPlugin.ts @@ -30,7 +30,7 @@ import { import { LogsThreadCreateEvt, LogsThreadDeleteEvt, LogsThreadUpdateEvt } from "./events/LogsThreadModifyEvts.js"; import { LogsGuildMemberUpdateEvt } from "./events/LogsUserUpdateEvts.js"; import { LogsVoiceStateUpdateEvt } from "./events/LogsVoiceChannelEvts.js"; -import { FORMAT_NO_TIMESTAMP, LogsPluginType, zLogsConfig } from "./types.js"; +import { LogsPluginType, zLogsConfig } from "./types.js"; import { getLogMessage } from "./util/getLogMessage.js"; import { log } from "./util/log.js"; import { onMessageDelete } from "./util/onMessageDelete.js"; diff --git a/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts b/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts index a712c60ef..1952d0213 100644 --- a/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts +++ b/backend/src/plugins/Logs/logFunctions/logMessageDelete.ts @@ -12,7 +12,7 @@ import { userToTemplateSafeUser, } from "../../../utils/templateSafeObjects.js"; import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; -import { FORMAT_NO_TIMESTAMP, LogsPluginType } from "../types.js"; +import { LogsPluginType } from "../types.js"; import { log } from "../util/log.js"; export interface LogMessageDeleteData { diff --git a/backend/src/plugins/Logs/types.ts b/backend/src/plugins/Logs/types.ts index 95754015a..11eadbd1c 100644 --- a/backend/src/plugins/Logs/types.ts +++ b/backend/src/plugins/Logs/types.ts @@ -6,7 +6,7 @@ import { GuildCases } from "../../data/GuildCases.js"; import { GuildLogs } from "../../data/GuildLogs.js"; import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; import { LogType } from "../../data/LogType.js"; -import { keys, zBoundedCharacters, zMessageContent, zRegex, zSnowflake } from "../../utils.js"; +import { zBoundedCharacters, zMessageContent, zRegex, zSnowflake } from "../../utils.js"; import { MessageBuffer } from "../../utils/MessageBuffer.js"; import { TemplateSafeCase, diff --git a/backend/src/plugins/Logs/util/getLogMessage.ts b/backend/src/plugins/Logs/util/getLogMessage.ts index 65d5a06cd..30c92087b 100644 --- a/backend/src/plugins/Logs/util/getLogMessage.ts +++ b/backend/src/plugins/Logs/util/getLogMessage.ts @@ -25,7 +25,7 @@ import { TemplateSafeUser, } from "../../../utils/templateSafeObjects.js"; import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js"; -import { FORMAT_NO_TIMESTAMP, ILogTypeData, LogsPluginType, TLogChannel } from "../types.js"; +import { ILogTypeData, LogsPluginType, TLogChannel } from "../types.js"; export async function getLogMessage( pluginData: GuildPluginData, diff --git a/backend/src/plugins/MessageSaver/MessageSaverPlugin.ts b/backend/src/plugins/MessageSaver/MessageSaverPlugin.ts index 895c9ab19..ead63597b 100644 --- a/backend/src/plugins/MessageSaver/MessageSaverPlugin.ts +++ b/backend/src/plugins/MessageSaver/MessageSaverPlugin.ts @@ -2,7 +2,12 @@ import { PluginOptions, guildPlugin } from "knub"; import { GuildSavedMessages } from "../../data/GuildSavedMessages.js"; import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB.js"; import { SavePinsToDBCmd } from "./commands/SavePinsToDB.js"; -import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts.js"; +import { + MessageCreateEvt, + MessageDeleteBulkEvt, + MessageDeleteEvt, + MessageUpdateEvt, +} from "./events/SaveMessagesEvts.js"; import { MessageSaverPluginType, zMessageSaverConfig } from "./types.js"; const defaultOptions: PluginOptions = { diff --git a/backend/src/plugins/ModActions/commands/CasesUserCmd.ts b/backend/src/plugins/ModActions/commands/CasesUserCmd.ts index d45ffb633..7380443d2 100644 --- a/backend/src/plugins/ModActions/commands/CasesUserCmd.ts +++ b/backend/src/plugins/ModActions/commands/CasesUserCmd.ts @@ -3,7 +3,14 @@ import { commandTypeHelpers as ct } from "../../../commandTypes.js"; import { CaseTypes } from "../../../data/CaseTypes.js"; import { sendErrorMessage } from "../../../pluginUtils.js"; import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js"; -import { UnknownUser, chunkArray, emptyEmbedValue, renderUsername, resolveMember, resolveUser } from "../../../utils.js"; +import { + UnknownUser, + chunkArray, + emptyEmbedValue, + renderUsername, + resolveMember, + resolveUser, +} from "../../../utils.js"; import { asyncMap } from "../../../utils/async.js"; import { createPaginatedMessage } from "../../../utils/createPaginatedMessage.js"; import { getGuildPrefix } from "../../../utils/getGuildPrefix.js"; diff --git a/backend/src/plugins/ModActions/functions/kickMember.ts b/backend/src/plugins/ModActions/functions/kickMember.ts index eddf802e8..527f6163c 100644 --- a/backend/src/plugins/ModActions/functions/kickMember.ts +++ b/backend/src/plugins/ModActions/functions/kickMember.ts @@ -3,7 +3,13 @@ import { GuildPluginData } from "knub"; import { CaseTypes } from "../../../data/CaseTypes.js"; import { LogType } from "../../../data/LogType.js"; import { renderTemplate, TemplateParseError, TemplateSafeValueContainer } from "../../../templateFormatter.js"; -import { createUserNotificationError, notifyUser, resolveUser, ucfirst, UserNotificationResult } from "../../../utils.js"; +import { + createUserNotificationError, + notifyUser, + resolveUser, + ucfirst, + UserNotificationResult, +} from "../../../utils.js"; import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; import { CasesPlugin } from "../../Cases/CasesPlugin.js"; import { LogsPlugin } from "../../Logs/LogsPlugin.js"; diff --git a/backend/src/plugins/ModActions/functions/warnMember.ts b/backend/src/plugins/ModActions/functions/warnMember.ts index 056e26db0..a7a8f5318 100644 --- a/backend/src/plugins/ModActions/functions/warnMember.ts +++ b/backend/src/plugins/ModActions/functions/warnMember.ts @@ -2,7 +2,13 @@ import { GuildMember, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import { CaseTypes } from "../../../data/CaseTypes.js"; import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js"; -import { UserNotificationResult, createUserNotificationError, notifyUser, resolveUser, ucfirst } from "../../../utils.js"; +import { + UserNotificationResult, + createUserNotificationError, + notifyUser, + resolveUser, + ucfirst, +} from "../../../utils.js"; import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js"; import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js"; import { CasesPlugin } from "../../Cases/CasesPlugin.js"; diff --git a/backend/src/plugins/Phisherman/functions/getDomainInfo.ts b/backend/src/plugins/Phisherman/functions/getDomainInfo.ts index f29131947..b8fabcb85 100644 --- a/backend/src/plugins/Phisherman/functions/getDomainInfo.ts +++ b/backend/src/plugins/Phisherman/functions/getDomainInfo.ts @@ -1,5 +1,9 @@ import { GuildPluginData } from "knub"; -import { getPhishermanDomainInfo, phishermanDomainIsSafe, trackPhishermanCaughtDomain } from "../../../data/Phisherman.js"; +import { + getPhishermanDomainInfo, + phishermanDomainIsSafe, + trackPhishermanCaughtDomain, +} from "../../../data/Phisherman.js"; import { PhishermanDomainInfo } from "../../../data/types/phisherman.js"; import { PhishermanPluginType } from "../types.js"; diff --git a/backend/src/templateFormatter.test.ts b/backend/src/templateFormatter.test.ts index f906e054c..0d7bd9934 100644 --- a/backend/src/templateFormatter.test.ts +++ b/backend/src/templateFormatter.test.ts @@ -1,5 +1,10 @@ import test from "ava"; -import { parseTemplate, renderParsedTemplate, renderTemplate, TemplateSafeValueContainer } from "./templateFormatter.js"; +import { + parseTemplate, + renderParsedTemplate, + renderTemplate, + TemplateSafeValueContainer, +} from "./templateFormatter.js"; test("Parses plain string templates correctly", (t) => { const result = parseTemplate("foo bar baz"); diff --git a/backend/src/utils.ts b/backend/src/utils.ts index b898fbe4e..214d3f20b 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -286,8 +286,10 @@ export type StrictMessageContent = { }; export type MessageContent = string | StrictMessageContent; -export const zMessageContent = z.union([zBoundedCharacters(0, 4000), zStrictMessageContent]) as z.ZodType; - +export const zMessageContent = z.union([ + zBoundedCharacters(0, 4000), + zStrictMessageContent, +]) as z.ZodType; export function validateAndParseMessageContent(input: unknown): StrictMessageContent { if (input == null) { From c24a24667dd602327d75a897afe907a96fbc1dd2 Mon Sep 17 00:00:00 2001 From: rubyowo Date: Sun, 2 Jun 2024 15:26:32 +0000 Subject: [PATCH 11/11] docs: fix typo (`trhead -> thread`) in Plugin Configuration (#470) Co-authored-by: Almeida --- dashboard/src/components/docs/PluginConfiguration.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/src/components/docs/PluginConfiguration.vue b/dashboard/src/components/docs/PluginConfiguration.vue index cfa4c46ac..e725ab8e3 100644 --- a/dashboard/src/components/docs/PluginConfiguration.vue +++ b/dashboard/src/components/docs/PluginConfiguration.vue @@ -54,7 +54,7 @@ - channel: "109672661671505920" config: can_kick: false - # Don't allow kicking on any trhead + # Don't allow kicking on any thread - is_thread: true config: can_kick: false