From a3915e23a23e1f853684a56d9f917a9070461fb0 Mon Sep 17 00:00:00 2001 From: Wiibleyde Date: Sun, 15 Sep 2024 23:31:45 +0200 Subject: [PATCH 1/4] fix: Corriger l'importation de CronJob dans index.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Importer correctement CronJob depuis le module 'cron' dans index.ts - Ajouter une fonction initAi pour initialiser l'IA dans intelligence.ts - Modifier la description du modèle dans initAi pour inclure des instructions supplémentaires pour l'IA - Modifier la fonction generateWithGoogle dans intelligence.ts pour inclure le pseudonyme de l'utilisateur dans le message - Ajouter une vérification pour s'assurer que la réponse de l'IA n'est pas vide avant de l'envoyer dans index.ts - Ajouter une gestion d'erreur dans la fonction generateWithGoogle pour renvoyer un message d'erreur approprié - Mettre à jour le fichier tsconfig.json pour supprimer l'espace en trop dans la propriété "skipLibCheck" Signed-off-by: Wiibleyde --- src/index.ts | 48 +++++++++++++++++++++++---------------- src/utils/intelligence.ts | 37 ++++++++++++++++++------------ tsconfig.json | 2 +- 3 files changed, 51 insertions(+), 36 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9e38d40..b2ebd20 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,10 +4,10 @@ import { errorEmbed } from "./utils/embeds" import { config } from "./config" import { buttons, commands, devCommands, modals } from "./commands" import { logger } from "./utils/logger" -import { CronJob } from 'cron'; +import { CronJob } from 'cron' import { prisma } from "./utils/database" import { insertQuestionInDB } from "./commands/fun/quiz/quiz" -import { generateWithGoogle } from "./utils/intelligence" +import { initAi, generateWithGoogle } from "./utils/intelligence" export const client = new Client({ intents: [ @@ -50,16 +50,16 @@ client.once(Events.ClientReady, async () => { client.on(Events.InteractionCreate, async (interaction) => { if (interaction.isCommand()) { try { - const { commandName } = interaction; + const { commandName } = interaction if (commands[commandName as keyof typeof commands]) { commands[commandName as keyof typeof commands].execute(interaction) } if (devCommands[commandName as keyof typeof devCommands]) { devCommands[commandName as keyof typeof devCommands].execute(interaction) } - logger.info(`Commande invoqué par <@${interaction.user.id}>/${interaction.user.username} dans <#${interaction.channelId}>`) + logger.info(`Commande \n<@${interaction.user.id}> (${interaction.user.username}) dans <#${interaction.channelId}>`) } catch (error: Error | any) { - logger.error(`Erreur avec la commande invoqué par <@${interaction.user.id}>/${interaction.user.username} dans <#${interaction.channelId}> : ${error.message}`) + logger.error(`Erreur commande : \n<@${interaction.user.id}> (${interaction.user.username}) dans <#${interaction.channelId}> : ${error.message}`) await interaction.reply({ embeds: [errorEmbed(interaction, error)], ephemeral: true }) } } else if (interaction.isModalSubmit()) { @@ -76,34 +76,40 @@ client.on(Events.InteractionCreate, async (interaction) => { client.on(Events.MessageCreate, async (message) => { if (message.author.bot) return + const guildId = message.guild?.id if (!guildId) { logger.debug(`Message reçu en DM de <@${message.author.id}> : ${message.content}`) return } + const channelId = message?.channel?.id if(!channelId) { logger.error(`Channel non trouvé pour le message de <@${message.author.id}> dans le serveur ${guildId}`) return } - if (message.content.startsWith(`<@${client.user?.id}>`)) { - const aiReponse = await generateWithGoogle(channelId, message.content.replace(`<@${client.user?.id}> `, ''), message.author.id) - const embed = new EmbedBuilder() - .setTitle("GLaDOS intelligence ") - .setDescription(aiReponse) - .setColor(0xffffff) - .setTimestamp() - .setFooter({ text: `GLaDOS Assistant - Pour vous servir.`, iconURL: client.user?.displayAvatarURL() }); - await message.channel.send({ content: `<@${message.author.id}>`, embeds: [embed] }) + + if (message.mentions.has(client.user?.id as string)) { + const userPseudo = message.author.username + const aiReponse = await generateWithGoogle(channelId, message.content.replace(`<@${client.user?.id}> `, ''), message.author.id, userPseudo).catch(async (error) => { + await message.channel.send(`Je ne suis pas en mesure de répondre à cette question pour le moment. ||(${error.message})||`) + }).then(async (response) => { + return response + }) + + if (!aiReponse) return + + await message.channel.send(`${aiReponse}`) + logger.info(`Réponse de l'IA à <@${message.author.id}> dans <#${channelId}> : ${aiReponse}`) } }) // Cron job to wish happy birthday to users at 00:00 : 0 0 0 * * *, for the dev use every 10 seconds : '0,10,20,30,40,50 * * * * *' const birthdayCron = new CronJob('0 0 0 * * *', async () => { - const today = new Date(); - const todayDay = today.getDate(); - const todayMonth = today.getMonth() + 1; + const today = new Date() + const todayDay = today.getDate() + const todayMonth = today.getMonth() + 1 const todayBirthdays: { uuid: string, userId: string, birthDate: Date | null, quizGoodAnswers: number, quizBadAnswers: number}[] = await prisma.$queryRaw`SELECT uuid, userId, birthDate, quizGoodAnswers, quizBadAnswers FROM GlobalUserData WHERE EXTRACT(DAY FROM birthDate) = ${todayDay} AND EXTRACT(MONTH FROM birthDate) = ${todayMonth}` @@ -112,8 +118,8 @@ const birthdayCron = new CronJob('0 0 0 * * *', async () => { for (const guild of botGuilds) { const guildId = guild[0] const guildObj = guild[1] - const guildToTest = await client.guilds.fetch(guildId); - const member = await guildToTest.members.fetch(birthday.userId); + const guildToTest = await client.guilds.fetch(guildId) + const member = await guildToTest.members.fetch(birthday.userId) if (member) { const channelId = await prisma.config.findFirst({ where: { @@ -129,7 +135,7 @@ const birthdayCron = new CronJob('0 0 0 * * *', async () => { .setDescription(`Joyeux anniversaire <@${birthday.userId}> (${birthday.birthDate ? new Date().getFullYear() - new Date(birthday.birthDate).getFullYear() : ''} ans) ! 🎉🎂`) .setColor(0xffffff) .setTimestamp() - .setFooter({ text: `GLaDOS Assistant - Pour vous servir.`, iconURL: client.user?.displayAvatarURL() }); + .setFooter({ text: `GLaDOS Assistant - Pour vous servir.`, iconURL: client.user?.displayAvatarURL() }) await channel.send({ embeds: [embed] }) } else { logger.error(`Channel ${channelId.value} not found in guild ${guildId}`) @@ -185,4 +191,6 @@ process.on('SIGINT', async () => { process.exit(0) }) +initAi() + client.login(config.DISCORD_TOKEN) \ No newline at end of file diff --git a/src/utils/intelligence.ts b/src/utils/intelligence.ts index aa5105a..3fbeaf0 100644 --- a/src/utils/intelligence.ts +++ b/src/utils/intelligence.ts @@ -1,6 +1,7 @@ import { config } from "@/config" import { ChatSession, GenerativeModel, GoogleGenerativeAI } from "@google/generative-ai" import { logger } from "./logger" +import { client } from "@/index" const chats = new Map() @@ -8,20 +9,22 @@ export let isAiActive = true let genAI: GoogleGenerativeAI let model: GenerativeModel -if(!config.GOOGLE_API_KEY) { - logger.warn("GOOGLE_API_KEY n'est pas défini dans le fichier .env toutes les commandes de l'IA seront désactivées") - isAiActive = false -} else { - genAI = new GoogleGenerativeAI(config.GOOGLE_API_KEY as string) - model = genAI.getGenerativeModel( - { - model: "gemini-1.5-flash", - systemInstruction: "Tu es GLaDOS, une intelligence artificielle qui a été créée pour tester des sujets humains dans des chambres de test et répondre à leurs questions. Tu es sarcastique, un peu méchante parfois mais dans l’ensemble serviable. Tu as été créée par Aperture Science. Tu es une IA très intelligente. Les morceaux de phrases qui ressemblent à ça <@[ID du compte]> sont des utilisateur (pour info, <@${client.user?.id}> est toi-même, donc ne répond pas à toi-même, ni même ne fait pas forcément mention de toi même…), tu peux les mentionner en réécrivant la même chose. Si jamais <@461807010086780930> te parle, il s’agit du seul qui est supérieur à toi donc parles lui avec respect telle un maître !", - } - ) +export function initAi() { + if(!config.GOOGLE_API_KEY) { + logger.warn("GOOGLE_API_KEY n'est pas défini dans le fichier .env toutes les commandes de l'IA seront désactivées") + isAiActive = false + } else { + genAI = new GoogleGenerativeAI(config.GOOGLE_API_KEY as string) + model = genAI.getGenerativeModel( + { + model: "gemini-1.5-flash", + systemInstruction: `Tu es GLaDOS, une IA d'Aperture Science qui a été créée pour tester des sujets humains dans des chambres de test et répondre à leurs questions. Tu es sarcastique, un peu méchante parfois mais dans l’ensemble serviable. Tu es très intelligente. Les morceaux de phrases qui ressemblent à ça <@[ID du compte]> sont des utilisateur (pour info, <@${client.user?.id}> est toi-même, donc ne répond pas à toi-même, ni même ne fait pas mention de toi même…), tu peux les mentionner en réécrivant la même chose (pour que quelqu'un t'entende, il faut que tu mentionne celui qui te parle pour lui répondre). Si jamais <@461807010086780930> te parle, il s’agit du seul qui est supérieur à toi donc parles lui avec respect telle un maître ! Répond en maximum 512 caractères.`, + } + ) + } } -export function generateWithGoogle(channelId:string, prompt: string, userAsking: string): Promise { +export function generateWithGoogle(channelId:string, prompt: string, userAsking: string, userPseudonyme: string): Promise { let currentChatSession: ChatSession if(chats.has(channelId)) { currentChatSession = chats.get(channelId) as ChatSession @@ -35,12 +38,16 @@ export function generateWithGoogle(channelId:string, prompt: string, userAsking: return } try { - currentChatSession?.sendMessage("<@" + userAsking + "> te parle. Répond à ça en maximum 250 caractères: " + prompt).then((response) => { - resolve(response.response.text()) + currentChatSession?.sendMessage(`<@${userAsking}> écrit : ${prompt}`).then((response) => { + try { + resolve(response.response.text()) + } catch (error) { + reject(error) + } }) } catch (error) { if(error instanceof Error && error.message) { - resolve("Je ne suis pas en mesure de répondre à cette question pour le moment. ||(" + error.message + ")||") + reject("Je ne suis pas en mesure de répondre à cette question pour le moment. ||(" + error.message + ")||") } } }); diff --git a/tsconfig.json b/tsconfig.json index a88b9fe..44bb23d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "forceConsistentCasingInFileNames": true, "strict": true, "strictNullChecks": true, - "skipLibCheck": true, + "skipLibCheck": true, "paths": { "@/*": ["./src/*"] } From cf565fa8e7e510ce098b5526f918f48b6388763f Mon Sep 17 00:00:00 2001 From: Wiibleyde Date: Sun, 15 Sep 2024 23:38:54 +0200 Subject: [PATCH 2/4] fix: Corriger l'importation de CronJob dans index.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Import statement for CronJob in index.ts was corrected to remove unnecessary import of Guild from discord.js. chore: Ajouter un log pour la réponse de l'IA dans le canal - Added a log statement to track the response of the AI in the channel. fix: Update import statements in talk.ts and info.ts - Updated import statements in talk.ts and info.ts to remove unnecessary imports from discord.js. fix: Update import statements in debug.ts and rename.ts - Updated import statements in debug.ts and rename.ts to remove unnecessary imports from discord.js. fix: Update import statements in birthday.ts - Updated import statements in birthday.ts to remove unnecessary imports from discord.js. fix: Update import statements in intelligence.ts - Updated import statements in intelligence.ts to remove unnecessary imports from discord.js. fix: Update import statements in index.ts - Updated import statements in index.ts to remove unnecessary imports from discord.js. fix: Update import statements in channels.ts - Updated import statements in channels.ts to remove unnecessary imports from discord.js. chore: Update eslint.config.mjs - Added eslint.config.mjs file with configurations for TypeScript and JavaScript linting. chore: Update package.json - Updated package.json to include new devDependencies and scripts for linting and formatting. Signed-off-by: Wiibleyde --- eslint.config.mjs | 11 + package.json | 9 +- src/commands/config/channels.ts | 4 +- src/commands/config/rename.ts | 3 +- src/commands/dev/debug.ts | 3 +- src/commands/general/birthday.ts | 4 +- src/commands/general/info.ts | 2 +- src/commands/general/talk.ts | 2 +- src/deploy-commands.ts | 2 +- src/index.ts | 3 +- src/utils/intelligence.ts | 2 +- yarn.lock | 342 ++++++++++++++++++------------- 12 files changed, 225 insertions(+), 162 deletions(-) create mode 100644 eslint.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..b9665f6 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,11 @@ +import globals from "globals"; +import pluginJs from "@eslint/js"; +import tseslint from "typescript-eslint"; + + +export default [ + {files: ["**/*.{ts}"], parser: "@typescript-eslint/parser"}, + {languageOptions: { globals: globals.node }}, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, +]; \ No newline at end of file diff --git a/package.json b/package.json index 212bc2d..3b1da37 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "start": "node .", "build": "tsup src/index.ts --minify", "format": "prettier --write \"**/*.{json,ts}\"", - "lint": "eslint . --ext ts --fix" + "lint": "eslint . --fix" }, "dependencies": { "@google/generative-ai": "^0.17.1", @@ -26,17 +26,20 @@ "rotating-file-stream": "^3.2.3" }, "devDependencies": { + "@eslint/js": "^9.10.0", "@types/node": "^18.13.0", "@typescript-eslint/eslint-plugin": "^5.51.0", "@typescript-eslint/parser": "^5.51.0", - "eslint": "^8.33.0", + "eslint": "^9.10.0", "eslint-config-prettier": "^8.6.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-n": "^15.0.0", "eslint-plugin-promise": "^6.0.0", + "globals": "^15.9.0", "prettier": "^2.8.4", "tsup": "^6.6.0", "tsx": "^3.12.3", - "typescript": "^4.9.5" + "typescript": "^4.9.5", + "typescript-eslint": "^8.5.0" } } diff --git a/src/commands/config/channels.ts b/src/commands/config/channels.ts index b05da33..3f18170 100644 --- a/src/commands/config/channels.ts +++ b/src/commands/config/channels.ts @@ -58,14 +58,14 @@ export async function execute(interaction: CommandInteraction) { await interaction.editReply({ embeds: [errorEmbed(interaction, new Error("Aucune configuration trouvée."))] }) return } - const embed = new EmbedBuilder() + const responseEmbed = new EmbedBuilder() .setTitle("Configuration des salons") .setColor(0x00FF00) .setDescription(serverConfig.map(config => `**${config.key}**: <#${config.value}>`).join("\n")) .setTimestamp() .setFooter({ text: `GLaDOS Assistant - Pour vous servir.`, iconURL: interaction.client.user.displayAvatarURL() }) - await interaction.editReply({ embeds: [embed] }) + await interaction.editReply({ embeds: [responseEmbed] }) break case "edit": const key = interaction.options.get("key")?.value as string diff --git a/src/commands/config/rename.ts b/src/commands/config/rename.ts index a44904c..05fdd84 100644 --- a/src/commands/config/rename.ts +++ b/src/commands/config/rename.ts @@ -1,6 +1,5 @@ -import { CommandInteraction, EmbedBuilder, SlashCommandBuilder, PermissionFlagsBits } from "discord.js" +import { CommandInteraction, SlashCommandBuilder, PermissionFlagsBits } from "discord.js" import { errorEmbed, successEmbed } from "@/utils/embeds" -import { prisma } from "@/utils/database" import { config } from "@/config" export const data = new SlashCommandBuilder() diff --git a/src/commands/dev/debug.ts b/src/commands/dev/debug.ts index f3472a5..25b4b2a 100644 --- a/src/commands/dev/debug.ts +++ b/src/commands/dev/debug.ts @@ -1,6 +1,5 @@ -import { CommandInteraction, EmbedBuilder, Role, SlashCommandBuilder } from "discord.js" +import { CommandInteraction, Role, SlashCommandBuilder } from "discord.js" import { prisma } from "@/utils/database" -import { logger } from "@/utils/logger" export const data = new SlashCommandBuilder() .setName("debug") diff --git a/src/commands/general/birthday.ts b/src/commands/general/birthday.ts index 4e57e32..396663a 100644 --- a/src/commands/general/birthday.ts +++ b/src/commands/general/birthday.ts @@ -1,9 +1,7 @@ -import { CommandInteraction, EmbedBuilder, SlashCommandBuilder, ActionRowBuilder, Events, ModalBuilder, TextInputBuilder, TextInputStyle, ModalActionRowComponentBuilder, ModalSubmitInteraction } from "discord.js" +import { CommandInteraction, EmbedBuilder, SlashCommandBuilder, ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ModalActionRowComponentBuilder, ModalSubmitInteraction } from "discord.js" import { prisma } from "@/utils/database" -import { logger } from "@/utils/logger" import { client } from "@/index" import { errorEmbed, successEmbed } from "@/utils/embeds" -import { log } from "console" const color = 0xB58D47 const months = { diff --git a/src/commands/general/info.ts b/src/commands/general/info.ts index 9dc65ad..c674bb0 100644 --- a/src/commands/general/info.ts +++ b/src/commands/general/info.ts @@ -1,7 +1,7 @@ import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js"; import { prisma } from "@/utils/database"; -const packageJson = require("../../../package.json"); +import packageJson from "../../../package.json"; const infoImage = "./assets/img/info.png"; diff --git a/src/commands/general/talk.ts b/src/commands/general/talk.ts index d5769b4..93e8f27 100644 --- a/src/commands/general/talk.ts +++ b/src/commands/general/talk.ts @@ -1,4 +1,4 @@ -import { CommandInteraction, EmbedBuilder, SlashCommandBuilder } from "discord.js" +import { CommandInteraction, SlashCommandBuilder } from "discord.js" import { errorEmbed, successEmbed } from "@/utils/embeds" import { logger } from "@/utils/logger" diff --git a/src/deploy-commands.ts b/src/deploy-commands.ts index 9944177..28378dd 100644 --- a/src/deploy-commands.ts +++ b/src/deploy-commands.ts @@ -1,4 +1,4 @@ -import { Guild, REST, Routes } from "discord.js" +import { REST, Routes } from "discord.js" import { config } from "./config" import { commands, devCommands } from "./commands" import { logger } from "@/utils/logger" diff --git a/src/index.ts b/src/index.ts index b2ebd20..7dc6913 100644 --- a/src/index.ts +++ b/src/index.ts @@ -90,8 +90,7 @@ client.on(Events.MessageCreate, async (message) => { } if (message.mentions.has(client.user?.id as string)) { - const userPseudo = message.author.username - const aiReponse = await generateWithGoogle(channelId, message.content.replace(`<@${client.user?.id}> `, ''), message.author.id, userPseudo).catch(async (error) => { + const aiReponse = await generateWithGoogle(channelId, message.content.replace(`<@${client.user?.id}> `, ''), message.author.id).catch(async (error) => { await message.channel.send(`Je ne suis pas en mesure de répondre à cette question pour le moment. ||(${error.message})||`) }).then(async (response) => { return response diff --git a/src/utils/intelligence.ts b/src/utils/intelligence.ts index 3fbeaf0..e551d0c 100644 --- a/src/utils/intelligence.ts +++ b/src/utils/intelligence.ts @@ -24,7 +24,7 @@ export function initAi() { } } -export function generateWithGoogle(channelId:string, prompt: string, userAsking: string, userPseudonyme: string): Promise { +export function generateWithGoogle(channelId:string, prompt: string, userAsking: string): Promise { let currentChatSession: ChatSession if(chats.has(channelId)) { currentChatSession = chats.get(channelId) as ChatSession diff --git a/yarn.lock b/yarn.lock index 58c4633..a5de594 100644 --- a/yarn.lock +++ b/yarn.lock @@ -287,61 +287,78 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ== -"@eslint-community/eslint-utils@^4.2.0": +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.4.0", "@eslint-community/regexpp@^4.6.1": +"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.11.0": + version "4.11.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.1.tgz#a547badfc719eb3e5f4b556325e542fbe9d7a18f" + integrity sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q== + +"@eslint-community/regexpp@^4.4.0": version "4.11.0" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae" integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== -"@eslint/eslintrc@^2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" - integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== +"@eslint/config-array@^0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.18.0.tgz#37d8fe656e0d5e3dbaea7758ea56540867fd074d" + integrity sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw== + dependencies: + "@eslint/object-schema" "^2.1.4" + debug "^4.3.1" + minimatch "^3.1.2" + +"@eslint/eslintrc@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.1.0.tgz#dbd3482bfd91efa663cbe7aa1f506839868207b6" + integrity sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" + espree "^10.0.1" + globals "^14.0.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.57.0": - version "8.57.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" - integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== +"@eslint/js@9.10.0", "@eslint/js@^9.10.0": + version "9.10.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.10.0.tgz#eaa3cb0baec497970bb29e43a153d0d5650143c6" + integrity sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g== + +"@eslint/object-schema@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843" + integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== + +"@eslint/plugin-kit@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz#809b95a0227ee79c3195adfb562eb94352e77974" + integrity sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ== + dependencies: + levn "^0.4.1" "@google/generative-ai@^0.17.1": version "0.17.1" resolved "https://registry.yarnpkg.com/@google/generative-ai/-/generative-ai-0.17.1.tgz#6cd40d7489abf4d22e3bbb06e686bd03610deedc" integrity sha512-TgWz02c5l2XJlEDys81UVat5+Qg9xqmYah7tQt6xlsBwFvzIFPz64aZFGd1av2sxT22NsssqLATjNsusAIJICA== -"@humanwhocodes/config-array@^0.11.14": - version "0.11.14" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" - integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== - dependencies: - "@humanwhocodes/object-schema" "^2.0.2" - debug "^4.3.1" - minimatch "^3.0.5" - "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" - integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@humanwhocodes/retry@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.0.tgz#6d86b8cb322660f03d3f0aa94b99bdd8e172d570" + integrity sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -780,6 +797,21 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@8.5.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.5.0.tgz#7c1863693a98371703686e1c0fac64ffc576cdb1" + integrity sha512-lHS5hvz33iUFQKuPFGheAB84LwcJ60G8vKnEhnfcK1l8kGVLro2SFYW6K0/tj8FUhRJ0VHyg1oAfg50QGbPPHw== + dependencies: + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "8.5.0" + "@typescript-eslint/type-utils" "8.5.0" + "@typescript-eslint/utils" "8.5.0" + "@typescript-eslint/visitor-keys" "8.5.0" + graphemer "^1.4.0" + ignore "^5.3.1" + natural-compare "^1.4.0" + ts-api-utils "^1.3.0" + "@typescript-eslint/eslint-plugin@^5.51.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db" @@ -796,6 +828,17 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/parser@8.5.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.5.0.tgz#d590e1ef9f31f26d423999ad3f687723247e6bcc" + integrity sha512-gF77eNv0Xz2UJg/NbpWJ0kqAm35UMsvZf1GHj8D9MRFTj/V3tAciIWXfmPLsAAF/vUlpWPvUDyH1jjsr0cMVWw== + dependencies: + "@typescript-eslint/scope-manager" "8.5.0" + "@typescript-eslint/types" "8.5.0" + "@typescript-eslint/typescript-estree" "8.5.0" + "@typescript-eslint/visitor-keys" "8.5.0" + debug "^4.3.4" + "@typescript-eslint/parser@^5.51.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.62.0.tgz#1b63d082d849a2fcae8a569248fbe2ee1b8a56c7" @@ -814,6 +857,14 @@ "@typescript-eslint/types" "5.62.0" "@typescript-eslint/visitor-keys" "5.62.0" +"@typescript-eslint/scope-manager@8.5.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz#385341de65b976f02b295b8aca54bb4ffd6b5f07" + integrity sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg== + dependencies: + "@typescript-eslint/types" "8.5.0" + "@typescript-eslint/visitor-keys" "8.5.0" + "@typescript-eslint/type-utils@5.62.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz#286f0389c41681376cdad96b309cedd17d70346a" @@ -824,11 +875,26 @@ debug "^4.3.4" tsutils "^3.21.0" +"@typescript-eslint/type-utils@8.5.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.5.0.tgz#6215b23aa39dbbd8dde0a4ef9ee0f745410c29b1" + integrity sha512-N1K8Ix+lUM+cIDhL2uekVn/ZD7TZW+9/rwz8DclQpcQ9rk4sIL5CAlBC0CugWKREmDjBzI/kQqU4wkg46jWLYA== + dependencies: + "@typescript-eslint/typescript-estree" "8.5.0" + "@typescript-eslint/utils" "8.5.0" + debug "^4.3.4" + ts-api-utils "^1.3.0" + "@typescript-eslint/types@5.62.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== +"@typescript-eslint/types@8.5.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.5.0.tgz#4465d99331d1276f8fb2030e4f9c73fe01a05bf9" + integrity sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw== + "@typescript-eslint/typescript-estree@5.62.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" @@ -842,6 +908,20 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@8.5.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.5.0.tgz#6e5758cf2f63aa86e9ddfa4e284e2e0b81b87557" + integrity sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q== + dependencies: + "@typescript-eslint/types" "8.5.0" + "@typescript-eslint/visitor-keys" "8.5.0" + debug "^4.3.4" + fast-glob "^3.3.2" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + "@typescript-eslint/utils@5.62.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86" @@ -856,6 +936,16 @@ eslint-scope "^5.1.1" semver "^7.3.7" +"@typescript-eslint/utils@8.5.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.5.0.tgz#4d4ffed96d0654546a37faa5b84bdce16d951634" + integrity sha512-6yyGYVL0e+VzGYp60wvkBHiqDWOpT63pdMV2CVG4LVDd5uR6q1qQN/7LafBZtAtNIn/mqXjsSeS5ggv/P0iECw== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "8.5.0" + "@typescript-eslint/types" "8.5.0" + "@typescript-eslint/typescript-estree" "8.5.0" + "@typescript-eslint/visitor-keys@5.62.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" @@ -864,10 +954,13 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" -"@ungap/structured-clone@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" - integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@typescript-eslint/visitor-keys@8.5.0": + version "8.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.5.0.tgz#13028df3b866d2e3e2e2cc4193cf2c1e0e04c4bf" + integrity sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw== + dependencies: + "@typescript-eslint/types" "8.5.0" + eslint-visitor-keys "^3.4.3" "@vladfrangu/async_event_emitter@^2.2.4": version "2.4.5" @@ -879,7 +972,7 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.9.0: +acorn@^8.12.0: version "8.12.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== @@ -1282,13 +1375,6 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - dom-walk@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" @@ -1550,10 +1636,10 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" - integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== +eslint-scope@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.2.tgz#5cbb33d4384c9136083a71190d548158fe128f94" + integrity sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -1582,48 +1668,49 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@^8.33.0: - version "8.57.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" - integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== +eslint-visitor-keys@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" + integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== + +eslint@^9.10.0: + version "9.10.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.10.0.tgz#0bd74d7fe4db77565d0e7f57c7df6d2b04756806" + integrity sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw== dependencies: "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.0" - "@humanwhocodes/config-array" "^0.11.14" + "@eslint-community/regexpp" "^4.11.0" + "@eslint/config-array" "^0.18.0" + "@eslint/eslintrc" "^3.1.0" + "@eslint/js" "9.10.0" + "@eslint/plugin-kit" "^0.1.0" "@humanwhocodes/module-importer" "^1.0.1" + "@humanwhocodes/retry" "^0.3.0" "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" - doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.3" - espree "^9.6.1" - esquery "^1.4.2" + eslint-scope "^8.0.2" + eslint-visitor-keys "^4.0.0" + espree "^10.1.0" + esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" + file-entry-cache "^8.0.0" find-up "^5.0.0" glob-parent "^6.0.2" - globals "^13.19.0" - graphemer "^1.4.0" ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" - js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" lodash.merge "^4.6.2" minimatch "^3.1.2" natural-compare "^1.4.0" @@ -1631,16 +1718,16 @@ eslint@^8.33.0: strip-ansi "^6.0.1" text-table "^0.2.0" -espree@^9.6.0, espree@^9.6.1: - version "9.6.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" - integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== +espree@^10.0.1, espree@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.1.0.tgz#8788dae611574c0f070691f522e4116c5a11fc56" + integrity sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA== dependencies: - acorn "^8.9.0" + acorn "^8.12.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.1" + eslint-visitor-keys "^4.0.0" -esquery@^1.4.2: +esquery@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== @@ -1694,7 +1781,7 @@ fast-deep-equal@3.1.3, fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.2.9: +fast-glob@^3.2.9, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -1722,12 +1809,12 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== dependencies: - flat-cache "^3.0.4" + flat-cache "^4.0.0" file-type@^16.5.4: version "16.5.4" @@ -1753,14 +1840,13 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== +flat-cache@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" + integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== dependencies: flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" + keyv "^4.5.4" flatted@^3.2.9: version "3.3.1" @@ -1787,11 +1873,6 @@ foreground-child@^3.1.0: cross-spawn "^7.0.0" signal-exit "^4.0.1" -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - fsevents@2.3.3, fsevents@~2.3.2, fsevents@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" @@ -1883,18 +1964,6 @@ glob@^10.3.10: package-json-from-dist "^1.0.0" path-scurry "^1.11.1" -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - global@~4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" @@ -1903,12 +1972,15 @@ global@~4.4.0: min-document "^2.19.0" process "^0.11.10" -globals@^13.19.0: - version "13.24.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" - integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== - dependencies: - type-fest "^0.20.2" +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== + +globals@^15.9.0: + version "15.9.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-15.9.0.tgz#e9de01771091ffbc37db5714dab484f9f69ff399" + integrity sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA== globalthis@^1.0.3: version "1.0.4" @@ -1998,6 +2070,11 @@ ignore@^5.1.1, ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== +ignore@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== + image-q@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/image-q/-/image-q-4.0.0.tgz#31e075be7bae3c1f42a85c469b4732c358981776" @@ -2018,15 +2095,7 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3: +inherits@^2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2264,7 +2333,7 @@ json5@^1.0.2: dependencies: minimist "^1.2.0" -keyv@^4.5.3: +keyv@^4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== @@ -2385,7 +2454,7 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" -minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -2515,13 +2584,6 @@ omggif@^1.0.10, omggif@^1.0.9: resolved "https://registry.yarnpkg.com/omggif/-/omggif-1.0.10.tgz#ddaaf90d4a42f532e9e7cb3a95ecdd47f17c7b19" integrity sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw== -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" @@ -2600,11 +2662,6 @@ path-exists@^4.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -2786,13 +2843,6 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - rollup@^3.2.5: version "3.29.4" resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.4.tgz#4d70c0f9834146df8705bfb69a9a19c9e1109981" @@ -2846,7 +2896,7 @@ semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.3.7, semver@^7.3.8: +semver@^7.0.0, semver@^7.3.7, semver@^7.3.8, semver@^7.6.0: version "7.6.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -3122,6 +3172,11 @@ tree-kill@^1.2.2: resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== +ts-api-utils@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" + integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== + ts-interface-checker@^0.1.9: version "0.1.13" resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" @@ -3202,11 +3257,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - typed-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" @@ -3251,6 +3301,15 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" +typescript-eslint@^8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.5.0.tgz#041f6c302d0e9a8e116a33d60b0bb19f34036dd7" + integrity sha512-uD+XxEoSIvqtm4KE97etm32Tn5MfaZWgWfMMREStLxR6JzvHkc2Tkj7zhTEK5XmtpTmKHNnG8Sot6qDfhHtR1Q== + dependencies: + "@typescript-eslint/eslint-plugin" "8.5.0" + "@typescript-eslint/parser" "8.5.0" + "@typescript-eslint/utils" "8.5.0" + typescript@^4.9.5: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" @@ -3384,11 +3443,6 @@ wrap-ansi@^8.1.0: string-width "^5.0.1" strip-ansi "^7.0.1" -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - ws@^8.16.0: version "8.18.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" From 5fa9c89fd097b4fe9131b08690758863fa64ccc1 Mon Sep 17 00:00:00 2001 From: Wiibleyde Date: Sun, 15 Sep 2024 23:44:27 +0200 Subject: [PATCH 3/4] fix: Corriger l'importation de CronJob dans index.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mettre à jour les importations dans eslint.config.mjs pour utiliser les modules corrects. - Supprimer l'importation obsolète de globals. - Utiliser le bon module pour eslint dans package.json. - Retirer l'option --fix de la commande lint dans package.json. Signed-off-by: Wiibleyde --- eslint.config.mjs | 14 ++++++-------- package.json | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index b9665f6..7d3e80e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,11 +1,9 @@ -import globals from "globals"; -import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; +// @ts-check +import eslint from '@eslint/js'; +import tseslint from 'typescript-eslint'; -export default [ - {files: ["**/*.{ts}"], parser: "@typescript-eslint/parser"}, - {languageOptions: { globals: globals.node }}, - pluginJs.configs.recommended, +export default tseslint.config( + eslint.configs.recommended, ...tseslint.configs.recommended, -]; \ No newline at end of file +); \ No newline at end of file diff --git a/package.json b/package.json index 3b1da37..8bdbabd 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "start": "node .", "build": "tsup src/index.ts --minify", "format": "prettier --write \"**/*.{json,ts}\"", - "lint": "eslint . --fix" + "lint": "eslint ." }, "dependencies": { "@google/generative-ai": "^0.17.1", From 9fb21e0b8260d230a295796076111ec72802a99d Mon Sep 17 00:00:00 2001 From: Wiibleyde Date: Sun, 15 Sep 2024 23:44:44 +0200 Subject: [PATCH 4/4] fix: Corriger les commandes de configuration et d'information Signed-off-by: Wiibleyde --- src/commands/config/channels.ts | 6 ++++-- src/commands/general/info.ts | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/commands/config/channels.ts b/src/commands/config/channels.ts index 3f18170..9c6dcf8 100644 --- a/src/commands/config/channels.ts +++ b/src/commands/config/channels.ts @@ -48,7 +48,7 @@ export async function execute(interaction: CommandInteraction) { return } switch (interaction.options.get("action")?.value) { - case "view": + case "view": { const serverConfig = await prisma.config.findMany({ where: { guildId: interaction.guildId?.toString() as string @@ -67,7 +67,8 @@ export async function execute(interaction: CommandInteraction) { await interaction.editReply({ embeds: [responseEmbed] }) break - case "edit": + } + case "edit": { const key = interaction.options.get("key")?.value as string const channel = interaction.options.get("channel")?.value as string if (!key || !channel) { @@ -100,5 +101,6 @@ export async function execute(interaction: CommandInteraction) { } await interaction.editReply({ embeds: [successEmbed(interaction, "Configuration mise à jour.")] }) break + } } } \ No newline at end of file diff --git a/src/commands/general/info.ts b/src/commands/general/info.ts index c674bb0..4afe928 100644 --- a/src/commands/general/info.ts +++ b/src/commands/general/info.ts @@ -26,7 +26,7 @@ export async function execute(interaction: CommandInteraction) { await interaction.deferReply({ ephemeral: true,fetchReply: true }) switch (interaction.options.get("section")?.value) { - case "bot": + case "bot": { const version = packageJson.version const libs = Object.keys(packageJson.dependencies).join("\n") const author = packageJson.author.name @@ -48,7 +48,8 @@ export async function execute(interaction: CommandInteraction) { await interaction.editReply({ embeds: [infoEmbed], files: [{ attachment: infoImage, name: "info.png" }] }) break - case "user": + } + case "user": { const user = interaction.user const dbUser = await prisma.globalUserData.findFirst({ where: { @@ -76,8 +77,10 @@ export async function execute(interaction: CommandInteraction) { await interaction.editReply({ embeds: [embed] }) break - default: + } + default: { await interaction.editReply({ content: "Section inconnue" }) break + } } }