diff --git a/package.json b/package.json index e23a677..93f6a01 100644 --- a/package.json +++ b/package.json @@ -1,68 +1,68 @@ -{ - "name": "loccr", - "version": "1.0.0", - "description": "The official system for handling Community Relations in the LOC Discord server.", - "main": "build/main.js", - "scripts": { - "lint": "eslint -c ./.eslintrc.json src --ext ts" - }, - "repository": "https://gitlab.libraryofcode.org/engineering/communityrelations.git", - "author": "Library of Code | Dept. of Engineering ", - "license": "AGPL-3.0", - "devDependencies": { - "@types/ari-client": "^2.2.7", - "@types/auth0": "^2.34.7", - "@types/bull": "^3.15.7", - "@types/cron": "^1.7.3", - "@types/express": "^4.17.13", - "@types/helmet": "^0.0.48", - "@types/ioredis": "4.28.10", - "@types/jsonwebtoken": "^8.5.6", - "@types/node": "^16.11.12", - "@types/nodemailer": "^6.4.4", - "@types/puppeteer": "^5.4.4", - "@types/signale": "^1.4.2", - "@types/uuid": "^8.3.3", - "@typescript-eslint/eslint-plugin": "^5.6.0", - "@typescript-eslint/parser": "^5.6.0", - "eslint": "^8.4.1", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-plugin-import": "^2.25.3", - "tslib": "^2.3.1", - "typescript": "^4.5.3" - }, - "dependencies": { - "@google-cloud/text-to-speech": "^3.4.0", - "@sentry/node": "^6.19.1", - "@sentry/tracing": "^6.19.1", - "ari-client": "^2.2.0", - "asterisk-manager": "^0.2.0", - "auth0": "^2.37.0", - "awesome-phonenumber": "^2.65.0", - "axios": "^0.24.0", - "body-parser": "^1.19.0", - "bull": "^4.1.1", - "cheerio": "^1.0.0-rc.10", - "cr-db": "git+https://gitlab.libraryofcode.org/engineering/community-relations/database.git", - "cron": "^1.8.2", - "eris": "^0.16.1", - "eris-pagination": "git+https://github.com/libraryofcode/eris-pagination.git", - "express": "^4.17.1", - "helmet": "^4.6.0", - "ioredis": "^4.28.2", - "jsonwebtoken": "^9.0.0", - "mathjs": "^10.0.0", - "moment": "^2.29.1", - "mongoose": "^6.1.1", - "nanoid": "^3.1.30", - "nodemailer": "^6.7.2", - "pluris": "^0.3.7", - "puppeteer": "^17.1.3", - "sd-notify": "^2.8.0", - "signale": "^1.4.0", - "stock-info": "^1.5.1", - "stripe": "^8.193.0", - "uuid": "^8.3.2", - "yaml": "^1.10.2" - } -} +{ + "name": "loccr", + "version": "1.0.0", + "description": "The official system for handling Community Relations in the LOC Discord server.", + "main": "build/main.js", + "scripts": { + "lint": "eslint -c ./.eslintrc.json src --ext ts" + }, + "repository": "https://gitlab.libraryofcode.org/engineering/communityrelations.git", + "author": "Library of Code, Inc. | Dept. of Engineering ", + "license": "AGPL-3.0", + "devDependencies": { + "@types/ari-client": "^2.2.7", + "@types/auth0": "^2.34.7", + "@types/bull": "^3.15.7", + "@types/cron": "^1.7.3", + "@types/express": "^4.17.13", + "@types/helmet": "^0.0.48", + "@types/ioredis": "4.28.10", + "@types/jsonwebtoken": "^8.5.6", + "@types/node": "^16.11.12", + "@types/nodemailer": "^6.4.4", + "@types/puppeteer": "^5.4.4", + "@types/signale": "^1.4.2", + "@types/uuid": "^8.3.3", + "@typescript-eslint/eslint-plugin": "^5.6.0", + "@typescript-eslint/parser": "^5.6.0", + "eslint": "^8.4.1", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.25.3", + "tslib": "^2.3.1", + "typescript": "^4.5.3" + }, + "dependencies": { + "@google-cloud/text-to-speech": "^3.4.0", + "@sentry/node": "^6.19.1", + "@sentry/tracing": "^6.19.1", + "ari-client": "^2.2.0", + "asterisk-manager": "^0.2.0", + "auth0": "^2.37.0", + "awesome-phonenumber": "^2.65.0", + "axios": "^0.24.0", + "body-parser": "^1.19.0", + "bull": "^4.1.1", + "cheerio": "^1.0.0-rc.10", + "cr-db": "git+https://gitlab.libraryofcode.org/engineering/community-relations/database.git", + "cron": "^1.8.2", + "eris": "^0.16.1", + "eris-pagination": "git+https://github.com/libraryofcode/eris-pagination.git", + "express": "^4.17.1", + "helmet": "^4.6.0", + "ioredis": "^4.28.2", + "jsonwebtoken": "^9.0.0", + "mathjs": "^10.0.0", + "moment": "^2.29.1", + "mongoose": "^6.1.1", + "nanoid": "^3.1.30", + "nodemailer": "^6.7.2", + "pluris": "^0.3.7", + "puppeteer": "^17.1.3", + "sd-notify": "^2.8.0", + "signale": "^1.4.0", + "stock-info": "^1.5.1", + "stripe": "^8.193.0", + "uuid": "^8.3.2", + "yaml": "^1.10.2" + } +} diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index ab58d50..f007652 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -82,7 +82,7 @@ export default class Root extends Route { ${payload.body} _____________________________________________________________________ - LIBRARY OF CODE SP-US | BOARD OF DIRECTORS + LIBRARY OF CODE INC | BOARD OF DIRECTORS BOARD REGISTER SYSTEM https://board.ins/ `, }); @@ -118,7 +118,7 @@ export default class Root extends Route { ${payload.body} _____________________________________________________________________ - LIBRARY OF CODE SP-US | BOARD OF DIRECTORS + LIBRARY OF CODE INC | BOARD OF DIRECTORS BOARD REGISTER SYSTEM https://board.ins/ `, }); @@ -140,7 +140,7 @@ export default class Root extends Route { embed.addField('Subject', payload.subject); embed.addField('Body', payload.body); embed.setColor(color); - embed.setFooter('Library of Code sp-us | Board Register System', 'https://static.libraryofcode.org/library_of_code.png'); + embed.setFooter('Library of Code Inc | Board Register System', 'https://static.libraryofcode.org/library_of_code.png'); embed.setTimestamp(); return embed; diff --git a/src/api/comm.libraryofcode.org/routes/report.ts b/src/api/comm.libraryofcode.org/routes/report.ts index 961ad73..4636ebc 100644 --- a/src/api/comm.libraryofcode.org/routes/report.ts +++ b/src/api/comm.libraryofcode.org/routes/report.ts @@ -449,7 +449,7 @@ export default class Report extends Route { updated = true; await this.server.client.report.createInquiry(member.user.id, `${member.username} via report.libraryofcode.org @ IP ${req.ip}`, 1); } else { - await this.server.client.report.createInquiry(member.user.id, 'Library of Code sp-us | Staff Team via report.libraryofcode.org', 1); + await this.server.client.report.createInquiry(member.user.id, 'Library of Code Inc | Staff Team via report.libraryofcode.org', 1); } } else if (!updated) { await this.server.client.report.createInquiry(member.user.id, `${member.username} via report.libraryofcode.org @ IP ${req.ip}`, 1); diff --git a/src/class/Queue.ts b/src/class/Queue.ts index d6f94be..a8f76f1 100644 --- a/src/class/Queue.ts +++ b/src/class/Queue.ts @@ -24,7 +24,7 @@ export default class Queue { } protected setCronJobs() { - const historialCommunityReportJob = new cron.CronJob('0 20 * * *', async () => { + const historicalCommunityReportJob = new cron.CronJob('0 20 * * *', async () => { try { const reports = await this.client.db.mongo.Score.find().lean().exec(); const startDate = new Date(); @@ -81,7 +81,7 @@ export default class Queue { }); }); - historialCommunityReportJob.start(); + historicalCommunityReportJob.start(); clearOldHistoricalReportsJob.start(); calculateScores.start(); } diff --git a/src/class/Server.ts b/src/class/Server.ts index b836a89..b58458d 100644 --- a/src/class/Server.ts +++ b/src/class/Server.ts @@ -13,7 +13,7 @@ export default class Server { public port: number; - private root: string; + private readonly root: string; protected parse: boolean; diff --git a/src/commands/callback.ts b/src/commands/callback.ts index f264cdf..5a79ba7 100644 --- a/src/commands/callback.ts +++ b/src/commands/callback.ts @@ -34,7 +34,7 @@ export default class Callback extends Command { embed.addField('Phone Number Type', phone.getType(), true); const communityReport = await this.client.db.mongo.Score.findOne({ userID: message.author.id }).lean().exec(); if (communityReport) { - await this.client.report.createInquiry(member.user.id, 'Library of Code sp-us | VOIP/PBX Member Support SVCS', 1); + await this.client.report.createInquiry(member.user.id, 'Library of Code Inc | VOIP/PBX Member Support SVCS', 1); embed.addField('PIN', `${communityReport.pin[0]}-${communityReport.pin[1]}-${communityReport.pin[2]}`, true); } try { diff --git a/src/commands/info.ts b/src/commands/info.ts index 6808689..ce16ccf 100644 --- a/src/commands/info.ts +++ b/src/commands/info.ts @@ -19,7 +19,7 @@ export default class Info extends Command { embed.setTitle('Information'); embed.setThumbnail(this.client.user.avatarURL); embed.setDescription(`*See \`${this.client.config.prefix}sysinfo\` for more information on libraries used by this application.*`); - embed.addField('Developers', 'Library of Code | Dept. of Engineering & other contributors', true); + embed.addField('Developers', 'Library of Code, Inc. | Dept. of Engineering & other contributors', true); embed.addField('Version', 'Rolling Release', true); embed.addField('Language(s)', '<:TypeScript:703451285789343774> TypeScript', true); embed.addField('Runtime', `Node (${process.version})`, true); diff --git a/src/commands/inquiry.ts b/src/commands/inquiry.ts index 66cb33f..8e43697 100644 --- a/src/commands/inquiry.ts +++ b/src/commands/inquiry.ts @@ -30,7 +30,7 @@ export default class Inquiry extends Command { const { report } = inquiry; // if (!report) return this.error(message.channel, 'Could not find inquiry information.'); - await this.client.report.createInquiry(member.id, 'Library of Code sp-us | Bureau of Community Reports', 1); + await this.client.report.createInquiry(member.id, 'Library of Code Inc | Bureau of Community Reports', 1); const embed = new RichEmbed(); embed.setTitle(`Hard Inquiry Information - ${inquiry.iid}`); diff --git a/src/commands/saa.ts b/src/commands/saa.ts index 35d2599..b238c17 100644 --- a/src/commands/saa.ts +++ b/src/commands/saa.ts @@ -89,7 +89,7 @@ export default class StaffAssistedApplication extends Command { // eslint-disable-next-line no-useless-escape notificationEmbed.addField('User', `${member.username}#${member.discriminator} | XXX-XX-${report.pin[2]}`); notificationEmbed.addField('Decision', 'PROCESSING'); - notificationEmbed.addField('Initiated by', `${ctx.message.author.username}${staff?.isManager ? ' [k]' : ''} *on behalf of Library of Code sp-us*`); + notificationEmbed.addField('Initiated by', `${ctx.message.author.username}${staff?.isManager ? ' [k]' : ''} *on behalf of Library of Code Inc*`); notificationEmbed.addField('Application ID', application.id); notificationEmbed.addField('Service Code', ctx.args[1]); notificationEmbed.setFooter(this.client.user.username, this.client.user.avatarURL); diff --git a/src/commands/saa_approve.ts b/src/commands/saa_approve.ts index 405d458..89930bf 100644 --- a/src/commands/saa_approve.ts +++ b/src/commands/saa_approve.ts @@ -38,7 +38,7 @@ export default class SAA_Approve extends Command { // eslint-disable-next-line no-useless-escape embed.addField('User', `${member.username}#${member.discriminator} | XXX-XX-${report.pin[2]}`); embed.addField('Decision', 'APPROVED'); - embed.addField('Underwriter', `${ctx.message.author.username}${staff?.isManager ? ' [k]' : ''} *on behalf of Library of Code sp-us*`); + embed.addField('Underwriter', `${ctx.message.author.username}${staff?.isManager ? ' [k]' : ''} *on behalf of Library of Code Inc*`); embed.addField('Application ID', saa.applicationID); embed.addField('Service Code', saa.serviceCode); embed.setFooter(this.client.user.username, this.client.user.avatarURL); diff --git a/src/commands/saa_decline.ts b/src/commands/saa_decline.ts index 37d6c16..2f4665e 100644 --- a/src/commands/saa_decline.ts +++ b/src/commands/saa_decline.ts @@ -35,7 +35,7 @@ export default class SAA_Decline extends Command { // eslint-disable-next-line no-useless-escape embed.addField('User', `${member.username}#${member.discriminator} | XXX-XX-${report.pin[2]}`); embed.addField('Decision', 'DECLINED'); - embed.addField('Underwriter', `${ctx.message.author.username}${staff?.isManager ? ' [k]' : ''} *on behalf of Library of Code sp-us*`); + embed.addField('Underwriter', `${ctx.message.author.username}${staff?.isManager ? ' [k]' : ''} *on behalf of Library of Code Inc*`); embed.addField('Application ID', saa.applicationID); embed.addField('Service Code', saa.serviceCode); embed.setFooter(this.client.user.username, this.client.user.avatarURL); diff --git a/src/commands/score.ts b/src/commands/score.ts index 9f606de..c3a463b 100644 --- a/src/commands/score.ts +++ b/src/commands/score.ts @@ -14,7 +14,7 @@ export default class Score extends Command { super(client); this.name = 'score'; this.description = 'Retrieves your Community Report'; - this.usage = `${this.client.config.prefix}score\n${this.client.config.prefix}score :`; + this.usage = `${this.client.config.prefix}score\n${this.client.config.prefix}score :`; this.aliases = ['report']; this.subcmds = [Score_Hist, Score_Notify, Score_Pref]; this.permissions = 0; @@ -181,7 +181,7 @@ export default class Score extends Command { let name = ''; // eslint-disable-next-line no-unreachable-loop for (const role of this.client.util.resolveMember(ctx.message.author.id, this.mainGuild).roles.map((r) => this.mainGuild.roles.get(r)).sort((a, b) => b.position - a.position)) { - name = `Library of Code sp-us | ${role.name}`; + name = `Library of Code Inc | ${role.name}`; break; } await this.client.report.createInquiry(user.id, name, 1); diff --git a/src/commands/score_hist.ts b/src/commands/score_hist.ts index 22d68c1..6273110 100644 --- a/src/commands/score_hist.ts +++ b/src/commands/score_hist.ts @@ -34,7 +34,7 @@ export default class Score_Hist extends Command { let name = ''; // eslint-disable-next-line no-unreachable-loop for (const role of this.client.util.resolveMember(ctx.message.author.id, this.mainGuild).roles.map((r) => this.mainGuild.roles.get(r)).sort((a, b) => b.position - a.position)) { - name = `Library of Code sp-us | ${role.name} - [HISTORICAL]`; + name = `Library of Code Inc | ${role.name} - [HISTORICAL]`; break; } await this.client.report.createInquiry(user.id, name, 1); diff --git a/src/commands/sss_create_account.ts b/src/commands/sss_create_account.ts index 23162f4..a9e27d0 100644 --- a/src/commands/sss_create_account.ts +++ b/src/commands/sss_create_account.ts @@ -110,7 +110,7 @@ export default class SSS_Create_Account extends Command { connection_id: 'con_T3ELEx2reigKMSlP', }); const channel = await this.client.getDMChannel(message.author.id); - channel.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n\nPlease click the link below to reset your password.\n\n${passwordTicket.ticket}`).catch(() => this.error(message.channel, 'Unable to send you a DM.')); + channel.createMessage(`__**Library of Code Inc | Identity & Account Management**__\n\nPlease click the link below to reset your password.\n\n${passwordTicket.ticket}`).catch(() => this.error(message.channel, 'Unable to send you a DM.')); return message.addReaction('modSuccess:578750988907970567'); } catch (err) { return this.client.util.handleError(err, message, this); diff --git a/src/commands/sss_password_reset.ts b/src/commands/sss_password_reset.ts index abb6c9b..c8d80e1 100644 --- a/src/commands/sss_password_reset.ts +++ b/src/commands/sss_password_reset.ts @@ -24,7 +24,7 @@ export default class SSS_Password_Reset extends Command { connection_id: 'con_T3ELEx2reigKMSlP', }); const channel = await this.client.getDMChannel(ctx.message.author.id); - channel.createMessage(`__**Library of Code sp-us | Identity & Account Management**__\n\nPlease click the link below to reset your password.\n\n${passwordTicket.ticket}`).catch(() => this.error(ctx.message.channel, 'Unable to send you a DM.')); + channel.createMessage(`__**Library of Code Inc | Identity & Account Management**__\n\nPlease click the link below to reset your password.\n\n${passwordTicket.ticket}`).catch(() => this.error(ctx.message.channel, 'Unable to send you a DM.')); return ctx.message.addReaction('modSuccess:578750988907970567'); } catch (err) { return this.client.util.handleError(err, ctx.message, this); diff --git a/src/commands/whois.ts b/src/commands/whois.ts index 24661cb..b7cc473 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -85,7 +85,7 @@ export default class Whois extends Command { embed.addField('Created At', `${moment(new Date(member.user.createdAt)).format('dddd, MMMM Do YYYY, h:mm:ss A')} ET`, true); const score = await this.client.db.mongo.Score.findOne({ userID: member.id }).lean().exec(); if (score) { - await this.client.report.createInquiry(member.id, 'Library of Code sp-us | Bureau of Community Reports', 1); + await this.client.report.createInquiry(member.id, 'Library of Code Inc | Bureau of Community Reports', 1); let totalScore = '0'; if (score.total < 200) totalScore = '---'; else if (score.total > 800) totalScore = '800'; diff --git a/src/events/messageReactionAdd.ts b/src/events/messageReactionAdd.ts index ee041dc..b0c02a5 100644 --- a/src/events/messageReactionAdd.ts +++ b/src/events/messageReactionAdd.ts @@ -125,7 +125,7 @@ export default class MessageReactionAdd extends Event { _____________________________________________________________________ - LIBRARY OF CODE SP-US | BOARD OF DIRECTORS + LIBRARY OF CODE INC | BOARD OF DIRECTORS BOARD REGISTER SYSTEM https://board.ins/ `, }); @@ -136,4 +136,3 @@ export default class MessageReactionAdd extends Event { } } } - diff --git a/src/intervals/departmentPager.ts b/src/intervals/departmentPager.ts index d9faefd..aa65486 100644 --- a/src/intervals/departmentPager.ts +++ b/src/intervals/departmentPager.ts @@ -175,7 +175,7 @@ export default async function departmentPager(client: Client): Promise