From e30edf77d2cc27db97a6b6b1f845730c4924046c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 08:59:20 -0400 Subject: ticket --- src/commands/tickets/ticket-!.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/commands/tickets/ticket-!.ts diff --git a/src/commands/tickets/ticket-!.ts b/src/commands/tickets/ticket-!.ts new file mode 100644 index 0000000..e69de29 -- cgit From bddeb83bc0641a059a08c5887e6585c759c3b643 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 08:59:39 -0400 Subject: invite info --- src/commands/info/inviteInfo.ts | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/commands/info/inviteInfo.ts diff --git a/src/commands/info/inviteInfo.ts b/src/commands/info/inviteInfo.ts new file mode 100644 index 0000000..bfe7eae --- /dev/null +++ b/src/commands/info/inviteInfo.ts @@ -0,0 +1,43 @@ +import { Arg, ArgType, BushCommand, clientSendAndPermCheck, colors, type CommandMessage, type SlashMessage } from '#lib'; +import { ApplicationCommandOptionType, EmbedBuilder, Invite, PermissionFlagsBits } from 'discord.js'; + +export default class InviteInfoCommand extends BushCommand { + public constructor() { + super('inviteInfo', { + aliases: ['invite-info', 'ii'], + category: 'info', + description: 'Get info about an invite.', + usage: ['invite-info [invite]'], + examples: ['invite-info discord.gg/moulberry'], + args: [ + { + id: 'invite', + description: 'The guild to find information about.', + type: 'invite', + prompt: 'What invite would you like to find information about?', + retry: '{error} Choose a valid invite to find information about.', + slashType: ApplicationCommandOptionType.String + } + ], + slash: true, + clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), + userPermissions: [] + }); + } + + public override async exec(message: CommandMessage | SlashMessage, args: { invite: ArgType<'invite' | 'string'> }) { + const invite = message.util.isSlashMessage(message) + ? ((await Arg.cast('invite', message, args.invite as string)) as ArgType<'invite'>) + : args.invite; + + const inviteInfoEmbed = new EmbedBuilder().setTitle(`Invite to ${invite.guild.name}`).setColor(colors.default); + + this.generateAboutField(inviteInfoEmbed, invite); + } + + private generateAboutField(embed: EmbedBuilder, invite: Invite) { + const about = [`**code:** ${invite.code}`, `**channel:** ${}`]; + + embed.addFields({ name: '» About', value: about.join('\n') }); + } +} -- cgit From 7cec4037ead3287c1d88db4274824b21d9d57d51 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 09:01:43 -0400 Subject: messing around with repo stuff --- assets/Faithful.ttf | Bin 0 -> 275832 bytes package.json | 1 + src/bot.ts | 46 ++--- src/commands/moulberry-bush/neuRepo.ts | 47 +++++ src/lib/common/util/Minecraft.ts | 303 +++++++++++++++++++++++++++++++++ src/tasks/cache/updateNeuItemCache.ts | 12 ++ tsconfig.json | 34 ++-- vite.config.ts | 14 +- yarn.lock | 8 + 9 files changed, 423 insertions(+), 42 deletions(-) create mode 100644 assets/Faithful.ttf create mode 100644 src/commands/moulberry-bush/neuRepo.ts create mode 100644 src/lib/common/util/Minecraft.ts create mode 100644 src/tasks/cache/updateNeuItemCache.ts diff --git a/assets/Faithful.ttf b/assets/Faithful.ttf new file mode 100644 index 0000000..aaadb94 Binary files /dev/null and b/assets/Faithful.ttf differ diff --git a/package.json b/package.json index 971378b..c1882bc 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "dependencies": { "@discordjs/builders": "^0.15.0", "@discordjs/rest": "^0.5.0", + "@ironm00n/nbt-ts": "^1.4.0", "@notenoughupdates/discord.js-minesweeper": "^1.0.10", "@notenoughupdates/events-intercept": "^3.0.1", "@notenoughupdates/humanize-duration": "^4.0.1", diff --git a/src/bot.ts b/src/bot.ts index d7b5ad9..640f2ab 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -1,23 +1,29 @@ -import { init } from './lib/utils/BushLogger.js'; -// creates proxies on console.log and console.warn -// also starts a REPL session -init(); +// import { init } from './lib/utils/BushLogger.js'; +// // creates proxies on console.log and console.warn +// // also starts a REPL session +// init(); -const { dirname } = await import('path'); -const { fileURLToPath } = await import('url'); -const { default: config } = await import('../config/options.js'); -const { Sentry } = await import('./lib/common/Sentry.js'); -const { BushClient } = await import('./lib/index.js'); - -const isDry = process.argv.includes('dry'); -if (!isDry && config.credentials.sentryDsn !== null) new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd(), config); -BushClient.extendStructures(); -const client = new BushClient(config); -if (!isDry) await client.dbPreInit(); -await client.init(); -if (isDry) { - await client.destroy(); - process.exit(0); +// eslint-disable-next-line no-constant-condition +if (false) { + // const { dirname } = await import('path'); + // const { fileURLToPath } = await import('url'); + // const { default: config } = await import('../config/options.js'); + // const { Sentry } = await import('./lib/common/Sentry.js'); + // const { BushClient } = await import('./lib/index.js'); + // + // const isDry = process.argv.includes('dry'); + // if (!isDry && config.credentials.sentryDsn !== null) + // new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd(), config); + // BushClient.extendStructures(); + // const client = new BushClient(config); + // if (!isDry) await client.dbPreInit(); + // await client.init(); + // if (isDry) { + // await client.destroy(); + // process.exit(0); + // } else { + // await client.start(); + // } } else { - await client.start(); + import('./lib/common/util/Minecraft.js'); } diff --git a/src/commands/moulberry-bush/neuRepo.ts b/src/commands/moulberry-bush/neuRepo.ts new file mode 100644 index 0000000..24f83ad --- /dev/null +++ b/src/commands/moulberry-bush/neuRepo.ts @@ -0,0 +1,47 @@ +import { BushCommand, clientSendAndPermCheck, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; +import { ApplicationCommandOptionType, AutocompleteInteraction, CacheType, PermissionFlagsBits } from 'discord.js'; + +export default class NeuRepoCommand extends BushCommand { + public static items: { name: string; id: string }[] = []; + + public constructor() { + super('neuRepo', { + aliases: ['neu-repo', 'repo-item', 'neu-item', 'item-repo'], + category: "Moulberry's Bush", + description: 'Get information about an item from the NEU item repo.', + usage: ['neu-repo '], + examples: ['neu-repo BARRIER'], + args: [ + { + id: 'item', + description: 'The item id that you would like to find neu item information about.', + type: 'string', + prompt: 'What SkyBlock item would you like to get information about?', + retry: '{error} Pick a valid SkyBlock item ID. Try using the slash command for a better experience.', + slashType: ApplicationCommandOptionType.String, + autocomplete: true + } + /* { + id: 'dangerous', + description: 'Whether or not to use the dangerous branch.', + prompt: 'Would you like to use the dangerous branch instead of the master branch?', + match: 'flag', + flag: ['--dangerous', '-d'], + default: false, + optional: true, + slashType: ApplicationCommandOptionType.Boolean + } */ + ], + slash: true, + clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), + userPermissions: [] + }); + } + + public override async exec( + message: CommandMessage | SlashMessage, + args: { item: ArgType<'string'> /* dangerous: ArgType<'flag'> */ } + ) {} + + public override async autocomplete(interaction: AutocompleteInteraction) {} +} diff --git a/src/lib/common/util/Minecraft.ts b/src/lib/common/util/Minecraft.ts new file mode 100644 index 0000000..fbacbf0 --- /dev/null +++ b/src/lib/common/util/Minecraft.ts @@ -0,0 +1,303 @@ +import { Byte, Int, parse } from '@ironm00n/nbt-ts'; +import { BitField } from 'discord.js'; +import fs from 'fs/promises'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +export enum FormattingCodes { + Black = '§0', + DarkBlue = '§1', + DarkGreen = '§2', + DarkAqua = '§3', + DarkRed = '§4', + DarkPurple = '§5', + Gold = '§6', + Gray = '§7', + DarkGray = '§8', + Blue = '§9', + Green = '§a', + Aqua = '§b', + Red = '§c', + LightPurple = '§d', + Yellow = '§e', + White = '§f', + + Obfuscated = '§k', + Bold = '§l', + Strikethrough = '§m', + Underline = '§n', + Italic = '§o', + Reset = '§r' +} + +// https://minecraft.fandom.com/wiki/Formatting_codes +export const formattingInfo = { + [FormattingCodes.Black]: { foreground: '#000000', background: '#000000', ansi: '\u001b[0;30m' }, + [FormattingCodes.DarkBlue]: { foreground: '#0000AA', background: '#00002A', ansi: '\u001b[0;34m' }, + [FormattingCodes.DarkGreen]: { foreground: '#00AA00', background: '#002A00', ansi: '\u001b[0;32m' }, + [FormattingCodes.DarkAqua]: { foreground: '#00AAAA', background: '#002A2A', ansi: '\u001b[0;36m' }, + [FormattingCodes.DarkRed]: { foreground: '#AA0000', background: '#2A0000', ansi: '\u001b[0;31m' }, + [FormattingCodes.DarkPurple]: { foreground: '#AA00AA', background: '#2A002A', ansi: '\u001b[0;35m' }, + [FormattingCodes.Gold]: { foreground: '#FFAA00', background: '#2A2A00', ansi: '\u001b[0;33m' }, + [FormattingCodes.Gray]: { foreground: '#AAAAAA', background: '#2A2A2A', ansi: '\u001b[0;37m' }, + [FormattingCodes.DarkGray]: { foreground: '#555555', background: '#151515', ansi: '\u001b[0;90m' }, + [FormattingCodes.Blue]: { foreground: '#5555FF', background: '#15153F', ansi: '\u001b[0;94m' }, + [FormattingCodes.Green]: { foreground: '#55FF55', background: '#153F15', ansi: '\u001b[0;92m' }, + [FormattingCodes.Aqua]: { foreground: '#55FFFF', background: '#153F3F', ansi: '\u001b[0;96m' }, + [FormattingCodes.Red]: { foreground: '#FF5555', background: '#3F1515', ansi: '\u001b[0;91m' }, + [FormattingCodes.LightPurple]: { foreground: '#FF55FF', background: '#3F153F', ansi: '\u001b[0;95m' }, + [FormattingCodes.Yellow]: { foreground: '#FFFF55', background: '#3F3F15', ansi: '\u001b[0;93m' }, + [FormattingCodes.White]: { foreground: '#FFFFFF', background: '#3F3F3F', ansi: '\u001b[0;97m' }, + + [FormattingCodes.Obfuscated]: { ansi: '\u001b[8m' }, + [FormattingCodes.Bold]: { ansi: '\u001b[1m' }, + [FormattingCodes.Strikethrough]: { ansi: '\u001b[9m' }, + [FormattingCodes.Underline]: { ansi: '\u001b[4m' }, + [FormattingCodes.Italic]: { ansi: '\u001b[3m' }, + [FormattingCodes.Reset]: { ansi: '\u001b[0m' } +} as const; + +export type McItemId = Lowercase; +export type SbItemId = Uppercase; +export type MojangJson = string; +export type SbRecipeItem = `${SbItemId}:${number}` | ''; +export type SbRecipe = { + [Location in `${'A' | 'B' | 'C'}${1 | 2 | 3}`]: SbRecipeItem; +}; +export type InfoType = 'WIKI_URL' | ''; + +type Slayer = `${'WOLF' | 'BLAZE' | 'EMAN'}_${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`; + +export interface RawNeuItem { + itemid: McItemId; + displayname: string; + nbttag: MojangJson; + damage: number; + lore: string[]; + recipe?: SbRecipe; + internalname: SbItemId; + modver: string; + infoType: InfoType; + info?: string[]; + crafttext: string; + vanilla?: boolean; + useneucraft?: boolean; + slayer_req?: Slayer; + clickcommand?: string; + x?: number; + y?: number; + z?: number; + island?: string; + recipes?: { type: string; cost: any[]; result: SbItemId }[]; + /** @deprecated */ + parent?: SbItemId; + noseal?: boolean; +} + +export enum HideFlagsBits { + Enchantments = 1, + AttributeModifiers = 2, + Unbreakable = 4, + CanDestroy = 8, + CanPlaceOn = 16, + /** + * potion effects, shield pattern info, "StoredEnchantments", written book + * "generation" and "author", "Explosion", "Fireworks", and map tooltips + */ + OtherInformation = 32, + Dyed = 64 +} + +export type HideFlagsString = keyof typeof HideFlagsBits; + +export class HideFlags extends BitField { + public static override Flags = HideFlagsBits; +} + +export const formattingCode = new RegExp( + `§[${Object.values(FormattingCodes) + .filter((v) => v.startsWith('§')) + .map((v) => v.substring(1)) + .join('')}]` +); + +export function removeMCFormatting(str: string) { + return str.replaceAll(formattingCode, ''); +} + +const repo = path.join(__dirname, '..', '..', '..', '..', '..', 'neu-item-repo-dangerous'); +const itemPath = path.join(repo, 'items'); +const items = await fs.readdir(itemPath); + +// for (let i = 0; i < 5; i++) { +for (const path_ of items) { + // const randomItem = items[Math.floor(Math.random() * items.length)]; + // console.log(randomItem); + const item = (await import(path.join(itemPath, /* randomItem */ path_), { assert: { type: 'json' } })).default as RawNeuItem; + if (item.displayname.includes('(Monster)') || item.displayname.includes('(NPC)')) continue; + /* console.log(path_); + console.dir(item, { depth: Infinity }); */ + + /* console.log('==========='); */ + const nbt = /* fn( */ parse(item.nbttag /* .replaceAll(/([0-9]{1,3}:)(["{])/g, '$2'), { useMaps: true } */) as any; /*); */ + console.dir(nbt, { depth: Infinity }); + console.log('==========='); + // console.dir((nbt.(item.nbttag))); + + /* // eslint-disable-next-line no-inner-declarations + function fn(map: TagMap) { + const ret = {} as any; + map.forEach((val, key) => { + function fn2(val: any): any { + if (val instanceof Map) return fn(val); + else if (Array.isArray(val)) return val.map((v) => fn2(v)); + else return val.valueOf(); + } + ret[key] = fn2(val); + }); + return ret; + } */ + + /* if (nbt?.display && nbt.display.Name !== item.displayname) + console.log(`${path_} display name mismatch: ${mcToAnsi(nbt.display.Name)} != ${mcToAnsi(item.displayname)}`); + + if (nbt?.ExtraAttributes && nbt?.ExtraAttributes.id !== item.internalname) + console.log(`${path_} internal name mismatch: ${mcToAnsi(nbt?.ExtraAttributes.id)} != ${mcToAnsi(item.internalname)}`); */ + + /* console.log('==========='); + + console.log(mcToAnsi(item.displayname)); + console.log(item.lore.map((l) => mcToAnsi(l)).join('\n')); */ + + /* const keys = [ + 'itemid', + 'displayname', + 'nbttag', + 'damage', + 'lore', + 'recipe', + 'internalname', + 'modver', + 'infoType', + 'info', + 'crafttext', + 'vanilla', + 'useneucraft', + 'slayer_req', + 'clickcommand', + 'x', + 'y', + 'z', + 'island', + 'recipes', + 'parent', + 'noseal' + ]; + + Object.keys(item).forEach((k) => { + if (!keys.includes(k)) throw new Error(`Unknown key: ${k}`); + }); + + if ( + 'slayer_req' in item && + !new Array(10).flatMap((_, i) => ['WOLF', 'BLAZE', 'EMAN'].map((e) => e + (i + 1)).includes(item.slayer_req!)) + ) + throw new Error(`Unknown slayer req: ${item.slayer_req!}`); */ + + /* console.log('=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-'); */ +} + +interface NbtTag { + overrideMeta?: Byte; + Unbreakable?: Int; + ench?: string[]; + HideFlags?: HideFlags; + SkullOwner?: SkullOwner; + display?: NbtTagDisplay; + ExtraAttributes?: ExtraAttributes; +} + +interface SkullOwner { + Id?: string; + Properties?: { + textures?: { Value?: string }[]; + }; +} + +interface NbtTagDisplay { + Lore?: string[]; + Name?: string; +} + +type RuneId = string; + +interface ExtraAttributes { + originTag?: Origin; + id?: string; + generator_tier?: Int; + boss_tier?: Int; + enchantments?: { hardened_mana?: Int }; + dungeon_item_level?: Int; + runes?: { [key: RuneId]: Int }; +} + +type Origin = 'SHOP_PURCHASE'; + +class NeuItem { + public itemId: string; + public nbtTag: NbtTag; + + public constructor(raw: RawNeuItem) { + this.itemId = raw.itemid; + this.nbtTag = parse(raw.nbttag); + } + + public get lore(): string { + return ''; + } + + private pet() {} +} + +function mcToAnsi(str: string) { + for (const format in formattingInfo) { + str = str.replaceAll(format, formattingInfo[format as keyof typeof formattingInfo].ansi); + } + return `${str}\u001b[0m`; +} + +const neuConstantsPath = path.join(repo, 'constants'); +const neuPetsPath = path.join(neuConstantsPath, 'pets.json'); +const neuPets = await import(neuPetsPath, { assert: { type: 'json' } }); + +// console.dir(await nbt.parse(buffer)); +/* console.dir( + await nbt.parse( + Buffer.from( + '{overrideMeta:1b,HideFlags:254,SkullOwner:{Id:"4173bc61-9e2f-3c84-8d31-4517e64062ab",Properties:{textures:[0:{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhYWY3YjFhNzc4OTQ5Njk2Y2I5OWQ0ZjA0YWQxYWE1MThjZWVlMjU2YzcyZTVlZDY1YmZhNWMyZDg4ZDllIn19fQ=="}]}},display:{Lore:[0:"§8Combat Pet",1:"",2:"§7Intelligence: §a{INTELLIGENCE}",3:"§7Strength: §a{STRENGTH}",4:"",5:"§6Rekindle",6:"§7§7Before death, become §eimmune",7:"§e§7and gain §c{0} §c❁ Strength",8:"§c§7for §a{1} §7seconds",9:"§83 minutes cooldown",10:"",11:"§6Fourth Flare",12:"§7§7On 4th melee strike, §6ignite",13:"§6§7mobs, dealing §c{4}x §7your",14:"§7§9☠ Crit Damage §7each second",15:"§7for §a{5} §7seconds",16:"",17:"§7§eRight-click to add this pet to",18:"§eyour pet menu!",19:"",20:"§5§lEPIC"],Name:"§f§f§7[Lvl {LVL}] §5Phoenix"},ExtraAttributes:{petInfo:"{\\"type\\":\\"PHOENIX\\",\\"active\\":false,\\"exp\\":0.0,\\"tier\\":\\"EPIC\\",\\"hideInfo\\":false}",id:"PHOENIX;3"},AttributeModifiers:[]}', + 'utf8' + ) + ) +); */ + +// import _ from 'lodash'; + +// const str = +// '{overrideMeta:1b,HideFlags:254,SkullOwner:{Id:"4173bc61-9e2f-3c84-8d31-4517e64062ab",Properties:{textures:[0:{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhYWY3YjFhNzc4OTQ5Njk2Y2I5OWQ0ZjA0YWQxYWE1MThjZWVlMjU2YzcyZTVlZDY1YmZhNWMyZDg4ZDllIn19fQ=="}]}},display:{Lore:[0:"§8Combat Pet",1:"",2:"§7Intelligence: §a{INTELLIGENCE}",3:"§7Strength: §a{STRENGTH}",4:"",5:"§6Rekindle",6:"§7§7Before death, become §eimmune",7:"§e§7and gain §c{0} §c❁ Strength",8:"§c§7for §a{1} §7seconds",9:"§83 minutes cooldown",10:"",11:"§6Fourth Flare",12:"§7§7On 4th melee strike, §6ignite",13:"§6§7mobs, dealing §c{4}x §7your",14:"§7§9☠ Crit Damage §7each second",15:"§7for §a{5} §7seconds",16:"",17:"§7§eRight-click to add this pet to",18:"§eyour pet menu!",19:"",20:"§5§lEPIC"],Name:"§f§f§7[Lvl {LVL}] §5Phoenix"},ExtraAttributes:{petInfo:"{\\"type\\":\\"PHOENIX\\",\\"active\\":false,\\"exp\\":0.0,\\"tier\\":\\"EPIC\\",\\"hideInfo\\":false}",id:"PHOENIX;3"},AttributeModifiers:[]}'.replaceAll( +// /([0-9]{1,3}:)(["{])/g, +// '$2' +// ); + +// console.log(str); + +// console.dir( +// _.chunk( +// str.split('').map((v, i) => [i, v]), +// 10 +// ).map((v) => [v[0][0], v.map((v) => v[1]).join('')]), +// { maxArrayLength: Infinity, compact: 100 } +// ); + +// console.dir(parse(str)); diff --git a/src/tasks/cache/updateNeuItemCache.ts b/src/tasks/cache/updateNeuItemCache.ts new file mode 100644 index 0000000..fff9e08 --- /dev/null +++ b/src/tasks/cache/updateNeuItemCache.ts @@ -0,0 +1,12 @@ +import { BushTask, Time } from '#lib'; + +export default class UpdatePriceItemCache extends BushTask { + public constructor() { + super('updatePriceItemCache', { + delay: 1 * Time.Hour, + runOnStart: true + }); + } + + public async exec() {} +} diff --git a/tsconfig.json b/tsconfig.json index eb23517..ed3f116 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,24 +18,26 @@ "forceConsistentCasingInFileNames": true, "allowSyntheticDefaultImports": true, "preserveValueImports": true, - "removeComments": true, - "paths": { - "#lib": ["./src/lib/index.ts"], - "#constants": ["./src/lib/utils/BushConstants.ts"], - "#args": ["./src/arguments/index.ts"], - "#commands": ["./src/commands/index.ts"], - "#tags": ["./src/lib/common/tags.js"] - } + "removeComments": true + // "paths": { + // "#lib": ["./src/lib/index.ts"], + // "#constants": ["./src/lib/utils/BushConstants.ts"], + // "#args": ["./src/arguments/index.ts"], + // "#commands": ["./src/commands/index.ts"], + // "#tags": ["./src/lib/common/tags.js"] + // } }, "include": [ - "src/**/*.ts", - "src/**/*d.ts", - "lib/**/*.ts", - "ecosystem.config.cjs", - ".eslintrc.cjs", - "config/**/*.ts", - "tests/**/*.ts", - "vite.config.ts" + // "src/**/*.ts", + // "src/**/*d.ts", + // "lib/**/*.ts", + // "ecosystem.config.cjs", + // ".eslintrc.cjs", + // "config/**/*.ts", + // "tests/**/*.ts", + "vite.config.ts", + "src/bot.ts", + "src/lib/common/util/Minecraft.ts" ], "exclude": ["dist", "node_modules"] } diff --git a/vite.config.ts b/vite.config.ts index 58e1d1c..5bb079e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,9 @@ -import { defineConfig } from 'vitest/config'; +// import { defineConfig } from 'vitest/config'; -export default defineConfig({ - test: { - include: ['./tests/**/*.test.ts'] - } -}); +// export default defineConfig({ +// test: { +// include: ['./tests/**/*.test.ts'] +// } +// }); + +export {}; diff --git a/yarn.lock b/yarn.lock index 311d506..f2c1f57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -126,6 +126,13 @@ __metadata: languageName: node linkType: hard +"@ironm00n/nbt-ts@npm:^1.4.0": + version: 1.4.0 + resolution: "@ironm00n/nbt-ts@npm:1.4.0" + checksum: c518403b261668fe077b2e202acb6b9c597cdefc4453d5a13fee40dc90dadc1c8e651b47f7ac1e3036b317d7a1998428a69762552179815c57923175c538bbb1 + languageName: node + linkType: hard + "@mapbox/node-pre-gyp@npm:^1.0.0": version: 1.0.9 resolution: "@mapbox/node-pre-gyp@npm:1.0.9" @@ -1122,6 +1129,7 @@ __metadata: dependencies: "@discordjs/builders": ^0.15.0 "@discordjs/rest": ^0.5.0 + "@ironm00n/nbt-ts": ^1.4.0 "@notenoughupdates/discord.js-minesweeper": ^1.0.10 "@notenoughupdates/events-intercept": ^3.0.1 "@notenoughupdates/humanize-duration": ^4.0.1 -- cgit From 7bdeccaeb4976a997d0d483481b29000795a92a9 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 11:17:52 -0400 Subject: this is very boring --- src/lib/common/util/Minecraft.ts | 140 +++++++++++++++++++++++---------------- 1 file changed, 84 insertions(+), 56 deletions(-) diff --git a/src/lib/common/util/Minecraft.ts b/src/lib/common/util/Minecraft.ts index fbacbf0..b4b013f 100644 --- a/src/lib/common/util/Minecraft.ts +++ b/src/lib/common/util/Minecraft.ts @@ -136,29 +136,28 @@ for (const path_ of items) { // const randomItem = items[Math.floor(Math.random() * items.length)]; // console.log(randomItem); const item = (await import(path.join(itemPath, /* randomItem */ path_), { assert: { type: 'json' } })).default as RawNeuItem; - if (item.displayname.includes('(Monster)') || item.displayname.includes('(NPC)')) continue; + if (/.*?((_MONSTER)|(_NPC)|(_ANIMAL)|(_MINIBOSS)|(_BOSS)|(_SC))$/.test(item.internalname)) continue; + if (!/.*?;[0-5]$/.test(item.internalname)) continue; /* console.log(path_); console.dir(item, { depth: Infinity }); */ /* console.log('==========='); */ - const nbt = /* fn( */ parse(item.nbttag /* .replaceAll(/([0-9]{1,3}:)(["{])/g, '$2'), { useMaps: true } */) as any; /*); */ + const nbt = parse(item.nbttag) as NbtTag; + + if (nbt?.SkullOwner?.Properties?.textures?.[0]?.Value) { + nbt.SkullOwner.Properties.textures[0].Value = parse( + Buffer.from(nbt.SkullOwner.Properties.textures[0].Value, 'base64').toString('utf-8') + ) as string; + } + + if (nbt.ExtraAttributes?.petInfo) { + nbt.ExtraAttributes.petInfo = JSON.parse(nbt.ExtraAttributes.petInfo as any as string); + } + + // delete nbt.display?.Lore; + console.dir(nbt, { depth: Infinity }); console.log('==========='); - // console.dir((nbt.(item.nbttag))); - - /* // eslint-disable-next-line no-inner-declarations - function fn(map: TagMap) { - const ret = {} as any; - map.forEach((val, key) => { - function fn2(val: any): any { - if (val instanceof Map) return fn(val); - else if (Array.isArray(val)) return val.map((v) => fn2(v)); - else return val.valueOf(); - } - ret[key] = fn2(val); - }); - return ret; - } */ /* if (nbt?.display && nbt.display.Name !== item.displayname) console.log(`${path_} display name mismatch: ${mcToAnsi(nbt.display.Name)} != ${mcToAnsi(item.displayname)}`); @@ -228,6 +227,7 @@ interface SkullOwner { interface NbtTagDisplay { Lore?: string[]; + color?: Int; Name?: string; } @@ -241,24 +241,86 @@ interface ExtraAttributes { enchantments?: { hardened_mana?: Int }; dungeon_item_level?: Int; runes?: { [key: RuneId]: Int }; + petInfo?: PetInfo; +} + +interface PetInfo { + type: 'ZOMBIE'; + active: boolean; + exp: number; + tier: 'COMMON' | 'UNCOMMON' | 'RARE' | 'EPIC' | 'LEGENDARY'; + hideInfo: boolean; + candyUsed: number; } type Origin = 'SHOP_PURCHASE'; +const neuConstantsPath = path.join(repo, 'constants'); +const neuPetsPath = path.join(neuConstantsPath, 'pets.json'); +const neuPets = (await import(neuPetsPath, { assert: { type: 'json' } })) as PetsConstants; +const neuPetNumsPath = path.join(neuConstantsPath, 'petnums.json'); +const neuPetNums = (await import(neuPetNumsPath, { assert: { type: 'json' } })) as PetNums; + +interface PetsConstants { + pet_rarity_offset: Record; + pet_levels: number[]; + custom_pet_leveling: Record; + pet_types: Record; +} + +interface PetNums { + [key: string]: { + [key: string]: { + '1': { + otherNums: number[]; + statNums: Record; + }; + '100': { + otherNums: number[]; + statNums: Record; + }; + 'stats_levelling_curve'?: `${number};${number};${number}`; + }; + }; +} + class NeuItem { - public itemId: string; + public itemId: McItemId; + public displayName: string; public nbtTag: NbtTag; + public internalName: SbItemId; + public lore: string[]; public constructor(raw: RawNeuItem) { this.itemId = raw.itemid; this.nbtTag = parse(raw.nbttag); - } + this.displayName = raw.displayname; + this.internalName = raw.internalname; + this.lore = raw.lore; - public get lore(): string { - return ''; + this.petLoreReplacements(); } - private pet() {} + private petLoreReplacements(level = -1) { + if (/.*?;[0-5]$/.test(this.internalName) && this.displayName.includes('LVL')) { + const maxLevel = neuPets?.custom_pet_leveling?.[this.internalName]?.max_level ?? 100; + this.displayName = this.displayName.replace('LVL', `1➡${maxLevel}`); + + const nums = neuPetNums[this.internalName]; + if (!nums) throw new Error(`Pet (${this.internalName}) has no pet nums.`); + + const teir = ['COMMON', 'UNCOMMON', 'RARE', 'EPIC', 'LEGENDARY', 'MYTHIC'][+this.internalName.at(-1)!]; + const petInfoTier = nums[teir]; + if (!petInfoTier) throw new Error(`Pet (${this.internalName}) has no pet nums for ${teir} rarity.`); + + const curve = petInfoTier?.stats_levelling_curve?.split(';'); + + const minStatsLevel = parseInt(curve?.[0] ?? '0'); + const maxStatsLevel = parseInt(curve?.[0] ?? '100'); + + const lore = ''; + } + } } function mcToAnsi(str: string) { @@ -267,37 +329,3 @@ function mcToAnsi(str: string) { } return `${str}\u001b[0m`; } - -const neuConstantsPath = path.join(repo, 'constants'); -const neuPetsPath = path.join(neuConstantsPath, 'pets.json'); -const neuPets = await import(neuPetsPath, { assert: { type: 'json' } }); - -// console.dir(await nbt.parse(buffer)); -/* console.dir( - await nbt.parse( - Buffer.from( - '{overrideMeta:1b,HideFlags:254,SkullOwner:{Id:"4173bc61-9e2f-3c84-8d31-4517e64062ab",Properties:{textures:[0:{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhYWY3YjFhNzc4OTQ5Njk2Y2I5OWQ0ZjA0YWQxYWE1MThjZWVlMjU2YzcyZTVlZDY1YmZhNWMyZDg4ZDllIn19fQ=="}]}},display:{Lore:[0:"§8Combat Pet",1:"",2:"§7Intelligence: §a{INTELLIGENCE}",3:"§7Strength: §a{STRENGTH}",4:"",5:"§6Rekindle",6:"§7§7Before death, become §eimmune",7:"§e§7and gain §c{0} §c❁ Strength",8:"§c§7for §a{1} §7seconds",9:"§83 minutes cooldown",10:"",11:"§6Fourth Flare",12:"§7§7On 4th melee strike, §6ignite",13:"§6§7mobs, dealing §c{4}x §7your",14:"§7§9☠ Crit Damage §7each second",15:"§7for §a{5} §7seconds",16:"",17:"§7§eRight-click to add this pet to",18:"§eyour pet menu!",19:"",20:"§5§lEPIC"],Name:"§f§f§7[Lvl {LVL}] §5Phoenix"},ExtraAttributes:{petInfo:"{\\"type\\":\\"PHOENIX\\",\\"active\\":false,\\"exp\\":0.0,\\"tier\\":\\"EPIC\\",\\"hideInfo\\":false}",id:"PHOENIX;3"},AttributeModifiers:[]}', - 'utf8' - ) - ) -); */ - -// import _ from 'lodash'; - -// const str = -// '{overrideMeta:1b,HideFlags:254,SkullOwner:{Id:"4173bc61-9e2f-3c84-8d31-4517e64062ab",Properties:{textures:[0:{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjNhYWY3YjFhNzc4OTQ5Njk2Y2I5OWQ0ZjA0YWQxYWE1MThjZWVlMjU2YzcyZTVlZDY1YmZhNWMyZDg4ZDllIn19fQ=="}]}},display:{Lore:[0:"§8Combat Pet",1:"",2:"§7Intelligence: §a{INTELLIGENCE}",3:"§7Strength: §a{STRENGTH}",4:"",5:"§6Rekindle",6:"§7§7Before death, become §eimmune",7:"§e§7and gain §c{0} §c❁ Strength",8:"§c§7for §a{1} §7seconds",9:"§83 minutes cooldown",10:"",11:"§6Fourth Flare",12:"§7§7On 4th melee strike, §6ignite",13:"§6§7mobs, dealing §c{4}x §7your",14:"§7§9☠ Crit Damage §7each second",15:"§7for §a{5} §7seconds",16:"",17:"§7§eRight-click to add this pet to",18:"§eyour pet menu!",19:"",20:"§5§lEPIC"],Name:"§f§f§7[Lvl {LVL}] §5Phoenix"},ExtraAttributes:{petInfo:"{\\"type\\":\\"PHOENIX\\",\\"active\\":false,\\"exp\\":0.0,\\"tier\\":\\"EPIC\\",\\"hideInfo\\":false}",id:"PHOENIX;3"},AttributeModifiers:[]}'.replaceAll( -// /([0-9]{1,3}:)(["{])/g, -// '$2' -// ); - -// console.log(str); - -// console.dir( -// _.chunk( -// str.split('').map((v, i) => [i, v]), -// 10 -// ).map((v) => [v[0][0], v.map((v) => v[1]).join('')]), -// { maxArrayLength: Infinity, compact: 100 } -// ); - -// console.dir(parse(str)); -- cgit From 9247fa8c65174eb35fbfe3cd9d4167f9cf9ce17a Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 15 Jul 2022 17:24:14 -0400 Subject: upgrade deps --- package.json | 16 +++---- src/bot.ts | 46 +++++++++----------- tsconfig.json | 30 ++++++------- yarn.lock | 134 +++++++++++++++++++++++++++++----------------------------- 4 files changed, 110 insertions(+), 116 deletions(-) diff --git a/package.json b/package.json index c1882bc..e858ae6 100644 --- a/package.json +++ b/package.json @@ -66,9 +66,9 @@ "@notenoughupdates/humanize-duration": "^4.0.1", "@notenoughupdates/simplify-number": "^1.0.1", "@notenoughupdates/wolfram-alpha-api": "^1.0.2", - "@sentry/integrations": "^7.5.1", - "@sentry/node": "^7.5.1", - "@sentry/tracing": "^7.5.1", + "@sentry/integrations": "^7.7.0", + "@sentry/node": "^7.7.0", + "@sentry/tracing": "^7.7.0", "canvas": "^2.9.3", "chalk": "^5.0.1", "deep-lock": "^1.0.0", @@ -88,18 +88,18 @@ "prettier": "^2.7.1", "pretty-bytes": "^6.0.0", "rimraf": "^3.0.2", - "sequelize": "6.21.2", + "sequelize": "6.21.3", "tinycolor2": "^1.4.2", "typescript": "^4.7.4", "vm2": "^3.9.10" }, "devDependencies": { "@sapphire/snowflake": "^3.2.2", - "@sentry/types": "^7.5.1", + "@sentry/types": "^7.7.0", "@types/eslint": "^8.4.5", "@types/express": "^4.17.13", "@types/lodash": "^4.14.182", - "@types/node": "^18.0.3", + "@types/node": "^18.0.4", "@types/numeral": "^2.0.2", "@types/pg": "^8.6.5", "@types/prettier": "^2.6.3", @@ -112,9 +112,9 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-deprecation": "^1.3.2", "eslint-plugin-import": "^2.26.0", - "node-fetch": "^3.2.6", + "node-fetch": "^3.2.8", "ts-essentials": "^9.2.0", - "vitest": "^0.17.1" + "vitest": "^0.18.0" }, "packageManager": "yarn@3.2.1" } diff --git a/src/bot.ts b/src/bot.ts index 640f2ab..038fbbb 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -1,29 +1,23 @@ -// import { init } from './lib/utils/BushLogger.js'; -// // creates proxies on console.log and console.warn -// // also starts a REPL session -// init(); +import { init } from './lib/utils/BushLogger.js'; +// creates proxies on console.log and console.warn +// also starts a REPL session +init(); -// eslint-disable-next-line no-constant-condition -if (false) { - // const { dirname } = await import('path'); - // const { fileURLToPath } = await import('url'); - // const { default: config } = await import('../config/options.js'); - // const { Sentry } = await import('./lib/common/Sentry.js'); - // const { BushClient } = await import('./lib/index.js'); - // - // const isDry = process.argv.includes('dry'); - // if (!isDry && config.credentials.sentryDsn !== null) - // new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd(), config); - // BushClient.extendStructures(); - // const client = new BushClient(config); - // if (!isDry) await client.dbPreInit(); - // await client.init(); - // if (isDry) { - // await client.destroy(); - // process.exit(0); - // } else { - // await client.start(); - // } +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import { default as config } from '../config/options.js'; +import { Sentry } from './lib/common/Sentry.js'; +import { BushClient } from './lib/index.js'; + +const isDry = process.argv.includes('dry'); +if (!isDry && config.credentials.sentryDsn !== null) new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd(), config); +BushClient.extendStructures(); +const client = new BushClient(config); +if (!isDry) await client.dbPreInit(); +await client.init(); +if (isDry) { + await client.destroy(); + process.exit(0); } else { - import('./lib/common/util/Minecraft.js'); + await client.start(); } diff --git a/tsconfig.json b/tsconfig.json index ed3f116..565346b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,23 +18,23 @@ "forceConsistentCasingInFileNames": true, "allowSyntheticDefaultImports": true, "preserveValueImports": true, - "removeComments": true - // "paths": { - // "#lib": ["./src/lib/index.ts"], - // "#constants": ["./src/lib/utils/BushConstants.ts"], - // "#args": ["./src/arguments/index.ts"], - // "#commands": ["./src/commands/index.ts"], - // "#tags": ["./src/lib/common/tags.js"] - // } + "removeComments": true, + "paths": { + "#lib": ["./src/lib/index.ts"], + "#constants": ["./src/lib/utils/BushConstants.ts"], + "#args": ["./src/arguments/index.ts"], + "#commands": ["./src/commands/index.ts"], + "#tags": ["./src/lib/common/tags.js"] + } }, "include": [ - // "src/**/*.ts", - // "src/**/*d.ts", - // "lib/**/*.ts", - // "ecosystem.config.cjs", - // ".eslintrc.cjs", - // "config/**/*.ts", - // "tests/**/*.ts", + "src/**/*.ts", + "src/**/*d.ts", + "lib/**/*.ts", + "ecosystem.config.cjs", + ".eslintrc.cjs", + "config/**/*.ts", + "tests/**/*.ts", "vite.config.ts", "src/bot.ts", "src/lib/common/util/Minecraft.ts" diff --git a/yarn.lock b/yarn.lock index f2c1f57..63b0c6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -255,83 +255,83 @@ __metadata: languageName: node linkType: hard -"@sentry/core@npm:7.5.1": - version: 7.5.1 - resolution: "@sentry/core@npm:7.5.1" +"@sentry/core@npm:7.7.0": + version: 7.7.0 + resolution: "@sentry/core@npm:7.7.0" dependencies: - "@sentry/hub": 7.5.1 - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/hub": 7.7.0 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 tslib: ^1.9.3 - checksum: 90613800c95bd17075b33ed8f76a2cf18a2fd03e9c1b244ee7a846f0e0b738b84a199bc7c085d62c8e9043913024169e45cb925a03b36cf77d064caf8e7e05fd + checksum: d3b9b5a92a9182bae7f39eef01502dd542d5be7365632ea9e26aa5247c90fd72e620856b20a393f4d3eeadb27f3b744bf25be93b1fdc4f7457a894e290c41fb0 languageName: node linkType: hard -"@sentry/hub@npm:7.5.1": - version: 7.5.1 - resolution: "@sentry/hub@npm:7.5.1" +"@sentry/hub@npm:7.7.0": + version: 7.7.0 + resolution: "@sentry/hub@npm:7.7.0" dependencies: - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 tslib: ^1.9.3 - checksum: 6b00f2ef5fb12f94d5844f3abef9a84ec79d4f19d8347e8e8b8c06719c2d84d06963bb94e09305deb76640231ca1ed34dd4b2c63ff447fdb8fa16c22ac022484 + checksum: 0683ae6da7d961e6bbb90ad1fded3b33cd9fc76dc54a080902a83bd7769991294ce8017277f5e0d145fcf9f2ad53ae89d3b0c7619fa0586c8513f4b585f14f6d languageName: node linkType: hard -"@sentry/integrations@npm:^7.5.1": - version: 7.5.1 - resolution: "@sentry/integrations@npm:7.5.1" +"@sentry/integrations@npm:^7.7.0": + version: 7.7.0 + resolution: "@sentry/integrations@npm:7.7.0" dependencies: - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 localforage: ^1.8.1 tslib: ^1.9.3 - checksum: 13b4cb068e09f5208fbb750aa569453956a7f5cc4093e4e3485a92bac74b0c77a056c39b51395a2bc307cbb02cbde3b989bb985aaa849d87eed6ee853bfd33b6 + checksum: cd24f34301c55069e8487adc6d9b3c61e9f4f7284a01d4e9954324695f15b74806303cf53bd2e88db325289c057d2b33546986ed240b022f6d170cada94a0cab languageName: node linkType: hard -"@sentry/node@npm:^7.5.1": - version: 7.5.1 - resolution: "@sentry/node@npm:7.5.1" +"@sentry/node@npm:^7.7.0": + version: 7.7.0 + resolution: "@sentry/node@npm:7.7.0" dependencies: - "@sentry/core": 7.5.1 - "@sentry/hub": 7.5.1 - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/core": 7.7.0 + "@sentry/hub": 7.7.0 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 cookie: ^0.4.1 https-proxy-agent: ^5.0.0 lru_map: ^0.3.3 tslib: ^1.9.3 - checksum: a8caa39edb923952a551a9609afb933c1753e5e6cf1a8eccb9b1f4adb6567356d3077d3319b266e502a3183f1cf402847ade0967217522a408f9c1640a220f02 + checksum: 554f4165f7cee16c70eca1e4e42d354330bcfcbf157bfbcdf4a17e89393f0c39f042cfaa07ba51ebb8391bbf2091d8dc6108a81650a60d39632d3b6a1edafe6f languageName: node linkType: hard -"@sentry/tracing@npm:^7.5.1": - version: 7.5.1 - resolution: "@sentry/tracing@npm:7.5.1" +"@sentry/tracing@npm:^7.7.0": + version: 7.7.0 + resolution: "@sentry/tracing@npm:7.7.0" dependencies: - "@sentry/hub": 7.5.1 - "@sentry/types": 7.5.1 - "@sentry/utils": 7.5.1 + "@sentry/hub": 7.7.0 + "@sentry/types": 7.7.0 + "@sentry/utils": 7.7.0 tslib: ^1.9.3 - checksum: cf70120946a1d4a337e05b2035ab7a2b00755f638006250d003dbf6badf1fba066f0abfc19689b60d4e6143e99616f4ada0d564376aec2d48a5171c6b9c871c8 + checksum: c3884c297e87284ab73f103338dfb2f8dc2d2fcf641981650ad72009f1d7a41292ded048a7283b57a66f730d8d7cb8932bb6ee64e8b512b33de08da8867a58fe languageName: node linkType: hard -"@sentry/types@npm:7.5.1, @sentry/types@npm:^7.5.1": - version: 7.5.1 - resolution: "@sentry/types@npm:7.5.1" - checksum: 2ff669f0e6c6ea5020c117a15012ec55147033faebbc0708c1a772aabf9cf6e283d69556903a9213e96b188b0a5f7030ded7006ad8805b2a89a6442d36202b21 +"@sentry/types@npm:7.7.0, @sentry/types@npm:^7.7.0": + version: 7.7.0 + resolution: "@sentry/types@npm:7.7.0" + checksum: 1f26c23617e9370cf32269ea5d5aa0f75fe86c34aede4fc07ae3bdae08803a788d628d0bba6f2e22c03d0430dcf63cc19453468ae086406448da07e13f36da70 languageName: node linkType: hard -"@sentry/utils@npm:7.5.1": - version: 7.5.1 - resolution: "@sentry/utils@npm:7.5.1" +"@sentry/utils@npm:7.7.0": + version: 7.7.0 + resolution: "@sentry/utils@npm:7.7.0" dependencies: - "@sentry/types": 7.5.1 + "@sentry/types": 7.7.0 tslib: ^1.9.3 - checksum: 567fdba09fdbfc62b0e50f5099d82b075f4e5ebd7dace67c4379a9f65c12e7191aad526fbc955ee681da757c8332807bda74a50880c4576c4c39d97c2c49e91d + checksum: 990224e0542015952a4f1fa83dd69c82a3a85894576457f10bc3c0c60620c675969424bdbfde9872a19a5db2b682dd1d51c67ec99f0c57acfc993e6f7c970aaf languageName: node linkType: hard @@ -536,10 +536,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.0.3": - version: 18.0.3 - resolution: "@types/node@npm:18.0.3" - checksum: 5dec59fbbc1186c808b53df1ca717dad034dbd6a901c75f5b052c845618b531b05f27217122c6254db99529a68618e4cfc534ae3dbf4e88754e9e572df80defa +"@types/node@npm:^18.0.4": + version: 18.0.4 + resolution: "@types/node@npm:18.0.4" + checksum: 981284fd57941f233f0e77038087c122f56e3c2b4fc4e090dfc7f0a93abfc526d5ccdd59eb3ef551d713245cf3943e37c7b957f12ba699209341a447c39fab59 languageName: node linkType: hard @@ -1136,14 +1136,14 @@ __metadata: "@notenoughupdates/simplify-number": ^1.0.1 "@notenoughupdates/wolfram-alpha-api": ^1.0.2 "@sapphire/snowflake": ^3.2.2 - "@sentry/integrations": ^7.5.1 - "@sentry/node": ^7.5.1 - "@sentry/tracing": ^7.5.1 - "@sentry/types": ^7.5.1 + "@sentry/integrations": ^7.7.0 + "@sentry/node": ^7.7.0 + "@sentry/tracing": ^7.7.0 + "@sentry/types": ^7.7.0 "@types/eslint": ^8.4.5 "@types/express": ^4.17.13 "@types/lodash": ^4.14.182 - "@types/node": ^18.0.3 + "@types/node": ^18.0.4 "@types/numeral": ^2.0.2 "@types/pg": ^8.6.5 "@types/prettier": ^2.6.3 @@ -1169,18 +1169,18 @@ __metadata: lodash: ^4.17.21 mathjs: ^10.6.4 nanoid: ^4.0.0 - node-fetch: ^3.2.6 + node-fetch: ^3.2.8 numeral: ^2.0.6 pg: ^8.7.3 pg-hstore: ^2.3.4 prettier: ^2.7.1 pretty-bytes: ^6.0.0 rimraf: ^3.0.2 - sequelize: 6.21.2 + sequelize: 6.21.3 tinycolor2: ^1.4.2 ts-essentials: ^9.2.0 typescript: ^4.7.4 - vitest: ^0.17.1 + vitest: ^0.18.0 vm2: ^3.9.10 languageName: unknown linkType: soft @@ -3679,14 +3679,14 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^3.2.6": - version: 3.2.6 - resolution: "node-fetch@npm:3.2.6" +"node-fetch@npm:^3.2.8": + version: 3.2.8 + resolution: "node-fetch@npm:3.2.8" dependencies: data-uri-to-buffer: ^4.0.0 fetch-blob: ^3.1.4 formdata-polyfill: ^4.0.10 - checksum: ece307ace3a3ff28638ccb0fa0545bb5c0cfd673a9d06fc314d937a73ae6a55917d5bacd7f080f9a9f1449ca20a5c01b1281d0e616acb20315e5ac315971da46 + checksum: 2f7fc3e59fbede43a273e988d2f2a3dd68160618114e32ad537477db253808b65221f1dbfd666b8fb33ff07bf1de9d6448035b0f8ada5ef876c5afec93b27318 languageName: node linkType: hard @@ -4444,9 +4444,9 @@ __metadata: languageName: node linkType: hard -"sequelize@npm:6.21.2": - version: 6.21.2 - resolution: "sequelize@npm:6.21.2" +"sequelize@npm:6.21.3": + version: 6.21.3 + resolution: "sequelize@npm:6.21.3" dependencies: "@types/debug": ^4.1.7 "@types/validator": ^13.7.1 @@ -4481,7 +4481,7 @@ __metadata: optional: true tedious: optional: true - checksum: 5486ec15e80cf51e49d819c2495a05a17b5a0102866ca0af054dbc4a625d2dc6200e36189261e50234625fcf4da5cbc973eb9900591a5b9e9f63c67955196f56 + checksum: 85a57cdde00edc5e1634585aacda874eeab9cc0d6d296e5ae90be3d861cba682bacde427009600d331fec82396520621a16a27d1958c689dd197d9d88051cf7e languageName: node linkType: hard @@ -5060,9 +5060,9 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^0.17.1": - version: 0.17.1 - resolution: "vitest@npm:0.17.1" +"vitest@npm:^0.18.0": + version: 0.18.0 + resolution: "vitest@npm:0.18.0" dependencies: "@types/chai": ^4.3.1 "@types/chai-subset": ^1.3.3 @@ -5092,7 +5092,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: eae2d024d97a46ba08f3cc7e0703a330c92dc0a6f4c7a9bc20ec8a5129bf787d8ebabd14bf31ae810897c1813e29178af59f63ec8b24b5944cfa62e225cd207c + checksum: 20e76b0de9f02dd09a412b11e5898d1ec7c5c9f9287da40a79fde98f6bd100db6f777fb5f1370496a2c153277cc5eb6738e176435101332fce1c87a565e62d5f languageName: node linkType: hard -- cgit From e4206aaa9211e792660b4015551519d633409355 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 20:10:42 -0400 Subject: random stuff --- .eslintrc.cjs | 9 +- package.json | 21 +- src/commands/info/inviteInfo.ts | 6 +- src/commands/utilities/highlight-!.ts | 5 +- src/lib/utils/BushLogger.ts | 58 ++- src/tasks/cache/updateNeuItemCache.ts | 4 +- yarn.lock | 800 ++++++++++++++++++++++++++++------ 7 files changed, 718 insertions(+), 185 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 9a6837f..e2d7435 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -115,17 +115,20 @@ const globals = [ 'btoa', 'createImageBitmap', 'fetch', 'queueMicrotask', 'sessionStorage', 'addEventListener', 'removeEventListener' ] +/** + * @type {import('eslint').Linter.Config} + */ module.exports = { env: { - es2021: true, + es2022: true, node: true }, extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], parser: '@typescript-eslint/parser', parserOptions: { - ecmaVersion: 12, + ecmaVersion: 'latest', sourceType: 'module', - project: './tsconfig.json' + project: './tsconfig.eslint.json' }, plugins: ['@typescript-eslint', 'deprecation', 'import'], ignorePatterns: ['dist'], diff --git a/package.json b/package.json index e858ae6..faa2706 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "license": "CC-BY-NC-SA-4.0", "scripts": { "build:esbuild": "yarn rimraf dist && yarn esbuild --sourcemap=inline --outdir=dist --platform=node --target=es2020 --format=esm --log-level=warning src/**/*.ts", - "build:tsc": "yarn rimraf dist && yarn tsc", + "build:tsc": "yarn tsc", "build:tsc:no-emit": "yarn tsc --noEmit", "start:raw": "node --enable-source-maps --experimental-json-modules --no-warnings dist/src/bot.js", "start:esbuild": "yarn build:esbuild && yarn start:raw", @@ -58,8 +58,8 @@ } }, "dependencies": { - "@discordjs/builders": "^0.15.0", - "@discordjs/rest": "^0.5.0", + "@discordjs/builders": "^1.0.0", + "@discordjs/rest": "^1.0.0", "@ironm00n/nbt-ts": "^1.4.0", "@notenoughupdates/discord.js-minesweeper": "^1.0.10", "@notenoughupdates/events-intercept": "^3.0.1", @@ -73,7 +73,7 @@ "chalk": "^5.0.1", "deep-lock": "^1.0.0", "discord-akairo": "npm:@notenoughupdates/discord-akairo@dev", - "discord-api-types": "0.34.0", + "discord-api-types": "0.36.2", "discord.js": "npm:@notenoughupdates/discord.js@dev", "fuse.js": "^6.6.2", "gif-to-apng": "^0.1.2", @@ -99,22 +99,23 @@ "@types/eslint": "^8.4.5", "@types/express": "^4.17.13", "@types/lodash": "^4.14.182", - "@types/node": "^18.0.4", + "@types/node": "^18.0.6", "@types/numeral": "^2.0.2", "@types/pg": "^8.6.5", "@types/prettier": "^2.6.3", "@types/rimraf": "^3.0.2", "@types/tinycolor2": "^1.4.3", "@types/validator": "^13.7.4", - "@typescript-eslint/eslint-plugin": "^5.30.5", - "@typescript-eslint/parser": "^5.30.5", - "eslint": "^8.19.0", + "@typescript-eslint/eslint-plugin": "^5.30.7", + "@typescript-eslint/parser": "^5.30.7", + "electron": "latest", + "eslint": "^8.20.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-deprecation": "^1.3.2", "eslint-plugin-import": "^2.26.0", - "node-fetch": "^3.2.8", + "node-fetch": "^3.2.9", "ts-essentials": "^9.2.0", - "vitest": "^0.18.0" + "vitest": "^0.18.1" }, "packageManager": "yarn@3.2.1" } diff --git a/src/commands/info/inviteInfo.ts b/src/commands/info/inviteInfo.ts index bfe7eae..5df86ad 100644 --- a/src/commands/info/inviteInfo.ts +++ b/src/commands/info/inviteInfo.ts @@ -28,15 +28,15 @@ export default class InviteInfoCommand extends BushCommand { public override async exec(message: CommandMessage | SlashMessage, args: { invite: ArgType<'invite' | 'string'> }) { const invite = message.util.isSlashMessage(message) ? ((await Arg.cast('invite', message, args.invite as string)) as ArgType<'invite'>) - : args.invite; + : (args.invite as Invite); - const inviteInfoEmbed = new EmbedBuilder().setTitle(`Invite to ${invite.guild.name}`).setColor(colors.default); + const inviteInfoEmbed = new EmbedBuilder().setTitle(`Invite to ${invite.guild!.name}`).setColor(colors.default); this.generateAboutField(inviteInfoEmbed, invite); } private generateAboutField(embed: EmbedBuilder, invite: Invite) { - const about = [`**code:** ${invite.code}`, `**channel:** ${}`]; + const about = [`**code:** ${invite.code}`, `**channel:** ${invite.channel!.name}`]; embed.addFields({ name: '» About', value: about.join('\n') }); } diff --git a/src/commands/utilities/highlight-!.ts b/src/commands/utilities/highlight-!.ts index b93f59a..f2ee259 100644 --- a/src/commands/utilities/highlight-!.ts +++ b/src/commands/utilities/highlight-!.ts @@ -186,10 +186,7 @@ export default class HighlightCommand extends BushCommand { throw new Error('This command is not meant to be executed directly.'); } - public override async execSlash( - message: SlashMessage, - args: { subcommand: keyof typeof highlightSubcommands; subcommandGroup?: string } - ) { + public override async execSlash(message: SlashMessage, args: { subcommand: string; subcommandGroup?: string }) { // manual `Flag.continue` const subcommand = this.handler.modules.get(`highlight-${args.subcommandGroup ?? args.subcommand}`)!; return subcommand.exec(message, args); diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts index 5c98760..995dd82 100644 --- a/src/lib/utils/BushLogger.ts +++ b/src/lib/utils/BushLogger.ts @@ -1,6 +1,7 @@ import chalk from 'chalk'; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { Client, EmbedBuilder, escapeMarkdown, PartialTextBasedChannelFields, type Message } from 'discord.js'; +import { Client, EmbedBuilder, escapeMarkdown, Formatters, PartialTextBasedChannelFields, type Message } from 'discord.js'; +import { stripVTControlCharacters as stripColor } from 'node:util'; import repl, { REPLServer, REPL_MODE_STRICT } from 'repl'; import { WriteStream } from 'tty'; import { type SendMessageType } from '../extensions/discord-akairo/BushClient.js'; @@ -72,16 +73,16 @@ function parseFormatting( discordFormat = false ): string | typeof content { if (typeof content !== 'string') return content; - const newContent: Array = content.split(/<<|>>/); - const tempParsedArray: Array = []; - newContent.forEach((value, index) => { - if (index % 2 !== 0) { - tempParsedArray.push(discordFormat ? `**${escapeMarkdown(value)}**` : color ? chalk[color](value) : value); - } else { - tempParsedArray.push(discordFormat ? escapeMarkdown(value) : value); - } - }); - return tempParsedArray.join(''); + return content + .split(/<<|>>/) + .map((value, index) => { + if (discordFormat) { + return index % 2 === 0 ? escapeMarkdown(value) : Formatters.bold(escapeMarkdown(value)); + } else { + return index % 2 === 0 || !color ? value : chalk[color](value); + } + }) + .join(''); } /** @@ -98,34 +99,25 @@ function inspectContent(content: any, depth = 2, colors = true): string { return content; } -/** - * Strips ANSI color codes from a string. - * @param text The string to strip color codes from. - * @returns A string without ANSI color codes. - */ -function stripColor(text: string): string { - return text.replace( - // eslint-disable-next-line no-control-regex - /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, - '' - ); -} - /** * Generates a formatted timestamp for logging. * @returns The formatted timestamp. */ function getTimeStamp(): string { const now = new Date(); - const hours = now.getHours(); - const minute = now.getMinutes(); - let hour = hours; - let amOrPm: 'AM' | 'PM' = 'AM'; - if (hour > 12) { - amOrPm = 'PM'; - hour = hour - 12; - } - return `${hour >= 10 ? hour : `0${hour}`}:${minute >= 10 ? minute : `0${minute}`} ${amOrPm}`; + const minute = pad(now.getMinutes()); + const hour = pad(now.getHours() % 12); + const meridiem = now.getHours() > 12 ? 'PM' : 'AM'; + const year = now.getFullYear().toString().slice(2).padStart(2, '0'); + const date = `${pad(now.getMonth() + 1)}/${pad(now.getDay())}/${year}`; + return `${date} ${hour}:${minute} ${meridiem}`; +} + +/** + * Pad a two-digit number. + */ +function pad(num: number) { + return num.toString().padStart(2, '0'); } /** diff --git a/src/tasks/cache/updateNeuItemCache.ts b/src/tasks/cache/updateNeuItemCache.ts index fff9e08..14c107b 100644 --- a/src/tasks/cache/updateNeuItemCache.ts +++ b/src/tasks/cache/updateNeuItemCache.ts @@ -1,8 +1,8 @@ import { BushTask, Time } from '#lib'; -export default class UpdatePriceItemCache extends BushTask { +export default class UpdateNeuItemCache extends BushTask { public constructor() { - super('updatePriceItemCache', { + super('updateNeuItemCache', { delay: 1 * Time.Hour, runOnStart: true }); diff --git a/yarn.lock b/yarn.lock index 63b0c6d..0e266d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,20 +14,6 @@ __metadata: languageName: node linkType: hard -"@discordjs/builders@npm:^0.15.0": - version: 0.15.0 - resolution: "@discordjs/builders@npm:0.15.0" - dependencies: - "@sapphire/shapeshift": ^3.1.0 - "@sindresorhus/is": ^4.6.0 - discord-api-types: ^0.33.3 - fast-deep-equal: ^3.1.3 - ts-mixer: ^6.0.1 - tslib: ^2.4.0 - checksum: 1a8a4ffe048243ebb9fbbc76a113e4994c68904a5b3d256a6b10c0123f1d0fb58b45809d134ba993293fb2190c9f3506663ddfb5068a86ec6b9c53b5db61f6a6 - languageName: node - linkType: hard - "@discordjs/builders@npm:^0.16.0-dev": version: 0.16.0-dev.1655510999-2681929 resolution: "@discordjs/builders@npm:0.16.0-dev.1655510999-2681929" @@ -42,10 +28,16 @@ __metadata: languageName: node linkType: hard -"@discordjs/collection@npm:^0.7.0": - version: 0.7.0 - resolution: "@discordjs/collection@npm:0.7.0" - checksum: 141aa35a5433bacba3617b533557b4948388c7b59cdaecee51ccd721c1b9242e50d95bdef53ee2491535a017095f5072ace3c3e9e594193f67a1c5a8a4b7db93 +"@discordjs/builders@npm:^1.0.0": + version: 1.0.0 + resolution: "@discordjs/builders@npm:1.0.0" + dependencies: + "@sapphire/shapeshift": ^3.5.1 + discord-api-types: ^0.36.2 + fast-deep-equal: ^3.1.3 + ts-mixer: ^6.0.1 + tslib: ^2.4.0 + checksum: eeb627c772a2bd1fea1bddd58d46d391c30d0e2411cc3976386b7efc2048724e6bfd204ba848724ebd6d04791b358637c3a9eee878f924ef525c4920bfbfa2de languageName: node linkType: hard @@ -56,17 +48,10 @@ __metadata: languageName: node linkType: hard -"@discordjs/rest@npm:^0.5.0": - version: 0.5.0 - resolution: "@discordjs/rest@npm:0.5.0" - dependencies: - "@discordjs/collection": ^0.7.0 - "@sapphire/async-queue": ^1.3.1 - "@sapphire/snowflake": ^3.2.2 - discord-api-types: ^0.33.3 - tslib: ^2.4.0 - undici: ^5.4.0 - checksum: 36427fd77ff11285da4400e9960fccb71aafa657e43c3de4fe4772d1497f20c3d84754c844ad44d2c6f68fed45303ace790191fd811c94414312fde20d0346c2 +"@discordjs/collection@npm:^1.0.0": + version: 1.0.0 + resolution: "@discordjs/collection@npm:1.0.0" + checksum: d8eafd35e782a6a2ee83a22c31679958bc827fce8cd5ffc7e5942cf681c96fd9543334b48c743ecda45179fcefa8d7be7a13f771d7f14effaec8a8ca25077031 languageName: node linkType: hard @@ -84,6 +69,43 @@ __metadata: languageName: node linkType: hard +"@discordjs/rest@npm:^1.0.0": + version: 1.0.0 + resolution: "@discordjs/rest@npm:1.0.0" + dependencies: + "@discordjs/collection": ^1.0.0 + "@sapphire/async-queue": ^1.3.2 + "@sapphire/snowflake": ^3.2.2 + discord-api-types: ^0.36.2 + file-type: ^17.1.2 + tslib: ^2.4.0 + undici: ^5.7.0 + checksum: dfe4348ce3d9cd7e91b1ee090b4b7c9eaf9f0b5a2acb4e2a1e71cb9a08afa260393190db5461e5873663d7d3bd29fbeda1ebec1bd74dcce87577371cf887cbbe + languageName: node + linkType: hard + +"@electron/get@npm:^1.14.1": + version: 1.14.1 + resolution: "@electron/get@npm:1.14.1" + dependencies: + debug: ^4.1.1 + env-paths: ^2.2.0 + fs-extra: ^8.1.0 + global-agent: ^3.0.0 + global-tunnel-ng: ^2.7.1 + got: ^9.6.0 + progress: ^2.0.3 + semver: ^6.2.0 + sumchecker: ^3.0.1 + dependenciesMeta: + global-agent: + optional: true + global-tunnel-ng: + optional: true + checksum: 21fec5e82bbee8f9fa183b46e05675b137c3130c7999d3b2b34a0047d1a06ec3c76347b9bbdb9911ba9b2123697804e360a15dda9db614c0226d5d4dcc4d6d15 + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^1.3.0": version: 1.3.0 resolution: "@eslint/eslintrc@npm:1.3.0" @@ -241,6 +263,13 @@ __metadata: languageName: node linkType: hard +"@sapphire/async-queue@npm:^1.3.2": + version: 1.3.2 + resolution: "@sapphire/async-queue@npm:1.3.2" + checksum: 348f35a278bff68cb6d5e2c2219b03ce66243162522003bb14426e5fdad251300bea8ef3883043eb034c181dddd52296a519e9f377075a5b31074807fe163e76 + languageName: node + linkType: hard + "@sapphire/shapeshift@npm:^3.1.0": version: 3.2.0 resolution: "@sapphire/shapeshift@npm:3.2.0" @@ -248,6 +277,16 @@ __metadata: languageName: node linkType: hard +"@sapphire/shapeshift@npm:^3.5.1": + version: 3.5.1 + resolution: "@sapphire/shapeshift@npm:3.5.1" + dependencies: + fast-deep-equal: ^3.1.3 + lodash.uniqwith: ^4.5.0 + checksum: caecfef844c9e43e921a5051da888fae7da8980bfd9f9bb4f7fee85931d40929ffb9b6dfae464c0dccee61e56f7698f998e4d9a54d25f35fad39a51ba1a4f391 + languageName: node + linkType: hard + "@sapphire/snowflake@npm:^3.2.2": version: 3.2.2 resolution: "@sapphire/snowflake@npm:3.2.2" @@ -335,6 +374,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/is@npm:^0.14.0": + version: 0.14.0 + resolution: "@sindresorhus/is@npm:0.14.0" + checksum: 971e0441dd44ba3909b467219a5e242da0fc584048db5324cfb8048148fa8dcc9d44d71e3948972c4f6121d24e5da402ef191420d1266a95f713bb6d6e59c98a + languageName: node + linkType: hard + "@sindresorhus/is@npm:^4.6.0": version: 4.6.0 resolution: "@sindresorhus/is@npm:4.6.0" @@ -342,6 +388,15 @@ __metadata: languageName: node linkType: hard +"@szmarczak/http-timer@npm:^1.1.2": + version: 1.1.2 + resolution: "@szmarczak/http-timer@npm:1.1.2" + dependencies: + defer-to-connect: ^1.0.1 + checksum: 4d9158061c5f397c57b4988cde33a163244e4f02df16364f103971957a32886beb104d6180902cbe8b38cb940e234d9f98a4e486200deca621923f62f50a06fe + languageName: node + linkType: hard + "@szmarczak/http-timer@npm:^5.0.1": version: 5.0.1 resolution: "@szmarczak/http-timer@npm:5.0.1" @@ -351,6 +406,13 @@ __metadata: languageName: node linkType: hard +"@tokenizer/token@npm:^0.3.0": + version: 0.3.0 + resolution: "@tokenizer/token@npm:0.3.0" + checksum: 1d575d02d2a9f0c5a4ca5180635ebd2ad59e0f18b42a65f3d04844148b49b3db35cf00b6012a1af2d59c2ab3caca59451c5689f747ba8667ee586ad717ee58e1 + languageName: node + linkType: hard + "@tootallnate/once@npm:2": version: 2.0.0 resolution: "@tootallnate/once@npm:2.0.0" @@ -492,7 +554,7 @@ __metadata: languageName: node linkType: hard -"@types/keyv@npm:*": +"@types/keyv@npm:*, @types/keyv@npm:^3.1.1": version: 3.1.4 resolution: "@types/keyv@npm:3.1.4" dependencies: @@ -536,10 +598,17 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.0.4": - version: 18.0.4 - resolution: "@types/node@npm:18.0.4" - checksum: 981284fd57941f233f0e77038087c122f56e3c2b4fc4e090dfc7f0a93abfc526d5ccdd59eb3ef551d713245cf3943e37c7b957f12ba699209341a447c39fab59 +"@types/node@npm:^16.11.26": + version: 16.11.45 + resolution: "@types/node@npm:16.11.45" + checksum: 57d61c951024f66d796e71e4a972faef266007398cd4e93a195822fea2d5deb41d0615f394a99ece89772b145ff057321d138c7e3442455dc7d785ff67cebde3 + languageName: node + linkType: hard + +"@types/node@npm:^18.0.6": + version: 18.0.6 + resolution: "@types/node@npm:18.0.6" + checksum: 780f8885a6b6eb12f4c0246617747fdc37a451931b3c01ce8148d356c0903b705dcb16cc6a914de63d48b0dc1b002c7a3dfae681f580e1761aa551d3cd996813 languageName: node linkType: hard @@ -641,13 +710,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/eslint-plugin@npm:5.30.5" +"@typescript-eslint/eslint-plugin@npm:^5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/eslint-plugin@npm:5.30.7" dependencies: - "@typescript-eslint/scope-manager": 5.30.5 - "@typescript-eslint/type-utils": 5.30.5 - "@typescript-eslint/utils": 5.30.5 + "@typescript-eslint/scope-manager": 5.30.7 + "@typescript-eslint/type-utils": 5.30.7 + "@typescript-eslint/utils": 5.30.7 debug: ^4.3.4 functional-red-black-tree: ^1.0.1 ignore: ^5.2.0 @@ -660,7 +729,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: cf763fb091dcdfd6c25843251a220b654ca83968b17266e0f343771f489085c6afc4e41fcf2187b4c72c4d12a787070c64b5e5367069460f95a8174573f48905 + checksum: d42af514f5817732646b5601030699687b4ef619ba7983754a4173bf908f6c6030324038e3733b88342ec6ace07af61aa946d677da6a6266931275bd2afc9fc2 languageName: node linkType: hard @@ -675,20 +744,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/parser@npm:5.30.5" +"@typescript-eslint/parser@npm:^5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/parser@npm:5.30.7" dependencies: - "@typescript-eslint/scope-manager": 5.30.5 - "@typescript-eslint/types": 5.30.5 - "@typescript-eslint/typescript-estree": 5.30.5 + "@typescript-eslint/scope-manager": 5.30.7 + "@typescript-eslint/types": 5.30.7 + "@typescript-eslint/typescript-estree": 5.30.7 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 6c16821e122b891420a538f200f6e576ad1167855a67e87f9a7d3a08c0513fe26006f6411b8ba6f4662a81526bd0339ae37c47dd88fa5943e6f27ff70da9f989 + checksum: f0b2da3cfd047d241f0bd3065a36afe008214aa9e8cd05e9f92d8b0e4b9ec19d3651d0e4a3995b8cb34b553cccb4b0d02d18c0cfbe11f53acd85923dd68366d5 languageName: node linkType: hard @@ -702,21 +771,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/scope-manager@npm:5.30.5" +"@typescript-eslint/scope-manager@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/scope-manager@npm:5.30.7" dependencies: - "@typescript-eslint/types": 5.30.5 - "@typescript-eslint/visitor-keys": 5.30.5 - checksum: 509bee6d62cca1716e8f4792d9180c189974992ba13d8103ca04423a64006cf184c4b2c606d55c776305458140c798a3a9a414d07a60790b83dd714f56c457b0 + "@typescript-eslint/types": 5.30.7 + "@typescript-eslint/visitor-keys": 5.30.7 + checksum: 434ce7a13a8f3bffae2af2b7fe19bab6e490c78114584212519f50cd1b91fbdcddc8ad93bdb3cacdc8cecca5a8c5d2eb606557e66bd3fcd9d3040846846c22ff languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/type-utils@npm:5.30.5" +"@typescript-eslint/type-utils@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/type-utils@npm:5.30.7" dependencies: - "@typescript-eslint/utils": 5.30.5 + "@typescript-eslint/utils": 5.30.7 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -724,7 +793,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 080cc1231729c34b778395658374e32d034474056f9b777dbc89d20d15eb93d93d0959328ad47c2a6623d40c6552364ababadce439842a944bce001f55b731b3 + checksum: e7a8d4ec973355c0fe5bad4c317a55940e41d24b1c33b0bf40e8bb268d784f6584a8048fc84ebdb7287849a2c70e2b36365067cba7815de849cd41a1d7653167 languageName: node linkType: hard @@ -735,10 +804,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.30.5": - version: 5.30.5 - resolution: "@typescript-eslint/types@npm:5.30.5" - checksum: c70420618cb875d4e964a20a3fa4cf40cb97a8ad3123e24860e3d829edf3b081c77fa1fe25644700499d27e44aee5783abc7765deee61e2ef59a928db96b2175 +"@typescript-eslint/types@npm:5.30.7": + version: 5.30.7 + resolution: "@typescript-eslint/types@npm:5.30.7" + checksum: 2f6345bf0e2e9f392c1f62a5f96c630d4565574230a000508d923444229e51c1a05e07cef042935ca30f4f35755dbf3871b8b9da808911f578d63e6a4b897b79 languageName: node linkType: hard @@ -760,12 +829,12 @@ __metadata: languageName: node linkType: hard -"@typescript-esl