From 2fde5d0fcdf6213fd71dca4e43c2ab056fdebb0d Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 30 Dec 2020 10:06:59 -0500 Subject: [PATCH 01/29] rm automod.ts & report.ts --- src/class/AutoMod.ts | 35 -------------------- src/class/Report.ts | 77 -------------------------------------------- 2 files changed, 112 deletions(-) delete mode 100644 src/class/AutoMod.ts delete mode 100644 src/class/Report.ts diff --git a/src/class/AutoMod.ts b/src/class/AutoMod.ts deleted file mode 100644 index da42242..0000000 --- a/src/class/AutoMod.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable no-bitwise */ -import { Member, Message, User } from 'eris'; -import { randomBytes } from 'crypto'; -import moment, { unitOfTime } from 'moment'; -import { Client, Moderation, RichEmbed } from '.'; -import { Moderation as ModerationModel, ModerationInterface } from '../models'; -import { moderation as channels } from '../configs/channels.json'; - -export default class AutoMod extends Moderation { - public client: Client; - - public list: Set - - // eslint-disable-next-line @typescript-eslint/no-useless-constructor - constructor(client: Client) { - super(client); - this.list = new Set(); - } - - public run(message: Message, member: Member) { - /* - try { - if (member) - } - */ - } - - public warn(message: Message, member: Member) { - /* - try { - await message.channel.createMessage(`__**`) - } - */ - } -} diff --git a/src/class/Report.ts b/src/class/Report.ts deleted file mode 100644 index e14a7b7..0000000 --- a/src/class/Report.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { EventEmitter } from 'events'; -import { Client, RichEmbed } from '.'; -import { ScoreHistoricalRaw } from '../models/ScoreHistorical'; - -export default class Report { - public client: Client; - - constructor(client: Client) { - this.client = client; - } - - public async soft(userID: string) { - const report = await this.client.db.Score.findOne({ userID }); - if (!report) return null; - let totalScore: number; - let activityScore: number; - const moderationScore = Math.round(report.moderation); - let roleScore: number; - let cloudServicesScore: number; - const otherScore = Math.round(report.other); - let miscScore: number; - - if (report.total < 200) totalScore = 0; - else if (report.total > 800) totalScore = 800; - else totalScore = Math.round(report.total); - - if (report.activity < 10) activityScore = 0; - else if (report.activity > Math.floor((Math.log1p(3000 + 300 + 200 + 100) * 12))) activityScore = Math.floor((Math.log1p(3000 + 300 + 200 + 100) * 12)); - else activityScore = Math.round(report.activity); - - if (report.roles <= 0) roleScore = 0; - else if (report.roles > 54) roleScore = 54; - else roleScore = Math.round(report.roles); - - if (report.staff <= 0) miscScore = 0; - else miscScore = Math.round(report.staff); - - if (report.cloudServices === 0) cloudServicesScore = 0; - else if (report.cloudServices > 10) cloudServicesScore = 10; - else cloudServicesScore = Math.round(report.cloudServices); - - const historicalData = await this.client.db.ScoreHistorical.find({ userID: member.userID }).lean().exec(); - const array: ScoreHistoricalRaw[] = []; - for (const data of historicalData) { - let total: number; - let activity: number; - const moderation = Math.round(data.report.moderation); - let role: number; - let cloud: number; - const other = Math.round(data.report.other); - let misc: number; - - if (data.report.total < 200) total = 0; - else if (data.report.total > 800) total = 800; - else total = Math.round(data.report.total); - - if (data.report.activity < 10) activity = 0; - else if (data.report.activity > Math.floor((Math.log1p(3000 + 300 + 200 + 100) * 12))) activity = Math.floor((Math.log1p(3000 + 300 + 200 + 100) * 12)); - else activity = Math.round(data.report.activity); - - if (data.report.roles <= 0) role = 0; - else if (data.report.roles > 54) role = 54; - else role = Math.round(data.report.roles); - - if (data.report.staff <= 0) role = 0; - else misc = Math.round(data.report.staff); - - if (data.report.cloudServices === 0) cloud = 0; - else if (data.report.cloudServices > 10) cloud = 10; - else cloud = Math.round(data.report.cloudServices); - - data.report.total = total; data.report.activity = activity; data.report.moderation = moderation; data.report.roles = role; data.report.cloudServices = cloud; data.report.other = other; data.report.staff = misc; - - array.push(data); - } - } -} From 38f5a5f70e989cb26b979a095332da9dbf47cf12 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Tue, 26 Jan 2021 23:33:54 -0400 Subject: [PATCH 02/29] Fix paging bug with emails --- src/commands/page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/page.ts b/src/commands/page.ts index 7ead34a..6687434 100644 --- a/src/commands/page.ts +++ b/src/commands/page.ts @@ -180,7 +180,7 @@ export default class Page extends Command { await this.client.util.transporter.sendMail({ from: '"LOC Paging System" ', to: email, - subject: `PAGE FROM ${recipientNumber}`, + subject: `PAGE FROM ${senderNumber}`, html: `

Page

${options?.emergencyNumber ? `

[SEN#${options.emergencyNumber}]` : ''}Recipient PN: ${recipientNumber}
Sender PN: ${senderNumber} (${sender ? `${sender.username}#${sender.discriminator}` : ''})
Initial Command: https://discordapp.com/channels/${this.mainGuild.id}/${message.channel.id}/${message.id} (<#${message.channel.id}>)

Pager Code: ${code} (${this.local.codeDict.get(code)})${txt ? `
Message: ${txt}` : ''}`, }); } From e084efc3693e9ae6c9c584c706d9697d7ea26c45 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Fri, 5 Feb 2021 23:01:46 -0400 Subject: [PATCH 03/29] Executive Orders --- src/api/board.ins/main.ts | 3 + src/api/board.ins/routes/index.ts | 1 + src/api/board.ins/routes/root.ts | 72 +++++++++++++++++++ .../comm.libraryofcode.org/routes/report.ts | 31 ++++---- src/class/Client.ts | 5 +- src/events/guildMemberAdd.ts | 2 +- src/models/ExecutiveOrder.ts | 17 +++++ src/models/index.ts | 1 + 8 files changed, 112 insertions(+), 20 deletions(-) create mode 100644 src/api/board.ins/main.ts create mode 100644 src/api/board.ins/routes/index.ts create mode 100644 src/api/board.ins/routes/root.ts create mode 100644 src/models/ExecutiveOrder.ts diff --git a/src/api/board.ins/main.ts b/src/api/board.ins/main.ts new file mode 100644 index 0000000..999fd95 --- /dev/null +++ b/src/api/board.ins/main.ts @@ -0,0 +1,3 @@ +import { Server, ServerManagement } from '../../class'; + +export default (management: ServerManagement) => new Server(management, 3892, `${__dirname}/routes`); diff --git a/src/api/board.ins/routes/index.ts b/src/api/board.ins/routes/index.ts new file mode 100644 index 0000000..fb1d2b2 --- /dev/null +++ b/src/api/board.ins/routes/index.ts @@ -0,0 +1 @@ +export { default as Root } from './root'; diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts new file mode 100644 index 0000000..e908f7d --- /dev/null +++ b/src/api/board.ins/routes/root.ts @@ -0,0 +1,72 @@ +import { TextChannel } from 'eris'; +import { RichEmbed, Route, Server } from '../../../class'; + +export default class Root extends Route { + constructor(server: Server) { + super(server); + this.conf = { + path: '/', + }; + } + + public bind() { + this.router.post('/executive-orders/new', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + + if (!director) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.body.subject) { + return res.status(401).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + if (!req.body.body) { + return res.status(401).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const executiveOrder = await this.server.client.db.ExecutiveOrder.create({ + issuedBy: director.userID, + subject: req.body.subject, + body: req.body.body, + at: new Date(), + }); + + const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + + const embed = new RichEmbed(); + embed.setTitle('Executive Order'); + embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); + embed.setColor('#dd3acd'); + embed.addField('Subject', req.body.subject); + embed.addField('Body', req.body.body); + embed.addField('ID', executiveOrder._id); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + await channel.createMessage({ embed }); + + return res.status(200).json({ + code: this.constants.codes.SUCCESS, + message: `Created new Executive Order with ID ${executiveOrder._id} by the ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + }); + }); + } +} diff --git a/src/api/comm.libraryofcode.org/routes/report.ts b/src/api/comm.libraryofcode.org/routes/report.ts index 706bc7b..780801b 100644 --- a/src/api/comm.libraryofcode.org/routes/report.ts +++ b/src/api/comm.libraryofcode.org/routes/report.ts @@ -77,7 +77,6 @@ export default class Report extends Route { return res.status(403).json({ code: this.constants.codes.PERMISSION_DENIED, message: this.constants.messages.PERMISSION_DENIED }); } - const flags = []; if (mem.user.publicFlags) { if ((mem.user.publicFlags & (1 << 0)) === 1 << 0) flags.push('DISCORD_EMPLOYEE'); @@ -196,8 +195,8 @@ export default class Report extends Route { embed.addField('Reason', req.body.reason ?? 'N/A', true); embed.setTimestamp(); embed.setFooter(this.server.client.user.username, this.server.client.user.avatarURL); - const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); - chan.createMessage({ embed }).catch(() => {}); + const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); + chan.createMessage({ embed }).catch(() => { }); return res.status(200).json({ code: this.constants.codes.SUCCESS, @@ -259,8 +258,8 @@ export default class Report extends Route { embed.addField('Department/Service', merchant.name.toUpperCase(), true); embed.setTimestamp(); embed.setFooter(this.server.client.user.username, this.server.client.user.avatarURL); - const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); - chan.createMessage({ embed }).catch(() => {}); + const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); + chan.createMessage({ embed }).catch(() => { }); if (!merchant.privileged) { return res.status(200).json({ @@ -355,7 +354,6 @@ export default class Report extends Route { array.push(data); } - return res.status(200).json({ code: this.constants.codes.SUCCESS, message: { @@ -414,8 +412,8 @@ export default class Report extends Route { embed.addField('Department/Service', merchant.name.toUpperCase(), true); embed.setTimestamp(); embed.setFooter(this.server.client.user.username, this.server.client.user.avatarURL); - const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); - chan.createMessage({ embed }).catch(() => {}); + const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); + chan.createMessage({ embed }).catch(() => { }); if (!merchant.privileged) { return res.status(200).json({ @@ -448,7 +446,6 @@ export default class Report extends Route { else if (member.cloudServices > 10) cloudServicesScore = 10; else cloudServicesScore = Math.round(member.cloudServices); - return res.status(200).json({ code: this.constants.codes.SUCCESS, message: { @@ -498,8 +495,8 @@ export default class Report extends Route { embed.addField('Department/Service', `${member.username} via report.libraryofcode.org @ IP ${req.ip}`.toUpperCase(), true); embed.setTimestamp(); embed.setFooter(this.server.client.user.username, this.server.client.user.avatarURL); - const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); - chan.createMessage({ embed }).catch(() => {}); + const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); + chan.createMessage({ embed }).catch(() => { }); } else { await this.server.client.db.Score.updateOne({ userID: score.userID }, { $addToSet: { softInquiries: { name: 'Library of Code sp-us | Staff Team via report.libraryofcode.org', date: new Date() } } }); const embed = new RichEmbed(); @@ -510,8 +507,8 @@ export default class Report extends Route { embed.addField('Department/Service', 'Library of Code sp-us | Staff Team via report.libraryofcode.org'.toUpperCase(), true); embed.setTimestamp(); embed.setFooter(this.server.client.user.username, this.server.client.user.avatarURL); - const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); - chan.createMessage({ embed }).catch(() => {}); + const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); + chan.createMessage({ embed }).catch(() => { }); } } else if (!updated) { await this.server.client.db.Score.updateOne({ userID: score.userID }, { $addToSet: { softInquiries: { name: `${member.username} via report.libraryofcode.org @ IP ${req.ip}`, date: new Date() } } }); @@ -523,8 +520,8 @@ export default class Report extends Route { embed.addField('Department/Service', `${member.username} via report.libraryofcode.org @ IP ${req.ip}`.toUpperCase(), true); embed.setTimestamp(); embed.setFooter(this.server.client.user.username, this.server.client.user.avatarURL); - const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); - chan.createMessage({ embed }).catch(() => {}); + const chan = this.server.client.guilds.get(this.server.client.config.guildID).channels.get('611584771356622849'); + chan.createMessage({ embed }).catch(() => { }); } score = await this.server.client.db.Score.findOne({ pin: [Number(args.split('-')[0]), Number(args.split('-')[1]), Number(args.split('-')[2])] }).lean().exec(); @@ -646,11 +643,11 @@ export default class Report extends Route { name?: string, department?: string, date?: Date, - }> jwt.verify(req.query.code.toString(), this.server.client.config.internalKey); + }>jwt.verify(req.query.code.toString(), this.server.client.config.internalKey); } catch { return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); } - const chan = this.server.client.guilds.get(this.constants.discord.SERVER_ID).channels.get(offer.channelID); + const chan = this.server.client.guilds.get(this.constants.discord.SERVER_ID).channels.get(offer.channelID); await chan.createMessage(`__**PRE-APPROVED OFFER ACCEPTED**__\n<@${offer.staffID}>`); const message = await chan.getMessage(offer.messageID); const args = []; diff --git a/src/class/Client.ts b/src/class/Client.ts index efa6b4c..d6b1a93 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -7,6 +7,7 @@ import { Collection, Command, LocalStorage, Queue, Util, ServerManagement, Event import { Customer, CustomerInterface, CustomerPortal, CustomerPortalInterface, + ExecutiveOrder, ExecutiveOrderInterface, File, FileInterface, Member, MemberInterface, Merchant, MerchantInterface, @@ -43,7 +44,7 @@ export default class Client extends eris.Client { public stripe: Stripe; - public db: { Customer: mongoose.Model, CustomerPortal: mongoose.Model, File: mongoose.Model, Member: mongoose.Model, Merchant: mongoose.Model, Moderation: mongoose.Model, NNTrainingData: mongoose.Model, Note: mongoose.Model, PagerNumber: mongoose.Model, Promo: mongoose.Model, Rank: mongoose.Model, Redirect: mongoose.Model, Score: mongoose.Model, ScoreHistorical: mongoose.Model, Staff: mongoose.Model, Stat: mongoose.Model, local: { muted: LocalStorage } }; + public db: { Customer: mongoose.Model, CustomerPortal: mongoose.Model, ExecutiveOrder: mongoose.Model, File: mongoose.Model, Member: mongoose.Model, Merchant: mongoose.Model, Moderation: mongoose.Model, NNTrainingData: mongoose.Model, Note: mongoose.Model, PagerNumber: mongoose.Model, Promo: mongoose.Model, Rank: mongoose.Model, Redirect: mongoose.Model, Score: mongoose.Model, ScoreHistorical: mongoose.Model, Staff: mongoose.Model, Stat: mongoose.Model, local: { muted: LocalStorage } }; constructor(token: string, options?: eris.ClientOptions) { super(token, options); @@ -51,7 +52,7 @@ export default class Client extends eris.Client { this.events = new Collection(); this.intervals = new Collection(); this.queue = new Queue(this); - this.db = { Customer, CustomerPortal, File, Member, Merchant, Moderation, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; + this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; } diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 13b167c..0d750f0 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -12,7 +12,7 @@ export default class GuildMemberAdd extends Event { public async run(_, member: Member) { try { const search = await this.client.db.local.muted.get(`muted-${member.user.id}`); - if (search === true) { + if (search) { member.addRole('478373942638149643'); } } catch (err) { diff --git a/src/models/ExecutiveOrder.ts b/src/models/ExecutiveOrder.ts new file mode 100644 index 0000000..a096f84 --- /dev/null +++ b/src/models/ExecutiveOrder.ts @@ -0,0 +1,17 @@ +import { Document, model, Schema } from 'mongoose'; + +export interface ExecutiveOrderInterface extends Document { + issuedBy: string; + subject: string; + body: string; + at: Date; +} + +const ExecutiveOrder = new Schema({ + issuedBy: { type: String, required: true }, + subject: { type: String, required: true }, + body: { type: String, required: true }, + at: { type: Date, required: true }, +}); + +export default model('ExecutiveOrders', ExecutiveOrder); diff --git a/src/models/index.ts b/src/models/index.ts index d3cc016..f6f0541 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -1,5 +1,6 @@ export { default as Customer, CustomerInterface } from './Customer'; export { default as CustomerPortal, CustomerPortalInterface } from './CustomerPortal'; +export { default as ExecutiveOrder, ExecutiveOrderInterface } from './ExecutiveOrder'; export { default as File, FileInterface } from './File'; export { default as Member, MemberInterface } from './Member'; export { default as Merchant, MerchantInterface } from './Merchant'; From 64b59bdd356d0ec3fa940452f523107c0283fff6 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Fri, 5 Feb 2021 23:09:09 -0400 Subject: [PATCH 04/29] Update with UUIDs --- src/api/board.ins/routes/root.ts | 10 ++++++---- src/api/index.ts | 2 ++ src/models/ExecutiveOrder.ts | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index e908f7d..8fb4542 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -1,4 +1,5 @@ import { TextChannel } from 'eris'; +import { v4 as genUUID } from 'uuid'; import { RichEmbed, Route, Server } from '../../../class'; export default class Root extends Route { @@ -28,14 +29,14 @@ export default class Root extends Route { } if (!req.body.subject) { - return res.status(401).json({ + return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, }); } if (!req.body.body) { - return res.status(401).json({ + return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, }); @@ -46,6 +47,7 @@ export default class Root extends Route { subject: req.body.subject, body: req.body.body, at: new Date(), + oID: genUUID(), }); const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); @@ -57,7 +59,7 @@ export default class Root extends Route { embed.setColor('#dd3acd'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); - embed.addField('ID', executiveOrder._id); + embed.addField('ID', executiveOrder.oID); embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); @@ -65,7 +67,7 @@ export default class Root extends Route { return res.status(200).json({ code: this.constants.codes.SUCCESS, - message: `Created new Executive Order with ID ${executiveOrder._id} by the ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + message: `Created new Executive Order with ID ${executiveOrder.oID} by the ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, }); }); } diff --git a/src/api/index.ts b/src/api/index.ts index 9af7ae9..096c31c 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,8 +1,10 @@ import locsh from './loc.sh/main'; import crins from './cr.ins/main'; import commlibraryofcodeorg from './comm.libraryofcode.org/main'; +import boardins from './board.ins/main'; export default { + 'board.ins': boardins, 'loc.sh': locsh, 'cr.ins': crins, 'comm.libraryofcode.org': commlibraryofcodeorg, diff --git a/src/models/ExecutiveOrder.ts b/src/models/ExecutiveOrder.ts index a096f84..f639358 100644 --- a/src/models/ExecutiveOrder.ts +++ b/src/models/ExecutiveOrder.ts @@ -5,6 +5,7 @@ export interface ExecutiveOrderInterface extends Document { subject: string; body: string; at: Date; + oID: string; } const ExecutiveOrder = new Schema({ @@ -12,6 +13,7 @@ const ExecutiveOrder = new Schema({ subject: { type: String, required: true }, body: { type: String, required: true }, at: { type: Date, required: true }, + oID: { type: String, required: true, unique: true } }); export default model('ExecutiveOrders', ExecutiveOrder); From d83c35b256755f31fb7f25f2cbeff5b7c72ee486 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Sat, 6 Feb 2021 00:14:27 -0400 Subject: [PATCH 05/29] Add in permission checking --- src/api/board.ins/routes/root.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 8fb4542..2c2dd21 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -20,8 +20,9 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); - if (!director) { + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, @@ -50,8 +51,8 @@ export default class Root extends Route { oID: genUUID(), }); - const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); const embed = new RichEmbed(); embed.setTitle('Executive Order'); From eebd5d1e4cefe322b27eaf7c3415b242bd1e6424 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Sat, 6 Feb 2021 23:04:18 -0400 Subject: [PATCH 06/29] Motions --- .eslintrc.json | 88 ++++++++++++++++---------------- src/api/board.ins/routes/root.ts | 69 ++++++++++++++++++++++++- src/class/Client.ts | 26 ++++++++-- src/class/Util.ts | 5 +- src/commands/apply.ts | 2 +- src/commands/billing_t3.ts | 2 +- src/intervals/motions.ts | 51 ++++++++++++++++++ src/models/ExecutiveOrder.ts | 2 +- src/models/Motion.ts | 34 ++++++++++++ src/models/index.ts | 1 + 10 files changed, 225 insertions(+), 55 deletions(-) create mode 100644 src/intervals/motions.ts create mode 100644 src/models/Motion.ts diff --git a/.eslintrc.json b/.eslintrc.json index da54f5a..8e5b667 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,47 +1,45 @@ { - "settings": { - "import/resolver": { - "node": { - "extensions": [".js", ".jsx", ".ts", ".tsx"] - } - } - }, - "env": { - "es6": true, - "node": true - }, - "extends": [ - "airbnb-base" - ], - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "linebreak-style": "off", - "no-unused-vars": "off", - "max-len": "off", - "import/no-dynamic-require": "off", - "global-require": "off", - "class-methods-use-this":"off", - "no-restricted-syntax": "off", - "camelcase": "off", - "indent": "warn", - "object-curly-newline": "off", - "import/prefer-default-export": "off", - "no-useless-constructor": "off", - "@typescript-eslint/no-useless-constructor": 2, - "import/extensions": "off", - "no-param-reassign": "off", - "no-underscore-dangle": "off" - }, - "ignorePatterns": "**/*.js" + "settings": { + "import/resolver": { + "node": { + "extensions": [".js", ".jsx", ".ts", ".tsx"] + } + } + }, + "env": { + "es6": true, + "node": true + }, + "extends": ["airbnb-base"], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": ["@typescript-eslint"], + "rules": { + "linebreak-style": "off", + "no-unused-vars": "off", + "max-len": "off", + "import/no-dynamic-require": "off", + "global-require": "off", + "class-methods-use-this": "off", + "no-restricted-syntax": "off", + "camelcase": "off", + "indent": "warn", + "object-curly-newline": "off", + "import/prefer-default-export": "off", + "no-useless-constructor": "off", + "@typescript-eslint/no-useless-constructor": 2, + "import/extensions": "off", + "no-param-reassign": "off", + "no-underscore-dangle": "off", + "keyword-spacing": "off", + "no-multiple-empty-lines": "off" + }, + "ignorePatterns": "**/*.js" } diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 2c2dd21..6aef088 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -68,7 +68,74 @@ export default class Root extends Route { return res.status(200).json({ code: this.constants.codes.SUCCESS, - message: `Created new Executive Order with ID ${executiveOrder.oID} by the ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + message: `Created new Executive Order with ID ${executiveOrder.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + }); + }); + + this.router.post('/motions/new', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.body.subject) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + if (!req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const motionID = genUUID(); + + const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + + const embed = new RichEmbed(); + embed.setTitle('Motion'); + embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); + embed.setColor('#66e1ff'); + embed.addField('Subject', req.body.subject); + embed.addField('Body', req.body.body); + embed.addField('ID', motionID); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + const motionMessage = await channel.createMessage({ embed }); + await motionMessage.addReaction(this.server.client.util.emojis.SUCCESS); + await motionMessage.addReaction(this.server.client.util.emojis.ERROR); + + const motion = await this.server.client.db.Motion.create({ + issuedBy: director.userID, + subject: req.body.subject, + body: req.body.body, + at: new Date(), + oID: motionID, + motionMessage: motionMessage.id, + processed: false, + }); + + return res.status(200).json({ + code: this.constants.codes.SUCCESS, + message: `Created new Motion with ID ${motion.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, }); }); } diff --git a/src/class/Client.ts b/src/class/Client.ts index d6b1a93..12816ac 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -12,6 +12,7 @@ import { Member, MemberInterface, Merchant, MerchantInterface, Moderation, ModerationInterface, + Motion, MotionInterface, NNTrainingData, NNTrainingDataInterface, Note, NoteInterface, PagerNumber, PagerNumberInterface, @@ -44,7 +45,27 @@ export default class Client extends eris.Client { public stripe: Stripe; - public db: { Customer: mongoose.Model, CustomerPortal: mongoose.Model, ExecutiveOrder: mongoose.Model, File: mongoose.Model, Member: mongoose.Model, Merchant: mongoose.Model, Moderation: mongoose.Model, NNTrainingData: mongoose.Model, Note: mongoose.Model, PagerNumber: mongoose.Model, Promo: mongoose.Model, Rank: mongoose.Model, Redirect: mongoose.Model, Score: mongoose.Model, ScoreHistorical: mongoose.Model, Staff: mongoose.Model, Stat: mongoose.Model, local: { muted: LocalStorage } }; + public db: { + Customer: mongoose.Model, + CustomerPortal: mongoose.Model, + ExecutiveOrder: mongoose.Model, + File: mongoose.Model, + Member: mongoose.Model, + Merchant: mongoose.Model, + Moderation: mongoose.Model, + Motion: mongoose.Model, + NNTrainingData: mongoose.Model, + Note: mongoose.Model, + PagerNumber: mongoose.Model, + Promo: mongoose.Model, + Rank: mongoose.Model, + Redirect: mongoose.Model, + Score: mongoose.Model, + ScoreHistorical: mongoose.Model, + Staff: mongoose.Model, + Stat: mongoose.Model, + local: { muted: LocalStorage } + }; constructor(token: string, options?: eris.ClientOptions) { super(token, options); @@ -52,10 +73,9 @@ export default class Client extends eris.Client { this.events = new Collection(); this.intervals = new Collection(); this.queue = new Queue(this); - this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; + this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, Motion, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; } - public async loadDatabase() { await mongoose.connect(this.config.mongoDB, { useNewUrlParser: true, useUnifiedTopology: true, poolSize: 50 }); diff --git a/src/class/Util.ts b/src/class/Util.ts index 25c0d3f..1005fd1 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -71,7 +71,6 @@ export default class Util { } return `${(bytes / 1024 ** i).toFixed(2)} ${sizes[i]}`; } - public async exec(command: string, _options: childProcess.ExecOptions = {}): Promise { const ex = promisify(childProcess.exec); @@ -105,7 +104,7 @@ export default class Util { * @param query Command input * @param message Only used to check for errors */ - public resolveCommand(query: string | string[], message?: Message): Promise<{cmd: Command, args: string[] }> { + public resolveCommand(query: string | string[], message?: Message): Promise<{ cmd: Command, args: string[] }> { try { let resolvedCommand: Command; if (typeof query === 'string') query = query.split(' '); @@ -195,7 +194,7 @@ export default class Util { public splitFields(fields: { name: string, value: string, inline?: boolean }[]): { name: string, value: string, inline?: boolean }[][] { let index = 0; - const array: {name: string, value: string, inline?: boolean}[][] = [[]]; + const array: { name: string, value: string, inline?: boolean }[][] = [[]]; while (fields.length) { if (array[index].length >= 25) { index += 1; array[index] = []; } array[index].push(fields[0]); fields.shift(); diff --git a/src/commands/apply.ts b/src/commands/apply.ts index c5c2602..1b41afc 100644 --- a/src/commands/apply.ts +++ b/src/commands/apply.ts @@ -38,7 +38,7 @@ export default class Apply extends Command { validation: (member: Member) => member.roles.includes('546457886440685578'), func: async (client: Client, ...data: any[]) => { const member = await client.guilds.get(client.config.guildID).getRESTMember(data[0]); - const ax = require('axios'); + const ax = require('axios'); await ax({ method: 'get', url: `https://api.cloud.libraryofcode.org/wh/t2?userID=${member.id}&auth=${client.config.internalKey}`, diff --git a/src/commands/billing_t3.ts b/src/commands/billing_t3.ts index bdc4823..63568cb 100644 --- a/src/commands/billing_t3.ts +++ b/src/commands/billing_t3.ts @@ -23,7 +23,7 @@ export default class Billing_T3 extends Command { emailAddress?: string, tier?: number, supportKey?: string, - }> (await axios.get(`https://api.cloud.libraryofcode.org/wh/info?id=${message.author.id}&authorization=${this.client.config.internalKey}`)).data; + }>(await axios.get(`https://api.cloud.libraryofcode.org/wh/info?id=${message.author.id}&authorization=${this.client.config.internalKey}`)).data; if (!response.found) return this.error(message.channel, 'CS Account not found.'); const customer = await this.client.db.Customer.findOne({ userID: message.author.id }); diff --git a/src/intervals/motions.ts b/src/intervals/motions.ts new file mode 100644 index 0000000..6470102 --- /dev/null +++ b/src/intervals/motions.ts @@ -0,0 +1,51 @@ +/* eslint-disable no-await-in-loop */ +import type { TextChannel } from 'eris'; +import { Client, RichEmbed } from '../class'; + +export default (client: Client) => { + const interval = setInterval(async () => { + const motions = await client.db.Motion.find({ processed: false }); + const directorLogs = client.getChannel('807444198969835550'); + + for (const motion of motions) { + const motionMessage = await directorLogs.getMessage(motion.motionMessage); + + if ((Date.now() - motionMessage.createdAt) > 86400) { + const yea = await motionMessage.getReaction(client.util.emojis.SUCCESS); + const nay = await motionMessage.getReaction(client.util.emojis.ERROR); + const present = yea.length + nay.length; + const totalDirectors = 5; + const absent = totalDirectors - present; + + await client.db.Motion.updateOne({ oID: motion.oID }, { + processed: true, + voteResults: { + yea: yea.length, + nay: nay.length, + present, + absent, + }, + }); + + const directorDiscord = client.users.get(motion.issuedBy); + const directorProfile = await client.db.Staff.findOne({ userID: motion.issuedBy }); + + const embed = new RichEmbed(); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorProfile.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setFooter(`${directorProfile.position} | Library of Code sp-us | Board of Directors`, 'https://static.libraryofcode.org/loccommunityadmin.png'); + let colour; + if (yea.length > nay.length) colour = '#27b17a'; + else if (yea.length === nay.length) colour = '#ffb34d'; + else colour = '#ff474a'; + embed.setColor(colour); + embed.addField('Motion ID', motion.oID); + embed.addField('Result', `- **Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present}\n**Absent:** ${absent}\n**Total:** ${present + absent}`); + embed.setTimestamp(); + + await directorLogs.createMessage({ content: directorDiscord.mention, embed }); + } + } + }, 300000); + + return interval; +}; diff --git a/src/models/ExecutiveOrder.ts b/src/models/ExecutiveOrder.ts index f639358..be4127a 100644 --- a/src/models/ExecutiveOrder.ts +++ b/src/models/ExecutiveOrder.ts @@ -13,7 +13,7 @@ const ExecutiveOrder = new Schema({ subject: { type: String, required: true }, body: { type: String, required: true }, at: { type: Date, required: true }, - oID: { type: String, required: true, unique: true } + oID: { type: String, required: true, unique: true }, }); export default model('ExecutiveOrders', ExecutiveOrder); diff --git a/src/models/Motion.ts b/src/models/Motion.ts new file mode 100644 index 0000000..d2f9711 --- /dev/null +++ b/src/models/Motion.ts @@ -0,0 +1,34 @@ +import { Document, model, Schema } from 'mongoose'; + +export interface MotionInterface extends Document { + issuedBy: string; + subject: string; + body: string; + at: Date; + oID: string; + voteResults: { + yea: number; + nay: number; + present: number; + absent: number; + }; + motionMessage: string; +} + +const Motion = new Schema({ + issuedBy: { type: String, required: true }, + subject: { type: String, required: true }, + body: { type: String, required: true }, + at: { type: Date, required: true }, + oID: { type: String, required: true, unique: true }, + voteResults: { + yea: Number, + Nay: Number, + present: Number, + absent: Number, + }, + motionMessage: { type: String, required: true, unique: true }, + processed: Boolean, +}); + +export default model('Motions', Motion); diff --git a/src/models/index.ts b/src/models/index.ts index f6f0541..f9dadc0 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -5,6 +5,7 @@ export { default as File, FileInterface } from './File'; export { default as Member, MemberInterface } from './Member'; export { default as Merchant, MerchantInterface } from './Merchant'; export { default as Moderation, ModerationInterface } from './Moderation'; +export { default as Motion, MotionInterface } from './Motion'; export { default as NNTrainingData, NNTrainingDataInterface } from './NNTrainingData'; export { default as Note, NoteInterface } from './Note'; export { default as PagerNumber, PagerNumberInterface, PagerNumberRaw } from './PagerNumber'; From 626131bf4e2c76a3c6e2189568a73ab233f7a406 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Sun, 7 Feb 2021 21:58:26 -0400 Subject: [PATCH 07/29] Resolutions --- package.json | 16 ++++++++-------- src/api/board.ins/routes/root.ts | 4 ++-- src/class/Client.ts | 4 +++- src/intervals/motions.ts | 17 +++++++++++++++- src/models/Resolution.ts | 33 ++++++++++++++++++++++++++++++++ src/models/index.ts | 1 + 6 files changed, 63 insertions(+), 12 deletions(-) create mode 100644 src/models/Resolution.ts diff --git a/package.json b/package.json index 26da961..ccbbfe1 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,14 @@ "@types/jsonwebtoken": "^8.5.0", "@types/mathjs": "^6.0.7", "@types/mongoose": "^5.7.19", - "@types/node": "^14.0.1", + "@types/node": "^14.14.25", "@types/nodemailer": "^6.4.0", - "@types/puppeteer": "^5.4.2", + "@types/puppeteer": "^5.4.3", "@types/signale": "^1.4.1", "@types/uuid": "^7.0.3", "@typescript-eslint/eslint-plugin": "^2.33.0", "@typescript-eslint/parser": "^2.33.0", - "eslint": "^7.0.0", + "eslint": "^7.19.0", "eslint-config-airbnb-base": "^14.1.0", "eslint-plugin-import": "^2.20.2", "typescript": "^3.9.2" @@ -35,27 +35,27 @@ "@google-cloud/text-to-speech": "^3.1.2", "ari-client": "^2.2.0", "asterisk-manager": "^0.1.16", - "awesome-phonenumber": "^2.41.0", + "awesome-phonenumber": "^2.45.0", "axios": "^0.19.2", "body-parser": "^1.19.0", "brain.js": "^2.0.0-beta.2", - "bull": "^3.18.1", + "bull": "^3.20.1", "cheerio": "^1.0.0-rc.5", "cron": "^1.8.2", "eris": "^0.13.3", - "eris-pagination": "bsian03/eris-pagination", + "eris-pagination": "github:bsian03/eris-pagination", "express": "^4.17.1", "helmet": "^3.22.0", "jsonwebtoken": "^8.5.1", "mathjs": "^7.6.0", "moment": "^2.25.3", - "mongoose": "^5.9.13", + "mongoose": "^5.11.15", "nodemailer": "^6.4.8", "pluris": "^0.2.5", "puppeteer": "^5.5.0", "sd-notify": "^2.8.0", "signale": "^1.4.0", - "stripe": "^8.120.0", + "stripe": "^8.134.0", "uuid": "^8.0.0", "yaml": "^1.9.2" } diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 6aef088..2199adb 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -11,7 +11,7 @@ export default class Root extends Route { } public bind() { - this.router.post('/executive-orders/new', async (req, res) => { + this.router.post('/executive-orders', async (req, res) => { if (!req.body.pin) { return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, @@ -72,7 +72,7 @@ export default class Root extends Route { }); }); - this.router.post('/motions/new', async (req, res) => { + this.router.post('/motions', async (req, res) => { if (!req.body.pin) { return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, diff --git a/src/class/Client.ts b/src/class/Client.ts index 12816ac..18c70de 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -19,6 +19,7 @@ import { Promo, PromoInterface, Rank, RankInterface, Redirect, RedirectInterface, + Resolution, ResolutionInterface, Score, ScoreInterface, ScoreHistorical, ScoreHistoricalInterface, Staff, StaffInterface, @@ -60,6 +61,7 @@ export default class Client extends eris.Client { Promo: mongoose.Model, Rank: mongoose.Model, Redirect: mongoose.Model, + Resolution: mongoose.Model, Score: mongoose.Model, ScoreHistorical: mongoose.Model, Staff: mongoose.Model, @@ -73,7 +75,7 @@ export default class Client extends eris.Client { this.events = new Collection(); this.intervals = new Collection(); this.queue = new Queue(this); - this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, Motion, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; + this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, Motion, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Resolution, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; } public async loadDatabase() { diff --git a/src/intervals/motions.ts b/src/intervals/motions.ts index 6470102..b7de6e9 100644 --- a/src/intervals/motions.ts +++ b/src/intervals/motions.ts @@ -26,19 +26,34 @@ export default (client: Client) => { absent, }, }); + await client.db.Resolution.create({ + issuedBy: motion.issuedBy, + subject: motion.subject, + body: motion.body, + at: motion.at, + oID: motion.oID, + voteResults: { + yea: yea.length, + Nay: nay.length, + present, + absent, + }, + acceptedAt: Number, + }); const directorDiscord = client.users.get(motion.issuedBy); const directorProfile = await client.db.Staff.findOne({ userID: motion.issuedBy }); const embed = new RichEmbed(); embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorProfile.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setTitle('Resolution'); embed.setFooter(`${directorProfile.position} | Library of Code sp-us | Board of Directors`, 'https://static.libraryofcode.org/loccommunityadmin.png'); let colour; if (yea.length > nay.length) colour = '#27b17a'; else if (yea.length === nay.length) colour = '#ffb34d'; else colour = '#ff474a'; embed.setColor(colour); - embed.addField('Motion ID', motion.oID); + embed.setDescription(motion.oID); embed.addField('Result', `- **Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present}\n**Absent:** ${absent}\n**Total:** ${present + absent}`); embed.setTimestamp(); diff --git a/src/models/Resolution.ts b/src/models/Resolution.ts new file mode 100644 index 0000000..45b3245 --- /dev/null +++ b/src/models/Resolution.ts @@ -0,0 +1,33 @@ +import { Document, model, Schema } from 'mongoose'; + +export interface ResolutionInterface extends Document { + issuedBy: string; + subject: string; + body: string; + at: Date; + oID: string; + voteResults: { + yea: number; + nay: number; + present: number; + absent: number; + }; + acceptedAt: number; +} + +const Resolution = new Schema({ + issuedBy: { type: String, required: true }, + subject: { type: String, required: true }, + body: { type: String, required: true }, + at: { type: Date, required: true }, + oID: { type: String, required: true, unique: true }, + voteResults: { + yea: Number, + Nay: Number, + present: Number, + absent: Number, + }, + acceptedAt: Number, +}); + +export default model('Resolutions', Resolution); diff --git a/src/models/index.ts b/src/models/index.ts index f9dadc0..568c71f 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -12,6 +12,7 @@ export { default as PagerNumber, PagerNumberInterface, PagerNumberRaw } from './ export { default as Promo, PromoInterface } from './Promo'; export { default as Rank, RankInterface } from './Rank'; export { default as Redirect, RedirectInterface, RedirectRaw } from './Redirect'; +export { default as Resolution, ResolutionInterface } from './Resolution'; export { default as Score, ScoreInterface, ScoreInterfaceRaw } from './Score'; export { default as ScoreHistorical, ScoreHistoricalInterface } from './ScoreHistorical'; export { default as Staff, StaffInterface } from './Staff'; From 34c298e51e27825ab43bc027013a44f4c331f531 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Sun, 7 Feb 2021 21:58:44 -0400 Subject: [PATCH 08/29] fix motions and embeds --- src/intervals/motions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intervals/motions.ts b/src/intervals/motions.ts index b7de6e9..9accc59 100644 --- a/src/intervals/motions.ts +++ b/src/intervals/motions.ts @@ -38,7 +38,7 @@ export default (client: Client) => { present, absent, }, - acceptedAt: Number, + acceptedAt: Date.now(), }); const directorDiscord = client.users.get(motion.issuedBy); From b185152b69b6dafe2570dee05b7cd70767e47c44 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Tue, 9 Feb 2021 22:37:52 -0400 Subject: [PATCH 09/29] Add in API endpoints --- src/api/board.ins/routes/root.ts | 24 ++++++++++++++++++++++++ src/intervals/motions.ts | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 2199adb..93b1cbe 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -138,5 +138,29 @@ export default class Root extends Route { message: `Created new Motion with ID ${motion.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, }); }); + + this.router.get('/motions', async (_req, res) => { + const motions = await this.server.client.db.Motion.find().lean(); + + res.status(200).send({ + motions, + }); + }); + + this.router.get('/resolutions', async (_req, res) => { + const resolutions = await this.server.client.db.Resolution.find().lean(); + + res.status(200).send({ + resolutions, + }); + }); + + this.router.get('/executive-orders', async (_req, res) => { + const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); + + res.status(200).send({ + executiveOrders, + }); + }); } } diff --git a/src/intervals/motions.ts b/src/intervals/motions.ts index 9accc59..4c9d74a 100644 --- a/src/intervals/motions.ts +++ b/src/intervals/motions.ts @@ -47,7 +47,7 @@ export default (client: Client) => { const embed = new RichEmbed(); embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorProfile.pn.join(', ')}`, directorDiscord.avatarURL); embed.setTitle('Resolution'); - embed.setFooter(`${directorProfile.position} | Library of Code sp-us | Board of Directors`, 'https://static.libraryofcode.org/loccommunityadmin.png'); + embed.setFooter(`${directorProfile.title} | Library of Code sp-us | Board of Directors`, 'https://static.libraryofcode.org/loccommunityadmin.png'); let colour; if (yea.length > nay.length) colour = '#27b17a'; else if (yea.length === nay.length) colour = '#ffb34d'; From 4b1c61f6e4576838ac422570dcf60ceff9600f1a Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Wed, 10 Feb 2021 00:24:25 -0400 Subject: [PATCH 10/29] Set nickname command --- .gitignore | 1 - package-lock.json | 4889 +++++++++++++++++++++++++++++++++++++++ package.json | 4 +- src/commands/score.ts | 16 +- src/commands/setnick.ts | 29 + 5 files changed, 4928 insertions(+), 11 deletions(-) create mode 100644 package-lock.json create mode 100644 src/commands/setnick.ts diff --git a/.gitignore b/.gitignore index 0a8ac78..8eb2218 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Package Management & Libraries node_modules -package-lock.json # Configuration Files config.yaml diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..002a160 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4889 @@ +{ + "name": "loccommunityrelations", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", + "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@eslint/eslintrc": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", + "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, + "@google-cloud/text-to-speech": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@google-cloud/text-to-speech/-/text-to-speech-3.1.3.tgz", + "integrity": "sha512-Dhv3kT8L3vuVa0X/uOi/okbNC3fNtq0vcJsUEHFR8fd275Y0rFLNo28j566xy+VJ1g31uwXN6eT8Ubq8yZGgOA==", + "requires": { + "google-gax": "^2.9.2" + } + }, + "@grpc/grpc-js": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.2.5.tgz", + "integrity": "sha512-CBCNwedw8McnEBq9jvoiJikws16WN0OiHFejQPovY71XkFWSiIqgvydYiDwpvIYDJmhPQ7qZNzW9BPndhXbx1Q==", + "requires": { + "@types/node": "^12.12.47", + "google-auth-library": "^6.1.1", + "semver": "^6.2.0" + }, + "dependencies": { + "@types/node": { + "version": "12.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.15.tgz", + "integrity": "sha512-lowukE3GUI+VSYSu6VcBXl14d61Rp5hA1D+61r16qnwC0lYNSqdxcvRh0pswejorHfS+HgwBasM8jLXz0/aOsw==" + } + } + }, + "@grpc/proto-loader": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.6.tgz", + "integrity": "sha512-DT14xgw3PSzPxwS13auTEwxhMMOoz33DPUKNtmYK/QYbBSpLXJy78FGGs5yVoxVobEqPm4iW9MOIoz0A3bLTRQ==", + "requires": { + "lodash.camelcase": "^4.3.0", + "protobufjs": "^6.8.6" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@types/ari-client": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@types/ari-client/-/ari-client-2.2.2.tgz", + "integrity": "sha512-ix9S/Gi6kCNuCm5SzrWgVaA7Fctkl1HwN8Y6VLX0c3Es4i+RvLW6LnC6vwKEHnp2jjdN1mP5SRAR8vW2qs9axQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ==", + "dev": true, + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/bson": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.3.tgz", + "integrity": "sha512-mVRvYnTOZJz3ccpxhr3wgxVmSeiYinW+zlzQz3SXWaJmD1DuL05Jeq7nKw3SnbKmbleW5qrLG5vdyWe/A9sXhw==", + "requires": { + "@types/node": "*" + } + }, + "@types/bull": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@types/bull/-/bull-3.15.0.tgz", + "integrity": "sha512-54Y1RYkJt6i+4dH45w4gZOP6fyhksTvOImfgBYAxgq/nt5ZrES4xFWwOzt2bxAgSR7FMH9fwvaiJN/pripPzag==", + "dev": true, + "requires": { + "@types/ioredis": "*" + } + }, + "@types/connect": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.34.tgz", + "integrity": "sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/cron": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@types/cron/-/cron-1.7.2.tgz", + "integrity": "sha512-AEpNLRcsVSc5AdseJKNHpz0d4e8+ow+abTaC0fKDbAU86rF1evoFF0oC2fV9FdqtfVXkG2LKshpLTJCFOpyvTg==", + "dev": true, + "requires": { + "@types/node": "*", + "moment": ">=2.14.0" + } + }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, + "@types/express": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.11.tgz", + "integrity": "sha512-no+R6rW60JEc59977wIxreQVsIEOAYwgCqldrA/vkpCnbD7MqTefO97lmoBe4WE0F156bC4uLSP1XHDOySnChg==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.18", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.18.tgz", + "integrity": "sha512-m4JTwx5RUBNZvky/JJ8swEJPKFd8si08pPF2PfizYjGZOKr/svUWPcoUmLow6MmPzhasphB7gSTINY67xn3JNA==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "@types/helmet": { + "version": "0.0.47", + "resolved": "https://registry.npmjs.org/@types/helmet/-/helmet-0.0.47.tgz", + "integrity": "sha512-TcHA/djjdUtrMtq/QAayVLrsgjNNZ1Uhtz0KhfH01mrmjH44E54DA1A0HNbwW0H/NBFqV+tGMo85ACuEhMXcdg==", + "dev": true, + "requires": { + "@types/express": "*" + } + }, + "@types/ioredis": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/@types/ioredis/-/ioredis-4.19.2.tgz", + "integrity": "sha512-fejSsJ4pYvA8zVLvAgQFI9T2uvxhUW7Ph95KodnNxMZvnUhQrn4ohxjH7fuU+jUw7Q4JCDcaba7JxDmszFmrCA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "@types/jsonwebtoken": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.0.tgz", + "integrity": "sha512-9bVao7LvyorRGZCw0VmH/dr7Og+NdjYSsKAxB43OQoComFbBgsEpoR9JW6+qSq/ogwVBg8GI2MfAlk4SYI4OLg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/long": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", + "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" + }, + "@types/mathjs": { + "version": "6.0.11", + "resolved": "https://registry.npmjs.org/@types/mathjs/-/mathjs-6.0.11.tgz", + "integrity": "sha512-q9B8ZreO41L38iTY76bCZEtAqzeRs4mNIOZpZ1sLSlcYgvgfFrnf8y8qfmas0tVWrsODjmQbQJFD6RJJJCqJbQ==", + "dev": true, + "requires": { + "decimal.js": "^10.0.0" + } + }, + "@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", + "dev": true + }, + "@types/mongodb": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.6.3.tgz", + "integrity": "sha512-6YNqGP1hk5bjUFaim+QoFFuI61WjHiHE1BNeB41TA00Xd2K7zG4lcWyLLq/XtIp36uMavvS5hoAUJ+1u/GcX2Q==", + "requires": { + "@types/bson": "*", + "@types/node": "*" + } + }, + "@types/mongoose": { + "version": "5.10.3", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.10.3.tgz", + "integrity": "sha512-VfdnaFImXEJZZiuL2ID/ysZs4inOIjxwrAnUgkr5eum2O2BLhFkiSI0i87AwignVva1qWTJ3H3DyM0Rf4USJ4A==", + "dev": true, + "requires": { + "@types/mongodb": "*", + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.14.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz", + "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==" + }, + "@types/nodemailer": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-6.4.0.tgz", + "integrity": "sha512-KY7bFWB0MahRZvVW4CuW83qcCDny59pJJ0MQ5ifvfcjNwPlIT0vW4uARO4u1gtkYnWdhSvURegecY/tzcukJcA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/puppeteer": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.3.tgz", + "integrity": "sha512-3nE8YgR9DIsgttLW+eJf6mnXxq8Ge+27m5SU3knWmrlfl6+KOG0Bf9f7Ua7K+C4BnaTMAh3/UpySqdAYvrsvjg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/qs": { + "version": "6.9.5", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.5.tgz", + "integrity": "sha512-/JHkVHtx/REVG0VVToGRGH2+23hsYLHdyG+GrvoUGlGAd0ErauXDyvHtRI/7H7mzLm+tBCKA7pfcpkQ1lf58iQ==", + "dev": true + }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==", + "dev": true + }, + "@types/serve-static": { + "version": "1.13.9", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", + "integrity": "sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA==", + "dev": true, + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "@types/signale": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@types/signale/-/signale-1.4.1.tgz", + "integrity": "sha512-05d9fUDqRnt36rizLgo38SbPTrkMzdhXpvSHSAhxzokgIUPGNUoXHV0zYjPpTd4IryDADJ0mGHpfJ/Yhjyh9JQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/uuid": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-7.0.4.tgz", + "integrity": "sha512-WGZCqBZZ0mXN2RxvLHL6/7RCu+OWs28jgQMP04LWfpyJlQUMTR6YU9CNJAKDgbw+EV/u687INXuLUc7FuML/4g==", + "dev": true + }, + "@types/yauzl": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.1.tgz", + "integrity": "sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==", + "optional": true, + "requires": { + "@types/node": "*" + } + }, + "@typescript-eslint/eslint-plugin": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz", + "integrity": "sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "2.34.0", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz", + "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.34.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.34.0.tgz", + "integrity": "sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "2.34.0", + "@typescript-eslint/typescript-estree": "2.34.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", + "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "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-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "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" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "ari-client": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ari-client/-/ari-client-2.2.0.tgz", + "integrity": "sha512-DPz+vC/dZyvy5HqBrEzYpNH6X2hDb+AIyRith6f8IVLHyveRWaHPO0S7rF1Q91qry/U8G+504KUZfeaBPwzIVQ==", + "requires": { + "backoff-func": "^0.1.2", + "bluebird": "^3.5.2", + "lodash": "^4.17.10", + "request": "^2.34.0", + "swagger-client": "2.0.26", + "uuid": "^3.0.0", + "ws": "^6.0.0" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + } + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "array-includes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.2.tgz", + "integrity": "sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "get-intrinsic": "^1.0.1", + "is-string": "^1.0.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + } + } + } + }, + "array.prototype.flat": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + } + } + } + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "asterisk-manager": { + "version": "0.1.16", + "resolved": "https://registry.npmjs.org/asterisk-manager/-/asterisk-manager-0.1.16.tgz", + "integrity": "sha512-JxcgSutGhz6B2XtYkqkOI/sRH3hCGHmeNXuqNBw1JMtDMrRzpfuXB0keH4ouRtQPxdb2LIj83RWdR5uVnFim9A==" + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "awesome-phonenumber": { + "version": "2.45.0", + "resolved": "https://registry.npmjs.org/awesome-phonenumber/-/awesome-phonenumber-2.45.0.tgz", + "integrity": "sha512-W5tMF9hJrw/WlWAnatYg+dXZnmJUF8e0TFqPmMqStwHsRDKnj5zkLsVbYjYI/6kd1f6A1mChF4lFC40zg/1dMw==" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + }, + "ax": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/ax/-/ax-0.1.8.tgz", + "integrity": "sha1-J8qac/pMeKR41i2CfK2GCiT91Jc=" + }, + "axios": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "requires": { + "follow-redirects": "1.5.10" + } + }, + "backoff-func": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/backoff-func/-/backoff-func-0.1.2.tgz", + "integrity": "sha1-VMP64rreWHI0utXbh+NBLJ+ph4M=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bit-twiddle": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", + "integrity": "sha1-DGwfq+KyPRcXPZpht7cJPrnhdp4=" + }, + "bl": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + } + } + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" + }, + "bowser": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.9.0.tgz", + "integrity": "sha512-2ld76tuLBNFekRgmJfT2+3j5MIrP6bFict8WAIT3beq+srz1gcKNAdNKMqHqauQt63NmAa88HfP1/Ypa9Er3HA==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "brain.js": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/brain.js/-/brain.js-2.0.0-beta.2.tgz", + "integrity": "sha512-Cg8iUGrEz1kRqWos8mJddabMJxdiAEF24OX6Z0EWX/+9gu7BIjg5GL+IyST/vl4kbfwdvKHqeBr/N9eWEDzGdQ==", + "requires": { + "gpu.js": "^2.9.5", + "thaw.js": "^2.1.0" + } + }, + "bson": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.5.tgz", + "integrity": "sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg==" + }, + "btoa": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.1.1.tgz", + "integrity": "sha1-J8gQYmMQjp3UH/L6qtKhcEXjXro=" + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "bull": { + "version": "3.20.1", + "resolved": "https://registry.npmjs.org/bull/-/bull-3.20.1.tgz", + "integrity": "sha512-wDwpVu47WKaGhiguEPa/US5UMrtGLPKNPiGFPo4OgVs3EEGzJEWwv3LRPfjJVIf1COdMAN/yowGhZwYmoOonjQ==", + "requires": { + "cron-parser": "^2.13.0", + "debuglog": "^1.0.0", + "get-port": "^5.1.1", + "ioredis": "^4.22.0", + "lodash": "^4.17.19", + "p-timeout": "^3.2.0", + "promise.prototype.finally": "^3.1.2", + "semver": "^7.3.2", + "util.promisify": "^1.0.1", + "uuid": "^8.3.0" + }, + "dependencies": { + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelize": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", + "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cheerio": { + "version": "1.0.0-rc.5", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.5.tgz", + "integrity": "sha512-yoqps/VCaZgN4pfXtenwHROTp8NG6/Hlt4Jpz2FEP0ZJQ+ZUkVDd0hAPDNKhj3nakpfPt/CNs57yEtxD1bXQiw==", + "requires": { + "cheerio-select-tmp": "^0.1.0", + "dom-serializer": "~1.2.0", + "domhandler": "^4.0.0", + "entities": "~2.1.0", + "htmlparser2": "^6.0.0", + "parse5": "^6.0.0", + "parse5-htmlparser2-tree-adapter": "^6.0.0" + } + }, + "cheerio-select-tmp": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/cheerio-select-tmp/-/cheerio-select-tmp-0.1.1.tgz", + "integrity": "sha512-YYs5JvbpU19VYJyj+F7oYrIE2BOll1/hRU7rEy/5+v9BzkSo3bK81iAeeQEMI92vRIxz677m72UmJUiVwwgjfQ==", + "requires": { + "css-select": "^3.1.2", + "css-what": "^4.0.0", + "domelementtype": "^2.1.0", + "domhandler": "^4.0.0", + "domutils": "^2.4.4" + } + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" + }, + "cluster-key-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz", + "integrity": "sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "complex.js": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.0.11.tgz", + "integrity": "sha512-6IArJLApNtdg1P1dFtn3dnyzoZBEF0MwMnrfF1exSBRpZYoy4yieMkpZhQDC0uwctw48vii0CFVyHfpgZ/DfGw==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "confusing-browser-globals": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz", + "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==", + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "content-security-policy-builder": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz", + "integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ==" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "cookiejar": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-1.3.1.tgz", + "integrity": "sha1-wEsEj2iPgBYjrNkM1YSMK/iJGhc=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cron": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/cron/-/cron-1.8.2.tgz", + "integrity": "sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==", + "requires": { + "moment-timezone": "^0.5.x" + } + }, + "cron-parser": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-2.18.0.tgz", + "integrity": "sha512-s4odpheTyydAbTBQepsqd2rNWGa2iV3cyo8g7zbI2QQYGLVsfbhmwukayS1XHppe02Oy1fg7mg6xoaraVJeEcg==", + "requires": { + "is-nan": "^1.3.0", + "moment-timezone": "^0.5.31" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "css-select": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-3.1.2.tgz", + "integrity": "sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA==", + "requires": { + "boolbase": "^1.0.0", + "css-what": "^4.0.0", + "domhandler": "^4.0.0", + "domutils": "^2.4.3", + "nth-check": "^2.0.0" + } + }, + "css-what": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-4.0.0.tgz", + "integrity": "sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A==" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "dasherize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", + "integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=" + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "debuglog": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=" + }, + "decimal.js": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz", + "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==" + }, + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "requires": { + "mimic-response": "^2.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" + }, + "denque": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", + "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" + }, + "devtools-protocol": { + "version": "0.0.818844", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.818844.tgz", + "integrity": "sha512-AD1hi7iVJ8OD0aMLQU5VK0XH9LDlA1+BcPIgrAxPfaibx2DbWucuyOhc4oyQCbnvDDO68nN6/LcKfqTP343Jjg==" + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-serializer": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.2.0.tgz", + "integrity": "sha512-n6kZFH/KlCrqs/1GHMOd5i2fd/beQHuehKdWvNNffbGHTr/almdhuVvTVFb3V7fglz+nC50fFusu3lY33h12pA==", + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.0.0", + "entities": "^2.0.0" + } + }, + "domelementtype": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", + "integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==" + }, + "domhandler": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.0.0.tgz", + "integrity": "sha512-KPTbnGQ1JeEMQyO1iYXoagsI6so/C96HZiFyByU3T6iAzpXn8EGEvct6unm1ZGoed8ByO2oirxgwxBmqKF9haA==", + "requires": { + "domelementtype": "^2.1.0" + } + }, + "domutils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.4.4.tgz", + "integrity": "sha512-jBC0vOsECI4OMdD0GC9mGn7NXPLb+Qt6KW1YDQzeQYRUFKmNG8lh7mO5HiELfr+lLQE7loDVI4QcAxV80HS+RA==", + "requires": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.0.1", + "domhandler": "^4.0.0" + } + }, + "dont-sniff-mimetype": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz", + "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==" + }, + "duplexify": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.1.tgz", + "integrity": "sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA==", + "requires": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" + }, + "env-paths": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", + "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==" + }, + "eris": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/eris/-/eris-0.13.4.tgz", + "integrity": "sha512-IFA14nasCig8xp8cVCULvzBuJ0qpYqJ3XyEtm9OLdC177DYDCJ9QM2Aq+KOpejIVl7838n9AyRlLI6w9Eu3PiQ==", + "requires": { + "opusscript": "^0.0.7", + "tweetnacl": "^1.0.1", + "ws": "^7.2.1" + }, + "dependencies": { + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "optional": true + }, + "ws": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", + "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==" + } + } + }, + "eris-pagination": { + "version": "github:bsian03/eris-pagination#c0f77b118e98309e89e6522ef545f9d121601f21", + "from": "github:bsian03/eris-pagination", + "requires": { + "eris-reactions": "^0.1.2" + } + }, + "eris-reactions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/eris-reactions/-/eris-reactions-0.1.4.tgz", + "integrity": "sha512-U2rMtfywnhh4TmqFcF7uo/ciyQN8vb9ptwSJMQs/uaY1a401f+t3sei1R3IR2gYqaFejJzgjTmzBMT6jIBPYYQ==" + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-latex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", + "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "eslint": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.19.0.tgz", + "integrity": "sha512-CGlMgJY56JZ9ZSYhJuhow61lMPPjUzWmChFya71Z/jilVos7mR/jPgaEfVGgMBY5DshbKdG8Ezb8FDCHcoMEMg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.3.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.0", + "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", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.20", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-config-airbnb-base": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", + "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", + "dev": true, + "requires": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.2" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "requires": { + "@types/yauzl": "^2.9.1", + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" + }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "requires": { + "pend": "~1.2.0" + } + }, + "feature-policy": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz", + "integrity": "sha512-ZtijOTFN7TzCujt1fnNhfWPFPSHeZkesff9AXZj+UEjYBynWNUIYpC87Ve4wHzyexQsImicLu7WsC2LHq7/xrQ==" + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", + "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + }, + "follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "requires": { + "debug": "=3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "requires": { + "is-callable": "^1.1.3" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fraction.js": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.13.tgz", + "integrity": "sha512-E1fz2Xs9ltlUp+qbiyx9wmt2n9dRzPsS11Jtdb8D2o+cC7wr9xkkKsVKJuBX0ST+LVS+LhLO+SbLJNtfWcJvXA==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "requires": { + "minipass": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "gaxios": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.1.0.tgz", + "integrity": "sha512-vb0to8xzGnA2qcgywAjtshOKKVDf2eQhJoiL6fHhgW5tVN7wNk7egnYIO9zotfn3lQ3De1VPdf7V5/BWfCtCmg==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.3.0" + } + }, + "gcp-metadata": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz", + "integrity": "sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw==", + "requires": { + "gaxios": "^4.0.0", + "json-bigint": "^1.0.0" + } + }, + "get-intrinsic": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.0.tgz", + "integrity": "sha512-M11rgtQp5GZMZzDL7jLTNxbDfurpzuau5uqRWDPvlHjfvg3TdScAZo96GLvhMjImrmR8uAt0FS2RLoMrfWGKlg==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-port": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", + "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==" + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "requires": { + "pump": "^3.0.0" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" + }, + "gl": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/gl/-/gl-4.9.0.tgz", + "integrity": "sha512-5Qz8fM4kO4xTo/Ofv80hq/iXEGNlMxOCSo1+9cvT9CX/j84tIFBsbFLXkBVFZiKulA3H2VPQGSs0qZIMwv3KEA==", + "requires": { + "bindings": "^1.5.0", + "bit-twiddle": "^1.0.2", + "glsl-tokenizer": "^2.0.2", + "nan": "^2.14.1", + "node-abi": "^2.18.0", + "node-gyp": "^7.1.0", + "prebuild-install": "^5.3.5" + } + }, + "gl-wiretap": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/gl-wiretap/-/gl-wiretap-0.6.2.tgz", + "integrity": "sha512-fxy1XGiPkfzK+T3XKDbY7yaqMBmozCGvAFyTwaZA3imeZH83w7Hr3r3bYlMRWIyzMI/lDUvUMM/92LE2OwqFyQ==" + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "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" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "glsl-tokenizer": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz", + "integrity": "sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==", + "requires": { + "through2": "^0.6.3" + } + }, + "google-auth-library": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.6.tgz", + "integrity": "sha512-Q+ZjUEvLQj/lrVHF/IQwRo6p3s8Nc44Zk/DALsN+ac3T4HY/g/3rrufkgtl+nZ1TW7DNAw5cTChdVp4apUXVgQ==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^4.0.0", + "gcp-metadata": "^4.2.0", + "gtoken": "^5.0.4", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + } + }, + "google-gax": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-2.10.0.tgz", + "integrity": "sha512-K+1JK5ofNl5k30LsI8UQb/DeLMEbhL/SWirCx0L9pnMcApSfAjRAO7yajXT5X1vicxDBnNSwKs+cu4elxpYraw==", + "requires": { + "@grpc/grpc-js": "~1.2.0", + "@grpc/proto-loader": "^0.5.1", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "fast-text-encoding": "^1.0.3", + "google-auth-library": "^6.1.3", + "is-stream-ended": "^0.1.4", + "node-fetch": "^2.6.1", + "protobufjs": "^6.10.2", + "retry-request": "^4.0.0" + } + }, + "google-p12-pem": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.0.3.tgz", + "integrity": "sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA==", + "requires": { + "node-forge": "^0.10.0" + } + }, + "gpu-mock.js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/gpu-mock.js/-/gpu-mock.js-1.3.1.tgz", + "integrity": "sha512-+lbp8rQ0p1nTa6Gk6HoLiw4yM6JTpql82U+nCF3sZbX4FJWP9PzzF1018dW8K+pbmqRmhLHbn6Bjc6i6tgUpbA==" + }, + "gpu.js": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/gpu.js/-/gpu.js-2.11.2.tgz", + "integrity": "sha512-9vTGWo/hpYTRX4Q+WO0lmug/8/eKjJ0CI8LXPFxKWfu0kN2sOLnZtlnrXcDIhLF/crA+/JV9rM+0zHi4x9wjPA==", + "requires": { + "acorn": "^7.1.1", + "gl": "^4.5.2", + "gl-wiretap": "^0.6.2", + "gpu-mock.js": "^1.3.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + }, + "gtoken": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.2.1.tgz", + "integrity": "sha512-OY0BfPKe3QnMsY9MzTHTSKn+Vl2l1CcLe6BwDEQj00mbbkl5nyQ/7EUREstg4fQNZ8iYE7br4JJ7TdKeDOPWmw==", + "requires": { + "gaxios": "^4.0.0", + "google-p12-pem": "^3.0.3", + "jws": "^4.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" + }, + "helmet": { + "version": "3.23.3", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz", + "integrity": "sha512-U3MeYdzPJQhtvqAVBPntVgAvNSOJyagwZwyKsFdyRa8TV3pOKVFljalPOCxbw5Wwf2kncGhmP0qHjyazIdNdSA==", + "requires": { + "depd": "2.0.0", + "dont-sniff-mimetype": "1.1.0", + "feature-policy": "0.3.0", + "helmet-crossdomain": "0.4.0", + "helmet-csp": "2.10.0", + "hide-powered-by": "1.1.0", + "hpkp": "2.0.0", + "hsts": "2.2.0", + "nocache": "2.1.0", + "referrer-policy": "1.2.0", + "x-xss-protection": "1.3.0" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + } + } + }, + "helmet-crossdomain": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/helmet-crossdomain/-/helmet-crossdomain-0.4.0.tgz", + "integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA==" + }, + "helmet-csp": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.10.0.tgz", + "integrity": "sha512-Rz953ZNEFk8sT2XvewXkYN0Ho4GEZdjAZy4stjiEQV3eN7GDxg1QKmYggH7otDyIA7uGA6XnUMVSgeJwbR5X+w==", + "requires": { + "bowser": "2.9.0", + "camelize": "1.0.0", + "content-security-policy-builder": "2.1.0", + "dasherize": "2.0.0" + } + }, + "hide-powered-by": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hide-powered-by/-/hide-powered-by-1.1.0.tgz", + "integrity": "sha512-Io1zA2yOA1YJslkr+AJlWSf2yWFkKjvkcL9Ni1XSUqnGLr/qRQe2UI3Cn/J9MsJht7yEVCe0SscY1HgVMujbgg==" + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "hpkp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hpkp/-/hpkp-2.0.0.tgz", + "integrity": "sha1-EOFCJk52IVpdMMROxD3mTe5tFnI=" + }, + "hsts": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hsts/-/hsts-2.2.0.tgz", + "integrity": "sha512-ToaTnQ2TbJkochoVcdXYm4HOCliNozlviNsg+X2XQLQvZNI/kCHR9rZxVYpJB3UPcHz80PgxRyWQ7PdU1r+VBQ==", + "requires": { + "depd": "2.0.0" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + } + } + }, + "htmlparser2": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.0.0.tgz", + "integrity": "sha512-numTQtDZMoh78zJpaNdJ9MXb2cv5G3jwUoe3dMQODubZvLoGvTE/Ofp6sHvH8OGKcN/8A47pGLi/k58xHP/Tfw==", + "requires": { + "domelementtype": "^2.0.1", + "domhandler": "^4.0.0", + "domutils": "^2.4.4", + "entities": "^2.0.0" + } + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "ioredis": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-4.22.0.tgz", + "integrity": "sha512-mtC+jNFMPRxReWx0HodDbcwj34Gj5pK/P4+aE6Nh0pdqgtZKvxUh4z2lVtLjqnRIvMhKaBnIgMYFR8qH/xtttA==", + "requires": { + "cluster-key-slot": "^1.1.0", + "debug": "^4.1.1", + "denque": "^1.1.0", + "lodash.defaults": "^4.2.0", + "lodash.flatten": "^4.4.0", + "p-map": "^2.1.0", + "redis-commands": "1.7.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.0.1" + } + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==" + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" + }, + "is-stream-ended": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k=" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "requires": { + "bignumber.js": "^9.0.0" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "dependencies": { + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "kareem": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz", + "integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==" + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" + }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "mathjs": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-7.6.0.tgz", + "integrity": "sha512-abywR28hUpKF4at5jE8Ys+Kigk40eKMT5mcBLD0/dtsqjfOLbtzd3WjlRqIopNo7oQ6FME51qph6lb8h/bhpUg==", + "requires": { + "complex.js": "^2.0.11", + "decimal.js": "^10.2.1", + "escape-latex": "^1.2.0", + "fraction.js": "^4.0.12", + "javascript-natural-sort": "^0.7.1", + "seed-random": "^2.2.0", + "tiny-emitter": "^2.1.0", + "typed-function": "^2.0.0" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "optional": true + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==" + }, + "mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "requires": { + "mime-db": "1.45.0" + } + }, + "mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "minipass": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", + "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "requires": { + "yallist": "^4.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + }, + "moment-timezone": { + "version": "0.5.32", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.32.tgz", + "integrity": "sha512-Z8QNyuQHQAmWucp8Knmgei8YNo28aLjJq6Ma+jy1ZSpSk5nyfRT8xgUbSQvD2+2UajISfenndwvFuH3NGS+nvA==", + "requires": { + "moment": ">= 2.9.0" + } + }, + "mongodb": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.3.tgz", + "integrity": "sha512-rOZuR0QkodZiM+UbQE5kDsJykBqWi0CL4Ec2i1nrGrUI3KO11r6Fbxskqmq3JK2NH7aW4dcccBuUujAP0ERl5w==", + "requires": { + "bl": "^2.2.1", + "bson": "^1.1.4", + "denque": "^1.4.1", + "require_optional": "^1.0.1", + "safe-buffer": "^5.1.2", + "saslprep": "^1.0.0" + }, + "dependencies": { + "bl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", + "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "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" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + } + } + }, + "mongoose": { + "version": "5.11.15", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.11.15.tgz", + "integrity": "sha512-8T4bT6eCGB7MqCm40oVhnhT/1AyAdwe+y1rYUhdl3ljsks3BpYz8whZgcMkIoh6VoCCjipOXRqZqdk1UByvlYA==", + "requires": { + "@types/mongodb": "^3.5.27", + "bson": "^1.1.4", + "kareem": "2.3.2", + "mongodb": "3.6.3", + "mongoose-legacy-pluralize": "1.0.2", + "mpath": "0.8.3", + "mquery": "3.2.3", + "ms": "2.1.2", + "regexp-clone": "1.0.0", + "safe-buffer": "5.2.1", + "sift": "7.0.1", + "sliced": "1.0.1" + } + }, + "mongoose-legacy-pluralize": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", + "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" + }, + "mpath": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.8.3.tgz", + "integrity": "sha512-eb9rRvhDltXVNL6Fxd2zM9D4vKBxjVVQNLNijlj7uoXUy19zNDsIif5zR+pWmPCWNKwAtqyo4JveQm4nfD5+eA==" + }, + "mquery": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.3.tgz", + "integrity": "sha512-cIfbP4TyMYX+SkaQ2MntD+F2XbqaBHUYWk3j+kqdDztPWok3tgyssOZxMHMtzbV1w9DaSlvEea0Iocuro41A4g==", + "requires": { + "bluebird": "3.5.1", + "debug": "3.1.0", + "regexp-clone": "^1.0.0", + "safe-buffer": "5.1.2", + "sliced": "1.0.1" + }, + "dependencies": { + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" + }, + "napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, + "nocache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/nocache/-/nocache-2.1.0.tgz", + "integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==" + }, + "node-abi": { + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.19.3.tgz", + "integrity": "sha512-9xZrlyfvKhWme2EXFKQhZRp1yNWT/uI1luYPr3sFl+H4keYY4xR+1jO7mvTTijIsHf1M+QDe9uWuKeEpLInIlg==", + "requires": { + "semver": "^5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + }, + "node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" + }, + "node-gyp": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", + "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", + "requires": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.3", + "nopt": "^5.0.0", + "npmlog": "^4.1.2", + "request": "^2.88.2", + "rimraf": "^3.0.2", + "semver": "^7.3.2", + "tar": "^6.0.2", + "which": "^2.0.2" + }, + "dependencies": { + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "nodemailer": { + "version": "6.4.17", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.17.tgz", + "integrity": "sha512-89ps+SBGpo0D4Bi5ZrxcrCiRFaMmkCt+gItMXQGzEtZVR3uAD3QAQIDoxTWnx3ky0Dwwy/dhFrQ+6NNGXpw/qQ==" + }, + "noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "nth-check": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", + "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", + "requires": { + "boolbase": "^1.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz", + "integrity": "sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + } + } + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz", + "integrity": "sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + } + } + } + }, + "object.values": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", + "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + } + } + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "opusscript": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.7.tgz", + "integrity": "sha512-DcBadTdYTUuH9zQtepsLjQn4Ll6rs3dmeFvN+SD0ThPnxRBRm/WC1zXWPg+wgAJimB784gdZvUMA57gDP7FdVg==", + "optional": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==" + }, + "p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "requires": { + "p-finally": "^1.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "requires": { + "parse5": "^6.0.1" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "pkg-conf": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", + "requires": { + "find-up": "^2.0.0", + "load-json-file": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + } + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "requires": { + "find-up": "^4.0.0" + } + }, + "pluris": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/pluris/-/pluris-0.2.5.tgz", + "integrity": "sha512-K7UsbUn7uKflcnLRwN9g4sSlFsGYtM+sYhrO+nFrNTay/Gn6wTnhZlMbiIg1dXIy6+gnpVQZqVGghmBJb9t1Pg==", + "requires": { + "eris": "^0.13.3", + "eris-reactions": "^0.1.2" + } + }, + "prebuild-install": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", + "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", + "requires": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + }, + "promise.prototype.finally": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/promise.prototype.finally/-/promise.prototype.finally-3.1.2.tgz", + "integrity": "sha512-A2HuJWl2opDH0EafgdjwEw7HysI8ff/n4lW4QEVBCUXFk9QeGecBWv0Deph0UmLe3tTNYegz8MOjsVuE6SMoJA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.0", + "function-bind": "^1.1.1" + } + }, + "protobufjs": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", + "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": "^13.7.0", + "long": "^4.0.0" + }, + "dependencies": { + "@types/node": { + "version": "13.13.40", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.40.tgz", + "integrity": "sha512-eKaRo87lu1yAXrzEJl0zcJxfUMDT5/mZalFyOkT44rnQps41eS2pfWzbaulSPpQLFNy29bFqn+Y5lOTL8ATlEQ==" + } + } + }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "puppeteer": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-5.5.0.tgz", + "integrity": "sha512-OM8ZvTXAhfgFA7wBIIGlPQzvyEETzDjeRa4mZRCRHxYL+GNH5WAuYUQdja3rpWZvkX/JKqmuVgbsxDNsDFjMEg==", + "requires": { + "debug": "^4.1.0", + "devtools-protocol": "0.0.818844", + "extract-zip": "^2.0.0", + "https-proxy-agent": "^4.0.0", + "node-fetch": "^2.6.1", + "pkg-dir": "^4.2.0", + "progress": "^2.0.1", + "proxy-from-env": "^1.0.0", + "rimraf": "^3.0.2", + "tar-fs": "^2.0.0", + "unbzip2-stream": "^1.3.3", + "ws": "^7.2.3" + }, + "dependencies": { + "agent-base": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==" + }, + "https-proxy-agent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", + "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "requires": { + "agent-base": "5", + "debug": "4" + } + }, + "ws": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", + "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==" + } + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "redis-commands": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", + "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==" + }, + "redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha1-62LSrbFeTq9GEMBK/hUpOEJQq60=" + }, + "redis-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ=", + "requires": { + "redis-errors": "^1.0.0" + } + }, + "referrer-policy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/referrer-policy/-/referrer-policy-1.2.0.tgz", + "integrity": "sha512-LgQJIuS6nAy1Jd88DCQRemyE3mS+ispwlqMk3b0yjZ257fI1v9c+/p6SD5gP5FGyXUIgrNOAfmyioHwZtYv2VA==" + }, + "regexp-clone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", + "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + } + } + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "require_optional": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", + "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", + "requires": { + "resolve-from": "^2.0.0", + "semver": "^5.1.0" + }, + "dependencies": { + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "retry-request": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.1.3.tgz", + "integrity": "sha512-QnRZUpuPNgX0+D1xVxul6DbJ9slvo4Rm6iV/dn63e048MvGbUZiKySVt6Tenp04JqmchxjiLltGerOJys7kJYQ==", + "requires": { + "debug": "^4.1.1" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "saslprep": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", + "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", + "optional": true, + "requires": { + "sparse-bitfield": "^3.0.3" + } + }, + "sd-notify": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/sd-notify/-/sd-notify-2.8.0.tgz", + "integrity": "sha512-e+D1v0Y6UzmqXcPlaTkHk1QMdqk36mF/jIYv5gwry/N2Tb8/UNnpfG6ktGLpeBOR6TCC5hPKgqA+0hTl9sm2tA==", + "requires": { + "bindings": "1.5.0" + } + }, + "seed-random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", + "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ=" + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shred": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/shred/-/shred-0.8.10.tgz", + "integrity": "sha1-zxz+gPeb9TE9Ltw7kSJ4/RB6hxc=", + "requires": { + "ax": "0.1.8", + "cookiejar": "1.3.1", + "iconv-lite": ">= 0.1.2", + "sprintf": "0.1.1" + } + }, + "sift": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz", + "integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g==" + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + }, + "signale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", + "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", + "requires": { + "chalk": "^2.3.2", + "figures": "^2.0.0", + "pkg-conf": "^2.1.0" + } + }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" + }, + "simple-get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", + "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + } + } + }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" + }, + "sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", + "optional": true, + "requires": { + "memory-pager": "^1.0.2" + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", + "dev": true + }, + "sprintf": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/sprintf/-/sprintf-0.1.1.tgz", + "integrity": "sha1-6JJfyYlOGqaJnpCRx/KhITC3DeU=" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "standard-as-callback": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.0.1.tgz", + "integrity": "sha512-NQOxSeB8gOI5WjSaxjBgog2QFw55FV8TkS6Y07BiB3VJ8xNTvUYm0wl0s8ObgQ5NhdpnNfigMIKjgPESzgr4tg==" + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", + "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "stripe": { + "version": "8.135.0", + "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.135.0.tgz", + "integrity": "sha512-cy2IhKhENtvcwdrqtX4jZK4kgu0crA0YrwMgHovIzMAv/Ebr5LqBQ/nhyBqsssExY1hJjn765vhltNrf0WV+Iw==", + "requires": { + "@types/node": ">=8.1.0", + "qs": "^6.6.0" + }, + "dependencies": { + "qs": { + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==" + } + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "swagger-client": { + "version": "2.0.26", + "resolved": "https://registry.npmjs.org/swagger-client/-/swagger-client-2.0.26.tgz", + "integrity": "sha1-c/FQk/be82nzG5ZwxtlkWzMWPk0=", + "requires": { + "btoa": "1.1.1", + "shred": "0.8.10" + } + }, + "table": { + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", + "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "dev": true, + "requires": { + "ajv": "^7.0.2", + "lodash": "^4.17.20", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ajv": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.4.tgz", + "integrity": "sha512-xzzzaqgEQfmuhbhAoqjJ8T/1okb6gAzXn/eQRNpAN1AEUoHJTNF9xCDRTtf/s3SKldtZfa+RJeTs+BQq+eZ/sw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "tar": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz", + "integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==", + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + } + }, + "tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "requires": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + }, + "dependencies": { + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + } + } + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "thaw.js": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/thaw.js/-/thaw.js-2.1.1.tgz", + "integrity": "sha512-CxgHF6U1sUI6bpKAIjzXjWMRJGRxa3ITLswR/k7Y4rz1ph3EqEbkkDzWmmpZNXbN6H9DW3fpcrY0tTJWzlzmog==" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "requires": { + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz", + "integrity": "sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typed-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-2.0.0.tgz", + "integrity": "sha512-Hhy1Iwo/e4AtLZNK10ewVVcP2UEs408DS35ubP825w/YgSBK1KVLwALvvIG4yX75QJrxjCpcWkzkVRB0BwwYlA==" + }, + "typescript": { + "version": "3.9.8", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.8.tgz", + "integrity": "sha512-nDbnFkUZZjkQ92qwKX+C+jtk4OGfU8H9toSEs3uAsl8cxLjG2sqQm6leF/pLWvm9FAEJ6KHkYMAbHYaY2ITeVg==", + "dev": true + }, + "unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "requires": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util.promisify": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.1.tgz", + "integrity": "sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "for-each": "^0.3.3", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.1" + } + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "requires": { + "async-limiter": "~1.0.0" + } + }, + "x-xss-protection": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz", + "integrity": "sha512-kpyBI9TlVipZO4diReZMAHWtS0MMa/7Kgx8hwG/EuZLiA6sg4Ah/4TRdASHhRRN3boobzcYgFRUFSgHRge6Qhg==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==" + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + } + } +} diff --git a/package.json b/package.json index ccbbfe1..127b264 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "eslint": "^7.19.0", "eslint-config-airbnb-base": "^14.1.0", "eslint-plugin-import": "^2.20.2", - "typescript": "^3.9.2" + "typescript": "^3.9.8" }, "dependencies": { "@google-cloud/text-to-speech": "^3.1.2", @@ -55,7 +55,7 @@ "puppeteer": "^5.5.0", "sd-notify": "^2.8.0", "signale": "^1.4.0", - "stripe": "^8.134.0", + "stripe": "^8.135.0", "uuid": "^8.0.0", "yaml": "^1.9.2" } diff --git a/src/commands/score.ts b/src/commands/score.ts index 0449f2d..89363c5 100644 --- a/src/commands/score.ts +++ b/src/commands/score.ts @@ -13,7 +13,7 @@ export default class Score extends Command { constructor(client: Client) { super(client); this.name = 'score'; - this.description = 'Retreives your Community Report'; + this.description = 'Retrieves your Community Report'; this.usage = `${this.client.config.prefix}score\n${this.client.config.prefix}score :`; this.subcmds = [Score_Hist, Score_Notify, Score_Pref]; this.permissions = 0; @@ -38,8 +38,8 @@ export default class Score extends Command { embed.addField('Department/Service', `${user.username} via Discord`.toUpperCase(), true); embed.setTimestamp(); embed.setFooter(this.client.user.username, this.client.user.avatarURL); - const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); - log.createMessage({ embed }).catch(() => {}); + const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); + log.createMessage({ embed }).catch(() => { }); check = true; } else { user = this.client.util.resolveMember(args[0], this.mainGuild)?.user; @@ -70,12 +70,12 @@ export default class Score extends Command { embed.addField('Reason', reason ?? 'N/A', true); embed.setTimestamp(); embed.setFooter(this.client.user.username, this.client.user.avatarURL); - const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); - log.createMessage({ embed }).catch(() => {}); + const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); + log.createMessage({ embed }).catch(() => { }); if (score.notify === true) { await this.client.getDMChannel(user.id).then((chan) => { chan.createMessage(`__**Community Score - Hard Pull Notification**__\n*You have signed up to be notified whenever your hard score has been pulled. See \`?score\` for more information.*\n\n**Department/Service:** ${name.toUpperCase()}`); - }).catch(() => {}); + }).catch(() => { }); } } } @@ -193,8 +193,8 @@ export default class Score extends Command { embed2.addField('Department/Service', name.toUpperCase(), true); embed2.setTimestamp(); embed2.setFooter(this.client.user.username, this.client.user.avatarURL); - const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); - log.createMessage({ embed: embed2 }).catch(() => {}); + const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); + log.createMessage({ embed: embed2 }).catch(() => { }); } } if (args[1] === 'hard' && this.checkCustomPermissions(this.client.util.resolveMember(message.author.id, this.mainGuild), 6)) { diff --git a/src/commands/setnick.ts b/src/commands/setnick.ts new file mode 100644 index 0000000..0515127 --- /dev/null +++ b/src/commands/setnick.ts @@ -0,0 +1,29 @@ +import { Message } from 'eris'; +import { Client, Command } from '../class'; + +export default class Setnick extends Command { + constructor(client: Client) { + super(client); + this.name = 'setnick'; + this.description = 'Changes the nickname of a member'; + this.usage = 'setnick [new nickname]'; + this.permissions = 2; + this.guildOnly = true; + this.enabled = true; + } + + public async run(message: Message, args: string[]) { + try { + if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); + const member = this.client.util.resolveMember(args[0], this.mainGuild); + if (!member) return this.error(message.channel, 'Cannot find user.'); + let nickname = args.slice(1).join(' '); + if (args.length === 1) nickname = null; + if (nickname?.length > 32) return this.error(message.channel, 'New nickname may not be more than 32 characters long.'); + await member.edit({ nick: nickname }); + return this.success(message.channel, `Updated the nickname of ${member.user.username}#${member.user.discriminator}.`); + } catch (err) { + return this.client.util.handleError(err, message, this, false); + } + } +} From 857ccc27363c2955ee15c6812685b0942d740ed3 Mon Sep 17 00:00:00 2001 From: haseeb Date: Sat, 13 Feb 2021 23:32:03 +0000 Subject: [PATCH 11/29] fix embeds and statements --- src/api/board.ins/routes/root.ts | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 93b1cbe..51e4881 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -29,14 +29,7 @@ export default class Root extends Route { }); } - if (!req.body.subject) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - if (!req.body.body) { + if (!req.body.subject || !req.body.body) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -60,7 +53,7 @@ export default class Root extends Route { embed.setColor('#dd3acd'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); - embed.addField('ID', executiveOrder.oID); + embed.setDescription(executiveOrder.oID); embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); @@ -90,14 +83,7 @@ export default class Root extends Route { }); } - if (!req.body.subject) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - if (!req.body.body) { + if (!req.body.subject || !req.body.body) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -115,7 +101,7 @@ export default class Root extends Route { embed.setColor('#66e1ff'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); - embed.addField('ID', motionID); + embed.setDescription(motionID); embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); From d5eb391ec62b2add8da179d5829430a5933163b1 Mon Sep 17 00:00:00 2001 From: Sterben Date: Sun, 14 Feb 2021 19:10:25 -0500 Subject: [PATCH 12/29] Add new file --- src/models/proclamation | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/models/proclamation diff --git a/src/models/proclamation b/src/models/proclamation new file mode 100644 index 0000000..fa0b9fb --- /dev/null +++ b/src/models/proclamation @@ -0,0 +1,29 @@ +import { Document, model, Schema } from 'mongoose'; + +export interface ProclamationInterface extends Document { + issuedBy: string; + subject: string; + body: string; + at: Date; + oID: string; + voteResults: { + yea: number; + nay: number; + }; + acceptedAt: number; +} + +const Proclamation = new Schema({ + issuedBy: { type: String, required: true }, + subject: { type: String, required: true }, + body: { type: String, required: true }, + at: { type: Date, required: true }, + oID: { type: String, required: true, unique: true }, + voteResults: { + yea: Number, + Nay: Number, + }, + acceptedAt: Number, +}); + +export default model('Proclamations', Proclamation); From 0ae20add1b3e78ca1c90b1b0f0e69cad7fd29d41 Mon Sep 17 00:00:00 2001 From: Sterben Date: Sun, 14 Feb 2021 19:10:46 -0500 Subject: [PATCH 13/29] Update proclamation --- src/models/proclamation | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/proclamation b/src/models/proclamation index fa0b9fb..df3cc6b 100644 --- a/src/models/proclamation +++ b/src/models/proclamation @@ -21,7 +21,7 @@ const Proclamation = new Schema({ oID: { type: String, required: true, unique: true }, voteResults: { yea: Number, - Nay: Number, + nay: Number, }, acceptedAt: Number, }); From 9bc5c90cdeafd1dd7da71d56a4740b12bec00a18 Mon Sep 17 00:00:00 2001 From: Sterben Date: Sun, 14 Feb 2021 19:10:56 -0500 Subject: [PATCH 14/29] Update proclamation --- src/models/{proclamation => proclamation.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/models/{proclamation => proclamation.ts} (100%) diff --git a/src/models/proclamation b/src/models/proclamation.ts similarity index 100% rename from src/models/proclamation rename to src/models/proclamation.ts From 32b5a462e2140acd6d0e2a48f4bd0ed5e7283697 Mon Sep 17 00:00:00 2001 From: Sterben Date: Sun, 14 Feb 2021 19:11:19 -0500 Subject: [PATCH 15/29] Update proclamation.ts --- src/models/{proclamation.ts => Proclamation.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/models/{proclamation.ts => Proclamation.ts} (100%) diff --git a/src/models/proclamation.ts b/src/models/Proclamation.ts similarity index 100% rename from src/models/proclamation.ts rename to src/models/Proclamation.ts From 7fe1516ef8e008c3b97f0c6d16c53e10250636da Mon Sep 17 00:00:00 2001 From: Sterben Date: Sun, 14 Feb 2021 19:12:09 -0500 Subject: [PATCH 16/29] Update index.ts --- src/models/index.ts | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/models/index.ts b/src/models/index.ts index 568c71f..0626279 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -1,19 +1,20 @@ -export { default as Customer, CustomerInterface } from './Customer'; -export { default as CustomerPortal, CustomerPortalInterface } from './CustomerPortal'; -export { default as ExecutiveOrder, ExecutiveOrderInterface } from './ExecutiveOrder'; -export { default as File, FileInterface } from './File'; -export { default as Member, MemberInterface } from './Member'; -export { default as Merchant, MerchantInterface } from './Merchant'; -export { default as Moderation, ModerationInterface } from './Moderation'; -export { default as Motion, MotionInterface } from './Motion'; -export { default as NNTrainingData, NNTrainingDataInterface } from './NNTrainingData'; -export { default as Note, NoteInterface } from './Note'; -export { default as PagerNumber, PagerNumberInterface, PagerNumberRaw } from './PagerNumber'; -export { default as Promo, PromoInterface } from './Promo'; -export { default as Rank, RankInterface } from './Rank'; -export { default as Redirect, RedirectInterface, RedirectRaw } from './Redirect'; -export { default as Resolution, ResolutionInterface } from './Resolution'; -export { default as Score, ScoreInterface, ScoreInterfaceRaw } from './Score'; -export { default as ScoreHistorical, ScoreHistoricalInterface } from './ScoreHistorical'; -export { default as Staff, StaffInterface } from './Staff'; -export { default as Stat, StatInterface } from './Stat'; +export { default as Customer, CustomerInterface } from './Customer'; +export { default as CustomerPortal, CustomerPortalInterface } from './CustomerPortal'; +export { default as ExecutiveOrder, ExecutiveOrderInterface } from './ExecutiveOrder'; +export { default as File, FileInterface } from './File'; +export { default as Member, MemberInterface } from './Member'; +export { default as Merchant, MerchantInterface } from './Merchant'; +export { default as Moderation, ModerationInterface } from './Moderation'; +export { default as Motion, MotionInterface } from './Motion'; +export { default as NNTrainingData, NNTrainingDataInterface } from './NNTrainingData'; +export { default as Note, NoteInterface } from './Note'; +export { default as PagerNumber, PagerNumberInterface, PagerNumberRaw } from './PagerNumber'; +export { default as Proclamation, ProclamationInterface } from './Proclamation' +export { default as Promo, PromoInterface } from './Promo'; +export { default as Rank, RankInterface } from './Rank'; +export { default as Redirect, RedirectInterface, RedirectRaw } from './Redirect'; +export { default as Resolution, ResolutionInterface } from './Resolution'; +export { default as Score, ScoreInterface, ScoreInterfaceRaw } from './Score'; +export { default as ScoreHistorical, ScoreHistoricalInterface } from './ScoreHistorical'; +export { default as Staff, StaffInterface } from './Staff'; +export { default as Stat, StatInterface } from './Stat'; From 6a3bf66f2851bca33705f82f3664e060f7a293e2 Mon Sep 17 00:00:00 2001 From: Sterben Date: Sun, 14 Feb 2021 19:13:35 -0500 Subject: [PATCH 17/29] procs --- src/class/Client.ts | 295 ++++++++++++++++++++++---------------------- 1 file changed, 148 insertions(+), 147 deletions(-) diff --git a/src/class/Client.ts b/src/class/Client.ts index 18c70de..48a5562 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -1,147 +1,148 @@ -import Stripe from 'stripe'; -import eris from 'eris'; -import pluris from 'pluris'; -import mongoose from 'mongoose'; -import { promises as fs } from 'fs'; -import { Collection, Command, LocalStorage, Queue, Util, ServerManagement, Event } from '.'; -import { - Customer, CustomerInterface, - CustomerPortal, CustomerPortalInterface, - ExecutiveOrder, ExecutiveOrderInterface, - File, FileInterface, - Member, MemberInterface, - Merchant, MerchantInterface, - Moderation, ModerationInterface, - Motion, MotionInterface, - NNTrainingData, NNTrainingDataInterface, - Note, NoteInterface, - PagerNumber, PagerNumberInterface, - Promo, PromoInterface, - Rank, RankInterface, - Redirect, RedirectInterface, - Resolution, ResolutionInterface, - Score, ScoreInterface, - ScoreHistorical, ScoreHistoricalInterface, - Staff, StaffInterface, - Stat, StatInterface, -} from '../models'; -import { Config } from '../../types'; // eslint-disable-line - -pluris(eris); - -export default class Client extends eris.Client { - public config: Config; - - public commands: Collection; - - public events: Collection; - - public intervals: Collection; - - public util: Util; - - public serverManagement: ServerManagement; - - public queue: Queue; - - public stripe: Stripe; - - public db: { - Customer: mongoose.Model, - CustomerPortal: mongoose.Model, - ExecutiveOrder: mongoose.Model, - File: mongoose.Model, - Member: mongoose.Model, - Merchant: mongoose.Model, - Moderation: mongoose.Model, - Motion: mongoose.Model, - NNTrainingData: mongoose.Model, - Note: mongoose.Model, - PagerNumber: mongoose.Model, - Promo: mongoose.Model, - Rank: mongoose.Model, - Redirect: mongoose.Model, - Resolution: mongoose.Model, - Score: mongoose.Model, - ScoreHistorical: mongoose.Model, - Staff: mongoose.Model, - Stat: mongoose.Model, - local: { muted: LocalStorage } - }; - - constructor(token: string, options?: eris.ClientOptions) { - super(token, options); - this.commands = new Collection(); - this.events = new Collection(); - this.intervals = new Collection(); - this.queue = new Queue(this); - this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, Motion, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Resolution, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; - } - - public async loadDatabase() { - await mongoose.connect(this.config.mongoDB, { useNewUrlParser: true, useUnifiedTopology: true, poolSize: 50 }); - - const statMessages = await this.db.Stat.findOne({ name: 'messages' }); - const statCommands = await this.db.Stat.findOne({ name: 'commands' }); - const statPages = await this.db.Stat.findOne({ name: 'pages' }); - const statRequests = await this.db.Stat.findOne({ name: 'requests' }); - - if (!statMessages) { - await (new this.db.Stat({ name: 'messages', value: 0 }).save()); - } - if (!statCommands) { - await (new this.db.Stat({ name: 'commands', value: 0 }).save()); - } - if (!statPages) { - await (new this.db.Stat({ name: 'pages', value: 0 }).save()); - } - if (!statRequests) { - await (new this.db.Stat({ name: 'requests', value: 0 }).save()); - } - } - - public loadPlugins() { - this.util = new Util(this); - this.serverManagement = new ServerManagement(this); - this.stripe = new Stripe(this.config.stripeKey, { apiVersion: null, typescript: true }); - } - - public async loadIntervals() { - const intervalFiles = await fs.readdir(`${__dirname}/../intervals`); - intervalFiles.forEach((file) => { - const intervalName = file.split('.')[0]; - if (file === 'index.js') return; - const interval: NodeJS.Timeout = (require(`${__dirname}/../intervals/${file}`).default)(this); - this.intervals.add(intervalName, interval); - this.util.signale.success(`Successfully loaded interval: ${intervalName}`); - }); - } - - public async loadEvents(eventFiles: { [s: string]: typeof Event; } | ArrayLike) { - const evtFiles = Object.entries(eventFiles); - for (const [name, Ev] of evtFiles) { - const event = new Ev(this); - this.events.add(event.event, event); - this.on(event.event, event.run); - this.util.signale.success(`Successfully loaded event: ${name}`); - delete require.cache[require.resolve(`${__dirname}/../events/${name}`)]; - } - } - - public async loadCommands(commandFiles: { [s: string]: typeof Command; } | ArrayLike) { - const cmdFiles = Object.values(commandFiles); - for (const Cmd of cmdFiles) { - const command = new Cmd(this); - if (command.subcmds.length) { - command.subcmds.forEach((C) => { - const cmd: Command = new C(this); - command.subcommands.add(cmd.name, cmd); - this.util.signale.success(`Successfully loaded subcommand ${cmd.name} under ${command.name}`); - }); - } - delete command.subcmds; - this.commands.add(command.name, command); - this.util.signale.success(`Successfully loaded command: ${command.name}`); - } - } -} +import Stripe from 'stripe'; +import eris from 'eris'; +import pluris from 'pluris'; +import mongoose from 'mongoose'; +import { promises as fs } from 'fs'; +import { Collection, Command, LocalStorage, Queue, Util, ServerManagement, Event } from '.'; +import { + Customer, CustomerInterface, + CustomerPortal, CustomerPortalInterface, + ExecutiveOrder, ExecutiveOrderInterface, + File, FileInterface, + Member, MemberInterface, + Merchant, MerchantInterface, + Moderation, ModerationInterface, + Motion, MotionInterface, + NNTrainingData, NNTrainingDataInterface, + Note, NoteInterface, + PagerNumber, PagerNumberInterface, + Proclamation, ProclamationInterface, + Promo, PromoInterface, + Rank, RankInterface, + Redirect, RedirectInterface, + Resolution, ResolutionInterface, + Score, ScoreInterface, + ScoreHistorical, ScoreHistoricalInterface, + Staff, StaffInterface, + Stat, StatInterface, +} from '../models'; +import { Config } from '../../types'; // eslint-disable-line + +pluris(eris); + +export default class Client extends eris.Client { + public config: Config; + + public commands: Collection; + + public events: Collection; + + public intervals: Collection; + + public util: Util; + + public serverManagement: ServerManagement; + + public queue: Queue; + + public stripe: Stripe; + + public db: { + Customer: mongoose.Model, + CustomerPortal: mongoose.Model, + ExecutiveOrder: mongoose.Model, + File: mongoose.Model, + Member: mongoose.Model, + Merchant: mongoose.Model, + Moderation: mongoose.Model, + Motion: mongoose.Model, + NNTrainingData: mongoose.Model, + Note: mongoose.Model, + PagerNumber: mongoose.Model, + Promo: mongoose.Model, + Rank: mongoose.Model, + Redirect: mongoose.Model, + Resolution: mongoose.Model, + Score: mongoose.Model, + ScoreHistorical: mongoose.Model, + Staff: mongoose.Model, + Stat: mongoose.Model, + local: { muted: LocalStorage } + }; + + constructor(token: string, options?: eris.ClientOptions) { + super(token, options); + this.commands = new Collection(); + this.events = new Collection(); + this.intervals = new Collection(); + this.queue = new Queue(this); + this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, Motion, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Resolution, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; + } + + public async loadDatabase() { + await mongoose.connect(this.config.mongoDB, { useNewUrlParser: true, useUnifiedTopology: true, poolSize: 50 }); + + const statMessages = await this.db.Stat.findOne({ name: 'messages' }); + const statCommands = await this.db.Stat.findOne({ name: 'commands' }); + const statPages = await this.db.Stat.findOne({ name: 'pages' }); + const statRequests = await this.db.Stat.findOne({ name: 'requests' }); + + if (!statMessages) { + await (new this.db.Stat({ name: 'messages', value: 0 }).save()); + } + if (!statCommands) { + await (new this.db.Stat({ name: 'commands', value: 0 }).save()); + } + if (!statPages) { + await (new this.db.Stat({ name: 'pages', value: 0 }).save()); + } + if (!statRequests) { + await (new this.db.Stat({ name: 'requests', value: 0 }).save()); + } + } + + public loadPlugins() { + this.util = new Util(this); + this.serverManagement = new ServerManagement(this); + this.stripe = new Stripe(this.config.stripeKey, { apiVersion: null, typescript: true }); + } + + public async loadIntervals() { + const intervalFiles = await fs.readdir(`${__dirname}/../intervals`); + intervalFiles.forEach((file) => { + const intervalName = file.split('.')[0]; + if (file === 'index.js') return; + const interval: NodeJS.Timeout = (require(`${__dirname}/../intervals/${file}`).default)(this); + this.intervals.add(intervalName, interval); + this.util.signale.success(`Successfully loaded interval: ${intervalName}`); + }); + } + + public async loadEvents(eventFiles: { [s: string]: typeof Event; } | ArrayLike) { + const evtFiles = Object.entries(eventFiles); + for (const [name, Ev] of evtFiles) { + const event = new Ev(this); + this.events.add(event.event, event); + this.on(event.event, event.run); + this.util.signale.success(`Successfully loaded event: ${name}`); + delete require.cache[require.resolve(`${__dirname}/../events/${name}`)]; + } + } + + public async loadCommands(commandFiles: { [s: string]: typeof Command; } | ArrayLike) { + const cmdFiles = Object.values(commandFiles); + for (const Cmd of cmdFiles) { + const command = new Cmd(this); + if (command.subcmds.length) { + command.subcmds.forEach((C) => { + const cmd: Command = new C(this); + command.subcommands.add(cmd.name, cmd); + this.util.signale.success(`Successfully loaded subcommand ${cmd.name} under ${command.name}`); + }); + } + delete command.subcmds; + this.commands.add(command.name, command); + this.util.signale.success(`Successfully loaded command: ${command.name}`); + } + } +} From 5127e93795d1b7985d39d36f00b8c1c2ff97bf6e Mon Sep 17 00:00:00 2001 From: Sterben Date: Sat, 20 Feb 2021 01:23:10 -0500 Subject: [PATCH 18/29] added get proclamations endpoint --- src/api/board.ins/routes/root.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 93b1cbe..67a4241 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -155,6 +155,14 @@ export default class Root extends Route { }); }); + this.router.get('/proclamations', async (_req, res) => { + const proclamations = await this.server.client.db.Proclamation.find().lean(); + + res.status(200).send({ + proclamations, + }); + }); + this.router.get('/executive-orders', async (_req, res) => { const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); From 7591ba8f2066fcfa02ac17d438caacee09c1200f Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Sun, 21 Feb 2021 23:47:41 -0400 Subject: [PATCH 19/29] Motion and EO endpoints --- .eslintrc.json | 3 +- src/api/board.ins/routes/root.ts | 90 +++++++++++++++++++++++++++++--- 2 files changed, 85 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 8e5b667..7cfeb4b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -39,7 +39,8 @@ "no-param-reassign": "off", "no-underscore-dangle": "off", "keyword-spacing": "off", - "no-multiple-empty-lines": "off" + "no-multiple-empty-lines": "off", + "consistent-return": "off" }, "ignorePatterns": "**/*.js" } diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 51e4881..49da1cb 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -11,7 +11,7 @@ export default class Root extends Route { } public bind() { - this.router.post('/executive-orders', async (req, res) => { + this.router.post('/eo', async (req, res) => { if (!req.body.pin) { return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, @@ -59,13 +59,13 @@ export default class Root extends Route { const channel = this.server.client.getChannel('807444198969835550'); await channel.createMessage({ embed }); - return res.status(200).json({ + res.status(200).json({ code: this.constants.codes.SUCCESS, message: `Created new Executive Order with ID ${executiveOrder.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, }); }); - this.router.post('/motions', async (req, res) => { + this.router.post('/motion', async (req, res) => { if (!req.body.pin) { return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, @@ -119,13 +119,89 @@ export default class Root extends Route { processed: false, }); - return res.status(200).json({ + res.status(200).json({ code: this.constants.codes.SUCCESS, message: `Created new Motion with ID ${motion.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, }); }); - this.router.get('/motions', async (_req, res) => { + this.router.delete('/eo/:id', async (req, res) => { + if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + + await this.server.client.db.ExecutiveOrder.deleteOne({ oID: req.params.id }); + + res.status(200).send({ message: `Executive Order with ID ${req.params.id} deleted.` }); + }); + + this.router.delete('/motion/:id', async (req, res) => { + if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + + await this.server.client.db.Motion.deleteOne({ oID: req.params.id }); + + res.status(200).send({ message: `Motion with ID ${req.params.id} deleted.` }); + }); + + this.router.get('/eo/:id', async (req, res) => { + if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + + const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); + + res.status(200).send({ + issuedBy: executiveOrder.issuedBy, + id: executiveOrder.oID, + subject: executiveOrder.subject, + body: executiveOrder.body, + at: new Date(executiveOrder.at), + }); + }); + + this.router.get('/motion/:id', async (req, res) => { + if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + + const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); + + res.status(200).send({ + issuedBy: motion.issuedBy, + id: motion.oID, + subject: motion.subject, + body: motion.body, + at: new Date(motion.at), + }); + }); + + this.router.patch('/eo/:id', async (req, res) => { + if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + if (!req.body.subject && !req.body.body) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + + const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); + await executiveOrder.updateOne({ + subject: req.body.subject || executiveOrder.subject, + body: req.body.body || executiveOrder.body, + }); + + res.status(200).send({ message: `Updated Executive Order with ID ${executiveOrder.oID}.` }); + }); + + this.router.patch('/motion/:id', async (req, res) => { + if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + if (!req.body.subject && !req.body.body) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + + const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); + await motion.updateOne({ + subject: req.body.subject || motion.subject, + body: req.body.body || motion.body, + }); + + res.status(200).send({ message: `Updated Motion with ID ${motion.oID}.` }); + }); + + this.router.get('/motion', async (_req, res) => { const motions = await this.server.client.db.Motion.find().lean(); res.status(200).send({ @@ -133,7 +209,7 @@ export default class Root extends Route { }); }); - this.router.get('/resolutions', async (_req, res) => { + this.router.get('/resolution', async (_req, res) => { const resolutions = await this.server.client.db.Resolution.find().lean(); res.status(200).send({ @@ -141,7 +217,7 @@ export default class Root extends Route { }); }); - this.router.get('/executive-orders', async (_req, res) => { + this.router.get('/eo', async (_req, res) => { const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); res.status(200).send({ From e67de98edab6b5be045351890645c80b98cf41d2 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Mon, 22 Feb 2021 00:07:57 -0400 Subject: [PATCH 20/29] Fixes for authentication and support for resolutions --- src/api/board.ins/routes/root.ts | 365 ++++++++++++++++++++++++++++--- 1 file changed, 331 insertions(+), 34 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 49da1cb..5fcbbd6 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -125,31 +125,185 @@ export default class Root extends Route { }); }); + this.router.post('/resolution', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.body.subject || !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const resolutionID = genUUID(); + + const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + + const embed = new RichEmbed(); + embed.setTitle('Resolution'); + embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); + embed.setColor('#29be74'); + embed.addField('Subject', req.body.subject); + embed.addField('Body', req.body.body); + embed.setDescription(resolutionID); + embed.setTimestamp(new Date()); + + const resolution = await this.server.client.db.Resolution.create({ + issuedBy: director.userID, + subject: req.body.subject, + body: req.body.body, + at: new Date(), + oID: resolutionID, + processed: false, + }); + + res.status(200).json({ + code: this.constants.codes.SUCCESS, + message: `Created new Resolution with ID ${resolution.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + }); + }); + this.router.delete('/eo/:id', async (req, res) => { - if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); - if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } await this.server.client.db.ExecutiveOrder.deleteOne({ oID: req.params.id }); - res.status(200).send({ message: `Executive Order with ID ${req.params.id} deleted.` }); + res.status(200).json({ message: `Executive Order with ID ${req.params.id} deleted.` }); }); this.router.delete('/motion/:id', async (req, res) => { - if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); - if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Resolution.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } await this.server.client.db.Motion.deleteOne({ oID: req.params.id }); - res.status(200).send({ message: `Motion with ID ${req.params.id} deleted.` }); + res.status(200).json({ message: `Motion with ID ${req.params.id} deleted.` }); + }); + + this.router.delete('/resolution/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Resolution.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + await this.server.client.db.Resolution.deleteOne({ oID: req.params.id }); + + res.status(200).json({ message: `Resolution with ID ${req.params.id} deleted.` }); }); this.router.get('/eo/:id', async (req, res) => { - if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); - if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); - res.status(200).send({ + res.status(200).json({ issuedBy: executiveOrder.issuedBy, id: executiveOrder.oID, subject: executiveOrder.subject, @@ -159,12 +313,22 @@ export default class Root extends Route { }); this.router.get('/motion/:id', async (req, res) => { - if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); - if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); - res.status(200).send({ + res.status(200).json({ issuedBy: motion.issuedBy, id: motion.oID, subject: motion.subject, @@ -173,10 +337,69 @@ export default class Root extends Route { }); }); + this.router.get('/resolution/:id', async (req, res) => { + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Resolution.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }); + + res.status(200).json({ + issuedBy: resolution.issuedBy, + id: resolution.oID, + subject: resolution.subject, + body: resolution.body, + at: new Date(resolution.at), + approvedAt: resolution.acceptedAt || null, + voteResults: resolution.voteResults || null, + }); + }); + this.router.patch('/eo/:id', async (req, res) => { - if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); - if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); - if (!req.body.subject && !req.body.body) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (!req.body.subject && !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); await executiveOrder.updateOne({ @@ -184,13 +407,45 @@ export default class Root extends Route { body: req.body.body || executiveOrder.body, }); - res.status(200).send({ message: `Updated Executive Order with ID ${executiveOrder.oID}.` }); + res.status(200).json({ message: `Updated Executive Order with ID ${executiveOrder.oID}.` }); }); this.router.patch('/motion/:id', async (req, res) => { - if (!req.params.id) return res.status(400).send(this.constants.messages.CLIENT_ERROR); - if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) return res.status(404).send(this.constants.messages.NOT_FOUND); - if (!req.body.subject && !req.body.body) return res.status(400).send(this.constants.messages.CLIENT_ERROR); + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (!req.body.subject && !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); await motion.updateOne({ @@ -198,31 +453,73 @@ export default class Root extends Route { body: req.body.body || motion.body, }); - res.status(200).send({ message: `Updated Motion with ID ${motion.oID}.` }); + res.status(200).json({ message: `Updated Motion with ID ${motion.oID}.` }); + }); + + this.router.patch('/resolution/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (!req.body.subject && !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }); + await resolution.updateOne({ + subject: req.body.subject || resolution.subject, + body: req.body.body || resolution.body, + }); + + res.status(200).json({ message: `Updated Resolution with ID ${resolution.oID}.` }); + }); + + + this.router.get('/eo', async (_req, res) => { + const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); + + + res.status(200).json({ executiveOrders }); }); this.router.get('/motion', async (_req, res) => { const motions = await this.server.client.db.Motion.find().lean(); - res.status(200).send({ - motions, - }); + res.status(200).json({ motions }); }); this.router.get('/resolution', async (_req, res) => { const resolutions = await this.server.client.db.Resolution.find().lean(); - res.status(200).send({ - resolutions, - }); - }); - - this.router.get('/eo', async (_req, res) => { - const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); - - res.status(200).send({ - executiveOrders, - }); + res.status(200).json({ resolutions }); }); } } From 64b4eeb0b836b185f02d338948257ea4ef6bfed3 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Tue, 23 Feb 2021 15:46:28 -0400 Subject: [PATCH 21/29] Update HTTP 401s to 403s to comply with RFC 7231 --- src/api/board.ins/routes/root.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 5fcbbd6..846e716 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -23,7 +23,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); @@ -77,7 +77,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); @@ -137,7 +137,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); @@ -191,7 +191,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); @@ -203,6 +203,7 @@ export default class Root extends Route { message: this.constants.messages.CLIENT_ERROR, }); } + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) { return res.status(404).json({ code: this.constants.codes.NOT_FOUND, @@ -227,7 +228,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); @@ -263,7 +264,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); @@ -376,7 +377,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); @@ -422,7 +423,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); @@ -468,7 +469,7 @@ export default class Root extends Route { const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(401).json({ + return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, }); From a116404ef592664c340fe5fb1455f7fadb8309d6 Mon Sep 17 00:00:00 2001 From: Sterben Date: Sun, 28 Feb 2021 00:06:13 -0600 Subject: [PATCH 22/29] all endpoints updated & added --- .eslintrc.json | 3 +- src/api/board.ins/routes/root.ts | 574 +++++++++++++++++++++++++++++-- src/class/Client.ts | 3 +- 3 files changed, 556 insertions(+), 24 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 8e5b667..7cfeb4b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -39,7 +39,8 @@ "no-param-reassign": "off", "no-underscore-dangle": "off", "keyword-spacing": "off", - "no-multiple-empty-lines": "off" + "no-multiple-empty-lines": "off", + "consistent-return": "off" }, "ignorePatterns": "**/*.js" } diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 67a4241..2594fe0 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -1,5 +1,6 @@ import { TextChannel } from 'eris'; import { v4 as genUUID } from 'uuid'; +import { Request, Response } from 'express'; import { RichEmbed, Route, Server } from '../../../class'; export default class Root extends Route { @@ -11,7 +12,7 @@ export default class Root extends Route { } public bind() { - this.router.post('/executive-orders', async (req, res) => { + this.router.post('/eo', async (req: Request, res: Response) => { if (!req.body.pin) { return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, @@ -66,13 +67,13 @@ export default class Root extends Route { const channel = this.server.client.getChannel('807444198969835550'); await channel.createMessage({ embed }); - return res.status(200).json({ + res.status(200).json({ code: this.constants.codes.SUCCESS, message: `Created new Executive Order with ID ${executiveOrder.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, }); }); - this.router.post('/motions', async (req, res) => { + this.router.post('/motion', async (req: Request, res: Response) => { if (!req.body.pin) { return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, @@ -133,29 +134,560 @@ export default class Root extends Route { processed: false, }); - return res.status(200).json({ + res.status(200).json({ code: this.constants.codes.SUCCESS, message: `Created new Motion with ID ${motion.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, }); }); - this.router.get('/motions', async (_req, res) => { + this.router.post('/proc', async (req: Request, res: Response) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.body.subject) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + if (!req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const proclamationID = genUUID(); + + const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + + const embed = new RichEmbed(); + embed.setTitle('Proclamation'); + embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); + embed.setColor('#66e1ff'); + embed.addField('Subject', req.body.subject); + embed.addField('Body', req.body.body); + embed.addField('ID', proclamationID); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + const motionMessage = await channel.createMessage({ embed }); + await motionMessage.addReaction(this.server.client.util.emojis.SUCCESS); + await motionMessage.addReaction(this.server.client.util.emojis.ERROR); + + const motion = await this.server.client.db.Proclamation.create({ + issuedBy: director.userID, + subject: req.body.subject, + body: req.body.body, + at: new Date(), + oID: proclamationID, + processed: false, + }); + + res.status(200).json({ + code: this.constants.codes.SUCCESS, + message: `Created new Proclamation with ID ${motion.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + }); + }); + + this.router.post('/resolution', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.body.subject || !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const resolutionID = genUUID(); + + const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + + const embed = new RichEmbed(); + embed.setTitle('Resolution'); + embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); + embed.setColor('#29be74'); + embed.addField('Subject', req.body.subject); + embed.addField('Body', req.body.body); + embed.setDescription(resolutionID); + embed.setTimestamp(new Date()); + + const resolution = await this.server.client.db.Resolution.create({ + issuedBy: director.userID, + subject: req.body.subject, + body: req.body.body, + at: new Date(), + oID: resolutionID, + processed: false, + }); + + res.status(200).json({ + code: this.constants.codes.SUCCESS, + message: `Created new Resolution with ID ${resolution.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + }); + }); + + this.router.delete('/eo/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + await this.server.client.db.ExecutiveOrder.deleteOne({ oID: req.params.id }); + + res.status(200).json({ message: `Executive Order with ID ${req.params.id} deleted.` }); + }); + + this.router.delete('/motion/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Resolution.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + await this.server.client.db.Motion.deleteOne({ oID: req.params.id }); + + res.status(200).json({ message: `Motion with ID ${req.params.id} deleted.` }); + }); + + this.router.delete('/resolution/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Resolution.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + await this.server.client.db.Resolution.deleteOne({ oID: req.params.id }); + + res.status(200).json({ message: `Resolution with ID ${req.params.id} deleted.` }); + }); + + this.router.delete('/proc/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Proclamation.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + await this.server.client.db.Proclamation.deleteOne({ oID: req.params.id }); + + res.status(200).json({ message: `Proclamation with ID ${req.params.id} deleted.` }); + }); + + this.router.get('/eo/:id', async (req, res) => { + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); + + res.status(200).json({ + issuedBy: executiveOrder.issuedBy, + id: executiveOrder.oID, + subject: executiveOrder.subject, + body: executiveOrder.body, + at: new Date(executiveOrder.at), + }); + }); + + this.router.get('/motion/:id', async (req, res) => { + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); + + res.status(200).json({ + issuedBy: motion.issuedBy, + id: motion.oID, + subject: motion.subject, + body: motion.body, + at: new Date(motion.at), + }); + }); + + this.router.get('/resolution/:id', async (req, res) => { + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Resolution.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }); + + res.status(200).json({ + issuedBy: resolution.issuedBy, + id: resolution.oID, + subject: resolution.subject, + body: resolution.body, + at: new Date(resolution.at), + approvedAt: resolution.acceptedAt || null, + voteResults: resolution.voteResults || null, + }); + }); + + this.router.get('/proc/:id', async (req: Request, res: Response) => { + const proclamation = await this.server.client.db.Proclamation.findOne({ oID: req.params.id }).lean(); + + res.status(200).send({ + proclamation, + }); + }); + + this.router.patch('/proc/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Proclamation.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (!req.body.subject && !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const proclamation = await this.server.client.db.Proclamation.findOne({ oID: req.params.id }); + await proclamation.updateOne({ + subject: req.body.subject || proclamation.subject, + body: req.body.body || proclamation.body, + }); + + res.status(200).json({ message: `Updated Proclamation with ID ${proclamation.oID}.` }); + }); + + this.router.patch('/eo/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.ExecutiveOrder.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (!req.body.subject && !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); + await executiveOrder.updateOne({ + subject: req.body.subject || executiveOrder.subject, + body: req.body.body || executiveOrder.body, + }); + + res.status(200).json({ message: `Updated Executive Order with ID ${executiveOrder.oID}.` }); + }); + + this.router.patch('/motion/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (!req.body.subject && !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); + await motion.updateOne({ + subject: req.body.subject || motion.subject, + body: req.body.body || motion.body, + }); + + res.status(200).json({ message: `Updated Motion with ID ${motion.oID}.` }); + }); + + this.router.patch('/resolution/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + + if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (!req.body.subject && !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }); + await resolution.updateOne({ + subject: req.body.subject || resolution.subject, + body: req.body.body || resolution.body, + }); + + res.status(200).json({ message: `Updated Resolution with ID ${resolution.oID}.` }); + }); + + this.router.get('/eo', async (_req, res) => { + const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); + + + res.status(200).json({ executiveOrders }); + }); + + this.router.get('/motion', async (_req, res) => { const motions = await this.server.client.db.Motion.find().lean(); - res.status(200).send({ - motions, - }); + res.status(200).json({ motions }); }); - this.router.get('/resolutions', async (_req, res) => { - const resolutions = await this.server.client.db.Resolution.find().lean(); - - res.status(200).send({ - resolutions, - }); - }); - - this.router.get('/proclamations', async (_req, res) => { + this.router.get('/proc', async (req: Request, res: Response) => { const proclamations = await this.server.client.db.Proclamation.find().lean(); res.status(200).send({ @@ -163,12 +695,10 @@ export default class Root extends Route { }); }); - this.router.get('/executive-orders', async (_req, res) => { - const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); + this.router.get('/resolution', async (_req, res) => { + const resolutions = await this.server.client.db.Resolution.find().lean(); - res.status(200).send({ - executiveOrders, - }); + res.status(200).json({ resolutions }); }); } } diff --git a/src/class/Client.ts b/src/class/Client.ts index 48a5562..c2d042a 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -59,6 +59,7 @@ export default class Client extends eris.Client { NNTrainingData: mongoose.Model, Note: mongoose.Model, PagerNumber: mongoose.Model, + Proclamation: mongoose.Model, Promo: mongoose.Model, Rank: mongoose.Model, Redirect: mongoose.Model, @@ -76,7 +77,7 @@ export default class Client extends eris.Client { this.events = new Collection(); this.intervals = new Collection(); this.queue = new Queue(this); - this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, Motion, NNTrainingData, Note, PagerNumber, Promo, Rank, Redirect, Resolution, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; + this.db = { Customer, CustomerPortal, ExecutiveOrder, File, Member, Merchant, Moderation, Motion, NNTrainingData, Note, PagerNumber, Proclamation, Promo, Rank, Redirect, Resolution, Score, ScoreHistorical, Staff, Stat, local: { muted: new LocalStorage('muted') } }; } public async loadDatabase() { From 10b10ec9c93b2d76631ac99f5882f83749036c18 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Mon, 1 Mar 2021 17:35:36 -0400 Subject: [PATCH 23/29] Proclamation recording --- src/api/board.ins/routes/root.ts | 32 ++++++++-------- src/events/guildMemberAdd.ts | 2 +- src/events/messageReactionAdd.ts | 57 +++++++++++++++++++++++++++ src/intervals/motions.ts | 66 -------------------------------- src/models/ExecutiveOrder.ts | 4 +- src/models/Motion.ts | 13 +++---- src/models/Proclamation.ts | 20 +++++++--- src/models/Resolution.ts | 8 ++-- 8 files changed, 99 insertions(+), 103 deletions(-) create mode 100644 src/events/messageReactionAdd.ts delete mode 100644 src/intervals/motions.ts diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index d53b99e..959f587 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -38,7 +38,7 @@ export default class Root extends Route { } const executiveOrder = await this.server.client.db.ExecutiveOrder.create({ - issuedBy: director.userID, + issuer: director.userID, subject: req.body.subject, body: req.body.body, at: new Date(), @@ -106,17 +106,14 @@ export default class Root extends Route { embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); - const motionMessage = await channel.createMessage({ embed }); - await motionMessage.addReaction(this.server.client.util.emojis.SUCCESS); - await motionMessage.addReaction(this.server.client.util.emojis.ERROR); + await channel.createMessage({ embed }); const motion = await this.server.client.db.Motion.create({ - issuedBy: director.userID, + issuer: director.userID, subject: req.body.subject, body: req.body.body, at: new Date(), oID: motionID, - motionMessage: motionMessage.id, processed: false, }); @@ -173,22 +170,23 @@ export default class Root extends Route { embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); - const motionMessage = await channel.createMessage({ embed }); - await motionMessage.addReaction(this.server.client.util.emojis.SUCCESS); - await motionMessage.addReaction(this.server.client.util.emojis.ERROR); + const procMessage = await channel.createMessage({ embed }); + await procMessage.addReaction(this.server.client.util.emojis.SUCCESS); + await procMessage.addReaction(this.server.client.util.emojis.ERROR); - const motion = await this.server.client.db.Proclamation.create({ - issuedBy: director.userID, + const proc = await this.server.client.db.Proclamation.create({ + issuer: director.userID, subject: req.body.subject, body: req.body.body, at: new Date(), oID: proclamationID, processed: false, + msg: procMessage.id, }); res.status(200).json({ code: this.constants.codes.SUCCESS, - message: `Created new Proclamation with ID ${motion.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + message: `Created new Proclamation with ID ${proc.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, }); }); @@ -232,7 +230,7 @@ export default class Root extends Route { embed.setTimestamp(new Date()); const resolution = await this.server.client.db.Resolution.create({ - issuedBy: director.userID, + issuer: director.userID, subject: req.body.subject, body: req.body.body, at: new Date(), @@ -408,7 +406,7 @@ export default class Root extends Route { const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); res.status(200).json({ - issuedBy: executiveOrder.issuedBy, + issuer: executiveOrder.issuer, id: executiveOrder.oID, subject: executiveOrder.subject, body: executiveOrder.body, @@ -433,7 +431,7 @@ export default class Root extends Route { const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); res.status(200).json({ - issuedBy: motion.issuedBy, + issuer: motion.issuer, id: motion.oID, subject: motion.subject, body: motion.body, @@ -458,13 +456,13 @@ export default class Root extends Route { const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }); res.status(200).json({ - issuedBy: resolution.issuedBy, + issuer: resolution.issuer, id: resolution.oID, subject: resolution.subject, body: resolution.body, at: new Date(resolution.at), approvedAt: resolution.acceptedAt || null, - voteResults: resolution.voteResults || null, + results: resolution.results || null, }); }); diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 0d750f0..8dbf502 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -13,7 +13,7 @@ export default class GuildMemberAdd extends Event { try { const search = await this.client.db.local.muted.get(`muted-${member.user.id}`); if (search) { - member.addRole('478373942638149643'); + await member.addRole('478373942638149643'); } } catch (err) { this.client.util.handleError(err); diff --git a/src/events/messageReactionAdd.ts b/src/events/messageReactionAdd.ts new file mode 100644 index 0000000..c00fcbf --- /dev/null +++ b/src/events/messageReactionAdd.ts @@ -0,0 +1,57 @@ +import { Emoji, GuildTextableChannel, Member, Message } from 'eris'; +import { Client, Event } from '../class'; + +export default class MessageReactionAdd extends Event { + public client: Client; + + constructor(client: Client) { + super(client); + this.event = 'messageReactionAdd'; + } + + public async run(message: Message, emoji: Emoji, reactor: Member) { + if (message.channel.id !== '807444198969835550') return; + if (message.author.id !== this.client.user.id) return; + + if (!reactor.roles[0]) { + reactor = await message.channel.guild.getRESTMember(reactor.id); + } + + if (!reactor.roles.includes('662163685439045632')) return; + + if ((await this.client.db.Proclamation.exists({ msg: message.id, processed: false }))) { + const yea = await message.getReaction(this.client.util.emojis.SUCCESS); + const nay = await message.getReaction(this.client.util.emojis.ERROR); + const present = await message.getReaction('🙋'); + const totalDirectors = 6; + const proc = await this.client.db.Proclamation.findOne({ msg: message.id }); + const processed = totalDirectors === (yea.length + nay.length + present.length) || Date.now() - proc.at > 604800000; + const absent = totalDirectors - (yea.length + nay.length + present.length); + + await this.client.db.Proclamation.updateOne({ msg: message.id }, { + results: { + yea: yea.length, + nay: nay.length, + present: present.length, + absent, + }, + processed, + }); + const inTheMajority = yea.length > nay.length + present.length; + + if (processed) { + const author = this.client.users.get(proc.issuer) || await this.client.getRESTUser(proc.issuer); + + if (inTheMajority) { + await author.createMessage(`__**Proclamation Majority Vote Received**__\nThe Proclamation you created at Library of Code sp-us, titled **${proc.subject}** (\`${proc.oID}\`) received the majority vote.`); + await message.channel.createMessage(`__**Proclamation Results**__\nProclamation issued by ${author.mention} **received** the majority vote. Proclamation ID: ${proc.oID}\n\n__Results:__\n**Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present.length}\n**Absent:** ${absent}`); + } else { + await author.createMessage(`__**Proclamation Majority Vote Lost**__\nThe Proclamation you created at Library of Code sp-us, titled **${proc.subject}** (\`${proc.oID}\`) lost the majority vote.`); + await message.channel.createMessage(`__**Proclamation Results**__\nProclamation issued by ${author.mention} **lost** the majority vote. Proclamation ID: ${proc.oID}\n\n__Results:__\n**Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present.length}\n**Absent:** ${absent}`); + } + } + + await reactor.user.createMessage(`__**Vote Recorded**\nYour vote on the proclamation with ID \`${proc.id}\` at Library of Code sp-us was successfully recorded.`); + } + } +} diff --git a/src/intervals/motions.ts b/src/intervals/motions.ts deleted file mode 100644 index 4c9d74a..0000000 --- a/src/intervals/motions.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint-disable no-await-in-loop */ -import type { TextChannel } from 'eris'; -import { Client, RichEmbed } from '../class'; - -export default (client: Client) => { - const interval = setInterval(async () => { - const motions = await client.db.Motion.find({ processed: false }); - const directorLogs = client.getChannel('807444198969835550'); - - for (const motion of motions) { - const motionMessage = await directorLogs.getMessage(motion.motionMessage); - - if ((Date.now() - motionMessage.createdAt) > 86400) { - const yea = await motionMessage.getReaction(client.util.emojis.SUCCESS); - const nay = await motionMessage.getReaction(client.util.emojis.ERROR); - const present = yea.length + nay.length; - const totalDirectors = 5; - const absent = totalDirectors - present; - - await client.db.Motion.updateOne({ oID: motion.oID }, { - processed: true, - voteResults: { - yea: yea.length, - nay: nay.length, - present, - absent, - }, - }); - await client.db.Resolution.create({ - issuedBy: motion.issuedBy, - subject: motion.subject, - body: motion.body, - at: motion.at, - oID: motion.oID, - voteResults: { - yea: yea.length, - Nay: nay.length, - present, - absent, - }, - acceptedAt: Date.now(), - }); - - const directorDiscord = client.users.get(motion.issuedBy); - const directorProfile = await client.db.Staff.findOne({ userID: motion.issuedBy }); - - const embed = new RichEmbed(); - embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorProfile.pn.join(', ')}`, directorDiscord.avatarURL); - embed.setTitle('Resolution'); - embed.setFooter(`${directorProfile.title} | Library of Code sp-us | Board of Directors`, 'https://static.libraryofcode.org/loccommunityadmin.png'); - let colour; - if (yea.length > nay.length) colour = '#27b17a'; - else if (yea.length === nay.length) colour = '#ffb34d'; - else colour = '#ff474a'; - embed.setColor(colour); - embed.setDescription(motion.oID); - embed.addField('Result', `- **Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present}\n**Absent:** ${absent}\n**Total:** ${present + absent}`); - embed.setTimestamp(); - - await directorLogs.createMessage({ content: directorDiscord.mention, embed }); - } - } - }, 300000); - - return interval; -}; diff --git a/src/models/ExecutiveOrder.ts b/src/models/ExecutiveOrder.ts index be4127a..c4c7bca 100644 --- a/src/models/ExecutiveOrder.ts +++ b/src/models/ExecutiveOrder.ts @@ -1,7 +1,7 @@ import { Document, model, Schema } from 'mongoose'; export interface ExecutiveOrderInterface extends Document { - issuedBy: string; + issuer: string; subject: string; body: string; at: Date; @@ -9,7 +9,7 @@ export interface ExecutiveOrderInterface extends Document { } const ExecutiveOrder = new Schema({ - issuedBy: { type: String, required: true }, + issuer: { type: String, required: true }, subject: { type: String, required: true }, body: { type: String, required: true }, at: { type: Date, required: true }, diff --git a/src/models/Motion.ts b/src/models/Motion.ts index d2f9711..d75c6d8 100644 --- a/src/models/Motion.ts +++ b/src/models/Motion.ts @@ -1,33 +1,32 @@ import { Document, model, Schema } from 'mongoose'; export interface MotionInterface extends Document { - issuedBy: string; + issuer: string; subject: string; body: string; at: Date; oID: string; - voteResults: { + results: { yea: number; nay: number; present: number; absent: number; }; - motionMessage: string; + processed: boolean; } const Motion = new Schema({ - issuedBy: { type: String, required: true }, + issuer: { type: String, required: true }, subject: { type: String, required: true }, body: { type: String, required: true }, at: { type: Date, required: true }, oID: { type: String, required: true, unique: true }, - voteResults: { + results: { yea: Number, - Nay: Number, + nay: Number, present: Number, absent: Number, }, - motionMessage: { type: String, required: true, unique: true }, processed: Boolean, }); diff --git a/src/models/Proclamation.ts b/src/models/Proclamation.ts index df3cc6b..e681da9 100644 --- a/src/models/Proclamation.ts +++ b/src/models/Proclamation.ts @@ -1,29 +1,37 @@ import { Document, model, Schema } from 'mongoose'; export interface ProclamationInterface extends Document { - issuedBy: string; + issuer: string; subject: string; body: string; - at: Date; + at: number; oID: string; - voteResults: { + results: { yea: number; nay: number; + present: number; + absent: number; }; acceptedAt: number; + msg: string; + processed: boolean; } const Proclamation = new Schema({ - issuedBy: { type: String, required: true }, + issuer: { type: String, required: true }, subject: { type: String, required: true }, body: { type: String, required: true }, - at: { type: Date, required: true }, + at: { type: Number, required: true }, oID: { type: String, required: true, unique: true }, - voteResults: { + results: { yea: Number, nay: Number, + present: Number, + absent: Number, }, acceptedAt: Number, + msg: { type: String, required: true, unique: true }, + processed: Boolean, }); export default model('Proclamations', Proclamation); diff --git a/src/models/Resolution.ts b/src/models/Resolution.ts index 45b3245..2f32c46 100644 --- a/src/models/Resolution.ts +++ b/src/models/Resolution.ts @@ -1,12 +1,12 @@ import { Document, model, Schema } from 'mongoose'; export interface ResolutionInterface extends Document { - issuedBy: string; + issuer: string; subject: string; body: string; at: Date; oID: string; - voteResults: { + results: { yea: number; nay: number; present: number; @@ -16,12 +16,12 @@ export interface ResolutionInterface extends Document { } const Resolution = new Schema({ - issuedBy: { type: String, required: true }, + issuer: { type: String, required: true }, subject: { type: String, required: true }, body: { type: String, required: true }, at: { type: Date, required: true }, oID: { type: String, required: true, unique: true }, - voteResults: { + results: { yea: Number, Nay: Number, present: Number, From 152a4c3c3b7bac881f60a4b17221932fc50af3d4 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Mon, 1 Mar 2021 17:39:45 -0400 Subject: [PATCH 24/29] Fixes --- src/api/board.ins/routes/root.ts | 1 + src/events/index.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 959f587..53bb3cb 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -173,6 +173,7 @@ export default class Root extends Route { const procMessage = await channel.createMessage({ embed }); await procMessage.addReaction(this.server.client.util.emojis.SUCCESS); await procMessage.addReaction(this.server.client.util.emojis.ERROR); + await procMessage.getReaction('🙋'); const proc = await this.server.client.db.Proclamation.create({ issuer: director.userID, diff --git a/src/events/index.ts b/src/events/index.ts index 277d16c..2c644b2 100644 --- a/src/events/index.ts +++ b/src/events/index.ts @@ -1,5 +1,6 @@ export { default as CallBackHandler } from './CallBackHandler'; export { default as CommandHandler } from './CommandHandler'; export { default as guildMemberAdd } from './guildMemberAdd'; +export { default as messageReactionAdd } from './messageReactionAdd'; export { default as ready } from './ready'; export { default as Training } from './Training'; From 4530b1b3ec3a7ec4cdbc21d58f2318e8b5da2cf4 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Thu, 4 Mar 2021 21:19:17 -0400 Subject: [PATCH 25/29] stuff --- src/api/board.ins/routes/root.ts | 311 ++++++++++++++++++------------- src/models/ExecutiveOrder.ts | 2 + src/models/Motion.ts | 2 + src/models/Resolution.ts | 2 + 4 files changed, 189 insertions(+), 128 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 53bb3cb..95e8366 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -37,32 +37,35 @@ export default class Root extends Route { }); } + const eoID = genUUID(); + + const directorDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + const directorInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + + const embed = new RichEmbed(); + embed.setTitle('Executive Order'); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setColor('#dd3acd'); + embed.addField('Subject', req.body.subject); + embed.addField('Body', req.body.body); + embed.setDescription(eoID); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + const msg = await channel.createMessage({ embed }); + const executiveOrder = await this.server.client.db.ExecutiveOrder.create({ issuer: director.userID, subject: req.body.subject, body: req.body.body, at: new Date(), - oID: genUUID(), + oID: eoID, + msg: msg.id, }); - const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); - const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); - - const embed = new RichEmbed(); - embed.setTitle('Executive Order'); - embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); - embed.setColor('#dd3acd'); - embed.addField('Subject', req.body.subject); - embed.addField('Body', req.body.body); - embed.setDescription(executiveOrder.oID); - embed.setTimestamp(new Date()); - - const channel = this.server.client.getChannel('807444198969835550'); - await channel.createMessage({ embed }); - res.status(200).json({ code: this.constants.codes.SUCCESS, - message: `Created new Executive Order with ID ${executiveOrder.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + message: `Created new Executive Order with ID ${executiveOrder.oID} by ${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}.`, }); }); @@ -93,12 +96,12 @@ export default class Root extends Route { const motionID = genUUID(); - const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); - const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + const directorDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + const directorInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); const embed = new RichEmbed(); embed.setTitle('Motion'); - embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}`, directorDiscord.avatarURL); embed.setColor('#66e1ff'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); @@ -106,7 +109,7 @@ export default class Root extends Route { embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); - await channel.createMessage({ embed }); + const msg = await channel.createMessage({ embed }); const motion = await this.server.client.db.Motion.create({ issuer: director.userID, @@ -115,11 +118,12 @@ export default class Root extends Route { at: new Date(), oID: motionID, processed: false, + msg: msg.id, }); res.status(200).json({ code: this.constants.codes.SUCCESS, - message: `Created new Motion with ID ${motion.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + message: `Created new Motion with ID ${motion.oID} by ${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}.`, }); }); @@ -157,12 +161,12 @@ export default class Root extends Route { const proclamationID = genUUID(); - const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); - const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + const directorDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); + const directorInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); const embed = new RichEmbed(); embed.setTitle('Proclamation'); - embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}`, directorDiscord.avatarURL); embed.setColor('#66e1ff'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); @@ -187,7 +191,7 @@ export default class Root extends Route { res.status(200).json({ code: this.constants.codes.SUCCESS, - message: `Created new Proclamation with ID ${proc.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + message: `Created new Proclamation with ID ${proc.oID} by ${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}.`, }); }); @@ -201,8 +205,9 @@ export default class Root extends Route { const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const directorDiscord = staffGuild.members.get(director.userID); - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, @@ -218,18 +223,20 @@ export default class Root extends Route { const resolutionID = genUUID(); - const staffDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); - const staffInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); + const directorInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); const embed = new RichEmbed(); embed.setTitle('Resolution'); - embed.setAuthor(`${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}`, staffDiscord.avatarURL); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}`, directorDiscord.avatarURL); embed.setColor('#29be74'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); embed.setDescription(resolutionID); embed.setTimestamp(new Date()); + const channel = this.server.client.getChannel('807444198969835550'); + const msg = await channel.createMessage({ embed }); + const resolution = await this.server.client.db.Resolution.create({ issuer: director.userID, subject: req.body.subject, @@ -237,11 +244,12 @@ export default class Root extends Route { at: new Date(), oID: resolutionID, processed: false, + msg: msg.id, }); res.status(200).json({ code: this.constants.codes.SUCCESS, - message: `Created new Resolution with ID ${resolution.oID} by ${staffDiscord.username}#${staffDiscord.discriminator}, ${staffInformation.pn.join(', ')}.`, + message: `Created new Resolution with ID ${resolution.oID} by ${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}.`, }); }); @@ -485,8 +493,9 @@ export default class Root extends Route { const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const directorDiscord = staffGuild.members.get(director.userID); - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, @@ -518,6 +527,23 @@ export default class Root extends Route { body: req.body.body || proclamation.body, }); + if (proclamation.subject !== req.body.subject || proclamation.body !== req.body.body) { + const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); + + const embed = new RichEmbed(); + embed.setTitle('Proclamation'); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setColor('#66e1ff'); + embed.addField('Subject', req.body.subject || proclamation.subject); + embed.addField('Body', req.body.body || proclamation.body); + embed.setDescription(req.params.id); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + const procMessage = await channel.getMessage(proclamation.msg); + await procMessage.edit({ embed }); + } + res.status(200).json({ message: `Updated Proclamation with ID ${proclamation.oID}.` }); }); @@ -531,8 +557,9 @@ export default class Root extends Route { const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const directorDiscord = staffGuild.members.get(director.userID); - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, @@ -564,6 +591,23 @@ export default class Root extends Route { body: req.body.body || executiveOrder.body, }); + if (executiveOrder.subject !== req.body.subject || executiveOrder.body !== req.body.body) { + const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); + + const embed = new RichEmbed(); + embed.setTitle('Executive Order'); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setColor('#66e1ff'); + embed.addField('Subject', req.body.subject || executiveOrder.subject); + embed.addField('Body', req.body.body || executiveOrder.body); + embed.setDescription(req.params.id); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + const eoMessage = await channel.getMessage(executiveOrder.msg); + await eoMessage.edit({ embed }); + } + res.status(200).json({ message: `Updated Executive Order with ID ${executiveOrder.oID}.` }); }); @@ -577,8 +621,9 @@ export default class Root extends Route { const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const directorDiscord = staffGuild.members.get(director.userID); - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, @@ -610,6 +655,23 @@ export default class Root extends Route { body: req.body.body || motion.body, }); + if (motion.subject !== req.body.subject || motion.body !== req.body.body) { + const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); + + const embed = new RichEmbed(); + embed.setTitle('Motion'); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setColor('#66e1ff'); + embed.addField('Subject', req.body.subject || motion.subject); + embed.addField('Body', req.body.body || motion.body); + embed.setDescription(req.params.id); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + const motionMessage = await channel.getMessage(motion.msg); + await motionMessage.edit({ embed }); + } + res.status(200).json({ message: `Updated Motion with ID ${motion.oID}.` }); }); @@ -623,8 +685,9 @@ export default class Root extends Route { const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const directorDiscord = staffGuild.members.get(director.userID); - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { + if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { return res.status(403).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED, @@ -656,6 +719,23 @@ export default class Root extends Route { body: req.body.body || resolution.body, }); + if (resolution.subject !== req.body.subject || resolution.body !== req.body.body) { + const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); + + const embed = new RichEmbed(); + embed.setTitle('Executive Order'); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setColor('#66e1ff'); + embed.addField('Subject', req.body.subject || resolution.subject); + embed.addField('Body', req.body.body || resolution.body); + embed.setDescription(req.params.id); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + const resMessage = await channel.getMessage(resolution.msg); + await resMessage.edit({ embed }); + } + res.status(200).json({ message: `Updated Resolution with ID ${resolution.oID}.` }); }); @@ -678,99 +758,6 @@ export default class Root extends Route { res.status(200).send({ proclamations }); }); - this.router.patch('/motion/:id', async (req, res) => { - if (!req.body.pin) { - return res.status(401).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); - - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(403).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - if (!req.params.id) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { - return res.status(404).json({ - code: this.constants.codes.NOT_FOUND, - message: this.constants.messages.NOT_FOUND, - }); - } - if (!req.body.subject && !req.body.body) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); - await motion.updateOne({ - subject: req.body.subject || motion.subject, - body: req.body.body || motion.body, - }); - - res.status(200).json({ message: `Updated Motion with ID ${motion.oID}.` }); - }); - - this.router.patch('/resolution/:id', async (req, res) => { - if (!req.body.pin) { - return res.status(401).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); - - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(403).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - if (!req.params.id) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { - return res.status(404).json({ - code: this.constants.codes.NOT_FOUND, - message: this.constants.messages.NOT_FOUND, - }); - } - if (!req.body.subject && !req.body.body) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }); - await resolution.updateOne({ - subject: req.body.subject || resolution.subject, - body: req.body.body || resolution.body, - }); - - res.status(200).json({ message: `Updated Resolution with ID ${resolution.oID}.` }); - }); - - this.router.get('/eo', async (_req, res) => { const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); @@ -795,5 +782,73 @@ export default class Root extends Route { res.status(200).json({ resolutions }); }); + + this.router.patch('/motion/confirm', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const directorDiscord = staffGuild.members.get(director.userID); + + if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id, processed: false }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (Number.isNaN(Number(req.body.yea)) || Number.isNaN(Number(req.body.nay)) || Number.isNaN(Number(req.body.present)) || Number.isNaN(Number(req.body.absent))) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); + await motion.updateOne({ + processed: true, + results: { + yea: Number(req.body.yea), + nay: Number(req.body.nay), + present: Number(req.body.present), + absent: Number(req.body.absent), + }, + }); + + const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); + + const channel = this.server.client.getChannel('807444198969835550'); + + const embed = new RichEmbed(); + embed.setTitle('Motion Confirmed'); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setColor('#27b17a'); + embed.addField('Subject', req.body.subject); + embed.addField('Body', req.body.body); + embed.setDescription(motion.oID); + embed.setFooter(motion.oID, directorDiscord.avatarURL); + embed.setTimestamp(new Date()); + + await channel.createMessage({ embed }); + + res.status(200).json({ message: `Confirmed results of motion with ID ${motion.oID}.` }); + }); } } diff --git a/src/models/ExecutiveOrder.ts b/src/models/ExecutiveOrder.ts index c4c7bca..12b8008 100644 --- a/src/models/ExecutiveOrder.ts +++ b/src/models/ExecutiveOrder.ts @@ -6,6 +6,7 @@ export interface ExecutiveOrderInterface extends Document { body: string; at: Date; oID: string; + msg: string; } const ExecutiveOrder = new Schema({ @@ -14,6 +15,7 @@ const ExecutiveOrder = new Schema({ body: { type: String, required: true }, at: { type: Date, required: true }, oID: { type: String, required: true, unique: true }, + msg: { type: String, required: true, unique: true }, }); export default model('ExecutiveOrders', ExecutiveOrder); diff --git a/src/models/Motion.ts b/src/models/Motion.ts index d75c6d8..65438bd 100644 --- a/src/models/Motion.ts +++ b/src/models/Motion.ts @@ -13,6 +13,7 @@ export interface MotionInterface extends Document { absent: number; }; processed: boolean; + msg: string; } const Motion = new Schema({ @@ -28,6 +29,7 @@ const Motion = new Schema({ absent: Number, }, processed: Boolean, + msg: { required: true, unique: true, type: String }, }); export default model('Motions', Motion); diff --git a/src/models/Resolution.ts b/src/models/Resolution.ts index 2f32c46..302c617 100644 --- a/src/models/Resolution.ts +++ b/src/models/Resolution.ts @@ -13,6 +13,7 @@ export interface ResolutionInterface extends Document { absent: number; }; acceptedAt: number; + msg: string; } const Resolution = new Schema({ @@ -28,6 +29,7 @@ const Resolution = new Schema({ absent: Number, }, acceptedAt: Number, + msg: { required: true, unique: true, type: String }, }); export default model('Resolutions', Resolution); From 178c1b7b7db92901be19584abc34160503c417f7 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Thu, 4 Mar 2021 23:40:39 -0400 Subject: [PATCH 26/29] Bug fixes and typo fixes --- src/api/board.ins/routes/root.ts | 400 +++++++++++++------------------ src/events/messageReactionAdd.ts | 16 +- 2 files changed, 177 insertions(+), 239 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 95e8366..ee29a43 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -21,7 +21,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { return res.status(403).json({ @@ -78,7 +78,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { return res.status(403).json({ @@ -136,7 +136,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { return res.status(401).json({ @@ -179,7 +179,7 @@ export default class Root extends Route { await procMessage.addReaction(this.server.client.util.emojis.ERROR); await procMessage.getReaction('🙋'); - const proc = await this.server.client.db.Proclamation.create({ + const proclamation = await this.server.client.db.Proclamation.create({ issuer: director.userID, subject: req.body.subject, body: req.body.body, @@ -191,65 +191,7 @@ export default class Root extends Route { res.status(200).json({ code: this.constants.codes.SUCCESS, - message: `Created new Proclamation with ID ${proc.oID} by ${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}.`, - }); - }); - - this.router.post('/resolution', async (req, res) => { - if (!req.body.pin) { - return res.status(401).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); - const directorDiscord = staffGuild.members.get(director.userID); - - if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { - return res.status(403).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - if (!req.body.subject || !req.body.body) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - const resolutionID = genUUID(); - - const directorInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); - - const embed = new RichEmbed(); - embed.setTitle('Resolution'); - embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}`, directorDiscord.avatarURL); - embed.setColor('#29be74'); - embed.addField('Subject', req.body.subject); - embed.addField('Body', req.body.body); - embed.setDescription(resolutionID); - embed.setTimestamp(new Date()); - - const channel = this.server.client.getChannel('807444198969835550'); - const msg = await channel.createMessage({ embed }); - - const resolution = await this.server.client.db.Resolution.create({ - issuer: director.userID, - subject: req.body.subject, - body: req.body.body, - at: new Date(), - oID: resolutionID, - processed: false, - msg: msg.id, - }); - - res.status(200).json({ - code: this.constants.codes.SUCCESS, - message: `Created new Resolution with ID ${resolution.oID} by ${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}.`, + message: `Created new Proclamation with ID ${proclamation.oID} by ${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}.`, }); }); @@ -262,7 +204,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { return res.status(403).json({ @@ -285,7 +227,16 @@ export default class Root extends Route { }); } - await this.server.client.db.ExecutiveOrder.deleteOne({ oID: req.params.id }); + const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); + + if (!['278620217221971968', executiveOrder.issuer].includes(director.userID)) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + await executiveOrder.delete(); res.status(200).json({ message: `Executive Order with ID ${req.params.id} deleted.` }); }); @@ -299,7 +250,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { return res.status(403).json({ @@ -314,54 +265,28 @@ export default class Root extends Route { message: this.constants.messages.CLIENT_ERROR, }); } - if (!(await this.server.client.db.Resolution.exists({ oID: req.params.id }))) { + + if (!(await this.server.client.db.Motion.exists({ oID: req.params.id }))) { return res.status(404).json({ code: this.constants.codes.NOT_FOUND, message: this.constants.messages.NOT_FOUND, }); } - await this.server.client.db.Motion.deleteOne({ oID: req.params.id }); + const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); + + if (!['278620217221971968', motion.issuer].includes(director.userID)) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + await motion.delete(); res.status(200).json({ message: `Motion with ID ${req.params.id} deleted.` }); }); - this.router.delete('/resolution/:id', async (req, res) => { - if (!req.body.pin) { - return res.status(401).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); - - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(403).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - if (!req.params.id) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - if (!(await this.server.client.db.Resolution.exists({ oID: req.params.id }))) { - return res.status(404).json({ - code: this.constants.codes.NOT_FOUND, - message: this.constants.messages.NOT_FOUND, - }); - } - - await this.server.client.db.Resolution.deleteOne({ oID: req.params.id }); - - res.status(200).json({ message: `Resolution with ID ${req.params.id} deleted.` }); - }); - this.router.delete('/proc/:id', async (req, res) => { if (!req.body.pin) { return res.status(401).json({ @@ -371,7 +296,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { return res.status(403).json({ @@ -393,7 +318,16 @@ export default class Root extends Route { }); } - await this.server.client.db.Proclamation.deleteOne({ oID: req.params.id }); + const proclamation = await this.server.client.db.Proclamation.findOne({ oID: req.params.id }); + + if (!['278620217221971968', proclamation.issuer].includes(director.userID)) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + await proclamation.delete(); res.status(200).json({ message: `Proclamation with ID ${req.params.id} deleted.` }); }); @@ -412,15 +346,9 @@ export default class Root extends Route { }); } - const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); + const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }).lean(); - res.status(200).json({ - issuer: executiveOrder.issuer, - id: executiveOrder.oID, - subject: executiveOrder.subject, - body: executiveOrder.body, - at: new Date(executiveOrder.at), - }); + res.status(200).json(executiveOrder); }); this.router.get('/motion/:id', async (req, res) => { @@ -437,15 +365,28 @@ export default class Root extends Route { }); } - const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); + const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }).lean(); - res.status(200).json({ - issuer: motion.issuer, - id: motion.oID, - subject: motion.subject, - body: motion.body, - at: new Date(motion.at), - }); + res.status(200).json(motion); + }); + + this.router.get('/proc/:id', async (req: Request, res: Response) => { + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Proclamation.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + + const proclamation = await this.server.client.db.Proclamation.findOne({ oID: req.params.id }).lean(); + + res.status(200).json(proclamation); }); this.router.get('/resolution/:id', async (req, res) => { @@ -462,89 +403,9 @@ export default class Root extends Route { }); } - const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }); + const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }).lean(); - res.status(200).json({ - issuer: resolution.issuer, - id: resolution.oID, - subject: resolution.subject, - body: resolution.body, - at: new Date(resolution.at), - approvedAt: resolution.acceptedAt || null, - results: resolution.results || null, - }); - }); - - this.router.get('/proc/:id', async (req: Request, res: Response) => { - const proclamation = await this.server.client.db.Proclamation.findOne({ oID: req.params.id }).lean(); - - res.status(200).send({ - proclamation, - }); - }); - - this.router.patch('/proc/:id', async (req, res) => { - if (!req.body.pin) { - return res.status(401).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); - const directorDiscord = staffGuild.members.get(director.userID); - - if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { - return res.status(403).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - if (!req.params.id) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - if (!(await this.server.client.db.Proclamation.exists({ oID: req.params.id }))) { - return res.status(404).json({ - code: this.constants.codes.NOT_FOUND, - message: this.constants.messages.NOT_FOUND, - }); - } - if (!req.body.subject && !req.body.body) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - const proclamation = await this.server.client.db.Proclamation.findOne({ oID: req.params.id }); - await proclamation.updateOne({ - subject: req.body.subject || proclamation.subject, - body: req.body.body || proclamation.body, - }); - - if (proclamation.subject !== req.body.subject || proclamation.body !== req.body.body) { - const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); - - const embed = new RichEmbed(); - embed.setTitle('Proclamation'); - embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); - embed.setColor('#66e1ff'); - embed.addField('Subject', req.body.subject || proclamation.subject); - embed.addField('Body', req.body.body || proclamation.body); - embed.setDescription(req.params.id); - embed.setTimestamp(new Date()); - - const channel = this.server.client.getChannel('807444198969835550'); - const procMessage = await channel.getMessage(proclamation.msg); - await procMessage.edit({ embed }); - } - - res.status(200).json({ message: `Updated Proclamation with ID ${proclamation.oID}.` }); + res.status(200).json(resolution); }); this.router.patch('/eo/:id', async (req, res) => { @@ -556,7 +417,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); const directorDiscord = staffGuild.members.get(director.userID); if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { @@ -586,6 +447,14 @@ export default class Root extends Route { } const executiveOrder = await this.server.client.db.ExecutiveOrder.findOne({ oID: req.params.id }); + + if (!['278620217221971968', executiveOrder.issuer].includes(director.userID)) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + await executiveOrder.updateOne({ subject: req.body.subject || executiveOrder.subject, body: req.body.body || executiveOrder.body, @@ -620,7 +489,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); const directorDiscord = staffGuild.members.get(director.userID); if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { @@ -650,6 +519,14 @@ export default class Root extends Route { } const motion = await this.server.client.db.Motion.findOne({ oID: req.params.id }); + + if (!['278620217221971968', motion.issuer].includes(director.userID)) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + await motion.updateOne({ subject: req.body.subject || motion.subject, body: req.body.body || motion.body, @@ -675,6 +552,78 @@ export default class Root extends Route { res.status(200).json({ message: `Updated Motion with ID ${motion.oID}.` }); }); + this.router.patch('/proc/:id', async (req, res) => { + if (!req.body.pin) { + return res.status(401).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); + const directorDiscord = staffGuild.members.get(director.userID); + + if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + if (!req.params.id) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + if (!(await this.server.client.db.Proclamation.exists({ oID: req.params.id }))) { + return res.status(404).json({ + code: this.constants.codes.NOT_FOUND, + message: this.constants.messages.NOT_FOUND, + }); + } + if (!req.body.subject && !req.body.body) { + return res.status(400).json({ + code: this.constants.codes.CLIENT_ERROR, + message: this.constants.messages.CLIENT_ERROR, + }); + } + + const proclamation = await this.server.client.db.Proclamation.findOne({ oID: req.params.id }); + + if (!['278620217221971968', proclamation.issuer].includes(director.userID)) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + + await proclamation.updateOne({ + subject: req.body.subject || proclamation.subject, + body: req.body.body || proclamation.body, + }); + + if (proclamation.subject !== req.body.subject || proclamation.body !== req.body.body) { + const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); + + const embed = new RichEmbed(); + embed.setTitle('Proclamation'); + embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); + embed.setColor('#66e1ff'); + embed.addField('Subject', req.body.subject || proclamation.subject); + embed.addField('Body', req.body.body || proclamation.body); + embed.setDescription(req.params.id); + embed.setTimestamp(new Date()); + + const channel = this.server.client.getChannel('807444198969835550'); + const procMessage = await channel.getMessage(proclamation.msg); + await procMessage.edit({ embed }); + } + + res.status(200).json({ message: `Updated Proclamation with ID ${proclamation.oID}.` }); + }); + this.router.patch('/resolution/:id', async (req, res) => { if (!req.body.pin) { return res.status(401).json({ @@ -684,7 +633,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); const directorDiscord = staffGuild.members.get(director.userID); if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { @@ -714,6 +663,14 @@ export default class Root extends Route { } const resolution = await this.server.client.db.Resolution.findOne({ oID: req.params.id }); + + if (!['278620217221971968', resolution.issuer].includes(director.userID)) { + return res.status(403).json({ + code: this.constants.codes.UNAUTHORIZED, + message: this.constants.messages.UNAUTHORIZED, + }); + } + await resolution.updateOne({ subject: req.body.subject || resolution.subject, body: req.body.body || resolution.body, @@ -723,7 +680,7 @@ export default class Root extends Route { const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); const embed = new RichEmbed(); - embed.setTitle('Executive Order'); + embed.setTitle('Resolution'); embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); embed.setColor('#66e1ff'); embed.addField('Subject', req.body.subject || resolution.subject); @@ -743,13 +700,13 @@ export default class Root extends Route { const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); - res.status(200).json({ executiveOrders }); + res.status(200).json(executiveOrders); }); this.router.get('/motion', async (_req, res) => { const motions = await this.server.client.db.Motion.find().lean(); - res.status(200).json({ motions }); + res.status(200).json(motions); }); this.router.get('/proc', async (_req: Request, res: Response) => { @@ -758,29 +715,10 @@ export default class Root extends Route { res.status(200).send({ proclamations }); }); - this.router.get('/eo', async (_req, res) => { - const executiveOrders = await this.server.client.db.ExecutiveOrder.find().lean(); - - - res.status(200).json({ executiveOrders }); - }); - - this.router.get('/motion', async (_req, res) => { - const motions = await this.server.client.db.Motion.find().lean(); - - res.status(200).json({ motions }); - }); - this.router.get('/resolution', async (_req, res) => { const resolutions = await this.server.client.db.Resolution.find().lean(); - res.status(200).json({ resolutions }); - }); - - this.router.get('/resolution', async (_req, res) => { - const resolutions = await this.server.client.db.Resolution.find().lean(); - - res.status(200).json({ resolutions }); + res.status(200).json(resolutions); }); this.router.patch('/motion/confirm', async (req, res) => { @@ -792,7 +730,7 @@ export default class Root extends Route { } const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get('446067825673633794') || await this.server.client.getRESTGuild('446067825673633794'); + const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); const directorDiscord = staffGuild.members.get(director.userID); if (!director || !directorDiscord?.roles?.includes('662163685439045632')) { diff --git a/src/events/messageReactionAdd.ts b/src/events/messageReactionAdd.ts index c00fcbf..478209a 100644 --- a/src/events/messageReactionAdd.ts +++ b/src/events/messageReactionAdd.ts @@ -24,8 +24,8 @@ export default class MessageReactionAdd extends Event { const nay = await message.getReaction(this.client.util.emojis.ERROR); const present = await message.getReaction('🙋'); const totalDirectors = 6; - const proc = await this.client.db.Proclamation.findOne({ msg: message.id }); - const processed = totalDirectors === (yea.length + nay.length + present.length) || Date.now() - proc.at > 604800000; + const proclamation = await this.client.db.Proclamation.findOne({ msg: message.id }); + const processed = totalDirectors === (yea.length + nay.length + present.length) || Date.now() - proclamation.at > 604800000; const absent = totalDirectors - (yea.length + nay.length + present.length); await this.client.db.Proclamation.updateOne({ msg: message.id }, { @@ -40,18 +40,18 @@ export default class MessageReactionAdd extends Event { const inTheMajority = yea.length > nay.length + present.length; if (processed) { - const author = this.client.users.get(proc.issuer) || await this.client.getRESTUser(proc.issuer); + const author = this.client.users.get(proclamation.issuer) || await this.client.getRESTUser(proclamation.issuer); if (inTheMajority) { - await author.createMessage(`__**Proclamation Majority Vote Received**__\nThe Proclamation you created at Library of Code sp-us, titled **${proc.subject}** (\`${proc.oID}\`) received the majority vote.`); - await message.channel.createMessage(`__**Proclamation Results**__\nProclamation issued by ${author.mention} **received** the majority vote. Proclamation ID: ${proc.oID}\n\n__Results:__\n**Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present.length}\n**Absent:** ${absent}`); + await author.createMessage(`__**Proclamation Majority Vote Received**__\nThe Proclamation you created at Library of Code sp-us, titled **${proclamation.subject}** (\`${proclamation.oID}\`) received the majority vote.`); + await message.channel.createMessage(`__**Proclamation Results**__\nProclamation issued by ${author.mention} **received** the majority vote. Proclamation ID: ${proclamation.oID}\n\n__Results:__\n**Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present.length}\n**Absent:** ${absent}`); } else { - await author.createMessage(`__**Proclamation Majority Vote Lost**__\nThe Proclamation you created at Library of Code sp-us, titled **${proc.subject}** (\`${proc.oID}\`) lost the majority vote.`); - await message.channel.createMessage(`__**Proclamation Results**__\nProclamation issued by ${author.mention} **lost** the majority vote. Proclamation ID: ${proc.oID}\n\n__Results:__\n**Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present.length}\n**Absent:** ${absent}`); + await author.createMessage(`__**Proclamation Majority Vote Lost**__\nThe Proclamation you created at Library of Code sp-us, titled **${proclamation.subject}** (\`${proclamation.oID}\`) lost the majority vote.`); + await message.channel.createMessage(`__**Proclamation Results**__\nProclamation issued by ${author.mention} **lost** the majority vote. Proclamation ID: ${proclamation.oID}\n\n__Results:__\n**Yea:** ${yea.length}\n**Nay:** ${nay.length}\n**Present:** ${present.length}\n**Absent:** ${absent}`); } } - await reactor.user.createMessage(`__**Vote Recorded**\nYour vote on the proclamation with ID \`${proc.id}\` at Library of Code sp-us was successfully recorded.`); + await reactor.user.createMessage(`__**Vote Recorded**\nYour vote on the proclamation with ID \`${proclamation.id}\` at Library of Code sp-us was successfully recorded.`); } } } From c0a96a5f67f2d4f01720cea2999245a34b25d41c Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Fri, 5 Mar 2021 00:04:47 -0400 Subject: [PATCH 27/29] Updated endpoints and typechecking --- src/api/board.ins/routes/root.ts | 145 ++++++++++++++----------------- src/events/messageReactionAdd.ts | 2 +- src/models/Resolution.ts | 8 +- 3 files changed, 69 insertions(+), 86 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index ee29a43..e8e18df 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -30,7 +30,7 @@ export default class Root extends Route { }); } - if (!req.body.subject || !req.body.body) { + if (typeof req.body.subject !== 'string' || typeof req.body.body !== 'string' || req.body.subject.length > 1024 || req.body.body.length > 1024) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -48,6 +48,7 @@ export default class Root extends Route { embed.setColor('#dd3acd'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); + embed.addField('Director', directorDiscord.mention); embed.setDescription(eoID); embed.setTimestamp(new Date()); @@ -69,64 +70,6 @@ export default class Root extends Route { }); }); - this.router.post('/motion', async (req, res) => { - if (!req.body.pin) { - return res.status(401).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - const director = await this.server.client.db.Score.findOne({ pin: req.body.pin }); - const staffGuild = this.server.client.guilds.get(this.server.client.config.guildID) || await this.server.client.getRESTGuild(this.server.client.config.guildID); - - if (!director || !staffGuild.members.get(director.userID)?.roles?.includes('662163685439045632')) { - return res.status(403).json({ - code: this.constants.codes.UNAUTHORIZED, - message: this.constants.messages.UNAUTHORIZED, - }); - } - - if (!req.body.subject || !req.body.body) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - const motionID = genUUID(); - - const directorDiscord = this.server.client.users.get(director.userID) || await this.server.client.getRESTUser(director.userID); - const directorInformation = await this.server.client.db.Staff.findOne({ userID: director.userID }); - - const embed = new RichEmbed(); - embed.setTitle('Motion'); - embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}`, directorDiscord.avatarURL); - embed.setColor('#66e1ff'); - embed.addField('Subject', req.body.subject); - embed.addField('Body', req.body.body); - embed.setDescription(motionID); - embed.setTimestamp(new Date()); - - const channel = this.server.client.getChannel('807444198969835550'); - const msg = await channel.createMessage({ embed }); - - const motion = await this.server.client.db.Motion.create({ - issuer: director.userID, - subject: req.body.subject, - body: req.body.body, - at: new Date(), - oID: motionID, - processed: false, - msg: msg.id, - }); - - res.status(200).json({ - code: this.constants.codes.SUCCESS, - message: `Created new Motion with ID ${motion.oID} by ${directorDiscord.username}#${directorDiscord.discriminator}, ${directorInformation.pn.join(', ')}.`, - }); - }); - this.router.post('/proc', async (req: Request, res: Response) => { if (!req.body.pin) { return res.status(401).json({ @@ -145,14 +88,7 @@ export default class Root extends Route { }); } - if (!req.body.subject) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - if (!req.body.body) { + if (typeof req.body.subject !== 'string' || typeof req.body.body !== 'string' || req.body.subject.length > 1024 || req.body.body.length > 1024) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -171,6 +107,7 @@ export default class Root extends Route { embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); embed.addField('ID', proclamationID); + embed.addField('Director', directorDiscord.mention); embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); @@ -439,7 +376,7 @@ export default class Root extends Route { message: this.constants.messages.NOT_FOUND, }); } - if (!req.body.subject && !req.body.body) { + if (typeof req.body.subject !== 'string' || typeof req.body.body !== 'string' || req.body.subject.length > 1024 || req.body.body.length > 1024) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -469,6 +406,7 @@ export default class Root extends Route { embed.setColor('#66e1ff'); embed.addField('Subject', req.body.subject || executiveOrder.subject); embed.addField('Body', req.body.body || executiveOrder.body); + embed.addField('Director', `<@!${executiveOrder.issuer}>`); embed.setDescription(req.params.id); embed.setTimestamp(new Date()); @@ -511,7 +449,7 @@ export default class Root extends Route { message: this.constants.messages.NOT_FOUND, }); } - if (!req.body.subject && !req.body.body) { + if (typeof req.body.subject !== 'string' || typeof req.body.body !== 'string' || req.body.subject.length > 1024 || req.body.body.length > 1024) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -541,6 +479,7 @@ export default class Root extends Route { embed.setColor('#66e1ff'); embed.addField('Subject', req.body.subject || motion.subject); embed.addField('Body', req.body.body || motion.body); + embed.addField('Director', `<@!${motion.issuer}>`); embed.setDescription(req.params.id); embed.setTimestamp(new Date()); @@ -583,7 +522,7 @@ export default class Root extends Route { message: this.constants.messages.NOT_FOUND, }); } - if (!req.body.subject && !req.body.body) { + if (typeof req.body.subject !== 'string' || typeof req.body.body !== 'string' || req.body.subject.length > 1024 || req.body.body.length > 1024) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -613,6 +552,7 @@ export default class Root extends Route { embed.setColor('#66e1ff'); embed.addField('Subject', req.body.subject || proclamation.subject); embed.addField('Body', req.body.body || proclamation.body); + embed.addField('Director', `<@!${proclamation.issuer}>`); embed.setDescription(req.params.id); embed.setTimestamp(new Date()); @@ -655,7 +595,7 @@ export default class Root extends Route { message: this.constants.messages.NOT_FOUND, }); } - if (!req.body.subject && !req.body.body) { + if (typeof req.body.subject !== 'string' || typeof req.body.body !== 'string' || req.body.subject.length > 1024 || req.body.body.length > 1024) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -678,19 +618,24 @@ export default class Root extends Route { if (resolution.subject !== req.body.subject || resolution.body !== req.body.body) { const directorStaffProfile = await this.server.client.db.Staff.findOne({ userID: directorDiscord.id }); + const motion = await this.server.client.db.Motion.findOne({ oID: resolution.oID }); const embed = new RichEmbed(); embed.setTitle('Resolution'); embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); - embed.setColor('#66e1ff'); + embed.setColor('#75b0ff'); embed.addField('Subject', req.body.subject || resolution.subject); embed.addField('Body', req.body.body || resolution.body); + embed.addField('Director', `<@!${motion.issuer}>`); embed.setDescription(req.params.id); embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); const resMessage = await channel.getMessage(resolution.msg); - await resMessage.edit({ embed }); + await resMessage.edit({ + content: `<@!${resolution.issuer}>`, + embed, + }); } res.status(200).json({ message: `Updated Resolution with ID ${resolution.oID}.` }); @@ -752,7 +697,13 @@ export default class Root extends Route { message: this.constants.messages.NOT_FOUND, }); } - if (Number.isNaN(Number(req.body.yea)) || Number.isNaN(Number(req.body.nay)) || Number.isNaN(Number(req.body.present)) || Number.isNaN(Number(req.body.absent))) { + + const yea = Number(req.body.yea); + const nay = Number(req.body.nay); + const present = Number(req.body.present); + const absent = Number(req.body.absent); + + if (Number.isNaN(yea) || Number.isNaN(nay) || Number.isNaN(present) || Number.isNaN(absent)) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -763,10 +714,10 @@ export default class Root extends Route { await motion.updateOne({ processed: true, results: { - yea: Number(req.body.yea), - nay: Number(req.body.nay), - present: Number(req.body.present), - absent: Number(req.body.absent), + yea, + nay, + present, + absent, }, }); @@ -778,14 +729,48 @@ export default class Root extends Route { embed.setTitle('Motion Confirmed'); embed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); embed.setColor('#27b17a'); - embed.addField('Subject', req.body.subject); - embed.addField('Body', req.body.body); + embed.addField('Subject', motion.subject); + embed.addField('Body', motion.body); + embed.addField('Director', `<@!${motion.issuer}>`); embed.setDescription(motion.oID); embed.setFooter(motion.oID, directorDiscord.avatarURL); embed.setTimestamp(new Date()); await channel.createMessage({ embed }); + const excludingYea = nay + present + absent; + if (yea > excludingYea) { + const resolutionEmbed = new RichEmbed(); + resolutionEmbed.setTitle('Resolution'); + resolutionEmbed.setAuthor(`${directorDiscord.username}#${directorDiscord.discriminator}, ${directorStaffProfile.pn.join(', ')}`, directorDiscord.avatarURL); + resolutionEmbed.setColor('#75b0ff'); + resolutionEmbed.addField('Subject', motion.subject); + resolutionEmbed.addField('Body', motion.body); + resolutionEmbed.addField('Director', `<@!${motion.issuer}>`); + resolutionEmbed.setDescription(motion.oID); + resolutionEmbed.setTimestamp(new Date()); + + const resMsg = await channel.createMessage({ + content: `<@!${motion.issuer}>`, + embed: resolutionEmbed, + }); + + await this.server.client.db.Resolution.create({ + issuer: motion.issuer, + subject: motion.subject, + body: motion.body, + at: Date.now(), + oID: motion.oID, + results: { + yea, + nay, + present, + absent, + }, + msg: resMsg.id, + }); + } + res.status(200).json({ message: `Confirmed results of motion with ID ${motion.oID}.` }); }); } diff --git a/src/events/messageReactionAdd.ts b/src/events/messageReactionAdd.ts index 478209a..3284f0f 100644 --- a/src/events/messageReactionAdd.ts +++ b/src/events/messageReactionAdd.ts @@ -9,7 +9,7 @@ export default class MessageReactionAdd extends Event { this.event = 'messageReactionAdd'; } - public async run(message: Message, emoji: Emoji, reactor: Member) { + public async run(message: Message, _emoji: Emoji, reactor: Member) { if (message.channel.id !== '807444198969835550') return; if (message.author.id !== this.client.user.id) return; diff --git a/src/models/Resolution.ts b/src/models/Resolution.ts index 302c617..b9f472c 100644 --- a/src/models/Resolution.ts +++ b/src/models/Resolution.ts @@ -4,7 +4,7 @@ export interface ResolutionInterface extends Document { issuer: string; subject: string; body: string; - at: Date; + at: number; oID: string; results: { yea: number; @@ -12,7 +12,6 @@ export interface ResolutionInterface extends Document { present: number; absent: number; }; - acceptedAt: number; msg: string; } @@ -20,7 +19,7 @@ const Resolution = new Schema({ issuer: { type: String, required: true }, subject: { type: String, required: true }, body: { type: String, required: true }, - at: { type: Date, required: true }, + at: { type: Number, required: true }, oID: { type: String, required: true, unique: true }, results: { yea: Number, @@ -28,8 +27,7 @@ const Resolution = new Schema({ present: Number, absent: Number, }, - acceptedAt: Number, - msg: { required: true, unique: true, type: String }, + msg: { type: String, required: true, unique: true }, }); export default model('Resolutions', Resolution); From 0289632f509a22b5f6856a672093f3c84e3a8025 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Fri, 5 Mar 2021 18:02:50 -0400 Subject: [PATCH 28/29] Profile command --- src/commands/profile.ts | 53 +++++++++++ src/commands/whois.ts | 19 ++-- src/configs/acknowledgements.json | 149 ------------------------------ src/models/Member.ts | 6 ++ src/models/Staff.ts | 6 -- 5 files changed, 70 insertions(+), 163 deletions(-) create mode 100644 src/commands/profile.ts delete mode 100644 src/configs/acknowledgements.json diff --git a/src/commands/profile.ts b/src/commands/profile.ts new file mode 100644 index 0000000..21c718e --- /dev/null +++ b/src/commands/profile.ts @@ -0,0 +1,53 @@ +import { Message } from 'eris'; +import { Client, Command } from '../class'; + +export default class Profile extends Command { + constructor(client: Client) { + super(client); + this.name = 'profile'; + this.description = 'Manages your profile on CR'; + this.usage = 'profile '; + this.permissions = 0; + this.enabled = true; + } + + public async run(message: Message, args: string[]) { + const profile = await this.client.db.Member.findOne({ userID: message.author.id }); + if (!profile) return this.error(message.channel, 'Please try again later. We do not currently have a member profile for you.'); + if (!args[1]) return this.error(message.channel, 'No new value was provided.'); + const newValue = args.slice(1).join(' '); + if (newValue.length >= 512) return this.error(message.channel, 'Please shorten your input.'); + + switch (args[0]) { + case 'github': + await profile.updateOne({ + additional: { + ...profile.additional, + github: args[1], + }, + }); + this.success(message.channel, 'Updated GitHub.'); + break; + case 'gitlab': + await profile.updateOne({ + additional: { + ...profile.additional, + gitlab: args[1], + }, + }); + this.success(message.channel, 'Updated GitLab.'); + break; + case 'bio': + await profile.updateOne({ + additional: { + ...profile.additional, + bio: newValue, + }, + }); + this.success(message.channel, 'Updated bio.'); + break; + default: + return this.error(message.channel, 'Please specify a valid option to change.'); + } + } +} diff --git a/src/commands/whois.ts b/src/commands/whois.ts index f70c2ed..2e609e0 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -58,14 +58,17 @@ export default class Whois extends Command { if (ackResolve?.extension) { description += `☎️ ${ackResolve.extension}\n`; } - if (ackResolve?.gitlab) { - description += `${emotes.gitlab} ${ackResolve.gitlab}\n`; + + const memberProfile = await this.client.db.Member.findOne({ userID: message.author.id }); + + if (memberProfile?.additional?.gitlab) { + description += `${emotes.gitlab} ${memberProfile?.additional.gitlab}\n`; } - if (ackResolve?.github) { - description += `${emotes.github} ${ackResolve.github}\n`; + if (memberProfile?.additional?.github) { + description += `${emotes.github} ${memberProfile?.additional.github}\n`; } - if (ackResolve?.bio) { - description += `${emotes.bio} *${ackResolve.bio}*\n`; + if (memberProfile?.additional?.bio) { + description += `${emotes.bio} *${memberProfile?.additional.bio}*\n`; } description += `\n<@${member.id}>`; embed.setDescription(description); @@ -93,8 +96,8 @@ export default class Whois extends Command { embed2.addField('Department/Service', 'Library of Code sp-us | Bureau of Community Reports'.toUpperCase(), true); embed2.setTimestamp(); embed2.setFooter(this.client.user.username, this.client.user.avatarURL); - const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); - log.createMessage({ embed: embed2 }).catch(() => {}); + const log = this.client.guilds.get(this.client.config.guildID).channels.get('611584771356622849'); + log.createMessage({ embed: embed2 }).catch(() => { }); let totalScore = '0'; if (score.total < 200) totalScore = '---'; else if (score.total > 800) totalScore = '800'; diff --git a/src/configs/acknowledgements.json b/src/configs/acknowledgements.json deleted file mode 100644 index 93d9740..0000000 --- a/src/configs/acknowledgements.json +++ /dev/null @@ -1,149 +0,0 @@ -[ - { - "name": "Matthew", - "id": "278620217221971968", - "title": "Chief Director of Engineering", - "pn": ["AD", "FSEN", "FSO", "FSCR", "FSCE", "FSED"], - "dept": "Board of Directors", - "emailAddress": "matthew@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/matthew", - "github": "https://github.com/matthew119427", - "bio": "so baby come light me up, and maybe ill let you on it. a little bit dangerous, but baby thats how i want it. a little less conversation and a little more touch my body. cuz im so into you... ~ Ariana Grande, Into You - Dangerous Woman", - "acknowledgements": ["Maintainer & Lead Developer"] - }, - { - "name": "Bsian", - "id": "253600545972027394", - "title": "Director of Engineering", - "pn": ["AD", "FSEN", "FSCR", "FSED"], - "dept": "Board of Directors", - "emailAddress": "bsian@staff.libraryofcode.org", - "bio": "I also like trains", - "acknowledgements": ["Maintainer & Assistant Lead Developer"] - }, - { - "name": "NightRaven", - "id": "239261547959025665", - "title": "Director of Information Security", - "pn": ["AD", "FSEN", "FSO", "FSCR", "FSED"], - "dept": "Board of Directors", - "emailAddress": "nightraven@staff.libraryofcode.org", - "bio": "I like trains" - }, - { - "name": "Unknown", - "id": "143414786913206272", - "title": "Director of Operations", - "pn": ["AD", "FSO", "FSM", "FSCR"], - "dept": "Board of Directors", - "emailAddress": "unknown@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/unknown", - "bio": "im not a proffesional developer or anything, i just enjoy it as a hobby." - }, - { - "name": "TheSkele27", - "id": "213632190557192192", - "title": "Director of Community Engagement", - "pn": ["AD", "FSCE"], - "dept": "Board of Directors", - "emailAddress": "theskele27@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/TheSkele27", - "github": "https://github.com/TheSkele27", - "bio": "Is water wet?" - }, - { - "name": "Catbirby", - "id": "131953641371205632", - "pn": ["SP", "FSO", "FSM"], - "dept": "Supervisor", - "emailAddress": "catbirby@staff.libraryofcode.org", - "github": "https://github.com/catbirby", - "bio": "Computer Tech/Networking Nerd/SysADin/Graphic Designer/Audiophile. I don't do much coding but know my way around most languages." - }, - { - "name": "D3XTER", - "id": "468009964263178262", - "pn": ["ST", "CE-I"], - "dept": "Core Team", - "emailAddress": "dexter@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/D3XTER", - "bio": "Hi I'm D3XTER how are ya?" - }, - { - "name": "DedShotTM", - "id": "402154763363418142", - "pn": ["ST", "FSCR"], - "dept": "Technician & Moderator", - "emailAddress": "dedshot@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/DedShotTM", - "github": "https://github.com/DedShotTM", - "bio": "Imagine having a bio", - "acknowledgements": ["Contributor"] - }, - { - "name": "EdgyBoi2414", - "id": "397432516010835970", - "pn": ["ST"], - "dept": "Core Team", - "emailAddress": "edgyboi2414@gmail.com", - "gitlab": "https://gitlab.libraryofcode.org/EdgyBoi2414", - "github": "https://github.com/EdgyBoi2414", - "bio": "\"If teardrops could be bottled, there'd be swimming pools, built by model..\" - Some Philosopher" - }, - { - "name": "Hector", - "id": "377781496292835339", - "pn": ["ST", "CRS-I"], - "dept": "Technician", - "emailAddress": "hector@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/Hector", - "github": "https://github.com/Hector6704", - "bio": "Hi there, I'm the developer of Delta, the Discord bot. I'm a free-time French JavASript developer. I hope you'll enjoy LOC!", - "acknowledgements": ["Contributor"] - }, - { - "name": "KhaaZ", - "id": "179908288337412096", - "pn": ["ST", "FSEN"], - "dept": "Core Team", - "emailAddress": "khaaz@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/KhaaZ", - "github": "https://github.com/Khaazz", - "bio": "I baguette for a living and eat code for breakfast.", - "acknowledgements": ["Assistant Maintainer"] - }, - { - "name": "PlayerVMachine", - "id": "273999507174195203", - "pn": ["ST", "ED-I"], - "dept": "Instructor & Core Team", - "emailAddress": "nicolas@staff.libraryofcode.org", - "bio": "I write C++ to pay off my student loans" - }, - { - "name": "Sterben", - "id": "241361691730903040", - "pn": ["ST", "CRS-I", "ENG-I"], - "dept": "Core Team", - "emailAddress": "sterben@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/Sterben", - "github": "https://github.com/sterben6", - "bio": "im bored" - }, - { - "name": "Raymond", - "id": "314564798992089090", - "pn": ["AS"], - "dept": "Associate", - "emailAddress": "smashjarchive@staff.libraryofcode.org", - "gitlab": "https://gitlab.libraryofcode.org/javaarchive", - "github": "https://github.com/javaarchive", - "bio": "I don't like reinventing the wheel and don't like coding on small screens like laptops as much" - }, - { - "name": "Null", - "id": "323673862971588609", - "gitlab": "https://gitlab.libraryofcode.org/null", - "acknowledgements": ["Contributor"] - } -] diff --git a/src/models/Member.ts b/src/models/Member.ts index e7023b5..8be3c96 100644 --- a/src/models/Member.ts +++ b/src/models/Member.ts @@ -5,6 +5,9 @@ export interface MemberInterface extends Document { additional: { langs: ['js', 'py', 'rb', 'ts', 'rs', 'go', 'cfam', 'csharp', 'swift', 'java', 'kt', 'asm'], operatingSystems: ['arch', 'deb', 'cent', 'fedora', 'manjaro', 'mdarwin', 'redhat', 'ubuntu', 'win'], + github: string; + gitlab: string; + bio: string; }, } @@ -13,6 +16,9 @@ const Member: Schema = new Schema({ additional: { langs: Array, operatingSystems: Array, + github: String, + gitlab: String, + bio: String, }, }); diff --git a/src/models/Staff.ts b/src/models/Staff.ts index 018512a..ec22b56 100644 --- a/src/models/Staff.ts +++ b/src/models/Staff.ts @@ -7,9 +7,6 @@ export interface StaffInterface extends Document { dept: string, pn: string[], emailAddress: string, - gitlab: string, - github: string, - bio: string, extension: string, acknowledgements: string[], } @@ -21,9 +18,6 @@ const Staff: Schema = new Schema({ dept: String, pn: Array, emailAddress: String, - gitlab: String, - github: String, - bio: String, extension: String, acknowledgements: Array, }); From 09f9cd4f63e3e654d8ff2aab331b9cf5b7f3fba1 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 6 Mar 2021 19:25:06 -0500 Subject: [PATCH 29/29] fixes to delete operation --- src/api/board.ins/routes/root.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index e8e18df..6296f2f 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -173,7 +173,7 @@ export default class Root extends Route { }); } - await executiveOrder.delete(); + await this.server.client.db.ExecutiveOrder.deleteOne({ oID: req.params.id }); res.status(200).json({ message: `Executive Order with ID ${req.params.id} deleted.` }); }); @@ -219,7 +219,7 @@ export default class Root extends Route { }); } - await motion.delete(); + await this.server.client.db.Motion.deleteOne({ oID: req.params.id }); res.status(200).json({ message: `Motion with ID ${req.params.id} deleted.` }); }); @@ -264,7 +264,7 @@ export default class Root extends Route { }); } - await proclamation.delete(); + await this.server.client.db.Proclamation.deleteOne({ oID: req.params.id }); res.status(200).json({ message: `Proclamation with ID ${req.params.id} deleted.` }); });