From 8116a5a004ffd82f6304503daf4be7fb1ca5e13e Mon Sep 17 00:00:00 2001 From: noolaan Date: Thu, 9 Apr 2020 15:08:28 -0600 Subject: [PATCH 01/16] restructuring changes & command handling --- .gitignore | 3 +- Intercom.js | 22 - Logger.js | 14 +- Manager.js | 14 +- middleware/client/Transporter.js | 23 - package.json | 1 + structure/{ => client}/CacheManager.js | 0 .../client/DiscordClient.js | 22 +- .../client/Dispatcher.js | 2 +- .../client/EventHooker.js | 0 Registry.js => structure/client/Registry.js | 15 +- {middleware => structure}/client/Resolver.js | 0 structure/client/Transporter.js | 12 + .../components/commands/utility/Ping.js | 38 + .../components/observers/CommandHandler.js | 186 +++ .../components/observers/CommandHandler.js | 108 -- structure/extensions/Message.js | 4 + structure/extensions/User.js | 6 + structure/interfaces/Argument.js | 56 + structure/interfaces/Command.js | 7 +- structure/interfaces/Component.js | 8 +- structure/interfaces/Module.js | 10 +- structure/interfaces/Observer.js | 6 +- structure/interfaces/index.js | 7 +- util/index.js | 3 +- yarn-error.log | 1175 ----------------- yarn.lock | 5 + 27 files changed, 364 insertions(+), 1383 deletions(-) delete mode 100644 Intercom.js delete mode 100644 middleware/client/Transporter.js rename structure/{ => client}/CacheManager.js (100%) rename {middleware => structure}/client/DiscordClient.js (69%) rename {middleware => structure}/client/Dispatcher.js (88%) rename {middleware => structure}/client/EventHooker.js (100%) rename Registry.js => structure/client/Registry.js (82%) rename {middleware => structure}/client/Resolver.js (100%) create mode 100644 structure/client/Transporter.js create mode 100644 structure/client/components/commands/utility/Ping.js create mode 100644 structure/client/components/observers/CommandHandler.js delete mode 100644 structure/components/observers/CommandHandler.js create mode 100644 structure/interfaces/Argument.js delete mode 100644 yarn-error.log diff --git a/.gitignore b/.gitignore index d4e9214..e5d8b42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ options.json -node_modules \ No newline at end of file +node_modules +yarn-error.log \ No newline at end of file diff --git a/Intercom.js b/Intercom.js deleted file mode 100644 index 8c94589..0000000 --- a/Intercom.js +++ /dev/null @@ -1,22 +0,0 @@ -class Intercom { - - constructor(manager, shardManager) { - - this.manager = manager; - this.shardManager = shardManager; - - // this.shardManager.on('message', this.receive.bind(this)); - - } - - send(shard, message) { - shard.send(message); - } - - receive(...args) { - console.log(args); - } - -} - -module.exports = Intercom; \ No newline at end of file diff --git a/Logger.js b/Logger.js index 0602282..642bf91 100644 --- a/Logger.js +++ b/Logger.js @@ -1,13 +1,25 @@ -const Winston = require('winston'); +const winston = require('winston'); +const moment = require('moment'); class Logger { constructor(manager) { this.manager = manager; + this.logger = winston.createLogger({ + transports: [ + new winston.transports.Console(), + new winston.transports.File({ filename: `${Date.now()}.log` }), + new winston.transports.File({ filename: `${Date.now()}-error.log`, level: 'error' }) + ] + }); } + get date() { + return moment().format("MM/DD/YYYY hh:mm:ss"); + } + } module.exports = Logger; \ No newline at end of file diff --git a/Manager.js b/Manager.js index 4f36c62..5c5f206 100644 --- a/Manager.js +++ b/Manager.js @@ -2,8 +2,6 @@ const { EventEmitter } = require('events'); const ShardManager = require('./middleware/ShardManager.js'); const StorageManager = require('./storage/StorageManager.js'); -const Registry = require('./Registry.js'); -const Intercom = require('./Intercom.js'); const Logger = require('./Logger.js'); const { Command, Setting, Inhibitor } = require('./structure/interfaces/'); @@ -14,12 +12,9 @@ class Manager extends EventEmitter { super(); - this.registry = new Registry(this); - this.shardManager = new ShardManager('./middleware/client/DiscordClient.js', options); + this.shardManager = new ShardManager('./structure/client/DiscordClient.js', options); this.storageManager = new StorageManager(this, options.storage) .initialize(); - - this.intercom = new Intercom(this, this.shardManager); this.logger = new Logger(this); @@ -28,13 +23,8 @@ class Manager extends EventEmitter { } async build() { - try { - await this.shardManager.spawn(); - }catch(e) { - console.log(e); - } - await this.registry.loadComponents('components/commands/', Command); + await this.shardManager.spawn(); this._built = true; diff --git a/middleware/client/Transporter.js b/middleware/client/Transporter.js deleted file mode 100644 index 1979423..0000000 --- a/middleware/client/Transporter.js +++ /dev/null @@ -1,23 +0,0 @@ -class Transporter { - - constructor(client, opts) { - - this.client = client; - - // process.on('message', this.receive.bind(this)); - - } - - async send() { - - process.send(); - - } - - async receive(message) { - - } - -} - -module.exports = Transporter; \ No newline at end of file diff --git a/package.json b/package.json index 28a0364..1ddb47a 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "discord.js": "discordjs/discord.js", "escape-string-regexp": "^3.0.0", "eslint": "^6.8.0", + "moment": "^2.24.0", "mongodb": "^3.5.5", "mysql": "^2.18.1", "node-fetch": "^2.6.0", diff --git a/structure/CacheManager.js b/structure/client/CacheManager.js similarity index 100% rename from structure/CacheManager.js rename to structure/client/CacheManager.js diff --git a/middleware/client/DiscordClient.js b/structure/client/DiscordClient.js similarity index 69% rename from middleware/client/DiscordClient.js rename to structure/client/DiscordClient.js index 01ea58f..912cd3a 100644 --- a/middleware/client/DiscordClient.js +++ b/structure/client/DiscordClient.js @@ -2,12 +2,14 @@ const { Client } = require('discord.js'); const options = require('../../options.json'); +const Registry = require('./Registry.js') const EventHooker = require('./EventHooker.js'); const Dispatcher = require('./Dispatcher.js') const Resolver = require('./Resolver.js'); const Transporter = require('./Transporter.js'); const { Guild, User, Message } = require('../../structure/extensions/'); +const { Command, Observer, Inhibitor, Setting } = require('../../structure/interfaces/'); class DiscordClient extends Client { @@ -15,6 +17,7 @@ class DiscordClient extends Client { super(options.bot.clientOptions); + this.registry = new Registry(this); this.eventHooker = new EventHooker(this); this.dispatcher = new Dispatcher(this); this.resolver = new Resolver(this); @@ -23,27 +26,18 @@ class DiscordClient extends Client { this._options = options; this._built = false; - process.send({ - - }); - - process.on('message', (message) => { - - }); - } async build() { + if(this._built) return undefined; + await super.login(this._options.bot.token); + await this.registry.loadComponents('components/commands/', Command); + await this.registry.loadComponents('components/observers', Observer); - this.on('message', (message) => { - console.log(message); - if(message.content === "kms") { - message.reply("ok"); - } - }); + await this.dispatcher.dispatch(); this._built = true; diff --git a/middleware/client/Dispatcher.js b/structure/client/Dispatcher.js similarity index 88% rename from middleware/client/Dispatcher.js rename to structure/client/Dispatcher.js index 7733074..c71f1f4 100644 --- a/middleware/client/Dispatcher.js +++ b/structure/client/Dispatcher.js @@ -14,7 +14,7 @@ class Dispatcher { for(const observer of observers.values()) { for(let [hook, func] of observer.hooks) { - this.client.hooker.hook(hook, func); + this.client.eventHooker.hook(hook, func); } } diff --git a/middleware/client/EventHooker.js b/structure/client/EventHooker.js similarity index 100% rename from middleware/client/EventHooker.js rename to structure/client/EventHooker.js diff --git a/Registry.js b/structure/client/Registry.js similarity index 82% rename from Registry.js rename to structure/client/Registry.js index ef7aacb..d4fde57 100644 --- a/Registry.js +++ b/structure/client/Registry.js @@ -1,21 +1,24 @@ const path = require('path'); const { EventEmitter } = require('events'); -const { Collection, Util } = require('./util/'); +const { Collection, Util } = require('../../util/'); + +const { Component, Module } = require('../../structure/interfaces'); class Registry extends EventEmitter { - constructor(manager) { + constructor(client) { super(); + this.client = client; this.components = new Collection(); } - async loadComponents(dir) { + async loadComponents(dir, classToHandle) { - const directory = path.join(process.cwd(), 'structure/', dir); //Finds directory of component folder relative to current working directory. + const directory = path.join(process.cwd(), 'structure/client/', dir); //Finds directory of component folder relative to current working directory. const files = Util.readdirRecursive(directory); //Loops through all folders in the directory and returns the files. const loaded = []; @@ -53,10 +56,12 @@ class Registry extends EventEmitter { return null; } + console.log(directory); + if(directory) component.directory = directory; if(component.module && typeof component.module === 'string') { //Sets modules or "groups" for each component, specified by their properties. let module = this.components.get(`module:${component.module}`); - if(!module) module = await this.loadComponent(new Module(this.manager, { name: component.module })); + if(!module) module = await this.loadComponent(new Module(this.client, { name: component.module })); this.components.set(module.resolveable, module); component.module = module; diff --git a/middleware/client/Resolver.js b/structure/client/Resolver.js similarity index 100% rename from middleware/client/Resolver.js rename to structure/client/Resolver.js diff --git a/structure/client/Transporter.js b/structure/client/Transporter.js new file mode 100644 index 0000000..0e3b656 --- /dev/null +++ b/structure/client/Transporter.js @@ -0,0 +1,12 @@ +class Transporter { + + constructor(manager) { + + this.manager = manager; + + } + + +} + +module.exports = Transporter; \ No newline at end of file diff --git a/structure/client/components/commands/utility/Ping.js b/structure/client/components/commands/utility/Ping.js new file mode 100644 index 0000000..d3d3c85 --- /dev/null +++ b/structure/client/components/commands/utility/Ping.js @@ -0,0 +1,38 @@ +const { Command, Argument } = require('../../../../interfaces/'); + +class PingCommand extends Command { + + constructor(client) { + + super(client, { + name: 'ping', + module: 'utility', + description: "Determines the ping of the bot.", + arguments: [ + new Argument(client, { + name: 'apple', + type: 'BOOLEAN', + types: ['VERBAL'] + }), + new Argument(client, { + name: 'banana', + aliases: ['bans', 'bananas'], + type: 'INTEGER', + types: ['FLAG', 'VERBAL'], + default: 0 + }) + ] + }); + + this.client = client; + + + } + + async execute(message) { + message.reply("test"); + } + +} + +module.exports = PingCommand; \ No newline at end of file diff --git a/structure/client/components/observers/CommandHandler.js b/structure/client/components/observers/CommandHandler.js new file mode 100644 index 0000000..a4f146f --- /dev/null +++ b/structure/client/components/observers/CommandHandler.js @@ -0,0 +1,186 @@ +const { stripIndents } = require('common-tags'); +const { escapeRegex } = require('escape-string-regexp'); + +const { Observer } = require('../../../interfaces/'); + +class CommandHandler extends Observer { + + constructor(client) { + + super(client, { + name: 'commandHandler', + priority: 5, + guarded: true + }); + + this.client = client; + + this.hooks = [ + ['message', this.handleMessage.bind(this)] + ]; + + this.commandPatterns = new Map(); + + + } + + async handleMessage(message) { + + if(!this.client._built + || message.webhookID + || message.author.bot + || (message.guild && !message.guild.available)) return undefined; + + if(message.guild && !message.member) { + await message.guild.members.fetch(message.author.id); + } + + const content = message.content; + const args = content.split(' '); + const { command, newArgs } = await this._getCommand(message, args); + if(!command) return undefined; + + message.command = command; + + return await this.handleCommand(message, newArgs); + + } + + async _getCommand(message, [arg1, arg2, ...args]) { + + const prefix = this.client._options.bot.prefix; //Change this for guild prefix settings. + let command = null; + let remains = []; + + if(arg1 && arg1.startsWith(prefix)) { + const commandName = arg1.slice(1); + command = await this._matchCommand(message, commandName); + remains = [arg2, ...args]; + } else if(arg1 && arg2 && arg1.startsWith('<@')){ + const pattern = new RegExp(`^(<@!?${this.client.user.id}>)`, 'i'); + if(arg2 && pattern.test(arg1)) { + command = await this._matchCommand(message, arg2); + } + remains = args + } + + return { command, newArgs: remains }; + + } + + + async _matchCommand(message, commandName) { + + const command = this.client.resolver.components(commandName, 'command', true)[0]; + if(!command) return null; + + //Eventually search for custom commands here. + + return command; + + } + + /* Command Handling */ + + async handleCommand(message, args) { + + const inhibitor = await this._handleInhibitors(message); + if(inhibitor.error) { + message.channel.send(`${inhibitor.resolveable} failed to pass.`); + return undefined; + } + + const parsedArguments = await this._parseArguments(message, args); + + + + } + + async _handleInhibitors(message) { + + const inhibitors = this.client.registry.components.filter(c=>c.type === 'inhibitor' && !c.disabled); + if(inhibitors.size === 0) return { error: false }; + + const promises = []; + for(const inhibitor of inhibitors.values()) { + if(inhibitor.guild && !message.guild) continue; + promises.push((async () => { + let inhibited = inhibitor.execute(message); + if(inhibited instanceof Promise) inhibited = await inhibited; + return inhibited; + })()); + } + + const reasons = (await Promise.all(promises)).filter(p=>p.error); + if(reasons.length === 0) return { error: false }; + + reasons.sort((a, b) => b.inhibitor.priority - a.inhibitor.priority); + return reasons[0]; + + } + + async _parseArguments(message, args = []) { + + const command = message.command; + let parsedArguments = []; + const flags = {}; + + const { shortFlags, longFlags, keys } = await this._createFlags(command.arguments); + + + + console.log(shortFlags, longFlags, keys); + message.channel.send(keys); + + let currentFlag = null; + for(const word of args) { + // if(currentFlag) + for(const key of keys) { + const regex = new RegExp('/[0-9]*([a-zA-Z]+)[0-9]*/g', 'g'); + const match = regex.exec(word); + console.log(match); + if(!match) continue; + + } + } + + } + + async _createFlags(args) { + + let shortFlags = {}; + let longFlags = {}; + let keys = []; + + for(const arg of args) { + + let letters = []; + let names = [ arg.name, ...arg.aliases ]; + keys = [...keys, ...names]; + + for(const name of names) { + longFlags[name] = arg.name; + + if(!arg.types.includes('FLAG')) continue; + + let letter = name.slice(0, 1); + if(letters.includes(letter)) continue; + if(keys.includes(letter)) letter = letter.toUpperCase(); + if(keys.includes(letter)) break; + + keys.push(letter); + letters.push(letter); + + shortFlags[letter] = arg.name; + } + + } + + return { shortFlags, longFlags, keys }; + + } + + +} + +module.exports = CommandHandler; \ No newline at end of file diff --git a/structure/components/observers/CommandHandler.js b/structure/components/observers/CommandHandler.js deleted file mode 100644 index 39fcf8b..0000000 --- a/structure/components/observers/CommandHandler.js +++ /dev/null @@ -1,108 +0,0 @@ -const { stripIndents } = require('common-tags'); -const { escapeRegex } = require('escape-string-regexp'); - -const { Observer } = require('../../interfaces'); - -class CommandHandler extends Observer { - - constructor(manager) { - - super(manager, { - name: 'commandHandler', - priority: 5, - guarded: true - }); - - this.manager = manager; - - this.hooks = [ - ['message', this.handleMessage.bind(this)] - ]; - - this.commandPatterns = new Map(); - - - } - - async handleMessage(message) { - - const client = message.client; - - if(!this.manager._built - || !client._built - || message.webhookID - || message.author.bot - || (message.guild && !message.guild.available)) return undefined; - - if(message.guild && !message.member) { - await message.guild.members.fetch(message.author.id); - } - - const content = message.cleanContent; - const args = content.split(' '); - const command = await this._getCommand(message, args); - if(!command) return undefined; - - return await this.handleCommand(message, command, args); - - } - - async handleCommand(message, command, args) { - - } - - async _getCommand(message, args = []) { - - const pattern = await this._getCommandPattern(message.guild); - - let command = await this._matchCommand(message, args, pattern, 2); - if(!command && !message.guild) command = await this._matchCommand(message, args, /^([^\s]+)/i); - - return command || null; - - } - - async _getCommandPattern(guild) { - - const createCommandPattern = (guild = null) => { - - const prefix = this.client._options.discord.prefix; - - const escapedPrefix = escapeRegex(prefix); - const pattern = new RegExp(`^(${escapedPrefix}\\s*|<@!?${this.client.user.id}>\\s+(?:${escapedPrefix})?)([^\\s]+)`, 'i'); - - const obj = { pattern, prefix }; - if(guild) { - this.client.logger.debug(`Created command pattern ${guild.name}: ${pattern}`); - this.commandPatterns.set(guild.id, obj); - } - - return obj; - }; - - if(!guild) return createCommandPattern().pattern; - let commandPattern = this.commandPatterns.get(guild.id); - - return commandPattern.pattern; - - } - - async _matchCommand(message, args, pattern, index = 1) { - - const matches = pattern.exec(message.cleanContent); - if(!matches) return null; - - const command = message.client.resolver.components(matches[index], 'command', true)[0]; - if(!command) return null; - - const indice = message.content.startsWith('<@') ? 2 : 1; - args.splice(0, indice); - - return command; - - } - - -} - -module.exports = CommandHandler; \ No newline at end of file diff --git a/structure/extensions/Message.js b/structure/extensions/Message.js index bcb86fa..e8d4018 100644 --- a/structure/extensions/Message.js +++ b/structure/extensions/Message.js @@ -12,6 +12,10 @@ const Message = Structures.extend('Message', (Message) => { } + async respond() { + + } + } return ExtendedMessage; diff --git a/structure/extensions/User.js b/structure/extensions/User.js index 8ee7b89..042ef4d 100644 --- a/structure/extensions/User.js +++ b/structure/extensions/User.js @@ -8,10 +8,16 @@ const User = Structures.extend('User', (User) => { super(...args); + this._settings = null; //internal cache of current users' settings; should ALWAYS stay the same as database. + this._cached = Date.now(); } + get timeSinceCached() { + return Date.now()-this._cached; + } + } return ExtendedUser; diff --git a/structure/interfaces/Argument.js b/structure/interfaces/Argument.js new file mode 100644 index 0000000..962051a --- /dev/null +++ b/structure/interfaces/Argument.js @@ -0,0 +1,56 @@ +const { Util } = require('../../util'); + +class Argument { + + constructor(client, options = {}) { + + this.client = client; + + this.name = options.name; + this.description = options.description; + this.aliases = options.aliases || []; //Aliases will work for both verbal and flag types. Careful for multiple aliases starting with different letters: more flags, more confusing. + + this.type = (options.type && Constants.Types.includes(options.type) ? options.type : 'BOOLEAN'); //What type the argument is ['STRING', 'INTEGER', 'FLOAT', 'BOOLEAN']. + + this.types = options.types || ['FLAG', 'VERBAL']; //['FLAG'], ['VERBAL'], or ['FLAG', 'VERBAL']. Declares if argument can be used verbally-only, flag-only, or both. + this.prompts = options.prompts || { + MISSING: `Argument **${this.name}** is missing and is required.`, + INVALID: `Argument **${this.name}** must be a \`${this.type}\` value.` + } //Default prompts to be replied to the user if an argument is missing or invalid. + + //NOTE: Instead of telling the person the argument is missing and is required, ask them and continue the command execution afterwards. More work to do. + + this.required = options.type === 'BOOLEAN' ? false : Boolean(options.required); //If the argument must be required for the command to work. Booleans + this.default = options.default || Constants.Defaults[options.type]; + this.infinite = Boolean(options.infinite); //Accepts infinite amount of arguments e.g. -u @nolan @navy. If false, will only detect one user. + + this.min = typeof options.min === 'number' ? options.min : null; //Min/max will only be used for INTEGER/FLOAT types. + this.max = typeof options.max === 'number' ? options.max : null; + + this.parser = options.parser || null; //Option to pass a function to verify values. + + } + + +} + +module.exports = Argument; + +const Constants = { + Defaults: { //these dont really mean anything, just default values. Most important one is the boolean one. + STRING: 'okay', + INTEGER: 5, + FLOAT: 2.5, + BOOLEAN: true + }, + Types: [ + 'STRING', + 'INTEGER', + 'FLOAT', + 'BOOLEAN' + ], + ArgumentTypes: [ + 'FLAG', + 'VERBAL' + ] +}; \ No newline at end of file diff --git a/structure/interfaces/Command.js b/structure/interfaces/Command.js index 6a1b7ca..f7811db 100644 --- a/structure/interfaces/Command.js +++ b/structure/interfaces/Command.js @@ -2,17 +2,17 @@ const Component = require('./Component.js'); class Command extends Component { - constructor(client, opts = {}) { + constructor(manager, opts = {}) { if(!opts) return null; - super(client, { + super(manager, { id: opts.name, type: 'command', disabled: opts.disabled || false, guarded: opts.guarded || false }); - Object.defineProperty(this, 'client', { value: client }); + this.manager = manager; this.name = opts.name; this.module = opts.module; @@ -25,6 +25,7 @@ class Command extends Component { this.restricted = Boolean(opts.restricted); this.archivable = opts.archivable === undefined ? false : Boolean(opts.archivable); this.guildOnly = Boolean(opts.guildOnly); + this.arguments = opts.arguments || []; this.clientPermissions = opts.clientPermissions || []; this.memberPermissions = opts.memberPermissions || []; diff --git a/structure/interfaces/Component.js b/structure/interfaces/Component.js index 2c231d4..f336305 100644 --- a/structure/interfaces/Component.js +++ b/structure/interfaces/Component.js @@ -1,9 +1,9 @@ class Component { - constructor(manager, opts = {}) { + constructor(client, opts = {}) { if(!opts) return null; - this.manager = manager; + this.client = client; this.id = opts.id; this.type = opts.type; @@ -13,7 +13,7 @@ class Component { this.guarded = Boolean(opts.guarded); this.disabled = Boolean(opts.disabled); - this.registry = this.manager.registry; + this.registry = this.client.registry; } @@ -55,7 +55,7 @@ class Component { newModule = require(this.directory); if(typeof newModule === 'function') { - newModule = new newModule(this.manager); + newModule = new newModule(this.client); } this.registry.unloadComponent(this); diff --git a/structure/interfaces/Module.js b/structure/interfaces/Module.js index 08c7a67..d7f4323 100644 --- a/structure/interfaces/Module.js +++ b/structure/interfaces/Module.js @@ -1,19 +1,17 @@ const Component = require('./Component.js'); -const Collection = require('../../../util/interfaces/Collection.js'); +const { Collection } = require('../../util'); class Module extends Component { - constructor(client, opts = {}) { + constructor(manager, opts = {}) { if(!opts) return null; - super(client, { + super(manager, { id: opts.name, type: 'module' }); - Object.defineProperty(this, 'client', { - value: client - }); + this.manager = manager; this.name = opts.name; this.components = new Collection(); diff --git a/structure/interfaces/Observer.js b/structure/interfaces/Observer.js index 92c7b03..aa08ea5 100644 --- a/structure/interfaces/Observer.js +++ b/structure/interfaces/Observer.js @@ -11,13 +11,11 @@ class Observer extends Component { disabled: opts.disabled }); + this.client = client; + this.name = opts.name; this.priority = opts.priority || 1; this.hooks = opts.hooks || []; - - Object.defineProperty(this, 'client', { - value: client - }); } diff --git a/structure/interfaces/index.js b/structure/interfaces/index.js index b127906..a810ccc 100644 --- a/structure/interfaces/index.js +++ b/structure/interfaces/index.js @@ -1,6 +1,9 @@ module.exports = { + Argument: require('./Argument.js'), Command: require('./Command.js'), Component: require('./Component.js'), Inhibitor: require('./Inhibitor.js'), - Setting: require('./Setting.js') -} \ No newline at end of file + Setting: require('./Setting.js'), + Module: require('./Module.js'), + Observer: require('./Observer.js') +}; \ No newline at end of file diff --git a/util/index.js b/util/index.js index a576971..65f3208 100644 --- a/util/index.js +++ b/util/index.js @@ -1,5 +1,4 @@ module.exports = { Collection: require('./Collection.js'), - Util: require('./Util.js'), - Resolver: require('../middleware/client/Resolver.js') + Util: require('./Util.js') } \ No newline at end of file diff --git a/yarn-error.log b/yarn-error.log deleted file mode 100644 index 4d16234..0000000 --- a/yarn-error.log +++ /dev/null @@ -1,1175 +0,0 @@ -Arguments: - C:\Program Files\nodejs\node.exe C:\Users\Nolan\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js add winstonjs - -PATH: - C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\PuTTY\;C:\sqlite3;C:\Program Files\nodejs\;C:\Users\Nolan\AppData\Local\Microsoft\WindowsApps;;C:\Users\Nolan\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Nolan\AppData\Roaming\npm - -Yarn version: - 1.21.1 - -Node version: - 13.12.0 - -Platform: - win32 x64 - -Trace: - Error: https://registry.yarnpkg.com/winstonjs: Not found - at Request.params.callback [as _callback] (C:\Users\Nolan\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:66947:18) - at Request.self.callback (C:\Users\Nolan\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:140665:22) - at Request.emit (events.js:315:20) - at Request. (C:\Users\Nolan\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:141637:10) - at Request.emit (events.js:315:20) - at IncomingMessage. (C:\Users\Nolan\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:141559:12) - at Object.onceWrapper (events.js:421:28) - at IncomingMessage.emit (events.js:327:22) - at endReadableNT (_stream_readable.js:1201:12) - at processTicksAndRejections (internal/process/task_queues.js:84:21) - -npm manifest: - { - "name": "new-gbot", - "version": "0.0.1", - "description": "New iteration of GalacticBot", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "start": "node index.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Navy-gif/New-GBot.git" - }, - "author": "Navy.gif & Nolan", - "license": "ISC", - "bugs": { - "url": "https://github.com/Navy-gif/New-GBot/issues" - }, - "homepage": "https://github.com/Navy-gif/New-GBot#readme", - "dependencies": { - "common-tags": "^1.8.0", - "discord.js": "discordjs/discord.js", - "escape-string-regexp": "^3.0.0", - "eslint": "^6.8.0", - "mongodb": "^3.5.5", - "mysql": "^2.18.1", - "node-fetch": "^2.6.0" - } - } - -yarn manifest: - No manifest - -Lockfile: - # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - # yarn lockfile v1 - - - "@babel/code-frame@^7.0.0": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" - integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== - dependencies: - "@babel/highlight" "^7.8.3" - - "@babel/helper-validator-identifier@^7.9.0": - version "7.9.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80" - integrity sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g== - - "@babel/highlight@^7.8.3": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.9.0.tgz#4e9b45ccb82b79607271b2979ad82c7b68163079" - integrity sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ== - dependencies: - "@babel/helper-validator-identifier" "^7.9.0" - chalk "^2.0.0" - js-tokens "^4.0.0" - - "@discordjs/collection@^0.1.5": - version "0.1.5" - resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-0.1.5.tgz#1781c620b4c88d619bd0373a1548e5a6025e3d3a" - integrity sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw== - - "@types/color-name@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" - integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== - - abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - - acorn-jsx@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" - integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== - - acorn@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" - integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== - - ajv@^6.10.0, ajv@^6.10.2: - version "6.12.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" - integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - - ansi-escapes@^4.2.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" - integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== - dependencies: - type-fest "^0.11.0" - - ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - - ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - - ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - - ansi-styles@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" - integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== - dependencies: - "@types/color-name" "^1.1.1" - color-convert "^2.0.1" - - argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - - astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - - asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - - balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - - bignumber.js@9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.0.tgz#805880f84a329b5eac6e7cb6f8274b6d82bdf075" - integrity sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A== - - bl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.0.tgz#e1a574cdf528e4053019bb800b041c0ac88da493" - integrity sha512-wbgvOpqopSr7uq6fJrLH8EsvYMJf9gzfo2jCsL2eTy75qXPukA4pCgHamOQkZtY5vmfVtjB+P3LNlMHW5CEZXA== - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - - brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - - bson@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.4.tgz#f76870d799f15b854dffb7ee32f0a874797f7e89" - integrity sha512-S/yKGU1syOMzO86+dGpg2qGoDL0zvzcb262G+gqEy6TgP6rt6z6qxSFX/8X6vLC91P7G7C3nLs0+bvDzmvBA3Q== - - callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - - chalk@^2.0.0, chalk@^2.1.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - - chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - - chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - - cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - - cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= - - color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - - color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - - color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - - color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - - combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - - common-tags@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" - integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== - - concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - - core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - - cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - - debug@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - - deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - - delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - - denque@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf" - integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ== - - discord.js@discordjs/discord.js: - version "12.1.1" - resolved "https://codeload.github.com/discordjs/discord.js/tar.gz/828640ca263db2c95ed21e7353a2746fe6ac9fb8" - dependencies: - "@discordjs/collection" "^0.1.5" - abort-controller "^3.0.0" - form-data "^3.0.0" - node-fetch "^2.6.0" - prism-media "^1.2.0" - setimmediate "^1.0.5" - tweetnacl "^1.0.3" - ws "^7.2.1" - - doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - - emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - - emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - - escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - - escape-string-regexp@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-3.0.0.tgz#1dad9cc28aed682be0de197280f79911a5fccd61" - integrity sha512-11dXIUC3umvzEViLP117d0KN6LJzZxh5+9F4E/7WLAAw7GrHk8NpUR+g9iJi/pe9C0py4F8rs0hreyRCwlAuZg== - - eslint-scope@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" - integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - - eslint-utils@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== - dependencies: - eslint-visitor-keys "^1.1.0" - - eslint-visitor-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== - - eslint@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" - integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^7.0.0" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.14" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.3" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" - table "^5.2.3" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - - espree@^6.1.2: - version "6.2.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" - integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== - dependencies: - acorn "^7.1.1" - acorn-jsx "^5.2.0" - eslint-visitor-keys "^1.1.0" - - esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - - esquery@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.2.0.tgz#a010a519c0288f2530b3404124bfb5f02e9797fe" - integrity sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q== - dependencies: - estraverse "^5.0.0" - - esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== - dependencies: - estraverse "^4.1.0" - - estraverse@^4.1.0, estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - - estraverse@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.0.0.tgz#ac81750b482c11cca26e4b07e83ed8f75fbcdc22" - integrity sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A== - - esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - - event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - - external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - - fast-deep-equal@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" - integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== - - fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - - fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - - figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - - file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - - flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== - dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" - - flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - - form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - - fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - - functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - - glob-parent@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== - dependencies: - is-glob "^4.0.1" - - glob@^7.1.3: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - - globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" - - has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - - has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - - iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - - ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - - import-fresh@^3.0.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" - integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - - imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - - inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - - inherits@2, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - - inquirer@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.1.0.tgz#1298a01859883e17c7264b82870ae1034f92dd29" - integrity sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg== - dependencies: - ansi-escapes "^4.2.1" - chalk "^3.0.0" - cli-cursor "^3.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.15" - mute-stream "0.0.8" - run-async "^2.4.0" - rxjs "^6.5.3" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - - is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - - is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - - is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - - is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - - is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= - - isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - - isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - - js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - - js-yaml@^3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - - json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - - json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - - levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - - lodash@^4.17.14, lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - - memory-pager@^1.0.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5" - integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg== - - mime-db@1.43.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" - integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== - - mime-types@^2.1.12: - version "2.1.26" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" - integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== - dependencies: - mime-db "1.43.0" - - mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - - minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - - minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - - mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - - mongodb@^3.5.5: - version "3.5.5" - resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.5.5.tgz#1334c3e5a384469ac7ef0dea69d59acc829a496a" - integrity sha512-GCjDxR3UOltDq00Zcpzql6dQo1sVry60OXJY3TDmFc2SWFY6c8Gn1Ardidc5jDirvJrx2GC3knGOImKphbSL3A== - dependencies: - bl "^2.2.0" - bson "^1.1.1" - denque "^1.4.1" - require_optional "^1.0.1" - safe-buffer "^5.1.2" - optionalDependencies: - saslprep "^1.0.0" - - ms@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - - mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - - mysql@^2.18.1: - version "2.18.1" - resolved "https://registry.yarnpkg.com/mysql/-/mysql-2.18.1.tgz#2254143855c5a8c73825e4522baf2ea021766717" - integrity sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig== - dependencies: - bignumber.js "9.0.0" - readable-stream "2.3.7" - safe-buffer "5.1.2" - sqlstring "2.3.1" - - natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - - nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - - node-fetch@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" - integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== - - once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - - onetime@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" - integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== - dependencies: - mimic-fn "^2.1.0" - - optionator@^0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - - os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - - parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - - path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - - path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - - prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - - prism-media@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prism-media/-/prism-media-1.2.1.tgz#168f323712bcaacb1d70ae613bf9d9dc44cf43d4" - integrity sha512-R3EbKwJiYlTvGwcG1DpUt+06DsxOGS5W4AMEHT7oVOjG93MjpdhGX1whHyjnqknylLMupKAsKMEXcTNRbPe6Vw== - - process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - - progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - - punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - - readable-stream@2.3.7, readable-stream@^2.3.5: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - - regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - - require_optional@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e" - integrity sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g== - dependencies: - resolve-from "^2.0.0" - semver "^5.1.0" - - resolve-from@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" - integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c= - - resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - - restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - - rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - - run-async@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.0.tgz#e59054a5b86876cfae07f431d18cbaddc594f1e8" - integrity sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg== - dependencies: - is-promise "^2.1.0" - - rxjs@^6.5.3: - version "6.5.5" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" - integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== - dependencies: - tslib "^1.9.0" - - safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - - safe-buffer@^5.1.1, safe-buffer@^5.1.2: - version "5.2.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" - integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== - - "safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - - saslprep@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.3.tgz#4c02f946b56cf54297e347ba1093e7acac4cf226" - integrity sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag== - dependencies: - sparse-bitfield "^3.0.3" - - semver@^5.1.0, semver@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - - semver@^6.1.2: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - - setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - - shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - - shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - - signal-exit@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - - slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - - sparse-bitfield@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11" - integrity sha1-/0rm5oZWBWuks+eSqzM004JzyhE= - dependencies: - memory-pager "^1.0.2" - - sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - - sqlstring@2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/sqlstring/-/sqlstring-2.3.1.tgz#475393ff9e91479aea62dcaf0ca3d14983a7fb40" - integrity sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A= - - string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - - string-width@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - - string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - - strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - - strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - - strip-json-comments@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.0.tgz#7638d31422129ecf4457440009fba03f9f9ac180" - integrity sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w== - - supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - - supports-color@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" - integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== - dependencies: - has-flag "^4.0.0" - - table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - - text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - - through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - - tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - - tslib@^1.9.0: - version "1.11.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" - integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== - - tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - - type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - - type-fest@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" - integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== - - type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - - uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - - util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - - v8-compile-cache@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" - integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== - - which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - - word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - - wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - - write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - - ws@^7.2.1: - version "7.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" - integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== diff --git a/yarn.lock b/yarn.lock index 8aefdbb..dc95c11 100644 --- a/yarn.lock +++ b/yarn.lock @@ -787,6 +787,11 @@ mkdirp@^0.5.1: dependencies: minimist "^1.2.5" +moment@^2.24.0: + version "2.24.0" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" + integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== + mongodb@^3.5.5: version "3.5.5" resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.5.5.tgz#1334c3e5a384469ac7ef0dea69d59acc829a496a" From 99d416f3d7cb3329771dcf805a82c964617c87c0 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 11 Apr 2020 11:06:39 +0300 Subject: [PATCH 02/16] resolvers --- structure/client/Resolver.js | 116 +++++++++++++++++++++++++++++++++- structure/extensions/Guild.js | 17 +++++ 2 files changed, 130 insertions(+), 3 deletions(-) diff --git a/structure/client/Resolver.js b/structure/client/Resolver.js index 929f9a1..0d3d0f3 100644 --- a/structure/client/Resolver.js +++ b/structure/client/Resolver.js @@ -57,6 +57,14 @@ class Resolver { } + /** + * Resolve several user resolveables + * + * @param {array} [resolveables=[]] an array of user resolveables (name, id, tag) + * @param {boolean} [strict=false] whether or not to attempt resolving by partial usernames + * @returns {array || boolean} Array of resolved users or false if none were resolved + * @memberof Resolver + */ async resolveUsers(resolveables = [], strict = false) { if(typeof resolveables === 'string') resolveables = [ resolveables ]; @@ -100,11 +108,20 @@ class Resolver { } - return resolved; + return resolved.length > 0 ? resolved : false; } - async resolveMember(resolveables = [], strict = false, guild) { + /** + * Resolve multiple member resolveables + * + * @param {array} [resolveables=[]] an array of member resolveables (name, nickname, tag, id) + * @param {boolean} [strict=false] whether or not to attempt resolving by partial matches + * @param {Guild} guild the guild in which to look for members + * @returns {array || boolean} an array of resolved members or false if none were resolved + * @memberof Resolver + */ + async resolveMembers(resolveables = [], guild, strict = false) { if(typeof resolveables === 'string') resolveables = [ resolveables ]; if(resolveables.length === 0) return false; @@ -151,7 +168,100 @@ class Resolver { } - return resolved; + return resolved.length > 0 ? resolved : false; + + } + + /** + * + * + * @param {array} [resolveables=[]] an array of channel resolveables (name, id) + * @param {guild} guild the guild in which to look for channels + * @param {boolean} [strict=false] whether or not partial names are resolved + * @returns {array} an array of guild channels + * @memberof Resolver + */ + async resolveChannels(resolveables = [], guild, strict = false) { + + if(typeof resolveables === 'string') resolveables = [ resolveables ]; + if(resolveables.length === 0) return false; + let channels = guild.channels; + let resolved = []; + + for(let resolveable of resolveables) { + + let channel = channels.resolve(resolveable); + if(channel) { + resolved.push(channel); + continue; + } + + let name = /^\#?([a-z0-9\-\_0]*)/i; + let id = /^\<\#([0-9]*)\>/i; + + if(name.test(resolveable)) { + + let match = resolveable.match(name); + let ch = match[1].toLowerCase(); + + let channel = channels.cache.filter(c => { + if(!strict) return c.name.toLowerCase().includes(ch) + return c.name.toLowerCase() === ch; + }).first(1); + + if(channel) resolved.push(channel); + + } else if(id.test(resolveable)) { + + let match = resolveable.match(id); + let ch = match[1]; + + let channel = channels.resolve(ch); + + if(channel) resolved.push(channel); + + } + + } + + return resolved.length > 0 ? resolved : false; + + } + + async resolveRoles(resolveables = [], guild, strict) { + + if(typeof resolveables === 'string') resolveables = [ resolveables ]; + if(resolveables.length === 0) return false; + let roles = guild.roles; + let resolved = []; + + for(let resolveable of resolveables) { + + let id = /^(<@&)?([0-9]{16,22})>?/i; + + if(id.test(resolveable)) { + + let match = resolveable.match(id); + let r_id = match[2]; + + let role = await roles.fetch(r_id).catch(console.error); + + if(role) resolved.push(role); + + } else { + + let role = roles.cache.filter(r => { + if(!strict) return r.name.toLowerCase().includes(resolveable.toLowerCase()); + return r.name.toLowerCase() === resolveable.toLowerCase(); + }).first(1); + + if(role) resolved.push(role); + + } + + } + + return resolved.length > 0 ? reoslved : false; } diff --git a/structure/extensions/Guild.js b/structure/extensions/Guild.js index f146c78..4bbb1a2 100644 --- a/structure/extensions/Guild.js +++ b/structure/extensions/Guild.js @@ -12,6 +12,23 @@ const Guild = Structures.extend('Guild', (Guild) => { } + async resolveMembers(members, strict = false) { + + return await this.client.resolver.resolveMembers(members, this, strict); + } + + async resolveChannels(channels, strict = false) { + + return await this.client.resolver.resolveChannels(channels, this, strict); + + } + + async resolveRoles(roles, strict = false) { + + return await this.client.resolver.resolveRoles(roles, this, strict); + + } + } return ExtendedGuild; From 7f88d8e09fefaa4dfccc9c988e1e24a8fa5f67de Mon Sep 17 00:00:00 2001 From: noolaan Date: Sat, 11 Apr 2020 02:10:52 -0600 Subject: [PATCH 03/16] command handler changes --- Logger.js | 6 +-- .../components/observers/CommandHandler.js | 43 +++++++++++-------- structure/interfaces/Argument.js | 3 ++ 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/Logger.js b/Logger.js index 642bf91..5e56eaf 100644 --- a/Logger.js +++ b/Logger.js @@ -9,15 +9,15 @@ class Logger { this.logger = winston.createLogger({ transports: [ new winston.transports.Console(), - new winston.transports.File({ filename: `${Date.now()}.log` }), - new winston.transports.File({ filename: `${Date.now()}-error.log`, level: 'error' }) + new winston.transports.File({ filename: `logs/${this.date}.log` }), + new winston.transports.File({ filename: `logs/${this.date}-error.log`, level: 'error' }) ] }); } get date() { - return moment().format("MM/DD/YYYY hh:mm:ss"); + return moment().format("MM-DD-YYYY-hh:mm:ss"); } } diff --git a/structure/client/components/observers/CommandHandler.js b/structure/client/components/observers/CommandHandler.js index a4f146f..51ebf05 100644 --- a/structure/client/components/observers/CommandHandler.js +++ b/structure/client/components/observers/CommandHandler.js @@ -19,8 +19,6 @@ class CommandHandler extends Observer { ['message', this.handleMessage.bind(this)] ]; - this.commandPatterns = new Map(); - } @@ -123,25 +121,34 @@ class CommandHandler extends Observer { const command = message.command; let parsedArguments = []; - const flags = {}; + const parsedFlags = {}; const { shortFlags, longFlags, keys } = await this._createFlags(command.arguments); - - - console.log(shortFlags, longFlags, keys); - message.channel.send(keys); - - let currentFlag = null; + let currentArgument = null; for(const word of args) { - // if(currentFlag) - for(const key of keys) { - const regex = new RegExp('/[0-9]*([a-zA-Z]+)[0-9]*/g', 'g'); - const match = regex.exec(word); - console.log(match); - if(!match) continue; - + if(currentArgument) { + //what } + const [one,two,...chars] = word.split(''); + if(one === '-' && two !== '-') { //short flag maybe? + const name = [ two, ...chars ].join(''); + currentArgument = shortFlags[name]; + if(!currentArgument) continue; + } else if(one === '-' && two === '-') { //long flag maybe? + const name = chars.join(''); + currentArgument = longFlags[name]; + if(!currentArgument) continue; + } else { //verbal argument + const regex = new RegExp('([0-9]*)([a-zA-Z]+)([0-9]*)', 'g'); + let match = regex.exec(word); + if(!match) continue; + currentArgument = longFlags[match[2]]; + if(!currentArgument) continue; + const value = match[1] || match[3]; + console.log(currentArgument); + } + } } @@ -159,7 +166,7 @@ class CommandHandler extends Observer { keys = [...keys, ...names]; for(const name of names) { - longFlags[name] = arg.name; + longFlags[name] = arg; if(!arg.types.includes('FLAG')) continue; @@ -171,7 +178,7 @@ class CommandHandler extends Observer { keys.push(letter); letters.push(letter); - shortFlags[letter] = arg.name; + shortFlags[letter] = arg; } } diff --git a/structure/interfaces/Argument.js b/structure/interfaces/Argument.js index 962051a..279e0cd 100644 --- a/structure/interfaces/Argument.js +++ b/structure/interfaces/Argument.js @@ -29,6 +29,9 @@ class Argument { this.parser = options.parser || null; //Option to pass a function to verify values. + this.value = null; //The value provided to the flag; assigned in the command handler. + + } From 12c0efb7fdb34e1656ecf8b331c611dfcf1dccd6 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 11 Apr 2020 11:11:22 +0300 Subject: [PATCH 04/16] comments --- structure/client/Resolver.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/structure/client/Resolver.js b/structure/client/Resolver.js index 0d3d0f3..dde8603 100644 --- a/structure/client/Resolver.js +++ b/structure/client/Resolver.js @@ -173,12 +173,12 @@ class Resolver { } /** - * + * Resolve multiple channels * * @param {array} [resolveables=[]] an array of channel resolveables (name, id) * @param {guild} guild the guild in which to look for channels * @param {boolean} [strict=false] whether or not partial names are resolved - * @returns {array} an array of guild channels + * @returns {array || false} an array of guild channels or false if none were resolved * @memberof Resolver */ async resolveChannels(resolveables = [], guild, strict = false) { @@ -228,7 +228,16 @@ class Resolver { } - async resolveRoles(resolveables = [], guild, strict) { + /** + * Resolve multiple roles + * + * @param {array} [resolveables=[]] an array of roles resolveables (name, id) + * @param {Guild} guild the guild in which to look for roles + * @param {boolean} [strict=false] whether or not partial names are resolved + * @returns {array || false} an array of roles or false if none were resolved + * @memberof Resolver + */ + async resolveRoles(resolveables = [], guild, strict = false) { if(typeof resolveables === 'string') resolveables = [ resolveables ]; if(resolveables.length === 0) return false; From 852d155717c4cdad52243a43cc1bf2b6e9dbec39 Mon Sep 17 00:00:00 2001 From: noolaan Date: Sat, 11 Apr 2020 04:00:53 -0600 Subject: [PATCH 05/16] more command handler changers --- .../components/observers/CommandHandler.js | 93 ++++++++++++++++--- structure/interfaces/Argument.js | 7 +- 2 files changed, 87 insertions(+), 13 deletions(-) diff --git a/structure/client/components/observers/CommandHandler.js b/structure/client/components/observers/CommandHandler.js index 51ebf05..1dcd9d6 100644 --- a/structure/client/components/observers/CommandHandler.js +++ b/structure/client/components/observers/CommandHandler.js @@ -125,34 +125,71 @@ class CommandHandler extends Observer { const { shortFlags, longFlags, keys } = await this._createFlags(command.arguments); + // -prune 50 -c #test + // -prune 50 -b -c #test + let currentArgument = null; for(const word of args) { - if(currentArgument) { - //what - } const [one,two,...chars] = word.split(''); if(one === '-' && two !== '-') { //short flag maybe? - const name = [ two, ...chars ].join(''); - currentArgument = shortFlags[name]; - if(!currentArgument) continue; + const name = [ two, ...chars ].join(''); + if(currentArgument) { + if(currentArgument.required) { + //Cannot use another flag after a required flag. + //Handle requirement error for currentArgument. + } + } + if(!keys.includes(name)) continue; + currentArgument = shortFlags[name]; + } else if(one === '-' && two === '-') { //long flag maybe? + if(currentArgument.required) { + //Cannot use another flag after a required flag. + //Handle requirement error for currentArgument. + } const name = chars.join(''); + if(!keys.includes(name)) continue; currentArgument = longFlags[name]; - if(!currentArgument) continue; - } else { //verbal argument + + } else { const regex = new RegExp('([0-9]*)([a-zA-Z]+)([0-9]*)', 'g'); let match = regex.exec(word); - if(!match) continue; + if(currentArgument && !match) { + await this._handleTypeParsing(currentArgument, word); + if(!currentArgument.infinite) currentArgument = null; + } + if(!keys[match[2]]) { + //do sometihng there + } currentArgument = longFlags[match[2]]; - if(!currentArgument) continue; const value = match[1] || match[3]; - console.log(currentArgument); + + } } } + async _handleTypeParsing(argument, string) { + + const { error, value } = await this.constructor.parseType(argument, string); //Cannot access static functions through "this". + if(error) { + //Failed to parse correctly. prompt.invalid + } + + if(['INTEGER', 'FLOAT'].includes(argument.type)) { + const { min, max } = argument; + if(value > max) { + //Failed to parse correctly. prompt.invalid + } + if(value < min) { + //Failed to parse correctly. prompt.invalid + } + } + + } + async _createFlags(args) { let shortFlags = {}; @@ -187,6 +224,40 @@ class CommandHandler extends Observer { } + static async parseType(type, str) { //this is in the class for a reason, will soon reference to a user resolver etc. + + //INTEGER AND FLOAT ARE SAME FUNCTION + + const types = { + STRING: (str) => { + return { error: false, value: `${str}` }; + }, + INTEGER: (str) => { + const int = parseInt(str); + if(Number.isNaN(int)) return { error: true } + return { error: false, value: int }; + }, + FLOAT: (str) => { + const float = parseInt(str); + if(Number.isNaN(float)) return { error: true } + return { error: false, value: float }; + }, + BOOLEAN: (str) => { + const truthy = ['yes', 'y', 'true', 't', 'on', 'enable']; + const falsey = ['no', 'n', 'false', 'f', 'off', 'disable']; + if(typeof str === 'boolean') return { error: false, value: str }; + + if(typeof str === 'string') str = str.toLowerCase(); + if(truthy.includes(str)) return { error: false, value: true }; + if(falsey.includes(str)) return { error: false, value: false }; + return { error: true }; + } + } + + return await types[type](str); + + } + } diff --git a/structure/interfaces/Argument.js b/structure/interfaces/Argument.js index 279e0cd..df75543 100644 --- a/structure/interfaces/Argument.js +++ b/structure/interfaces/Argument.js @@ -23,13 +23,14 @@ class Argument { this.required = options.type === 'BOOLEAN' ? false : Boolean(options.required); //If the argument must be required for the command to work. Booleans this.default = options.default || Constants.Defaults[options.type]; this.infinite = Boolean(options.infinite); //Accepts infinite amount of arguments e.g. -u @nolan @navy. If false, will only detect one user. + // Will turn value into an array instead of a string!!! this.min = typeof options.min === 'number' ? options.min : null; //Min/max will only be used for INTEGER/FLOAT types. this.max = typeof options.max === 'number' ? options.max : null; this.parser = options.parser || null; //Option to pass a function to verify values. - this.value = null; //The value provided to the flag; assigned in the command handler. + this.value = this.infinite ? [] : null; //The value provided to the flag; assigned in the command handler. } @@ -50,7 +51,9 @@ const Constants = { 'STRING', 'INTEGER', 'FLOAT', - 'BOOLEAN' + 'BOOLEAN', + 'MEMBER', + 'CHANNEL' ], ArgumentTypes: [ 'FLAG', From 4c2f0d2465ffb17978242772612984c4a13922af Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 11 Apr 2020 14:31:34 +0300 Subject: [PATCH 06/16] remove pointless client assignment --- structure/interfaces/Observer.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/structure/interfaces/Observer.js b/structure/interfaces/Observer.js index aa08ea5..bb1ef01 100644 --- a/structure/interfaces/Observer.js +++ b/structure/interfaces/Observer.js @@ -11,8 +11,6 @@ class Observer extends Component { disabled: opts.disabled }); - this.client = client; - this.name = opts.name; this.priority = opts.priority || 1; this.hooks = opts.hooks || []; From 8fbe72b3270cdb8dd103d956a07e8e0415c95abc Mon Sep 17 00:00:00 2001 From: noolaan Date: Sat, 11 Apr 2020 07:56:52 -0600 Subject: [PATCH 07/16] command handler MEAT --- .../components/commands/utility/Ping.js | 7 + .../components/observers/CommandHandler.js | 175 +++++++++++++----- 2 files changed, 140 insertions(+), 42 deletions(-) diff --git a/structure/client/components/commands/utility/Ping.js b/structure/client/components/commands/utility/Ping.js index d3d3c85..fdf1039 100644 --- a/structure/client/components/commands/utility/Ping.js +++ b/structure/client/components/commands/utility/Ping.js @@ -20,6 +20,13 @@ class PingCommand extends Command { type: 'INTEGER', types: ['FLAG', 'VERBAL'], default: 0 + }), + new Argument(client, { + name: 'carrot', + aliases: ['cars', 'carrots'], + type: 'STRING', + required: true, + types: ['FLAG', 'VERBAL'] }) ] }); diff --git a/structure/client/components/observers/CommandHandler.js b/structure/client/components/observers/CommandHandler.js index 1dcd9d6..0215ff9 100644 --- a/structure/client/components/observers/CommandHandler.js +++ b/structure/client/components/observers/CommandHandler.js @@ -1,5 +1,5 @@ const { stripIndents } = require('common-tags'); -const { escapeRegex } = require('escape-string-regexp'); +const escapeRegex = require('escape-string-regexp'); const { Observer } = require('../../../interfaces/'); @@ -124,70 +124,160 @@ class CommandHandler extends Observer { const parsedFlags = {}; const { shortFlags, longFlags, keys } = await this._createFlags(command.arguments); - - // -prune 50 -c #test - // -prune 50 -b -c #test - + const regex = new RegExp(`([0-9]*)(${Object.keys(longFlags).map(k=>escapeRegex(k)).join('|')})([0-9]*)`, 'i'); + console.log(regex); + let currentArgument = null; - for(const word of args) { + let params = []; + + for(let i=0; i 0 && ['INTEGER', 'FLOAT'].includes(currentArgument.type)) { //15 pts + console.log("asgsaiughasiguassag") + const lastItem = params[params.length-1]; + const beforeError = await this._handleTypeParsing(currentArgument, lastItem); + if(beforeError) { + continue; + } else { + params.pop(); + currentArgument.value = lastItem; + parsedArguments.push(currentArgument); + currentArgument = null; + continue; + } + } + const value = match[1] || match[3]; + const error = await this._handleTypeParsing(currentArgument, value); + if(value) { + if(error) { + if(currentArgument.required) { + console.error(`Argument ${currentArgument.name} is required and failed to meet requirements.`); + return undefined; + } else { + parsedArguments.push(currentArgument); + currentArgument = null; + continue; + } + } else { + currentArgument.value = value; + parsedArguments.push(currentArgument); + currentArgument = null; + continue; + } + } else { + continue; + } + } else { + if(currentArgument) { + const error = await this._handleTypeParsing(currentArgument, word); + if(error) { + if(currentArgument.default) { + params.push(word); + currentArgument.value = currentArgument.default; + parsedArguments.push(currentArgument); + currentArgument = null; + continue; + } + if(currentArgument.required) { + if(currentArgument.infinite) { + if(currentArgument.value.length === 0) { + console.error(`1 Argument ${currentArgument.name} is required and failed to meet requirements.`); + return undefined; + } else { + parsedArguments.push(currentArgument); + currentArgument = null; + params.push(word); + continue; + } + } else { + console.error(`2 Argument ${currentArgument.name} is required and failed to meet requirements.`); + return undefined; + } + } else { + currentArgument = null; + params.push(word); + continue; + } + } else { + if(currentArgument.infinite) continue; + parsedArguments.push(currentArgument); + currentArgument = null; + continue; + } + } else { + params.push(word); + continue; + } } - if(!keys[match[2]]) { - //do sometihng there - } - currentArgument = longFlags[match[2]]; - const value = match[1] || match[3]; - - } } + + message.channel.send(stripIndents`**arguments:** ${parsedArguments.map(a=>`${a.name}: ${a.value}`).join(' | ')} + **words:** ${params.join(', ')}`); + + } async _handleTypeParsing(argument, string) { - const { error, value } = await this.constructor.parseType(argument, string); //Cannot access static functions through "this". - if(error) { - //Failed to parse correctly. prompt.invalid + const parse = async (argument, string) => { + + const { error, value } = await this.constructor.parseType(argument.type, string); //Cannot access static functions through "this". + if(error) return { error: true }; + + if(['INTEGER', 'FLOAT'].includes(argument.type)) { + const { min, max } = argument; + if(value > max && max !== null) { + return { error: true }; + } + if(value < min && min !== null) { + return { error: true }; + } + } + + return { error: false, value }; + } - if(['INTEGER', 'FLOAT'].includes(argument.type)) { - const { min, max } = argument; - if(value > max) { - //Failed to parse correctly. prompt.invalid - } - if(value < min) { - //Failed to parse correctly. prompt.invalid - } + const { error, value } = await parse(argument, string); + + if(!error) { + argument.infinite + ? argument.value.push(value) + : argument.value = value; } + return error; + } async _createFlags(args) { @@ -254,6 +344,7 @@ class CommandHandler extends Observer { } } + return await types[type](str); } From 976574a5a0fa6c1477da89bd9dde05106a897969 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 11 Apr 2020 22:16:37 +0300 Subject: [PATCH 08/16] Storage manager and providers --- storage/Provider.js | 7 ++++--- storage/StorageManager.js | 21 ++++++++++++++++++++- storage/providers/Mariadb.js | 6 +++--- storage/providers/Mongodb.js | 6 +++--- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/storage/Provider.js b/storage/Provider.js index 5b726bd..918e9bf 100644 --- a/storage/Provider.js +++ b/storage/Provider.js @@ -1,14 +1,15 @@ class Provider { - constructor(manager, config) { + constructor(manager, config, name) { if(!config) throw new Error('No config file provided!'); - if(config && (!config.database || !config.url)) throw new Error('Invalid config file provided!'); + this.config = config[name]; + if(config && (!this.config.database || !this.config.host)) throw new Error('Invalid config file provided!' + JSON.stringify(this.config)); this.manager = manager; - this.config = config; this.db; this.loaded = false; + this.name = name; } diff --git a/storage/StorageManager.js b/storage/StorageManager.js index 988fc1b..00c65e3 100644 --- a/storage/StorageManager.js +++ b/storage/StorageManager.js @@ -1,15 +1,34 @@ const { Collection } = require('../util/'); +const path = require('path'); +const fs = require('fs'); class StorageManager { - constructor(manager) { + constructor(manager, options = {}) { this.providers = new Collection(); + this.manager = manager; + this.options = options; } async initialize() { + console.log('Initiating storage providers'); + let _providers = path.join(process.cwd(), 'storage', 'providers'); + let providers = fs.readdirSync(_providers); + + for(let _provider of providers) { + + let provider = require(path.join(_providers, _provider)); + provider = new provider(this.manager, this.options); + + await provider.init(); + + this.providers.set(provider.name, provider); + + } + } } diff --git a/storage/providers/Mariadb.js b/storage/providers/Mariadb.js index 7871f5f..51cda4f 100644 --- a/storage/providers/Mariadb.js +++ b/storage/providers/Mariadb.js @@ -1,11 +1,11 @@ -const Provider = require('./Provider.js'); +const Provider = require('../Provider.js'); const MySQL = require('mysql'); class MariaDBProvider extends Provider { constructor(manager, config) { - super(manager, config); + super(manager, config, 'mariadb'); } @@ -49,7 +49,7 @@ class MariaDBProvider extends Provider { * Query using SQL to MariaDB * * @param {string} query SQL query string. - * @param {array} values Array of values to replace ? with in the query string + * @param {array} values Array of values to replace ? with in the query string * @returns {object} Returns an object containing the query result * @memberof MariaDBProvider */ diff --git a/storage/providers/Mongodb.js b/storage/providers/Mongodb.js index 34bf0a2..0ed9456 100644 --- a/storage/providers/Mongodb.js +++ b/storage/providers/Mongodb.js @@ -1,11 +1,11 @@ -const Provider = require('./Provider.js'); +const Provider = require('../Provider.js'); const { MongoClient } = require('mongodb'); class MongoDBProvider extends Provider { constructor(manager, config) { - super(manager, config); + super(manager, config, 'mongodb'); this.client; @@ -13,7 +13,7 @@ class MongoDBProvider extends Provider { async init() { - this.manager.logger.log('Initializing mongodb.'); + //this.manager.logger.log('Initializing mongodb.'); try { From f3b5a1e25533502915a1e7ab4b5c60e18559a514 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 11 Apr 2020 22:16:45 +0300 Subject: [PATCH 09/16] log --- structure/client/DiscordClient.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/structure/client/DiscordClient.js b/structure/client/DiscordClient.js index 912cd3a..3d51002 100644 --- a/structure/client/DiscordClient.js +++ b/structure/client/DiscordClient.js @@ -32,6 +32,8 @@ class DiscordClient extends Client { if(this._built) return undefined; + console.log('Building Discord client'); + await super.login(this._options.bot.token); await this.registry.loadComponents('components/commands/', Command); @@ -41,6 +43,8 @@ class DiscordClient extends Client { this._built = true; + console.log('Client built'); + } From 66224698fce227145fd95603a0d612b2e36951d6 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Apr 2020 15:34:12 +0300 Subject: [PATCH 10/16] chalk --- package.json | 1 + yarn.lock | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/package.json b/package.json index 1ddb47a..821996b 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ }, "homepage": "https://github.com/Navy-gif/New-GBot#readme", "dependencies": { + "chalk": "^4.0.0", "common-tags": "^1.8.0", "discord.js": "discordjs/discord.js", "escape-string-regexp": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index dc95c11..468fa9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -169,6 +169,14 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" + integrity sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" From c5d6e0c5454ac24e15fac31a6393aa9442206bf5 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Apr 2020 15:34:26 +0300 Subject: [PATCH 11/16] transporter -> logger --- structure/client/Logger.js | 62 +++++++++++++++++++++++++++++++++ structure/client/Transporter.js | 12 ------- 2 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 structure/client/Logger.js delete mode 100644 structure/client/Transporter.js diff --git a/structure/client/Logger.js b/structure/client/Logger.js new file mode 100644 index 0000000..0c67f41 --- /dev/null +++ b/structure/client/Logger.js @@ -0,0 +1,62 @@ +const chalk = require('chalk'); + +class Logger { + + constructor(client) { + + this.client = client; + + this.client.hooker.hook('ready', () => { + this.transport(`Client connected to ${chalk.bold(this.client.user.tag)} with ${chalk.bold(`${this.client.guilds.size} guild${this.client.guilds.size === 1 ? '' : 's'}`)}.`, { embed: true, type: 'SUCCESS' }); + }); + + this.client.hooker.hook('componentUpdate', ({ component, type }) => { + this.info(`Component ${chalk.bold(component.resolveable)} was ${chalk.bold(Constants.ComponentTypes[type])}.`); + }); + + this.client.hooker.hook('reconnect', () => { + this.warn(`Shard is reconnecting.`, { embed: true }); + }); + + } + + async transport(message = 'N/A', opts = {}) { + process.send({ message, ...opts }); + } + + /* Quick & Dirty Functions */ + + log(message, opts = {}) { + this.transport(message, { ...opts, type: 'LOG' }); + } + + info(message, opts = {}) { + this.transport(message, { ...opts, type: 'INFO' }); + } + + warn(message, opts = {}) { + this.transport(message, { ...opts, type: 'WARN' }); + } + + debug(message, opts = {}) { + this.transport(message, { ...opts, type: 'DEBUG' }); + } + + error(message, opts = {}) { + this.transport(message, { ...opts, type: 'ERROR' }); + } + + +} + +module.exports = Logger; + +const Constants = { + ComponentTypes: { + LOAD: 'loaded', + UNLOAD: 'unloaded', + RELOAD: 'reloaded', + ENABLE: 'enabled', + DISABLE: 'disabled' + } +}; \ No newline at end of file diff --git a/structure/client/Transporter.js b/structure/client/Transporter.js deleted file mode 100644 index 0e3b656..0000000 --- a/structure/client/Transporter.js +++ /dev/null @@ -1,12 +0,0 @@ -class Transporter { - - constructor(manager) { - - this.manager = manager; - - } - - -} - -module.exports = Transporter; \ No newline at end of file From 7735a9fc98ef67eaed122ceb4dc5d75dbf5b4f74 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Apr 2020 15:34:35 +0300 Subject: [PATCH 12/16] main logger --- Logger.js | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/Logger.js b/Logger.js index 5e56eaf..990de5b 100644 --- a/Logger.js +++ b/Logger.js @@ -1,23 +1,58 @@ -const winston = require('winston'); +const { createLogger, format, transports, config } = require('winston'); +const { combine, label, printf } = format; const moment = require('moment'); +const chalk = require('chalk'); class Logger { constructor(manager) { this.manager = manager; - this.logger = winston.createLogger({ + this.logger = createLogger({ transports: [ - new winston.transports.Console(), - new winston.transports.File({ filename: `logs/${this.date}.log` }), - new winston.transports.File({ filename: `logs/${this.date}-error.log`, level: 'error' }) + new transports.Console(), + new transports.File({ filename: `logs/${this.date.replace(/ /g, '-')}.log` }), + new transports.File({ filename: `logs/${this.date.replace(/ /g, '-')}-error.log`, level: 'error' }) ] }); + this.client + .on('shardCreate', (shard) => this.write(shard, "Shard created.", 'DEBUG')) + .on('message', (shard, message) => this._handleMessage(shard, message)); + + } + + //Messages coming from the shards process.send functions. + async _handleMessage(shard, message) { + if(message._ready + || message._disconnect + || message._reconnecting + || message._sFetchProp + || message._sEval + || message._sRespawnAll) return undefined; //Properties used for discord.js internal sharding, must filter for. + + + + } + + //The MAIN function for writing everything to the logger. + async write(shard, string = '', type = 'silly') { + if(!config.npm.levels[type]) return undefined; + + const header = `[${this.date}][shard-${this._shardId(shard)}]`; + //[04/02/2020 12:52:20][shard-00] + + this.logger.log(type, string) + + } + + _shardId(shard) { + const id = shard.id; + return `${id}`.length === 1 ? `0${id}` : `${id}`; } get date() { - return moment().format("MM-DD-YYYY-hh:mm:ss"); + return moment().format("MM-DD-YYYY hh:mm:ss"); } } From d79c29acfdebb2ff9a6a977ce21a46b50557dbdc Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Apr 2020 15:34:46 +0300 Subject: [PATCH 13/16] extended timeout --- middleware/Shard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/Shard.js b/middleware/Shard.js index 8d15162..13de173 100644 --- a/middleware/Shard.js +++ b/middleware/Shard.js @@ -63,7 +63,7 @@ class Shard extends EventEmitter { this.once('ready', resolve); this.once('disconnect', () => reject(new Error(`[shard${this.id}] Shard disconnected while readying.`))); this.once('death', () => reject(new Error(`[shard${this.id}] Shard died while readying.`))); - setTimeout(() => reject(new Error(`[shard${this.id}] Shard timed out while readying.`)), 10000); + setTimeout(() => reject(new Error(`[shard${this.id}] Shard timed out while readying.`)), 30000); }); return this.process || this.worker; From 260e3215c2deb8837ef56563faaa34722a9db731 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Apr 2020 15:35:13 +0300 Subject: [PATCH 14/16] stuff --- structure/client/components/observers/CommandHandler.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/structure/client/components/observers/CommandHandler.js b/structure/client/components/observers/CommandHandler.js index 0215ff9..8e34537 100644 --- a/structure/client/components/observers/CommandHandler.js +++ b/structure/client/components/observers/CommandHandler.js @@ -24,6 +24,8 @@ class CommandHandler extends Observer { async handleMessage(message) { + //const time1 = new Date().getTime(); + if(!this.client._built || message.webhookID || message.author.bot @@ -40,7 +42,10 @@ class CommandHandler extends Observer { message.command = command; - return await this.handleCommand(message, newArgs); + await this.handleCommand(message, newArgs); + + //const time2 = new Date().getTime(); + //console.log(`${time2-time1}ms`); } @@ -241,7 +246,7 @@ class CommandHandler extends Observer { } - message.channel.send(stripIndents`**arguments:** ${parsedArguments.map(a=>`${a.name}: ${a.value}`).join(' | ')} + await message.channel.send(stripIndents`**arguments:** ${parsedArguments.map(a=>`${a.name}: ${a.value}`).join(' | ')} **words:** ${params.join(', ')}`); From aae82e2ed5b16e7b8a8036dfb209b057778cf6e6 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Apr 2020 15:35:27 +0300 Subject: [PATCH 15/16] logging --- structure/client/DiscordClient.js | 14 +++++++++++++- structure/client/Registry.js | 2 -- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/structure/client/DiscordClient.js b/structure/client/DiscordClient.js index 3d51002..4070f4c 100644 --- a/structure/client/DiscordClient.js +++ b/structure/client/DiscordClient.js @@ -43,6 +43,14 @@ class DiscordClient extends Client { this._built = true; + this.on('ready', () => { + console.log('Client websocket is ready.'); + }); + + this.registry.on('componentUpdate', (comp, type) => { + console.log(`[registry][${type}] ${comp.resolveable}`) + }); + console.log('Client built'); } @@ -54,4 +62,8 @@ class DiscordClient extends Client { module.exports = DiscordClient; const client = new DiscordClient(options); -client.build(); \ No newline at end of file +client.build(); + +process.on("unhandledRejection", (error) => { + console.error("Unhandled promise rejection:", error); //eslint-disable-line no-console +}); \ No newline at end of file diff --git a/structure/client/Registry.js b/structure/client/Registry.js index d4fde57..a86e3db 100644 --- a/structure/client/Registry.js +++ b/structure/client/Registry.js @@ -56,8 +56,6 @@ class Registry extends EventEmitter { return null; } - console.log(directory); - if(directory) component.directory = directory; if(component.module && typeof component.module === 'string') { //Sets modules or "groups" for each component, specified by their properties. let module = this.components.get(`module:${component.module}`); From 4a403c2d6d6ef0552fe772e6c6be6703801a8566 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Apr 2020 15:37:49 +0300 Subject: [PATCH 16/16] load checks --- storage/providers/Mongodb.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/storage/providers/Mongodb.js b/storage/providers/Mongodb.js index 0ed9456..a17aae2 100644 --- a/storage/providers/Mongodb.js +++ b/storage/providers/Mongodb.js @@ -44,11 +44,11 @@ class MongoDBProvider extends Provider { find(db, query) { - if(!this.loaded) throw new Error('MongoDB not connected'); - //if(this.manager.debug) this.manager.logger.debug(`Incoming find query for ${db} with parameters ${JSON.stringify(query)}`); return new Promise((resolve, reject) => { + if(!this.loaded) reject(new Error('MongoDB not connected')); + this.db.collection(db).find(query, async (error, cursor) => { if(error) return reject(error); @@ -71,11 +71,11 @@ class MongoDBProvider extends Provider { findOne(db, query) { - if(!this.loaded) throw new Error('MongoDB not connected'); - //if(this.manager.debug) this.manager.logger.debug(`Incoming findOne query for ${db} with parameters ${JSON.stringify(query)}`); return new Promise((resolve, reject) => { + if(!this.loaded) reject(new Error('MongoDB not connected')); + this.db.collection(db).findOne(query, async (error, item) => { if(error) return reject(error); @@ -99,10 +99,10 @@ class MongoDBProvider extends Provider { */ updateOne(db, query, data, upsert = false) { - if(!this.loaded) throw new Error('MongoDB not connected'); - //if(this.manager.debug) this.manager.logger.debug(`Incoming updateOne query for ${db} with parameters ${JSON.stringify(filter)}`); return new Promise((resolve, reject) => { + + if(!this.loaded) reject(new Error('MongoDB not connected')); this.db.collection(db).updateOne(query, { $set: data }, { upsert: upsert }, async (error, result) => { @@ -130,11 +130,11 @@ class MongoDBProvider extends Provider { */ push(db, query, data, upsert = false) { - if(!this.loaded) throw new Error('MongoDB not connected'); - //if(this.manager.debug) this.manager.logger.debug(`Incoming push query for ${db}, with upsert ${upsert} and with parameters ${JSON.stringify(filter)} and data ${JSON.stringify(data)}`); return new Promise((resolve, reject) => { + if(!this.loaded) reject(new Error('MongoDB not connected')); + this.db.collection(db).updateOne(query, { $push: data }, { upsert: upsert }, async (error, result) => { if(error) return reject(error); @@ -157,13 +157,13 @@ class MongoDBProvider extends Provider { */ random(db, query = {}, amount = 1) { - if(!this.loaded) throw new Error('MongoDB not connected'); - //if(this.manager.debug) this.manager.logger.debug(`Incoming random query for ${db} with parameters ${JSON.stringify(filter)} and amount ${amount}`); if(amount > 100) amount = 100; return new Promise((resolve, reject)=>{ + if(!this.loaded) reject(new Error('MongoDB not connected')); + this.db.collection(db).aggregate([{ $match: query }, { $sample: {size: amount}}], function(err, item) { if(err) return reject(err);