From 2e8299491df837c9920cdc887692a8713008ddf2 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Wed, 13 Mar 2024 09:11:58 +1100 Subject: [PATCH 01/10] Add 'es' to automod regex. --- src/components/Automod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Automod.ts b/src/components/Automod.ts index 35e7026..adde8d1 100644 --- a/src/components/Automod.ts +++ b/src/components/Automod.ts @@ -4,7 +4,7 @@ import Logger from '../helpers/Logger.js'; export default class Automoderator { private static logPrefix:string = 'Automod'; private static lockQuery:Set = new Set(); - static scanMsg =(message:Discord.Message)=>message.content.toLowerCase().replaceAll(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?\n?0-9]|[]|ing\b|ed\b/g, '').split(' ').join(''); + static scanMsg =(message:Discord.Message)=>message.content.toLowerCase().replaceAll(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?\n?0-9]|[]|ing\b|ed\b|es\b/g, '').split(' ').join(''); static async repeatedMessages(client:TClient, message:Discord.Message, action:'mute'|'ban'|'softban', thresholdTime:number, thresholdAmount:number, type:string, duration:string, reason:string) { const now = Date.now(); From 4fbdbcf79a14e5cce712604d406de1c405538e19 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:12:56 +1100 Subject: [PATCH 02/10] Improve MPModule's failure rate --- .pnp.cjs | 50 ++++++++++++++++++++--------------------- package.json | 8 +++---- src/modules/MPModule.ts | 33 ++++++++++++++++++--------- yarn.lock | 44 ++++++++++++++++++------------------ 4 files changed, 73 insertions(+), 62 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 1621c5f..1effc5e 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -30,7 +30,7 @@ const RAW_RUNTIME_STATE = ["@octokit/rest", "npm:20.0.2"],\ ["@toast/tokenservice-client", "npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz"],\ ["@types/ms", "npm:0.7.34"],\ - ["@types/node", "npm:20.11.25"],\ + ["@types/node", "npm:20.11.27"],\ ["@types/node-cron", "npm:3.0.11"],\ ["@types/pg", "npm:8.11.2"],\ ["@types/sequelize", "npm:4.28.20"],\ @@ -38,7 +38,7 @@ const RAW_RUNTIME_STATE = ["dayjs", "npm:1.11.10"],\ ["discord.js", "npm:14.14.1"],\ ["fast-xml-parser", "npm:4.3.5"],\ - ["mathjs", "npm:12.4.0"],\ + ["mathjs", "npm:12.4.1"],\ ["ms", "npm:2.1.3"],\ ["node-cron", "npm:3.0.3"],\ ["pg", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:8.11.3"],\ @@ -46,9 +46,9 @@ const RAW_RUNTIME_STATE = ["redis", "npm:4.6.13"],\ ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.37.1"],\ ["simple-git", "npm:3.22.0"],\ - ["systeminformation", "npm:5.22.0"],\ + ["systeminformation", "npm:5.22.2"],\ ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ - ["undici", "npm:6.7.1"]\ + ["undici", "npm:6.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -632,7 +632,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-continuation-local-storage-npm-3.2.7-763e4dc12b-1f272b53bc.zip/node_modules/@types/continuation-local-storage/",\ "packageDependencies": [\ ["@types/continuation-local-storage", "npm:3.2.7"],\ - ["@types/node", "npm:20.11.25"]\ + ["@types/node", "npm:20.11.27"]\ ],\ "linkType": "HARD"\ }]\ @@ -666,10 +666,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/node", [\ - ["npm:20.11.25", {\ - "packageLocation": "./.yarn/cache/@types-node-npm-20.11.25-b6ac39dd46-861265f1bb.zip/node_modules/@types/node/",\ + ["npm:20.11.27", {\ + "packageLocation": "./.yarn/cache/@types-node-npm-20.11.27-63306d6ffa-4be53485d4.zip/node_modules/@types/node/",\ "packageDependencies": [\ - ["@types/node", "npm:20.11.25"],\ + ["@types/node", "npm:20.11.27"],\ ["undici-types", "npm:5.26.5"]\ ],\ "linkType": "HARD"\ @@ -689,7 +689,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-pg-npm-8.11.2-bdf321bea4-7c05cf63be.zip/node_modules/@types/pg/",\ "packageDependencies": [\ ["@types/pg", "npm:8.11.2"],\ - ["@types/node", "npm:20.11.25"],\ + ["@types/node", "npm:20.11.27"],\ ["pg-protocol", "npm:1.6.0"],\ ["pg-types", "npm:4.0.2"]\ ],\ @@ -723,7 +723,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-ws-npm-8.5.10-a877a38f71-9b414dc5e0.zip/node_modules/@types/ws/",\ "packageDependencies": [\ ["@types/ws", "npm:8.5.10"],\ - ["@types/node", "npm:20.11.25"]\ + ["@types/node", "npm:20.11.27"]\ ],\ "linkType": "HARD"\ }],\ @@ -731,7 +731,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-ws-npm-8.5.9-91d1b2ab07-7cf66383b8.zip/node_modules/@types/ws/",\ "packageDependencies": [\ ["@types/ws", "npm:8.5.9"],\ - ["@types/node", "npm:20.11.25"]\ + ["@types/node", "npm:20.11.27"]\ ],\ "linkType": "HARD"\ }]\ @@ -799,7 +799,7 @@ const RAW_RUNTIME_STATE = ["@octokit/rest", "npm:20.0.2"],\ ["@toast/tokenservice-client", "npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz"],\ ["@types/ms", "npm:0.7.34"],\ - ["@types/node", "npm:20.11.25"],\ + ["@types/node", "npm:20.11.27"],\ ["@types/node-cron", "npm:3.0.11"],\ ["@types/pg", "npm:8.11.2"],\ ["@types/sequelize", "npm:4.28.20"],\ @@ -807,7 +807,7 @@ const RAW_RUNTIME_STATE = ["dayjs", "npm:1.11.10"],\ ["discord.js", "npm:14.14.1"],\ ["fast-xml-parser", "npm:4.3.5"],\ - ["mathjs", "npm:12.4.0"],\ + ["mathjs", "npm:12.4.1"],\ ["ms", "npm:2.1.3"],\ ["node-cron", "npm:3.0.3"],\ ["pg", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:8.11.3"],\ @@ -815,9 +815,9 @@ const RAW_RUNTIME_STATE = ["redis", "npm:4.6.13"],\ ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.37.1"],\ ["simple-git", "npm:3.22.0"],\ - ["systeminformation", "npm:5.22.0"],\ + ["systeminformation", "npm:5.22.2"],\ ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ - ["undici", "npm:6.7.1"]\ + ["undici", "npm:6.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -1015,10 +1015,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["mathjs", [\ - ["npm:12.4.0", {\ - "packageLocation": "./.yarn/cache/mathjs-npm-12.4.0-4e73cebf2f-ee168a7e4b.zip/node_modules/mathjs/",\ + ["npm:12.4.1", {\ + "packageLocation": "./.yarn/cache/mathjs-npm-12.4.1-ca45bb0559-171cdf4b6a.zip/node_modules/mathjs/",\ "packageDependencies": [\ - ["mathjs", "npm:12.4.0"],\ + ["mathjs", "npm:12.4.1"],\ ["@babel/runtime", "npm:7.24.0"],\ ["complex.js", "npm:2.1.1"],\ ["decimal.js", "npm:10.4.3"],\ @@ -1487,10 +1487,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["systeminformation", [\ - ["npm:5.22.0", {\ - "packageLocation": "./.yarn/unplugged/systeminformation-npm-5.22.0-ae815bb44c/node_modules/systeminformation/",\ + ["npm:5.22.2", {\ + "packageLocation": "./.yarn/unplugged/systeminformation-npm-5.22.2-646ba0b2c9/node_modules/systeminformation/",\ "packageDependencies": [\ - ["systeminformation", "npm:5.22.0"]\ + ["systeminformation", "npm:5.22.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1575,10 +1575,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:6.7.1", {\ - "packageLocation": "./.yarn/cache/undici-npm-6.7.1-cc741edc29-7e66eb7fb6.zip/node_modules/undici/",\ + ["npm:6.9.0", {\ + "packageLocation": "./.yarn/cache/undici-npm-6.9.0-9cc1c4dd88-ee22751758.zip/node_modules/undici/",\ "packageDependencies": [\ - ["undici", "npm:6.7.1"]\ + ["undici", "npm:6.9.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -1624,7 +1624,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/wkx-npm-0.5.0-fca5152cd8-b8975e33f9.zip/node_modules/wkx/",\ "packageDependencies": [\ ["wkx", "npm:0.5.0"],\ - ["@types/node", "npm:20.11.25"]\ + ["@types/node", "npm:20.11.27"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/package.json b/package.json index 2e02daa..0895d5e 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "dayjs": "1.11.10", "discord.js": "14.14.1", "fast-xml-parser": "4.3.5", - "mathjs": "12.4.0", + "mathjs": "12.4.1", "ms": "2.1.3", "node-cron": "3.0.3", "pg": "8.11.3", @@ -42,12 +42,12 @@ "redis": "4.6.13", "sequelize": "6.37.1", "simple-git": "3.22.0", - "systeminformation": "5.22.0", - "undici": "6.7.1" + "systeminformation": "5.22.2", + "undici": "6.9.0" }, "devDependencies": { "@types/ms": "0.7.34", - "@types/node": "20.11.25", + "@types/node": "20.11.27", "@types/node-cron": "3.0.11", "@types/pg": "8.11.2", "@types/sequelize": "4.28.20", diff --git a/src/modules/MPModule.ts b/src/modules/MPModule.ts index bf44bcf..f027d3d 100644 --- a/src/modules/MPModule.ts +++ b/src/modules/MPModule.ts @@ -8,7 +8,6 @@ import {IServer} from '../models/MPServer.js'; import {XMLParser} from 'fast-xml-parser'; import {FSPlayer, FSData, FSCareerSavegame} from 'src/interfaces'; -let failedAttempts:number = 0; let loggingPrefix:string = 'MPModule'; let dataUnavailable:string = 'Unavailable'; export let refreshTimerSecs:number = 45000; @@ -17,6 +16,10 @@ let refreshIntrvlTxt:string = `Refreshes every ${refreshTimerSecs/1000} seconds. let offlineStatus:string = 'Server is offline'; let unavailableStatus:string = 'Server didn\'t respond'; +interface IServerExt extends IServer { + failureCount?:number; +} + export default async(client:TClient)=>{ const message = await (client.channels.resolve(isBotInDevMode ? '1091300529696673792' : '543494084363288637') as Discord.TextChannel).messages.fetch(isBotInDevMode ? '1104563309451161742' : '1149141188079779900'); if (!client.config.botSwitches.mpSys) return message.edit({content: null, embeds: [mpModuleDisabled(client)]}); @@ -123,25 +126,33 @@ async function multifarmWebhook(client:TClient, server:IServer, webhookId:string }) } -export async function requestServerData(client:TClient, server:IServer):Promise<{dss:FSData, csg:FSCareerSavegame}|undefined>{ +export async function requestServerData(client:TClient, server:IServerExt):Promise<{dss:FSData, csg:FSCareerSavegame}|undefined>{ async function retryReqs(url:string) { // Attempt to reduce the failure rate of the requests before giving up and retrying in next refresh. - let maxRetries:number = 3; + let maxRetries:number = 4; + let delay:number = 500; + for (let i = 0; i < maxRetries; i++) { try { const data = await Undici.fetch(url, {keepalive: true, signal: AbortSignal.timeout(12000), headers: {'User-Agent': `${client.user.username} - MPModule/undici`}}); - if (data.status === 200 ?? 204) return data; - else if (data.status === 404) Logger.console('log', loggingPrefix, `(${i+1}/${maxRetries}) ${server.serverName} responded with an error (404), API is disabled or mismatched code`) + if (data.status === 200 ?? 204) { + server.failureCount = 0; + delay = 500; + return data + } else if (data.status === 404) Logger.console('log', loggingPrefix, `(${i+1}/${maxRetries}) ${server.serverName} responded with an error (404), API is disabled or mismatched code`); + else if (data.status === 400) Logger.console('log', loggingPrefix, `(${i+1}/${maxRetries}) ${server.serverName} responded with an error (400), bad endpoint or ratelimited`); // Seems to be taking L's left and right hourly... } catch(err) { Logger.console('log', loggingPrefix, `Couldn't get data for ${server.serverName}: ${err.message}`); - failedAttempts++; - if (failedAttempts >= 5 && server.isActive) { - Logger.console('log', loggingPrefix, `Maximum failed requests (${failedAttempts}) reached for ${server.serverName}, silenced server for 10 minutes`); + server.failureCount++; + if (server.failureCount >= 6 && server.isActive) { + Logger.console('log', loggingPrefix, `Maximum failed requests (${server.failureCount}) reached for ${server.serverName}, silenced server for 10 minutes`); silenceServer(client, server, 600000); } return null; } - await new Promise(resolve=>setTimeout(resolve, 500)) + await new Promise(resolve=>setTimeout(resolve, delay)); + delay *= 2; + console.log('Request delayed by %d for %s', delay, server.serverName); } return null; } @@ -189,8 +200,8 @@ function convertPlayerUptime(playTime:number) { return (Days > 0 ? Days+' d ':'')+(Hours > 0 ? Hours+' h ':'')+(Minutes > 0 ? Minutes+' m':'') } -function silenceServer(client:TClient, server:IServer, time:number):void { +function silenceServer(client:TClient, server:IServerExt, time:number):void { client.MPServer.toggleServerUsability(server.serverName, false); setTimeout(()=>client.MPServer.toggleServerUsability(server.serverName, true), time) - failedAttempts = 0; + server.failureCount = 0; } diff --git a/yarn.lock b/yarn.lock index 000f929..36852b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,7 +5,7 @@ __metadata: version: 8 cacheKey: 10 -"@babel/runtime@npm:^7.23.9": +"@babel/runtime@npm:^7.24.0": version: 7.24.0 resolution: "@babel/runtime@npm:7.24.0" dependencies: @@ -482,12 +482,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:20.11.25": - version: 20.11.25 - resolution: "@types/node@npm:20.11.25" +"@types/node@npm:*, @types/node@npm:20.11.27": + version: 20.11.27 + resolution: "@types/node@npm:20.11.27" dependencies: undici-types: "npm:~5.26.4" - checksum: 10/861265f1bbb151404bd8842b595f027a4ff067c61ecff9a37b9f7f53922c18dd532c8e795e8e7675dd8dba056645623fd2b9848d5ef72863ec3609096cd2923e + checksum: 10/4be53485d499dd7c7896190e76a0ce1f6c6917d1f4d0b4b240b3670160fcbc548daed32beaac0fc92429b37dbeaa2496fc56f460acaab969bddb77394318a89b languageName: node linkType: hard @@ -589,7 +589,7 @@ __metadata: "@octokit/rest": "npm:20.0.2" "@toast/tokenservice-client": "npm:1.0.16" "@types/ms": "npm:0.7.34" - "@types/node": "npm:20.11.25" + "@types/node": "npm:20.11.27" "@types/node-cron": "npm:3.0.11" "@types/pg": "npm:8.11.2" "@types/sequelize": "npm:4.28.20" @@ -597,7 +597,7 @@ __metadata: dayjs: "npm:1.11.10" discord.js: "npm:14.14.1" fast-xml-parser: "npm:4.3.5" - mathjs: "npm:12.4.0" + mathjs: "npm:12.4.1" ms: "npm:2.1.3" node-cron: "npm:3.0.3" pg: "npm:8.11.3" @@ -605,9 +605,9 @@ __metadata: redis: "npm:4.6.13" sequelize: "npm:6.37.1" simple-git: "npm:3.22.0" - systeminformation: "npm:5.22.0" + systeminformation: "npm:5.22.2" typescript: "npm:5.4.2" - undici: "npm:6.7.1" + undici: "npm:6.9.0" languageName: unknown linkType: soft @@ -763,11 +763,11 @@ __metadata: languageName: node linkType: hard -"mathjs@npm:12.4.0": - version: 12.4.0 - resolution: "mathjs@npm:12.4.0" +"mathjs@npm:12.4.1": + version: 12.4.1 + resolution: "mathjs@npm:12.4.1" dependencies: - "@babel/runtime": "npm:^7.23.9" + "@babel/runtime": "npm:^7.24.0" complex.js: "npm:^2.1.1" decimal.js: "npm:^10.4.3" escape-latex: "npm:^1.2.0" @@ -778,7 +778,7 @@ __metadata: typed-function: "npm:^4.1.1" bin: mathjs: bin/cli.js - checksum: 10/ee168a7e4be0bebe9fbd69292462f162d6aae973500e00dbf00f44392ccf80f4de86883819576df2434e9b3e4d6c222a14613e2c0450db8316c373f130bee2b6 + checksum: 10/171cdf4b6ad4786f902d112d4208a2e5b02381cd08a2b974d957b56d0102808064ddfcc7b953bef6022ad0302f3181b7f6146b3be6b54a240579a36b90c463ff languageName: node linkType: hard @@ -1146,12 +1146,12 @@ __metadata: languageName: node linkType: hard -"systeminformation@npm:5.22.0": - version: 5.22.0 - resolution: "systeminformation@npm:5.22.0" +"systeminformation@npm:5.22.2": + version: 5.22.2 + resolution: "systeminformation@npm:5.22.2" bin: systeminformation: lib/cli.js - checksum: 10/a739041bf0ef572eaebd06819ed54bb5f4a785793e3d542f16f39914ae5bbbf7d44b204ec936dcf560056709e97e2e55c11ee3ceda7b9585e778979f63ab7e3b + checksum: 10/ec74e682d77e86997d76460e8b74fa7a22c8f0a9adc3c9f46fec8bbb13f76fe86f590c3c52cf20f7cfbb0cf51e9c07f9a8170515a9d7cfd0dd087b99edaf6659 conditions: (os=darwin | os=linux | os=win32 | os=freebsd | os=openbsd | os=netbsd | os=sunos | os=android) languageName: node linkType: hard @@ -1243,10 +1243,10 @@ __metadata: languageName: node linkType: hard -"undici@npm:6.7.1": - version: 6.7.1 - resolution: "undici@npm:6.7.1" - checksum: 10/7e66eb7fb6b3641efc9381b335334a7fe0d69d4b8004147b2a7658f279adfd392fb908acf71627e2cd1f863d9ab4d5b1470139364468d486ab69aee43a8246e5 +"undici@npm:6.9.0": + version: 6.9.0 + resolution: "undici@npm:6.9.0" + checksum: 10/ee227517586f96b73db3b7a24387f101d191df6a6395ec0199688d6e56195dbe8c9d3456be2fa4a70af30fb1a9a905142826f9bf89c328dec842f00b55e9e5c2 languageName: node linkType: hard From ca3f926cb89543554bec776df90c97c1f05a222b Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Fri, 15 Mar 2024 21:02:30 +1100 Subject: [PATCH 03/10] bruh.exe has stopped responding. --- src/components/CacheServer.ts | 1 + src/events/interactionCreate.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/CacheServer.ts b/src/components/CacheServer.ts index c755a45..e47280d 100644 --- a/src/components/CacheServer.ts +++ b/src/components/CacheServer.ts @@ -29,6 +29,7 @@ export default class CacheServer { if (jsonMode) return await RedisClient.json.set(key, '.', value); else return await RedisClient.set(key, JSON.stringify(value)); } + /** @param time Cache expiration in seconds */ public static expiry = async(key:any, time:number)=>await RedisClient.expire(key, time); // NOTE: time is in seconds, not milliseconds -- you know what you did wrong public static delete = async(key:any)=>await RedisClient.del(key); public static init() { diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index 80bc9c1..0d574f6 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -2,6 +2,7 @@ import Discord from 'discord.js'; import TClient from '../client.js'; import Logger from '../helpers/Logger.js'; import MessageTool from '../helpers/MessageTool.js'; +import CacheServer from '../components/CacheServer.js'; const logPrefix = 'Interaction'; export default class InteractionCreate { static async run(client:TClient, interaction:Discord.BaseInteraction){ @@ -41,17 +42,24 @@ export default class InteractionCreate { return console.log('An error occurred while running autocomplete:\n', error) } } - static handleButton(client:TClient, interaction:Discord.ButtonInteraction<'cached'>) { + static async handleButton(client:TClient, interaction:Discord.ButtonInteraction<'cached'>) { + const time = Date.now(); if (interaction.customId.startsWith('reaction-') && client.config.botSwitches.buttonRoles){ const RoleID = interaction.customId.replace('reaction-',''); + let key = `${interaction.user.id}:role_room`; + const isRatelimited = await CacheServer.get(key, false); + const timeDiff = time - isRatelimited; + if (timeDiff < 5000) return interaction.reply({content: 'You are on **__cooldown__**, please avoid spam-clicking next time.\n\n*This system is put in place due to selfbots.. I\'m sorry!*', ephemeral: true}); + const MFFarm1 = '1149139369433776269'; const MFFarm2 = '1149139583729160325'; if (interaction.member.roles.cache.has(RoleID)) interaction.member.roles.remove(RoleID, 'Button Role').then(()=>interaction.reply({content: `You have been removed from <@&${RoleID}>`, ephemeral: true})); - else interaction.member.roles.add(RoleID, 'Button Role').then(()=>{ + else interaction.member.roles.add(RoleID, 'Button Role').then(async()=>{ this.roleConflictHandler(interaction, MFFarm1, MFFarm2, RoleID); - interaction.reply({content: `You have been added to <@&${RoleID}>`, ephemeral: true, fetchReply: true}) + await interaction.reply({content: `You have been added to <@&${RoleID}>`, ephemeral: true, fetchReply: true}); + CacheServer.set(key, time, false).then(()=>CacheServer.expiry(key, 10)); }); } else if (interaction.customId.includes('deleteEvalEmbed')) { if (!client.config.whitelist.includes(interaction.user.id)) return interaction.reply({content: 'You are not whitelisted, therefore you cannot delete this message.', ephemeral: true}); From a86efd78a55cfa53aaff5ad9f6c32fa41eec3d13 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Sat, 16 Mar 2024 20:53:39 +1100 Subject: [PATCH 04/10] Improve the code comment for API ratelimit that is set by GIANTS --- src/modules/MPModule.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/MPModule.ts b/src/modules/MPModule.ts index f027d3d..4143272 100644 --- a/src/modules/MPModule.ts +++ b/src/modules/MPModule.ts @@ -152,7 +152,8 @@ export async function requestServerData(client:TClient, server:IServerExt):Promi } await new Promise(resolve=>setTimeout(resolve, delay)); delay *= 2; - console.log('Request delayed by %d for %s', delay, server.serverName); + Logger.console('log', loggingPrefix, `Request delayed by ${delay} for ${server.serverName}`); + // Workaround for the API ratelimit (seen by panel responding with HTTP 400 apparently...) } return null; } From 6c34752c0bedbd2f8a24d7b9fa223bca189800b0 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:15:16 +1100 Subject: [PATCH 05/10] It's like trying to repair a hole in a car tire. --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b5ab9f7..c8c3290 100644 --- a/src/index.ts +++ b/src/index.ts @@ -66,7 +66,10 @@ setInterval(async()=>{ if (!dailyMsgs.find(x=>x.dataValues.day === formattedDate)) { let total = (await client.userLevels.fetchEveryone()).reduce((a,b)=>a + b.messages, 0); // Sum of all users const yesterday = dailyMsgs.find(x=>x.day === formattedDate - 1) - if (total < yesterday?.total) total = yesterday.total; // Messages went down. + if (yesterday && total < yesterday.total) Logger.console('log', 'DailyMsgs', `Total messages for day ${formattedDate} is less than total messages for day ${formattedDate - 1}.`); + // Update total if it's the same as yesterday's total + if (yesterday && total === yesterday.total) total = (await client.userLevels.fetchEveryone()).reduce((a,b)=>a + b.messages, 0); // Recalculate total + await client.dailyMsgs.newDay(formattedDate, total); Logger.console('log', 'DailyMsgs', `Pushed [${formattedDate}, ${total}]`) From 4571cdfc7eb832e299ca941ef5c5672ea2ac3d71 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:45:28 +1100 Subject: [PATCH 06/10] See if it can pick up another NPM registry --- .github/dependabot.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5dc1052..dff3940 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,7 +13,10 @@ updates: timezone: "Australia/NSW" assignees: - "toast-ts" + reviewers: + - "toast-ts" labels: - "dependencies" open-pull-requests-limit: 8 rebase-strategy: auto + registries: "*" From 49dc4c2f7eae11724a911a346a772733225bdb23 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:54:24 +1100 Subject: [PATCH 07/10] I guess we can try secrets? --- .github/dependabot.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dff3940..9920151 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,12 @@ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 +registries: + toast: + type: npm-registry + url: "https://git.toast-server.net/api/packages/toast/npm/" + token: ${{ secrets.GITEA_TOKEN }} + updates: - package-ecosystem: "npm" directory: "/" @@ -19,4 +25,5 @@ updates: - "dependencies" open-pull-requests-limit: 8 rebase-strategy: auto - registries: "*" + registries: + - toast From 711bb3a0535e0a0902e5722053ac96f46f1b6755 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:11:37 +1100 Subject: [PATCH 08/10] Combined Dependabot PR (#98) * Bump fast-xml-parser from 4.3.5 to 4.3.6 Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.3.5 to 4.3.6. - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.3.5...v4.3.6) --- updated-dependencies: - dependency-name: fast-xml-parser dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump simple-git from 3.22.0 to 3.23.0 Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.22.0 to 3.23.0. - [Release notes](https://github.com/steveukx/git-js/releases) - [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md) - [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.23.0/simple-git) --- updated-dependencies: - dependency-name: simple-git dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump @types/node from 20.11.27 to 20.11.28 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.27 to 20.11.28. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .pnp.cjs | 32 ++++++++++++++++++++------------ package.json | 6 +++--- yarn.lock | 33 +++++++++++++++++++++------------ 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 1effc5e..c6cb118 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -30,14 +30,14 @@ const RAW_RUNTIME_STATE = ["@octokit/rest", "npm:20.0.2"],\ ["@toast/tokenservice-client", "npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz"],\ ["@types/ms", "npm:0.7.34"],\ - ["@types/node", "npm:20.11.27"],\ + ["@types/node", "npm:20.11.28"],\ ["@types/node-cron", "npm:3.0.11"],\ ["@types/pg", "npm:8.11.2"],\ ["@types/sequelize", "npm:4.28.20"],\ ["ansi-colors", "npm:4.1.3"],\ ["dayjs", "npm:1.11.10"],\ ["discord.js", "npm:14.14.1"],\ - ["fast-xml-parser", "npm:4.3.5"],\ + ["fast-xml-parser", "npm:4.3.6"],\ ["mathjs", "npm:12.4.1"],\ ["ms", "npm:2.1.3"],\ ["node-cron", "npm:3.0.3"],\ @@ -45,7 +45,7 @@ const RAW_RUNTIME_STATE = ["pg-hstore", "npm:2.3.4"],\ ["redis", "npm:4.6.13"],\ ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.37.1"],\ - ["simple-git", "npm:3.22.0"],\ + ["simple-git", "npm:3.23.0"],\ ["systeminformation", "npm:5.22.2"],\ ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ ["undici", "npm:6.9.0"]\ @@ -673,6 +673,14 @@ const RAW_RUNTIME_STATE = ["undici-types", "npm:5.26.5"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:20.11.28", {\ + "packageLocation": "./.yarn/cache/@types-node-npm-20.11.28-6be967407c-b03f69213a.zip/node_modules/@types/node/",\ + "packageDependencies": [\ + ["@types/node", "npm:20.11.28"],\ + ["undici-types", "npm:5.26.5"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@types/node-cron", [\ @@ -799,14 +807,14 @@ const RAW_RUNTIME_STATE = ["@octokit/rest", "npm:20.0.2"],\ ["@toast/tokenservice-client", "npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz"],\ ["@types/ms", "npm:0.7.34"],\ - ["@types/node", "npm:20.11.27"],\ + ["@types/node", "npm:20.11.28"],\ ["@types/node-cron", "npm:3.0.11"],\ ["@types/pg", "npm:8.11.2"],\ ["@types/sequelize", "npm:4.28.20"],\ ["ansi-colors", "npm:4.1.3"],\ ["dayjs", "npm:1.11.10"],\ ["discord.js", "npm:14.14.1"],\ - ["fast-xml-parser", "npm:4.3.5"],\ + ["fast-xml-parser", "npm:4.3.6"],\ ["mathjs", "npm:12.4.1"],\ ["ms", "npm:2.1.3"],\ ["node-cron", "npm:3.0.3"],\ @@ -814,7 +822,7 @@ const RAW_RUNTIME_STATE = ["pg-hstore", "npm:2.3.4"],\ ["redis", "npm:4.6.13"],\ ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.37.1"],\ - ["simple-git", "npm:3.22.0"],\ + ["simple-git", "npm:3.23.0"],\ ["systeminformation", "npm:5.22.2"],\ ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ ["undici", "npm:6.9.0"]\ @@ -932,10 +940,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["fast-xml-parser", [\ - ["npm:4.3.5", {\ - "packageLocation": "./.yarn/cache/fast-xml-parser-npm-4.3.5-3cd12e5b84-ccfd943e4e.zip/node_modules/fast-xml-parser/",\ + ["npm:4.3.6", {\ + "packageLocation": "./.yarn/cache/fast-xml-parser-npm-4.3.6-b71efbeb6c-3e431e5949.zip/node_modules/fast-xml-parser/",\ "packageDependencies": [\ - ["fast-xml-parser", "npm:4.3.5"],\ + ["fast-xml-parser", "npm:4.3.6"],\ ["strnum", "npm:1.0.5"]\ ],\ "linkType": "HARD"\ @@ -1457,10 +1465,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["simple-git", [\ - ["npm:3.22.0", {\ - "packageLocation": "./.yarn/cache/simple-git-npm-3.22.0-42ea3caec2-309e7f0b73.zip/node_modules/simple-git/",\ + ["npm:3.23.0", {\ + "packageLocation": "./.yarn/cache/simple-git-npm-3.23.0-a7d8879afb-08ddfcbc31.zip/node_modules/simple-git/",\ "packageDependencies": [\ - ["simple-git", "npm:3.22.0"],\ + ["simple-git", "npm:3.23.0"],\ ["@kwsites/file-exists", "npm:1.1.1"],\ ["@kwsites/promise-deferred", "npm:1.1.1"],\ ["debug", "virtual:8dde907e274d6cda4b3be6cd808e5a16421eab0e2ce2f6110b97323dbadda969b2dab36e690fd106d5bd3c87e0525cade2b2ba6fb4fb0c0e439212e4cf5c851b#npm:4.3.4"]\ diff --git a/package.json b/package.json index 0895d5e..ad41afe 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "ansi-colors": "4.1.3", "dayjs": "1.11.10", "discord.js": "14.14.1", - "fast-xml-parser": "4.3.5", + "fast-xml-parser": "4.3.6", "mathjs": "12.4.1", "ms": "2.1.3", "node-cron": "3.0.3", @@ -41,13 +41,13 @@ "pg-hstore": "2.3.4", "redis": "4.6.13", "sequelize": "6.37.1", - "simple-git": "3.22.0", + "simple-git": "3.23.0", "systeminformation": "5.22.2", "undici": "6.9.0" }, "devDependencies": { "@types/ms": "0.7.34", - "@types/node": "20.11.27", + "@types/node": "20.11.28", "@types/node-cron": "3.0.11", "@types/pg": "8.11.2", "@types/sequelize": "4.28.20", diff --git a/yarn.lock b/yarn.lock index 36852b3..a9a4f93 100644 --- a/yarn.lock +++ b/yarn.lock @@ -482,7 +482,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:20.11.27": +"@types/node@npm:*": version: 20.11.27 resolution: "@types/node@npm:20.11.27" dependencies: @@ -491,6 +491,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:20.11.28": + version: 20.11.28 + resolution: "@types/node@npm:20.11.28" + dependencies: + undici-types: "npm:~5.26.4" + checksum: 10/b03f69213ac6e7cd5f7efa86139f24e23ff70a12fed04adeac5413b62d6982343ce94906f74c401c5afefda48d36ae0efd6a575240996b15a5cf80b456ab4221 + languageName: node + linkType: hard + "@types/pg@npm:8.11.2": version: 8.11.2 resolution: "@types/pg@npm:8.11.2" @@ -589,14 +598,14 @@ __metadata: "@octokit/rest": "npm:20.0.2" "@toast/tokenservice-client": "npm:1.0.16" "@types/ms": "npm:0.7.34" - "@types/node": "npm:20.11.27" + "@types/node": "npm:20.11.28" "@types/node-cron": "npm:3.0.11" "@types/pg": "npm:8.11.2" "@types/sequelize": "npm:4.28.20" ansi-colors: "npm:4.1.3" dayjs: "npm:1.11.10" discord.js: "npm:14.14.1" - fast-xml-parser: "npm:4.3.5" + fast-xml-parser: "npm:4.3.6" mathjs: "npm:12.4.1" ms: "npm:2.1.3" node-cron: "npm:3.0.3" @@ -604,7 +613,7 @@ __metadata: pg-hstore: "npm:2.3.4" redis: "npm:4.6.13" sequelize: "npm:6.37.1" - simple-git: "npm:3.22.0" + simple-git: "npm:3.23.0" systeminformation: "npm:5.22.2" typescript: "npm:5.4.2" undici: "npm:6.9.0" @@ -694,14 +703,14 @@ __metadata: languageName: node linkType: hard -"fast-xml-parser@npm:4.3.5": - version: 4.3.5 - resolution: "fast-xml-parser@npm:4.3.5" +"fast-xml-parser@npm:4.3.6": + version: 4.3.6 + resolution: "fast-xml-parser@npm:4.3.6" dependencies: strnum: "npm:^1.0.5" bin: fxparser: src/cli/cli.js - checksum: 10/ccfd943e4ed400bf3acd4b6fcba9a15ec992a4a76c9a0cf825fc06f2b35a79a6d1de477b9a73c23633597c4f2a35838550ec3013a056f2591aa8cb3989d1f242 + checksum: 10/3e431e594960f04996e60a01fb51d8f4346138a7ba60d97244bf7866a3072eaf2f6dc73008d7b07871b98b606a8d7db955efdeae787992f685dd0e5bcc67c36a languageName: node linkType: hard @@ -1121,14 +1130,14 @@ __metadata: languageName: node linkType: hard -"simple-git@npm:3.22.0": - version: 3.22.0 - resolution: "simple-git@npm:3.22.0" +"simple-git@npm:3.23.0": + version: 3.23.0 + resolution: "simple-git@npm:3.23.0" dependencies: "@kwsites/file-exists": "npm:^1.1.1" "@kwsites/promise-deferred": "npm:^1.1.1" debug: "npm:^4.3.4" - checksum: 10/309e7f0b73550f99949c0c6cfd4b4799ec0452fc4835dc440f89ec9351fe553c979c4e2bf7a772308e608697d3a27512281fbc64df0328a73607641f389b0aaf + checksum: 10/08ddfcbc310bfeaba066ef7b0d178967d9984aa1bc5e29f0360d166b0ccf820a3e5bb67d02036fca40fde6cdfc998f2b5fb2db9a8bbbad29b4feb4c1391f39e0 languageName: node linkType: hard From 4a1d4e9eedcc8702614704ec5cc512d3814a6db1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:14:29 +1100 Subject: [PATCH 09/10] Bump systeminformation from 5.22.2 to 5.22.3 (#95) Bumps [systeminformation](https://github.com/sebhildebrandt/systeminformation) from 5.22.2 to 5.22.3. - [Changelog](https://github.com/sebhildebrandt/systeminformation/blob/master/CHANGELOG.md) - [Commits](https://github.com/sebhildebrandt/systeminformation/compare/v5.22.2...v5.22.3) --- updated-dependencies: - dependency-name: systeminformation dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .pnp.cjs | 10 +++++----- package.json | 2 +- yarn.lock | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index c6cb118..072d726 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -46,7 +46,7 @@ const RAW_RUNTIME_STATE = ["redis", "npm:4.6.13"],\ ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.37.1"],\ ["simple-git", "npm:3.23.0"],\ - ["systeminformation", "npm:5.22.2"],\ + ["systeminformation", "npm:5.22.3"],\ ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ ["undici", "npm:6.9.0"]\ ],\ @@ -823,7 +823,7 @@ const RAW_RUNTIME_STATE = ["redis", "npm:4.6.13"],\ ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.37.1"],\ ["simple-git", "npm:3.23.0"],\ - ["systeminformation", "npm:5.22.2"],\ + ["systeminformation", "npm:5.22.3"],\ ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ ["undici", "npm:6.9.0"]\ ],\ @@ -1495,10 +1495,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["systeminformation", [\ - ["npm:5.22.2", {\ - "packageLocation": "./.yarn/unplugged/systeminformation-npm-5.22.2-646ba0b2c9/node_modules/systeminformation/",\ + ["npm:5.22.3", {\ + "packageLocation": "./.yarn/unplugged/systeminformation-npm-5.22.3-b08524e9a7/node_modules/systeminformation/",\ "packageDependencies": [\ - ["systeminformation", "npm:5.22.2"]\ + ["systeminformation", "npm:5.22.3"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/package.json b/package.json index ad41afe..6ee44ad 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "redis": "4.6.13", "sequelize": "6.37.1", "simple-git": "3.23.0", - "systeminformation": "5.22.2", + "systeminformation": "5.22.3", "undici": "6.9.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index a9a4f93..f94fdc7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -614,7 +614,7 @@ __metadata: redis: "npm:4.6.13" sequelize: "npm:6.37.1" simple-git: "npm:3.23.0" - systeminformation: "npm:5.22.2" + systeminformation: "npm:5.22.3" typescript: "npm:5.4.2" undici: "npm:6.9.0" languageName: unknown @@ -1155,12 +1155,12 @@ __metadata: languageName: node linkType: hard -"systeminformation@npm:5.22.2": - version: 5.22.2 - resolution: "systeminformation@npm:5.22.2" +"systeminformation@npm:5.22.3": + version: 5.22.3 + resolution: "systeminformation@npm:5.22.3" bin: systeminformation: lib/cli.js - checksum: 10/ec74e682d77e86997d76460e8b74fa7a22c8f0a9adc3c9f46fec8bbb13f76fe86f590c3c52cf20f7cfbb0cf51e9c07f9a8170515a9d7cfd0dd087b99edaf6659 + checksum: 10/a4b0bf49e5319424c828aff805a7cf158235ec79407039acfa13133e9dcfe2b6121aaafeffec94cae45dc85899dd91fd00583a4bc018ed507d38a4aea7ae6459 conditions: (os=darwin | os=linux | os=win32 | os=freebsd | os=openbsd | os=netbsd | os=sunos | os=android) languageName: node linkType: hard From 3309da55f26e259cf5fba952cc7effc69a3e49d3 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:17:25 +1100 Subject: [PATCH 10/10] Dedupe @types/node --- .pnp.cjs | 18 +++++------------- yarn.lock | 11 +---------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 072d726..0ed9e3b 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -632,7 +632,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-continuation-local-storage-npm-3.2.7-763e4dc12b-1f272b53bc.zip/node_modules/@types/continuation-local-storage/",\ "packageDependencies": [\ ["@types/continuation-local-storage", "npm:3.2.7"],\ - ["@types/node", "npm:20.11.27"]\ + ["@types/node", "npm:20.11.28"]\ ],\ "linkType": "HARD"\ }]\ @@ -666,14 +666,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/node", [\ - ["npm:20.11.27", {\ - "packageLocation": "./.yarn/cache/@types-node-npm-20.11.27-63306d6ffa-4be53485d4.zip/node_modules/@types/node/",\ - "packageDependencies": [\ - ["@types/node", "npm:20.11.27"],\ - ["undici-types", "npm:5.26.5"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:20.11.28", {\ "packageLocation": "./.yarn/cache/@types-node-npm-20.11.28-6be967407c-b03f69213a.zip/node_modules/@types/node/",\ "packageDependencies": [\ @@ -697,7 +689,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-pg-npm-8.11.2-bdf321bea4-7c05cf63be.zip/node_modules/@types/pg/",\ "packageDependencies": [\ ["@types/pg", "npm:8.11.2"],\ - ["@types/node", "npm:20.11.27"],\ + ["@types/node", "npm:20.11.28"],\ ["pg-protocol", "npm:1.6.0"],\ ["pg-types", "npm:4.0.2"]\ ],\ @@ -731,7 +723,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-ws-npm-8.5.10-a877a38f71-9b414dc5e0.zip/node_modules/@types/ws/",\ "packageDependencies": [\ ["@types/ws", "npm:8.5.10"],\ - ["@types/node", "npm:20.11.27"]\ + ["@types/node", "npm:20.11.28"]\ ],\ "linkType": "HARD"\ }],\ @@ -739,7 +731,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-ws-npm-8.5.9-91d1b2ab07-7cf66383b8.zip/node_modules/@types/ws/",\ "packageDependencies": [\ ["@types/ws", "npm:8.5.9"],\ - ["@types/node", "npm:20.11.27"]\ + ["@types/node", "npm:20.11.28"]\ ],\ "linkType": "HARD"\ }]\ @@ -1632,7 +1624,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/wkx-npm-0.5.0-fca5152cd8-b8975e33f9.zip/node_modules/wkx/",\ "packageDependencies": [\ ["wkx", "npm:0.5.0"],\ - ["@types/node", "npm:20.11.27"]\ + ["@types/node", "npm:20.11.28"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/yarn.lock b/yarn.lock index f94fdc7..0c0e531 100644 --- a/yarn.lock +++ b/yarn.lock @@ -482,16 +482,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*": - version: 20.11.27 - resolution: "@types/node@npm:20.11.27" - dependencies: - undici-types: "npm:~5.26.4" - checksum: 10/4be53485d499dd7c7896190e76a0ce1f6c6917d1f4d0b4b240b3670160fcbc548daed32beaac0fc92429b37dbeaa2496fc56f460acaab969bddb77394318a89b - languageName: node - linkType: hard - -"@types/node@npm:20.11.28": +"@types/node@npm:*, @types/node@npm:20.11.28": version: 20.11.28 resolution: "@types/node@npm:20.11.28" dependencies: