diff --git a/.gitignore b/.gitignore index 81ce2e3d..d765bb9b 100644 --- a/.gitignore +++ b/.gitignore @@ -77,4 +77,6 @@ typings/ dist -.vs \ No newline at end of file +.vs + +.idea \ No newline at end of file diff --git a/.npmignore b/.npmignore index 5c5532a6..506ff152 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ src/ -tsconfig.json \ No newline at end of file +tsconfig.json +docs/ \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..42061c01 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 2f316681..1b53835a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,6 +2,7 @@ "semi": true, "trailingComma": "all", "singleQuote": true, - "printWidth": 120, - "tabWidth": 4 + "printWidth": 100, + "tabWidth": 4, + "arrowParens": "avoid" } diff --git a/README.md b/README.md index 47b6d47a..0501c6ed 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,22 @@ # Sern Handler + NPM version NPM downloads Builds Passing Sern can automate and streamline development of your discord bot with new version compatibility and full customization. -- A reincarnation of [this old project](https://github.com/jacoobes/sern_handler) +- A reincarnation of [this old project](https://github.com/jacoobes/sern_handler) ## Installation ```sh npm install sern-handler ``` + ```sh yarn add sern-handler ``` + ```sh pnpm add sern-handler ``` @@ -21,6 +24,7 @@ pnpm add sern-handler ## Basic Usage #### ` index.js ` + ```js import { Client, Intents } from 'discord.js'; import { Sern } from 'sern-handler'; @@ -35,12 +39,12 @@ const client = new Client({ }); new Sern.Handler({ - client, - prefix, - commands : 'dist/commands', - privateServers : [ + client, + prefix, + commands: 'dist/commands', + privateServers: [ { - test : true, + test: true, id: 'server-id' } ], @@ -54,17 +58,18 @@ client.login(token); ``` #### ` ping.js ` + ```js import { Sern, Types } from 'sern-handler'; import { Ok } from 'ts-results'; -export default { +export default { alias: [], - desc : 'A ping pong command', - visibility : 'private', - test : false, + desc: 'A ping pong command', + visibility: 'private', + test: false, type: Sern.CommandType.SLASH | Sern.CommandType.TEXT, - execute : async ({ message, interaction }, args) => 'pong!' + execute: async ({ message, interaction }, args) => 'pong!' }; ``` @@ -78,8 +83,8 @@ See [documentation](https://sern-handler.js.org) for TypeScript examples and mor ## Contribute -- Pull up on [issues](https://github.com/sern-handler/Sern/issues) and tell us, if there are bugs -- All kinds of contributions are welcomed! +- Pull up on [issues](https://github.com/sern-handler/Sern/issues) and tell us, if there are bugs +- All kinds of contributions are welcomed! ## TODO diff --git a/package-lock.json b/package-lock.json index cca081d3..4d7419a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,17 @@ { - "name": "sern-handler", - "version": "0.1.0", + "name": "@sern/handler", + "version": "0.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "sern-handler", - "version": "0.1.0", + "name": "@sern/handler", + "version": "0.0.1", "license": "ISC", "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.10.2", - "@typescript-eslint/parser": "^5.10.2", - "dayjs": "^1.10.7", - "discord.js": "^13.6.0", - "eslint": "^8.8.0", - "prettier": "^2.5.1", + "discord.js": "^14.0.0-dev.1647259751.2297c2b", + "rxjs": "^7.5.5", + "ts-pattern": "^4.0.2", "ts-results": "^3.3.0" }, "devDependencies": { @@ -22,9 +19,13 @@ "@babel/preset-env": "^7.16.11", "@babel/preset-typescript": "^7.16.7", "@types/jest": "^27.4.0", + "@typescript-eslint/eslint-plugin": "^5.10.2", + "@typescript-eslint/parser": "^5.10.2", "babel-jest": "^27.5.1", "cz-conventional-changelog": "^3.0.1", + "eslint": "^8.8.0", "jest": "^27.5.1", + "prettier": "2.6.2", "standard-version": "^9.3.2", "typedoc": "^0.22.11", "typescript": "^4.5.5" @@ -1933,61 +1934,70 @@ } }, "node_modules/@discordjs/builders": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz", - "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==", + "version": "0.14.0-dev.1653091712-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.14.0-dev.1653091712-fdeac9d.tgz", + "integrity": "sha512-7/esDI5KkDBI8sxSNFmPYNQXMUTbopD4FkjBAm+nQmp5Xxda1xFjWvi3oJ7QC8l/IVanUAD47xxrb8lhckMRzA==", "dependencies": { - "@sindresorhus/is": "^4.2.0", - "discord-api-types": "^0.26.0", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" + "@sapphire/shapeshift": "^3.0.0", + "@sindresorhus/is": "^4.6.0", + "discord-api-types": "^0.33.0", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.1", + "tslib": "^2.3.1" }, "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "node": ">=16.9.0" } }, "node_modules/@discordjs/collection": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", - "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==", + "version": "0.7.0-dev.1653091708-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1653091708-fdeac9d.tgz", + "integrity": "sha512-21gKkNVlqWMTf5kkZ2uAkfe8kU149w/JXC9Vpu7nNEir6A5AHNPULtd+1FssvXYAfoEnzus7/gZC6pYD5eX/gQ==", "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "node": ">=16.9.0" + } + }, + "node_modules/@discordjs/rest": { + "version": "0.5.0-dev.1653091732-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.5.0-dev.1653091732-fdeac9d.tgz", + "integrity": "sha512-2XIobHE+C0X/LFJC205CSeiHKvt0aBRqYb5dwAoq6VsZAprmvL+Mma0V2bKWInaOCmrr85X+XlEgQf+H22CK+A==", + "dependencies": { + "@discordjs/collection": "^0.7.0-dev", + "@sapphire/async-queue": "^1.3.1", + "@sapphire/snowflake": "^3.2.1", + "discord-api-types": "^0.33.0", + "tslib": "^2.3.1", + "undici": "^5.2.0" + }, + "engines": { + "node": ">=16.9.0" } }, "node_modules/@eslint/eslintrc": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", - "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.3.tgz", + "integrity": "sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA==", + "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.2.0", + "espree": "^9.3.2", "globals": "^13.9.0", - "ignore": "^4.0.6", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "engines": { - "node": ">= 4" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", "integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==", + "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -2000,7 +2010,8 @@ "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true }, "node_modules/@hutson/parse-repository-url": { "version": "3.0.2", @@ -2415,6 +2426,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -2427,6 +2439,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "engines": { "node": ">= 8" } @@ -2435,6 +2448,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -2444,18 +2458,36 @@ } }, "node_modules/@sapphire/async-queue": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.9.tgz", - "integrity": "sha512-CbXaGwwlEMq+l1TRu01FJCvySJ1CEFKFclHT48nIfNeZXaAAmmwwy7scUKmYHPUa3GhoMp6Qr1B3eAJux6XgOQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", + "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/shapeshift": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.0.0.tgz", + "integrity": "sha512-LTVj/a70UDzjOFaViMGpVzSzKYD2pBk0TmZIHnBf4vnytV7TK/L6XVN6hslq7R+qwRZyL/mzIldu6mAV6r7vzA==", + "engines": { + "node": ">=v15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/snowflake": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", + "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==", "engines": { "node": ">=v14.0.0", "npm": ">=7.0.0" } }, "node_modules/@sindresorhus/is": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.3.0.tgz", - "integrity": "sha512-wwOvh0eO3PiTEivGJWiZ+b946SlMSb4pe+y+Ur/4S87cwo09pYi+FWHHnbrM3W9W7cBYKDqQXcrFYjYUCOJUEQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "engines": { "node": ">=10" }, @@ -2605,7 +2637,8 @@ "node_modules/@types/json-schema": { "version": "7.0.9", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true }, "node_modules/@types/minimist": { "version": "1.2.2", @@ -2618,28 +2651,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.10.tgz", "integrity": "sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==" }, - "node_modules/@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", - "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "node_modules/@types/node-fetch/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -2666,9 +2677,9 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", - "integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", + "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", "dependencies": { "@types/node": "*" } @@ -2692,6 +2703,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz", "integrity": "sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q==", + "dev": true, "dependencies": { "@typescript-eslint/scope-manager": "5.10.2", "@typescript-eslint/type-utils": "5.10.2", @@ -2724,6 +2736,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.2.tgz", "integrity": "sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg==", + "dev": true, "dependencies": { "@typescript-eslint/scope-manager": "5.10.2", "@typescript-eslint/types": "5.10.2", @@ -2750,6 +2763,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz", "integrity": "sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw==", + "dev": true, "dependencies": { "@typescript-eslint/types": "5.10.2", "@typescript-eslint/visitor-keys": "5.10.2" @@ -2766,6 +2780,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz", "integrity": "sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw==", + "dev": true, "dependencies": { "@typescript-eslint/utils": "5.10.2", "debug": "^4.3.2", @@ -2791,6 +2806,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.2.tgz", "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==", + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -2803,6 +2819,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz", "integrity": "sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ==", + "dev": true, "dependencies": { "@typescript-eslint/types": "5.10.2", "@typescript-eslint/visitor-keys": "5.10.2", @@ -2829,6 +2846,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.2.tgz", "integrity": "sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg==", + "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@typescript-eslint/scope-manager": "5.10.2", @@ -2852,6 +2870,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz", "integrity": "sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q==", + "dev": true, "dependencies": { "@typescript-eslint/types": "5.10.2", "eslint-visitor-keys": "^3.0.0" @@ -2871,9 +2890,10 @@ "dev": true }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -2916,6 +2936,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -2952,6 +2973,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2967,6 +2989,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -2975,6 +2998,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -3008,7 +3032,8 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-ify": { "version": "1.0.0", @@ -3020,6 +3045,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, "engines": { "node": ">=8" } @@ -3036,7 +3062,8 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "node_modules/babel-jest": { "version": "27.5.1", @@ -3190,12 +3217,14 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3205,6 +3234,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -3273,6 +3303,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "engines": { "node": ">=6" } @@ -3317,6 +3348,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3403,6 +3435,7 @@ "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, "dependencies": { "color-name": "~1.1.4" }, @@ -3413,12 +3446,14 @@ "node_modules/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==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -3439,7 +3474,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "node_modules/concat-stream": { "version": "2.0.0", @@ -3815,6 +3851,7 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -4006,15 +4043,11 @@ "node": "*" } }, - "node_modules/dayjs": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.7.tgz", - "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==" - }, "node_modules/debug": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -4073,7 +4106,8 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true }, "node_modules/deepmerge": { "version": "4.2.2", @@ -4100,6 +4134,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, "engines": { "node": ">=0.4.0" } @@ -4145,6 +4180,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -4153,37 +4189,36 @@ } }, "node_modules/discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==", - "engines": { - "node": ">=12" - } + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.0.tgz", + "integrity": "sha512-RS1dMM6xuMhdHwQJ0T+XuCD7v1tKnyZ89Eq6q/DbOJWMbIh3ihgAzDhcF70QsFCtk9a5Gn9XU29S7eoEXuwQ5w==" }, "node_modules/discord.js": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz", - "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==", - "dependencies": { - "@discordjs/builders": "^0.11.0", - "@discordjs/collection": "^0.4.0", - "@sapphire/async-queue": "^1.1.9", - "@types/node-fetch": "^2.5.12", - "@types/ws": "^8.2.2", - "discord-api-types": "^0.26.0", - "form-data": "^4.0.0", - "node-fetch": "^2.6.1", - "ws": "^8.4.0" - }, - "engines": { - "node": ">=16.6.0", - "npm": ">=7.0.0" + "version": "14.0.0-dev.1653091711-fdeac9d", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.0-dev.1653091711-fdeac9d.tgz", + "integrity": "sha512-wXx4tuWUcIadzWkfHgB190AUif5YXSA8udZ16F/S1kH37QeKGUsBGlAyn2WRmw/3oP2QA2FUIcJUQCGdcUExPg==", + "dependencies": { + "@discordjs/builders": "^0.14.0-dev", + "@discordjs/collection": "^0.7.0-dev", + "@discordjs/rest": "^0.5.0-dev", + "@sapphire/snowflake": "^3.2.1", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.33.0", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.3.1", + "undici": "^5.2.0", + "ws": "^8.5.0" + }, + "engines": { + "node": ">=16.9.0" } }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -4344,6 +4379,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "engines": { "node": ">=10" }, @@ -4434,11 +4470,12 @@ } }, "node_modules/eslint": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.8.0.tgz", - "integrity": "sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.15.0.tgz", + "integrity": "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==", + "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.0.5", + "@eslint/eslintrc": "^1.2.3", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -4446,10 +4483,10 @@ "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", + "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.2.0", - "espree": "^9.3.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -4465,7 +4502,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -4488,6 +4525,7 @@ "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, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -4500,6 +4538,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, "dependencies": { "eslint-visitor-keys": "^2.0.0" }, @@ -4517,22 +4556,25 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, "engines": { "node": ">=10" } }, "node_modules/eslint-visitor-keys": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", - "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", - "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -4545,18 +4587,20 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/espree": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", - "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "dev": true, "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.1.0" + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -4579,6 +4623,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -4590,6 +4635,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { "node": ">=4.0" } @@ -4598,6 +4644,7 @@ "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, "dependencies": { "estraverse": "^5.2.0" }, @@ -4609,6 +4656,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { "node": ">=4.0" } @@ -4617,6 +4665,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, "engines": { "node": ">=4.0" } @@ -4625,6 +4674,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -4709,6 +4759,7 @@ "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -4724,6 +4775,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -4734,17 +4786,20 @@ "node_modules/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==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -4762,6 +4817,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, "dependencies": { "flat-cache": "^3.0.4" }, @@ -4773,6 +4829,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -4800,6 +4857,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, "dependencies": { "flatted": "^3.1.0", "rimraf": "^3.0.2" @@ -4811,20 +4869,8 @@ "node_modules/flatted": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true }, "node_modules/fs-access": { "version": "1.0.1", @@ -4841,7 +4887,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -4866,7 +4913,8 @@ "node_modules/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=" + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -5049,6 +5097,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5068,6 +5117,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -5089,9 +5139,10 @@ } }, "node_modules/globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "dev": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -5106,6 +5157,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -5173,6 +5225,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -5271,6 +5324,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, "engines": { "node": ">= 4" } @@ -5279,6 +5333,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -5313,6 +5368,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, "engines": { "node": ">=0.8.19" } @@ -5330,6 +5386,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -5338,7 +5395,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/ini": { "version": "1.3.8", @@ -5368,6 +5426,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5385,6 +5444,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -5396,6 +5456,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -5463,7 +5524,8 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", @@ -6190,6 +6252,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -6340,12 +6403,14 @@ "node_modules/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==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/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=" + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", @@ -6430,6 +6495,7 @@ "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, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -6532,7 +6598,13 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=" }, "node_modules/longest": { "version": "2.0.1", @@ -6547,6 +6619,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -6800,6 +6873,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "engines": { "node": ">= 8" } @@ -6808,6 +6882,7 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, "dependencies": { "braces": "^3.0.1", "picomatch": "^2.2.3" @@ -6820,6 +6895,7 @@ "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true, "engines": { "node": ">= 0.6" } @@ -6828,6 +6904,7 @@ "version": "2.1.34", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dev": true, "dependencies": { "mime-db": "1.51.0" }, @@ -6845,9 +6922,10 @@ } }, "node_modules/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6856,9 +6934,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/minimist-options": { @@ -6887,12 +6965,14 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true }, "node_modules/neo-async": { "version": "2.6.2", @@ -6900,25 +6980,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -7013,6 +7074,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "dependencies": { "wrappy": "1" } @@ -7021,6 +7083,7 @@ "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -7076,6 +7139,7 @@ "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, "dependencies": { "callsites": "^3.0.0" }, @@ -7120,6 +7184,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -7128,6 +7193,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, "engines": { "node": ">=8" } @@ -7142,6 +7208,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } @@ -7156,6 +7223,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -7249,19 +7317,24 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "dev": true, "bin": { "prettier": "bin-prettier.js" }, "engines": { "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/pretty-format": { @@ -7319,6 +7392,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, "engines": { "node": ">=6" } @@ -7337,6 +7411,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -7573,6 +7648,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, "engines": { "node": ">=8" }, @@ -7675,6 +7751,7 @@ "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, "engines": { "node": ">=4" } @@ -7705,6 +7782,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -7723,6 +7801,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -7737,6 +7816,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -7755,6 +7835,14 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/rxjs": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz", + "integrity": "sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==", + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -7797,6 +7885,7 @@ "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -7811,6 +7900,7 @@ "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, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -7822,6 +7912,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, "engines": { "node": ">=8" } @@ -7853,6 +7944,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } @@ -8103,6 +8195,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -8144,6 +8237,7 @@ "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, "engines": { "node": ">=8" }, @@ -8155,6 +8249,7 @@ "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, "dependencies": { "has-flag": "^4.0.0" }, @@ -8262,7 +8357,8 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true }, "node_modules/throat": { "version": "6.0.1", @@ -8304,6 +8400,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -8325,11 +8422,6 @@ "node": ">=6" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -8340,9 +8432,9 @@ } }, "node_modules/ts-mixer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", - "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.1.tgz", + "integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==" }, "node_modules/ts-node": { "version": "10.5.0", @@ -8387,6 +8479,11 @@ } } }, + "node_modules/ts-pattern": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-4.0.2.tgz", + "integrity": "sha512-eHqR/7A6fcw05vCOfnL6RwgGJbVi9G/YHTdYdjYmElhDdJ1SMn7pWs+6+YuxygaFwQS/g+cIDlu+UD8IVpur1A==" + }, "node_modules/ts-results": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/ts-results/-/ts-results-3.3.0.tgz", @@ -8401,6 +8498,7 @@ "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, "dependencies": { "tslib": "^1.8.1" }, @@ -8414,12 +8512,14 @@ "node_modules/tsutils/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true }, "node_modules/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, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -8440,6 +8540,7 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, "engines": { "node": ">=10" }, @@ -8488,6 +8589,7 @@ "version": "4.5.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8509,6 +8611,14 @@ "node": ">=0.8.0" } }, + "node_modules/undici": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.2.0.tgz", + "integrity": "sha512-XY6+NS3WH9b3TKOHeNz2CjR+qrVz/k4fO9g3etPpLozRvULoQmZ1+dk9JbIz40ehn27xzFk4jYVU2MU3Nle62A==", + "engines": { + "node": ">=12.18" + } + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -8562,6 +8672,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -8575,7 +8686,8 @@ "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true }, "node_modules/v8-compile-cache-lib": { "version": "3.0.0", @@ -8659,11 +8771,6 @@ "makeerror": "1.0.12" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, "node_modules/whatwg-encoding": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", @@ -8679,19 +8786,11 @@ "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", "dev": true }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -8706,6 +8805,7 @@ "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, "engines": { "node": ">=0.10.0" } @@ -8759,7 +8859,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "node_modules/write-file-atomic": { "version": "3.0.3", @@ -8774,9 +8875,9 @@ } }, "node_modules/ws": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz", - "integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", "engines": { "node": ">=10.0.0" }, @@ -8826,7 +8927,8 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/yaml": { "version": "1.10.2", @@ -8909,14 +9011,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zod": { - "version": "3.11.6", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz", - "integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } }, "dependencies": { @@ -10278,49 +10372,58 @@ } }, "@discordjs/builders": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz", - "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==", + "version": "0.14.0-dev.1653091712-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.14.0-dev.1653091712-fdeac9d.tgz", + "integrity": "sha512-7/esDI5KkDBI8sxSNFmPYNQXMUTbopD4FkjBAm+nQmp5Xxda1xFjWvi3oJ7QC8l/IVanUAD47xxrb8lhckMRzA==", "requires": { - "@sindresorhus/is": "^4.2.0", - "discord-api-types": "^0.26.0", - "ts-mixer": "^6.0.0", - "tslib": "^2.3.1", - "zod": "^3.11.6" + "@sapphire/shapeshift": "^3.0.0", + "@sindresorhus/is": "^4.6.0", + "discord-api-types": "^0.33.0", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.1", + "tslib": "^2.3.1" } }, "@discordjs/collection": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", - "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==" + "version": "0.7.0-dev.1653091708-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0-dev.1653091708-fdeac9d.tgz", + "integrity": "sha512-21gKkNVlqWMTf5kkZ2uAkfe8kU149w/JXC9Vpu7nNEir6A5AHNPULtd+1FssvXYAfoEnzus7/gZC6pYD5eX/gQ==" + }, + "@discordjs/rest": { + "version": "0.5.0-dev.1653091732-fdeac9d", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.5.0-dev.1653091732-fdeac9d.tgz", + "integrity": "sha512-2XIobHE+C0X/LFJC205CSeiHKvt0aBRqYb5dwAoq6VsZAprmvL+Mma0V2bKWInaOCmrr85X+XlEgQf+H22CK+A==", + "requires": { + "@discordjs/collection": "^0.7.0-dev", + "@sapphire/async-queue": "^1.3.1", + "@sapphire/snowflake": "^3.2.1", + "discord-api-types": "^0.33.0", + "tslib": "^2.3.1", + "undici": "^5.2.0" + } }, "@eslint/eslintrc": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", - "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.3.tgz", + "integrity": "sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA==", + "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.2.0", + "espree": "^9.3.2", "globals": "^13.9.0", - "ignore": "^4.0.6", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" - } } }, "@humanwhocodes/config-array": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", "integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==", + "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -10330,7 +10433,8 @@ "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true }, "@hutson/parse-repository-url": { "version": "3.0.2", @@ -10655,6 +10759,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -10663,26 +10768,38 @@ "@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true }, "@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "@sapphire/async-queue": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.9.tgz", - "integrity": "sha512-CbXaGwwlEMq+l1TRu01FJCvySJ1CEFKFclHT48nIfNeZXaAAmmwwy7scUKmYHPUa3GhoMp6Qr1B3eAJux6XgOQ==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.1.tgz", + "integrity": "sha512-FFTlPOWZX1kDj9xCAsRzH5xEJfawg1lNoYAA+ecOWJMHOfiZYb1uXOI3ne9U4UILSEPwfE68p3T9wUHwIQfR0g==" + }, + "@sapphire/shapeshift": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.0.0.tgz", + "integrity": "sha512-LTVj/a70UDzjOFaViMGpVzSzKYD2pBk0TmZIHnBf4vnytV7TK/L6XVN6hslq7R+qwRZyL/mzIldu6mAV6r7vzA==" + }, + "@sapphire/snowflake": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.2.2.tgz", + "integrity": "sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ==" }, "@sindresorhus/is": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.3.0.tgz", - "integrity": "sha512-wwOvh0eO3PiTEivGJWiZ+b946SlMSb4pe+y+Ur/4S87cwo09pYi+FWHHnbrM3W9W7cBYKDqQXcrFYjYUCOJUEQ==" + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==" }, "@sinonjs/commons": { "version": "1.8.3", @@ -10823,7 +10940,8 @@ "@types/json-schema": { "version": "7.0.9", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true }, "@types/minimist": { "version": "1.2.2", @@ -10836,27 +10954,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.10.tgz", "integrity": "sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==" }, - "@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - }, - "dependencies": { - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } - }, "@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -10883,9 +10980,9 @@ "dev": true }, "@types/ws": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", - "integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", + "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", "requires": { "@types/node": "*" } @@ -10909,6 +11006,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz", "integrity": "sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q==", + "dev": true, "requires": { "@typescript-eslint/scope-manager": "5.10.2", "@typescript-eslint/type-utils": "5.10.2", @@ -10925,6 +11023,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.2.tgz", "integrity": "sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg==", + "dev": true, "requires": { "@typescript-eslint/scope-manager": "5.10.2", "@typescript-eslint/types": "5.10.2", @@ -10936,6 +11035,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz", "integrity": "sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw==", + "dev": true, "requires": { "@typescript-eslint/types": "5.10.2", "@typescript-eslint/visitor-keys": "5.10.2" @@ -10945,6 +11045,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz", "integrity": "sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw==", + "dev": true, "requires": { "@typescript-eslint/utils": "5.10.2", "debug": "^4.3.2", @@ -10954,12 +11055,14 @@ "@typescript-eslint/types": { "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.2.tgz", - "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==" + "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==", + "dev": true }, "@typescript-eslint/typescript-estree": { "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz", "integrity": "sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ==", + "dev": true, "requires": { "@typescript-eslint/types": "5.10.2", "@typescript-eslint/visitor-keys": "5.10.2", @@ -10974,6 +11077,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.2.tgz", "integrity": "sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg==", + "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@typescript-eslint/scope-manager": "5.10.2", @@ -10987,6 +11091,7 @@ "version": "5.10.2", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz", "integrity": "sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q==", + "dev": true, "requires": { "@typescript-eslint/types": "5.10.2", "eslint-visitor-keys": "^3.0.0" @@ -10999,9 +11104,10 @@ "dev": true }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "dev": true }, "acorn-globals": { "version": "6.0.0", @@ -11031,6 +11137,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, "requires": {} }, "acorn-walk": { @@ -11059,6 +11166,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -11069,12 +11177,14 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "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" } @@ -11099,7 +11209,8 @@ "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "array-ify": { "version": "1.0.0", @@ -11110,7 +11221,8 @@ "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true }, "arrify": { "version": "1.0.1", @@ -11121,7 +11233,8 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "babel-jest": { "version": "27.5.1", @@ -11244,12 +11357,14 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -11259,6 +11374,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -11310,7 +11426,8 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true }, "camelcase": { "version": "5.3.1", @@ -11339,6 +11456,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -11408,6 +11526,7 @@ "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" } @@ -11415,12 +11534,14 @@ "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==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -11438,7 +11559,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "2.0.0", @@ -11738,6 +11860,7 @@ "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", @@ -11891,15 +12014,11 @@ "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", "dev": true }, - "dayjs": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.7.tgz", - "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==" - }, "debug": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, "requires": { "ms": "2.1.2" } @@ -11943,7 +12062,8 @@ "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true }, "deepmerge": { "version": "4.2.2", @@ -11963,7 +12083,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "detect-indent": { "version": "6.0.0", @@ -11994,35 +12115,39 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "requires": { "path-type": "^4.0.0" } }, "discord-api-types": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", - "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==" + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.0.tgz", + "integrity": "sha512-RS1dMM6xuMhdHwQJ0T+XuCD7v1tKnyZ89Eq6q/DbOJWMbIh3ihgAzDhcF70QsFCtk9a5Gn9XU29S7eoEXuwQ5w==" }, "discord.js": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz", - "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==", - "requires": { - "@discordjs/builders": "^0.11.0", - "@discordjs/collection": "^0.4.0", - "@sapphire/async-queue": "^1.1.9", - "@types/node-fetch": "^2.5.12", - "@types/ws": "^8.2.2", - "discord-api-types": "^0.26.0", - "form-data": "^4.0.0", - "node-fetch": "^2.6.1", - "ws": "^8.4.0" + "version": "14.0.0-dev.1653091711-fdeac9d", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.0-dev.1653091711-fdeac9d.tgz", + "integrity": "sha512-wXx4tuWUcIadzWkfHgB190AUif5YXSA8udZ16F/S1kH37QeKGUsBGlAyn2WRmw/3oP2QA2FUIcJUQCGdcUExPg==", + "requires": { + "@discordjs/builders": "^0.14.0-dev", + "@discordjs/collection": "^0.7.0-dev", + "@discordjs/rest": "^0.5.0-dev", + "@sapphire/snowflake": "^3.2.1", + "@types/ws": "^8.5.3", + "discord-api-types": "^0.33.0", + "fast-deep-equal": "^3.1.3", + "lodash.snakecase": "^4.1.1", + "tslib": "^2.3.1", + "undici": "^5.2.0", + "ws": "^8.5.0" } }, "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" } @@ -12144,7 +12269,8 @@ "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true }, "escodegen": { "version": "2.0.0", @@ -12207,11 +12333,12 @@ } }, "eslint": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.8.0.tgz", - "integrity": "sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.15.0.tgz", + "integrity": "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==", + "dev": true, "requires": { - "@eslint/eslintrc": "^1.0.5", + "@eslint/eslintrc": "^1.2.3", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -12219,10 +12346,10 @@ "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", + "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.2.0", - "espree": "^9.3.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -12238,7 +12365,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -12249,9 +12376,10 @@ }, "dependencies": { "eslint-scope": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", - "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -12260,7 +12388,8 @@ "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true } } }, @@ -12268,6 +12397,7 @@ "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" @@ -12277,6 +12407,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, "requires": { "eslint-visitor-keys": "^2.0.0" }, @@ -12284,23 +12415,26 @@ "eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==" + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true } } }, "eslint-visitor-keys": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", - "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true }, "espree": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", - "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "dev": true, "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.1.0" + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" } }, "esprima": { @@ -12313,6 +12447,7 @@ "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" }, @@ -12320,7 +12455,8 @@ "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true } } }, @@ -12328,6 +12464,7 @@ "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" }, @@ -12335,19 +12472,22 @@ "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true } } }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + "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==" + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true }, "execa": { "version": "5.1.1", @@ -12410,6 +12550,7 @@ "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -12422,6 +12563,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -12431,17 +12573,20 @@ "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==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true }, "fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, "requires": { "reusify": "^1.0.4" } @@ -12459,6 +12604,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, "requires": { "flat-cache": "^3.0.4" } @@ -12467,6 +12613,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -12485,6 +12632,7 @@ "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" @@ -12493,17 +12641,8 @@ "flatted": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true }, "fs-access": { "version": "1.0.1", @@ -12517,7 +12656,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "2.3.2", @@ -12535,7 +12675,8 @@ "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=" + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true }, "gensync": { "version": "1.0.0-beta.2", @@ -12680,6 +12821,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -12693,6 +12835,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, "requires": { "is-glob": "^4.0.3" } @@ -12708,9 +12851,10 @@ } }, "globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "dev": true, "requires": { "type-fest": "^0.20.2" } @@ -12719,6 +12863,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -12765,7 +12910,8 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "has-symbols": { "version": "1.0.2", @@ -12836,12 +12982,14 @@ "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "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" @@ -12860,7 +13008,8 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true }, "indent-string": { "version": "4.0.0", @@ -12872,6 +13021,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -12880,7 +13030,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "ini": { "version": "1.3.8", @@ -12906,7 +13057,8 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true }, "is-generator-fn": { "version": "2.1.0", @@ -12918,6 +13070,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -12925,7 +13078,8 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-obj": { "version": "2.0.0", @@ -12975,7 +13129,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "istanbul-lib-coverage": { "version": "3.2.0", @@ -13542,6 +13697,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "requires": { "argparse": "^2.0.1" } @@ -13648,12 +13804,14 @@ "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==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "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=" + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, "json-stringify-safe": { "version": "5.0.1", @@ -13714,6 +13872,7 @@ "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" @@ -13797,7 +13956,13 @@ "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=" }, "longest": { "version": "2.0.1", @@ -13809,6 +13974,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "requires": { "yallist": "^4.0.0" } @@ -14000,12 +14166,14 @@ "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true }, "micromatch": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, "requires": { "braces": "^3.0.1", "picomatch": "^2.2.3" @@ -14014,12 +14182,14 @@ "mime-db": { "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true }, "mime-types": { "version": "2.1.34", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dev": true, "requires": { "mime-db": "1.51.0" } @@ -14031,17 +14201,18 @@ "dev": true }, "minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "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==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "minimist-options": { @@ -14064,12 +14235,14 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true }, "neo-async": { "version": "2.6.2", @@ -14077,14 +14250,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -14158,6 +14323,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } @@ -14166,6 +14332,7 @@ "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", @@ -14203,6 +14370,7 @@ "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" } @@ -14234,12 +14402,14 @@ "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=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true }, "path-parse": { "version": "1.0.7", @@ -14250,7 +14420,8 @@ "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "picocolors": { "version": "1.0.0", @@ -14261,7 +14432,8 @@ "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, "pify": { "version": "2.3.0", @@ -14326,12 +14498,14 @@ "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true }, "prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "dev": true }, "pretty-format": { "version": "27.5.1", @@ -14377,7 +14551,8 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "q": { "version": "1.5.1", @@ -14388,7 +14563,8 @@ "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true }, "quick-lru": { "version": "4.0.1", @@ -14569,7 +14745,8 @@ "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==" + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true }, "regexpu-core": { "version": "5.0.1", @@ -14645,7 +14822,8 @@ "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==" + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true }, "resolve-global": { "version": "1.0.0", @@ -14666,7 +14844,8 @@ "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true }, "right-pad": { "version": "1.0.1", @@ -14678,6 +14857,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "requires": { "glob": "^7.1.3" } @@ -14686,10 +14866,19 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "requires": { "queue-microtask": "^1.2.2" } }, + "rxjs": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.5.tgz", + "integrity": "sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==", + "requires": { + "tslib": "^2.1.0" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -14715,6 +14904,7 @@ "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -14723,6 +14913,7 @@ "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" } @@ -14730,7 +14921,8 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true }, "shiki": { "version": "0.10.1", @@ -14758,7 +14950,8 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true }, "source-map": { "version": "0.6.1", @@ -14968,6 +15161,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -14996,12 +15190,14 @@ "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==" + "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" } @@ -15075,7 +15271,8 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true }, "throat": { "version": "6.0.1", @@ -15114,6 +15311,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "requires": { "is-number": "^7.0.0" } @@ -15129,11 +15327,6 @@ "universalify": "^0.1.2" } }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, "trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -15141,9 +15334,9 @@ "dev": true }, "ts-mixer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", - "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.1.tgz", + "integrity": "sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg==" }, "ts-node": { "version": "10.5.0", @@ -15167,6 +15360,11 @@ "yn": "3.1.1" } }, + "ts-pattern": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-4.0.2.tgz", + "integrity": "sha512-eHqR/7A6fcw05vCOfnL6RwgGJbVi9G/YHTdYdjYmElhDdJ1SMn7pWs+6+YuxygaFwQS/g+cIDlu+UD8IVpur1A==" + }, "ts-results": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/ts-results/-/ts-results-3.3.0.tgz", @@ -15181,6 +15379,7 @@ "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, "requires": { "tslib": "^1.8.1" }, @@ -15188,7 +15387,8 @@ "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true } } }, @@ -15196,6 +15396,7 @@ "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" } @@ -15209,7 +15410,8 @@ "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true }, "typedarray": { "version": "0.0.6", @@ -15242,7 +15444,8 @@ "typescript": { "version": "4.5.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==" + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "dev": true }, "uglify-js": { "version": "3.15.1", @@ -15251,6 +15454,11 @@ "dev": true, "optional": true }, + "undici": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.2.0.tgz", + "integrity": "sha512-XY6+NS3WH9b3TKOHeNz2CjR+qrVz/k4fO9g3etPpLozRvULoQmZ1+dk9JbIz40ehn27xzFk4jYVU2MU3Nle62A==" + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -15289,6 +15497,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "requires": { "punycode": "^2.1.0" } @@ -15302,7 +15511,8 @@ "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true }, "v8-compile-cache-lib": { "version": "3.0.0", @@ -15379,11 +15589,6 @@ "makeerror": "1.0.12" } }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, "whatwg-encoding": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", @@ -15399,19 +15604,11 @@ "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", "dev": true }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "requires": { "isexe": "^2.0.0" } @@ -15419,7 +15616,8 @@ "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==" + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true }, "wordwrap": { "version": "1.0.0", @@ -15460,7 +15658,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "write-file-atomic": { "version": "3.0.3", @@ -15475,9 +15674,9 @@ } }, "ws": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz", - "integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", "requires": {} }, "xml-name-validator": { @@ -15507,7 +15706,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "yaml": { "version": "1.10.2", @@ -15568,11 +15768,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true - }, - "zod": { - "version": "3.11.6", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz", - "integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg==" } } } diff --git a/package.json b/package.json index 629c9d0b..20e29431 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "sern-handler", - "version": "0.1.0", + "name": "@sern/handler", + "version": "0.0.1", "description": "", "main": "dist/index.js", "scripts": { @@ -11,21 +11,21 @@ "release": "standard-version && git push --follow-tags", "test": "jest --coverage --verbose", "commit": "cz", - "docs" : "typedoc src/index.ts --out docs" + "docs": "typedoc src/index.ts --out docs" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.10.2", - "@typescript-eslint/parser": "^5.10.2", - "dayjs": "^1.10.7", - "discord.js": "^13.6.0", - "eslint": "^8.8.0", - "prettier": "^2.5.1", + "discord.js": "^14.0.0-dev.1647259751.2297c2b", + "rxjs": "^7.5.5", + "ts-pattern": "^4.0.2", "ts-results": "^3.3.0" }, "devDependencies": { + "eslint": "^8.8.0", + "@typescript-eslint/parser": "^5.10.2", + "@typescript-eslint/eslint-plugin": "^5.10.2", "@babel/core": "^7.17.2", "@babel/preset-env": "^7.16.11", "@babel/preset-typescript": "^7.16.7", @@ -33,6 +33,7 @@ "babel-jest": "^27.5.1", "cz-conventional-changelog": "^3.0.1", "jest": "^27.5.1", + "prettier": "2.6.2", "standard-version": "^9.3.2", "typedoc": "^0.22.11", "typescript": "^4.5.5" diff --git a/src/handler/events/interactionCreate.ts b/src/handler/events/interactionCreate.ts new file mode 100644 index 00000000..2c8e5c1b --- /dev/null +++ b/src/handler/events/interactionCreate.ts @@ -0,0 +1,232 @@ +import type { + CommandInteraction, + Interaction, + MessageComponentInteraction, + ModalSubmitInteraction, + SelectMenuInteraction, +} from 'discord.js'; +import { concatMap, fromEvent, map, Observable, of, throwError } from 'rxjs'; +import type Wrapper from '../structures/wrapper'; +import * as Files from '../utilities/readFile'; +import { match } from 'ts-pattern'; +import { SernError } from '../structures/errors'; +import Context from '../structures/context'; +import { controller } from '../sern'; +import type { Module } from '../structures/module'; +import { + isButton, + isChatInputCommand, + isMessageCtxMenuCmd, + isPromise, + isSelectMenu, + isUserContextMenuCmd, +} from '../utilities/predicates'; +import { filterCorrectModule } from './observableHandling'; +import { CommandType } from '../structures/enums'; +import type { Result } from 'ts-results'; +import type { AutocompleteInteraction } from 'discord.js'; + +function applicationCommandHandler(mod: Module | undefined, interaction: CommandInteraction) { + const mod$ = (cmdTy: T) => of(mod).pipe(filterCorrectModule(cmdTy)); + return ( + match(interaction) + .when(isChatInputCommand, i => { + const ctx = Context.wrap(i); + return mod$(CommandType.Slash).pipe( + concatMap(m => { + return of( + m.onEvent.map(e => e.execute([ctx, ['slash', i.options]], controller)), + ).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx, ['slash', i.options]); + }, + })), + ); + }), + ); + }) + //Todo: refactor so that we dont have to have two separate branches. They're near identical!! + //Only thing that differs is type of interaction + .when(isMessageCtxMenuCmd, ctx => { + return mod$(CommandType.MenuMsg).pipe( + concatMap(m => { + return of(m.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx); + }, + })), + ); + }), + ); + }) + .when(isUserContextMenuCmd, ctx => { + return mod$(CommandType.MenuUser).pipe( + concatMap(m => { + return of(m.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx); + }, + })), + ); + }), + ); + }) + .run() + ); +} + +function messageComponentInteractionHandler( + mod: Module | undefined, + interaction: MessageComponentInteraction, +) { + const mod$ = (ty: T) => of(mod).pipe(filterCorrectModule(ty)); + //Todo: refactor so that we dont have to have two separate branches. They're near identical!! + //Only thing that differs is type of interaction + return match(interaction) + .when(isButton, ctx => { + return mod$(CommandType.Button).pipe( + concatMap(m => { + return of(m.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx); + }, + })), + ); + }), + ); + }) + .when(isSelectMenu, (ctx: SelectMenuInteraction) => { + return mod$(CommandType.MenuSelect).pipe( + concatMap(m => { + return of(m.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return m.execute(ctx); + }, + })), + ); + }), + ); + }) + .otherwise(() => throwError(() => SernError.NotSupportedInteraction)); +} + +function modalHandler(modul: Module | undefined, ctx: ModalSubmitInteraction) { + return of(modul).pipe( + filterCorrectModule(CommandType.Modal), + concatMap(mod => { + return of(mod.onEvent.map(e => e.execute([ctx], controller))).pipe( + map(res => ({ + mod, + res, + execute() { + return mod.execute(ctx); + }, + })), + ); + }), + ); +} + +function autoCmpHandler(mod: Module | undefined, interaction: AutocompleteInteraction) { + return of(mod).pipe( + filterCorrectModule(CommandType.Slash), + concatMap(mod => { + const choice = interaction.options.getFocused(true); + const selectedOption = mod.options?.find(o => o.autocomplete && o.name === choice.name); + if (selectedOption !== undefined && selectedOption.autocomplete) { + return of( + selectedOption.command.onEvent.map(e => e.execute([interaction], controller)), + ).pipe( + map(res => ({ + mod, + res, + execute() { + return selectedOption.command.execute(interaction); + }, + })), + ); + } + return throwError( + () => + SernError.NotSupportedInteraction + + ` There is probably no autocomplete tag for this option`, + ); + }), + ); +} + +export function onInteractionCreate(wrapper: Wrapper) { + const { client } = wrapper; + + const interactionEvent$ = >fromEvent(client, 'interactionCreate'); + + interactionEvent$ + .pipe( + /*processing plugins*/ + concatMap(interaction => { + if (interaction.isCommand()) { + const modul = + Files.ApplicationCommands[interaction.commandType].get( + interaction.commandName, + ) ?? Files.BothCommands.get(interaction.commandName); + return applicationCommandHandler(modul, interaction); + } + if (interaction.isMessageComponent()) { + const modul = Files.MessageCompCommands[interaction.componentType].get( + interaction.customId, + ); + return messageComponentInteractionHandler(modul, interaction); + } + if (interaction.isModalSubmit()) { + const modul = Files.ModalSubmitCommands.get(interaction.customId); + return modalHandler(modul, interaction); + } + if (interaction.isAutocomplete()) { + const modul = + Files.ApplicationCommands['1'].get(interaction.commandName) ?? + Files.BothCommands.get(interaction.commandName); + return autoCmpHandler(modul, interaction); + } + return throwError(() => SernError.NotSupportedInteraction); + }), + ) + .subscribe({ + async next({ mod, res: eventPluginRes, execute }) { + const ePlugArr: Result[] = []; + for await (const res of eventPluginRes) { + if (isPromise(res)) { + ePlugArr.push(res); + } + ePlugArr.push(res as Awaited>); + } + if (ePlugArr.every(e => e.ok)) { + await execute(); + wrapper.sernEmitter?.emit('module.activate', { success: true, module: mod! }); + } else { + wrapper.sernEmitter?.emit('module.activate', { + success: false, + module: mod!, + reason: SernError.PluginFailure, + }); + } + }, + error(err) { + wrapper.sernEmitter?.emit('error', err); + }, + }); +} diff --git a/src/handler/events/messageEvent.ts b/src/handler/events/messageEvent.ts new file mode 100644 index 00000000..9b5d7ccd --- /dev/null +++ b/src/handler/events/messageEvent.ts @@ -0,0 +1,71 @@ +import type { Message } from 'discord.js'; +import { concatMap, from, fromEvent, map, Observable, of } from 'rxjs'; +import type { Args } from '../..'; +import { controller } from '../sern'; +import Context from '../structures/context'; +import type Wrapper from '../structures/wrapper'; +import { fmt } from '../utilities/messageHelpers'; +import * as Files from '../utilities/readFile'; +import { filterCorrectModule, ignoreNonBot } from './observableHandling'; +import { CommandType } from '../structures/enums'; +import { SernError } from '../structures/errors'; + +export const onMessageCreate = (wrapper: Wrapper) => { + const { client, defaultPrefix } = wrapper; + if (defaultPrefix === undefined) return; + + const messageEvent$ = >fromEvent(client, 'messageCreate'); + + const processMessage$ = messageEvent$.pipe( + ignoreNonBot(defaultPrefix), + map(message => { + const [prefix, ...rest] = fmt(message, defaultPrefix); + return { + ctx: Context.wrap(message), + args: ['text', rest], + mod: + Files.TextCommands.text.get(prefix) ?? + Files.BothCommands.get(prefix) ?? + Files.TextCommands.aliases.get(prefix), + }; + }), + ); + const ensureModuleType$ = processMessage$.pipe( + concatMap(payload => + of(payload.mod).pipe( + filterCorrectModule(CommandType.Text), + map(mod => ({ ...payload, mod })), + ), + ), + ); + + const processEventPlugins$ = ensureModuleType$.pipe( + concatMap(({ ctx, args, mod }) => { + const res = Promise.all( + mod.onEvent.map(ePlug => { + return ePlug.execute([ctx, args], controller); + }), + ); + return from(res).pipe(map(res => ({ mod, ctx, args, res }))); + }), + ); + + processEventPlugins$.subscribe({ + next({ mod, ctx, args, res }) { + if (res.every(pl => pl.ok)) { + Promise.resolve(mod.execute(ctx, args)).then(() => { + wrapper.sernEmitter?.emit('module.activate', { success: true, module: mod! }); + }); + } else { + wrapper.sernEmitter?.emit('module.activate', { + success: false, + module: mod!, + reason: SernError.PluginFailure, + }); + } + }, + error(e) { + wrapper.sernEmitter?.emit('error', e); + }, + }); +}; diff --git a/src/handler/events/observableHandling.ts b/src/handler/events/observableHandling.ts new file mode 100644 index 00000000..ca744540 --- /dev/null +++ b/src/handler/events/observableHandling.ts @@ -0,0 +1,44 @@ +import type { Message } from 'discord.js'; +import { Observable, throwError } from 'rxjs'; +import { SernError } from '../structures/errors'; +import type { Module, ModuleDefs } from '../structures/module'; +import { correctModuleType } from '../utilities/predicates'; +export function filterCorrectModule(cmdType: T) { + return (src: Observable) => + new Observable(subscriber => { + return src.subscribe({ + next(mod) { + if (mod === undefined) { + return throwError(() => SernError.UndefinedModule); + } + if (correctModuleType(mod, cmdType)) { + subscriber.next(mod!); + } else { + return throwError(() => SernError.MismatchModule); + } + }, + error: e => subscriber.error(e), + complete: () => subscriber.complete(), + }); + }); +} + +export function ignoreNonBot(prefix: string) { + return (src: Observable) => + new Observable(subscriber => { + return src.subscribe({ + next(m) { + const messageFromHumanAndHasPrefix = + !m.author.bot && + m.content + .slice(0, prefix.length) + .localeCompare(prefix, undefined, { sensitivity: 'accent' }) === 0; + if (messageFromHumanAndHasPrefix) { + subscriber.next(m); + } + }, + error: e => subscriber.error(e), + complete: () => subscriber.complete(), + }); + }); +} diff --git a/src/handler/events/readyEvent.ts b/src/handler/events/readyEvent.ts new file mode 100644 index 00000000..224a2ae2 --- /dev/null +++ b/src/handler/events/readyEvent.ts @@ -0,0 +1,140 @@ +import { + concat, + concatMap, + from, + fromEvent, + map, + Observable, + of, + skip, + take, + throwError, +} from 'rxjs'; +import { basename } from 'path'; +import * as Files from '../utilities/readFile'; +import type Wrapper from '../structures/wrapper'; +import { controller } from '../sern'; +import type { Result } from 'ts-results'; +import { Err, Ok } from 'ts-results'; +import type { Awaitable } from 'discord.js'; +import { ApplicationCommandType, ComponentType } from 'discord.js'; +import type { Module } from '../structures/module'; +import { match } from 'ts-pattern'; +import { SernError } from '../structures/errors'; +import type { DefinitelyDefined } from '../../types/handler'; +import { CommandType, PluginType } from '../structures/enums'; + +export const onReady = (wrapper: Wrapper) => { + const { client, commands } = wrapper; + const ready$ = fromEvent(client, 'ready').pipe(take(1), skip(1)); + const processCommandFiles$ = Files.buildData(commands).pipe( + map(({ mod, absPath }) => { + if (mod?.name === undefined) { + const name = Files.fmtFileName(basename(absPath)); + return { name, ...mod }; + } + return mod; + }), + ); + const processPlugins$ = processCommandFiles$.pipe( + concatMap(mod => { + if (mod.type === CommandType.Autocomplete) { + return throwError( + () => + SernError.NonValidModuleType + + `. You cannot use command plugins and Autocomplete.`, + ); + } + const cmdPluginsRes = + mod.plugins?.map(plug => { + return { + ...plug, + name: plug?.name ?? 'Unnamed Plugin', + execute: plug.execute(client, mod, controller), + }; + }) ?? []; + return of({ mod, cmdPluginsRes }); + }), + ); + + ( + concat(ready$, processPlugins$) as Observable<{ + mod: DefinitelyDefined; + cmdPluginsRes: { + execute: Awaitable>; + type: PluginType.Command; + name: string; + description: string; + }[]; + }> + ) + .pipe( + concatMap(pl => + from( + Promise.all( + pl.cmdPluginsRes.map(async e => ({ ...e, execute: await e.execute })), + ), + ).pipe(map(res => ({ ...pl, cmdPluginsRes: res }))), + ), + ) + .subscribe(({ mod, cmdPluginsRes }) => { + const loadedPluginsCorrectly = cmdPluginsRes.every(res => res.execute.ok); + if (loadedPluginsCorrectly) { + const res = registerModule(mod); + if (res.err) { + throw Error( + SernError.NonValidModuleType + + ', or loading modules was handled incorrectly. ' + + 'Check commands path and command files!', + ); + } + wrapper.sernEmitter?.emit('module.register', { success: true, module: mod }); + } else { + wrapper.sernEmitter?.emit('module.register', { + success: false, + module: mod, + reason: SernError.PluginFailure, + }); + } + }); +}; + +function registerModule(mod: DefinitelyDefined): Result { + const name = mod.name; + return match(mod) + .with({ type: CommandType.Text }, mod => { + mod.alias?.forEach(a => Files.TextCommands.aliases.set(a, mod)); + Files.TextCommands.text.set(name, mod); + return Ok.EMPTY; + }) + .with({ type: CommandType.Slash }, mod => { + Files.ApplicationCommands[ApplicationCommandType.ChatInput].set(name, mod); + return Ok.EMPTY; + }) + .with({ type: CommandType.Both }, mod => { + Files.BothCommands.set(name, mod); + mod.alias?.forEach(a => Files.TextCommands.aliases.set(a, mod)); + return Ok.EMPTY; + }) + .with({ type: CommandType.MenuUser }, mod => { + Files.ApplicationCommands[ApplicationCommandType.User].set(name, mod); + return Ok.EMPTY; + }) + .with({ type: CommandType.MenuMsg }, mod => { + Files.ApplicationCommands[ApplicationCommandType.Message].set(name, mod); + return Ok.EMPTY; + }) + .with({ type: CommandType.Button }, mod => { + Files.ApplicationCommands[ComponentType.Button].set(name, mod); + return Ok.EMPTY; + }) + .with({ type: CommandType.MenuSelect }, mod => { + Files.MessageCompCommands[ComponentType.SelectMenu].set(name, mod); + return Ok.EMPTY; + }) + .with({ type: CommandType.Modal }, mod => { + Files.ModalSubmitCommands.set(name, mod); + return Ok.EMPTY; + }) + .otherwise(() => Err.EMPTY); +} diff --git a/src/handler/logger.ts b/src/handler/logger.ts deleted file mode 100644 index f9a38b8b..00000000 --- a/src/handler/logger.ts +++ /dev/null @@ -1,43 +0,0 @@ -import dayJS from 'dayjs'; -import Timezone from 'dayjs/plugin/timezone'; -import UTC from 'dayjs/plugin/timezone'; - -export enum sEvent { - GLOBAL_SLASH, - LOCAL_SLASH, - MISUSE_CMD, - DM, - CRASH, - TEXT_CMD, -} - -export default class Logger { - public clear() { - console.clear(); - } - - public log(e: T, guildId: string, message: string) { - dayJS.extend(UTC); - dayJS.extend(Timezone); - dayJS.tz.guess(); - // add colored logging? - const tz = dayJS().format(); - console.log(`[${tz}] [${sEvent[e]}] @ ${guildId} :: ${message}`); - } - - /** - * Utilizes console.table() to print out memory usage of current process. - * Optional at startup. - * - */ - - public tableRam() { - console.table( - Object.entries(process.memoryUsage()) - .map(([k, v]: [string, number]) => { - return { [k]: `${(((Math.round(v) / 1024 / 1024) * 100) / 100).toFixed(2)} MBs` }; - }) - .reduce((r, c) => Object.assign(r, c), {}), - ); - } -} diff --git a/src/handler/plugins/plugin.ts b/src/handler/plugins/plugin.ts new file mode 100644 index 00000000..27a815ca --- /dev/null +++ b/src/handler/plugins/plugin.ts @@ -0,0 +1,108 @@ +// +// Plugins can be inserted on all commands and are emitted +// +// 1. on ready event, where all commands are loaded. +// 2. on corresponding observable (command triggers) +// +// The goal of plugins is to organize commands and +// provide extensions to repetitive patterns +// examples include refreshing modules, +// categorizing commands, cooldowns, permissions, etc. +// Plugins are reminiscent of middleware in express. +// + +import type { Awaitable, Client } from 'discord.js'; +import type { Err, Ok, Result } from 'ts-results'; +import type { Module, Override } from '../..'; +import { CommandType } from '../..'; +import type { AutocompleteCommand, BaseModule, ModuleDefs } from '../structures/module'; +import { PluginType } from '../structures/enums'; + +export interface Controller { + next: () => Ok; + stop: () => Err; +} + +type BasePlugin = Override< + BaseModule, + { + type: PluginType; + } +>; + +export type CommandPlugin = { + [K in T]: Override< + BasePlugin, + { + type: PluginType.Command; + execute: ( + wrapper: Client, + module: ModuleDefs[T], + controller: Controller, + ) => Awaitable>; + } + >; +}[T]; +export type EventPlugin = { + [K in T]: Override< + BasePlugin, + { + type: PluginType.Event; + execute: ( + event: Parameters, + controller: Controller, + ) => Awaitable>; + } + >; +}[T]; + +//Syntactic sugar on hold +// export function plugins( +// ...plug: (EventPlugin | CommandPlugin)[] +// ) { +// return plug; +// } + +type ModuleNoPlugins = { + [T in keyof ModuleDefs]: Omit; +}; + +function isEventPlugin( + e: CommandPlugin | EventPlugin, +): e is EventPlugin { + return e.type === PluginType.Event; +} +function isCommandPlugin( + e: CommandPlugin | EventPlugin, +): e is CommandPlugin { + return !isEventPlugin(e); +} +//TODO: I WANT BETTER TYPINGS AHHHHHHHHHHHHHHH +export function sernModule( + plugin: (CommandPlugin | EventPlugin)[], + mod: ModuleNoPlugins[T], +): Module { + const onEvent = plugin.filter(isEventPlugin); + const plugins = plugin.filter(isCommandPlugin); + if (mod.type === CommandType.Autocomplete) { + throw new Error( + 'You cannot use this function declaration for Autocomplete Interactions! use the raw object for options or' + + 'sernAutoComplete function', + ); + } else + return { + onEvent, + plugins, + ...mod, + } as Module; +} + +export function sernAutocomplete( + onEvent: EventPlugin[], + mod: Omit, +): Omit { + return { + onEvent, + ...mod, + }; +} diff --git a/src/handler/sern.ts b/src/handler/sern.ts index 83935fac..dbe0af9c 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -1,283 +1,35 @@ -import * as Files from './utilities/readFile'; -import type { - possibleOutput, -} from '../types/handler'; +import type { DiscordEvent, EventEmitterRegister } from '../types/handler'; -import type { - ApplicationCommandOptionData, - Client, - CommandInteraction, - Message -} from 'discord.js'; - -import { Ok, None, Some } from 'ts-results'; -import { isNotFromBot, hasPrefix, fmt } from './utilities/messageHelpers'; -import Logger, { sEvent } from './logger'; -import { AllTrue } from './utilities/higherOrders'; -import type Module from './structures/module'; -import Context from './structures/context'; import type Wrapper from './structures/wrapper'; +import { fromEvent } from 'rxjs'; +import { onReady } from './events/readyEvent'; +import { onMessageCreate } from './events/messageEvent'; +import { onInteractionCreate } from './events/interactionCreate'; +import { Err, Ok } from 'ts-results'; +import { isDiscordEvent } from './utilities/predicates'; +import type { Client } from 'discord.js'; + +export function init(wrapper: Wrapper) { + const { events, client } = wrapper; + if (events !== undefined) { + eventObserver(client, events); + } + onReady(wrapper); + onMessageCreate(wrapper); + onInteractionCreate(wrapper); +} -/** - * @class - */ -export class Handler { - private wrapper: Wrapper; - private defaultLogger: Logger = new Logger(); - /** - * - * @constructor - * @param {Wrapper} wrapper The data that is required to run sern handler - */ - - constructor(wrapper: Wrapper) { - this.wrapper = wrapper; - this.client - - /** - * On ready, builds command data and registers them all - * from command directory - **/ - - .on('ready', async () => { - this.defaultLogger.clear(); - Files.buildData(this) - .then(data => this.registerModules(data)); - }) - - .on('messageCreate', async (message: Message) => { - const isExecutable = AllTrue(isNotFromBot, hasPrefix); - if (!isExecutable(message, this.prefix)) return; - if (message.channel.type === 'DM') return; // TODO: Handle dms - const module = this.findModuleFrom(message); - if (module === undefined) { - this.defaultLogger.log( - sEvent.MISUSE_CMD, - message.guildId!, - `Unknown legacy command.` - ); - return; - } - const cmdResult = await this.commandResult(module, message); - if (cmdResult === undefined) return; - - message.channel.send(cmdResult); - }) - - .on('interactionCreate', async (interaction) => { - if (!interaction.isCommand()) return; - if (interaction.guild === null) return; // TODO : handle dms - const module = this.findModuleFrom(interaction); - if (module === undefined) { - this.defaultLogger.log( - sEvent.MISUSE_CMD, - interaction.guildId!, - `Unknown slash command.` - ); - return; - } - const res = await this.interactionResult(module, interaction); - if (res === undefined) return; - await interaction.reply(res); - }); - } - - /** - * - * @param {Files.CommandVal} module Command file information - * @param {CommandInteraction} interaction The Discord.js command interaction (DiscordJS#CommandInteraction)) - * @returns {possibleOutput | undefined} Takes return value and replies it, if possible input - */ - - private async interactionResult( - module: Files.CommandVal, - interaction: CommandInteraction, - ): Promise { - const name = this.findModuleFrom(interaction); - if (name === undefined) return `Could not find ${interaction.commandName} command!`; - - if (module.mod.type < CommandType.SLASH) return 'This is not a slash command'; - const context = new Context(None, Some(interaction)); - const parsedArgs = module.mod.parse?.(context, ['slash', interaction.options]) ?? Ok(''); - - if (parsedArgs.err) return parsedArgs.val; - - return (module.mod.execute?.(context, parsedArgs) as possibleOutput | undefined); - } - - /** - * - * @param {Files.CommandVal} module Command file information - * @param {Message} message The message object - * @param {string} args Anything after the command - * @returns Takes return value and replies it, if possible input - */ - - private async commandResult( - module: Files.CommandVal, - message: Message, - ): Promise { - if (module.mod.type === CommandType.SLASH) { - this.defaultLogger.log( - sEvent.MISUSE_CMD, - message.guildId!, - `The text command ${module.mod.name} may be a slash command and not a text command` - ); - return; - } - if (module.mod.visibility === 'private') { - const checkIsTestServer = this.privateServers.find(({ id }) => id === message.guildId!)?.test; - if (checkIsTestServer === undefined) { - this.defaultLogger.log( - sEvent.MISUSE_CMD, - message.guildId!, - `The text command ${module.mod.name} has private modifier but is not registered in private server config.` - ); - return; - } - if (checkIsTestServer !== module.mod.test) { - this.defaultLogger.log( - sEvent.MISUSE_CMD, - message.guildId!, - `The command ${module.mod.name} is only available on test servers.` - ); - return; - } - } - const context = new Context ( Some(message), None ); - const args = message.content.slice(this.prefix.length).trim().split(/s+/g); - const parsedArgs = module.mod.parse?.(context, ['text', args]) ?? Ok(args); - if (parsedArgs.err) return parsedArgs.val; - return (module.mod.execute?.(context, parsedArgs) as possibleOutput | undefined); - } - - /** - * This function chains `Files.buildData` - * @param {{name: string, mod: Module, absPath: string}} modArr module information - */ - - private async registerModules( - modArr: { - name: string; - mod: Module; - absPath: string; - }[], - ) { - for await (const { name, mod, absPath } of modArr) { - const cmdName = Files.fmtFileName(name); - switch (mod.type) { - case 1: - Files.Commands.set(cmdName, { mod: { name: cmdName, ...mod }, options: [] }); - break; - case 2: - case 1 | 2: - { - const options = (await import(absPath)).options as ApplicationCommandOptionData[]; - Files.Commands.set(cmdName, { mod: { name: cmdName, ...mod }, options: options ?? [] }); - switch (mod.visibility) { - case 'private': { - // Reloading guild slash commands - await this.reloadSlash(cmdName, mod.desc, options); - } - case 'public': { - // Creating global commands - await this.client.application!.commands.create({ - name: cmdName, - description: mod.desc, - options, - }); - } - } - } - break; - default: - throw Error(`SernHandlerError: ${name} with ${mod.visibility} is not a valid module type.`); - } - - if (mod.alias.length > 0) { - for (const alias of mod.alias) { - Files.Alias.set(alias, { mod: { name: cmdName, ...mod }, options: [] }); - } - } - } - } - - /** - * - * @param {T extends Message | CommandInteraction} ctx name of possible command - * @returns {Files.CommandVal | undefined} - */ - - private findModuleFrom(ctx: T): Files.CommandVal | undefined { - const name = ctx.applicationId === null ? fmt(ctx as Message, this.prefix).shift()! : (ctx as CommandInteraction).commandName; - return Files.Commands.get(name) ?? Files.Alias.get(name); - } - - /** - * - * @param {string} cmdName name of command - * @param {string} description description of command - * @param {ApplicationCommandOptionData[]} options any options for the slash command - */ - - private async reloadSlash( - cmdName: string, - description: string, - options: ApplicationCommandOptionData[], - ): Promise { - for (const { id } of this.privateServers) { - const guild = await this.client.guilds.fetch(id); - guild.commands.create({ - name: cmdName, - description, - options, - }); +function eventObserver(client: Client, events: (DiscordEvent | EventEmitterRegister)[]) { + events.forEach(event => { + if (isDiscordEvent(event)) { + fromEvent(client, event[0], event[1]).subscribe(); + } else { + fromEvent(event[0], event[1], event[2]).subscribe(); } - } - - /** - * @readonly - * @returns {string} The prefix used for legacy commands - */ - - get prefix(): string { - return this.wrapper.prefix; - } - - /** - * @readonly - * @returns {string} Directory of the commands folder - */ - - get commandDir(): string { - return this.wrapper.commands; - } - - /** - * @readonly - * @returns {Client} the discord.js client (DiscordJS#Client)); - */ - - get client(): Client { - return this.wrapper.client; - } - - /** - * @readonly - * @returns {{test: boolean, id: string}[]} Private server ID for testing or personal use - */ - - get privateServers(): { test: boolean; id: string }[] { - return this.wrapper.privateServers; - } + }); } - -/** - * @enum { number }; - */ - -export enum CommandType { - TEXT = 1, - SLASH = 2, -} +export const controller = { + next: () => Ok.EMPTY, + stop: () => Err.EMPTY, +}; diff --git a/src/handler/sernEmitter.ts b/src/handler/sernEmitter.ts new file mode 100644 index 00000000..a6282418 --- /dev/null +++ b/src/handler/sernEmitter.ts @@ -0,0 +1,48 @@ +import { EventEmitter } from 'events'; +import type { Module } from './structures/module'; + +type Payload = + | { success: true; module: Module } + | { success: false; module: Module | undefined; reason: string | Error }; + +type SernEventsMapping = { + ['module.register']: [Payload]; + ['module.activate']: [Payload]; + ['error']: [Error | string]; +}; + +export default class SernEmitter extends EventEmitter { + /** + * Listening to sern events with on. This event stays on until a crash or a normal exit + * @param eventName + * @param listener what to do with the data + */ + public override on( + eventName: T, + listener: (...args: SernEventsMapping[T][]) => void, + ): this { + return super.on(eventName, listener); + } + /** + * Listening to sern events with on. This event stays on until a crash or a normal exit + * @param eventName + * @param listener what to do with the data + */ + public override once( + eventName: T, + listener: (...args: SernEventsMapping[T][]) => void, + ): this { + return super.once(eventName, listener); + } + /** + * Listening to sern events with on. This event stays on until a crash or a normal exit + * @param eventName + * @param args the arguments for emitting the { eventName } + */ + public override emit( + eventName: T, + ...args: SernEventsMapping[T] + ): boolean { + return super.emit(eventName, ...args); + } +} diff --git a/src/handler/structures/context.ts b/src/handler/structures/context.ts index 3de364d1..918c7941 100644 --- a/src/handler/structures/context.ts +++ b/src/handler/structures/context.ts @@ -1,29 +1,157 @@ +import type { APIGuildMember } from 'discord-api-types/v9'; import type { - Interaction, - Message + ChatInputCommandInteraction, + Client, + Guild, + GuildMember, + InteractionReplyOptions, + Message, + ReplyMessageOptions, + Snowflake, + TextBasedChannel, + User, } from 'discord.js'; -import { None, Option } from 'ts-results'; +import { None, Option, Some } from 'ts-results'; +import type { Nullish } from '../../types/handler'; +import { ExternallyUsed } from '../utilities/externallyUsed'; +function firstSome(...args: Option[]): Nullish { + for (const op of args) { + if (op.some) return op.val; + } + return null; +} + +//Could I refactor with Either monad? +/** + * Provides values shared between + * Message and ChatInputCommandInteraction + */ export default class Context { - private msg: Option = None; - private interac: Option = None; + private constructor( + private oMsg: Option = None, + private oInterac: Option = None, + ) { + this.oMsg = oMsg; + this.oInterac = oInterac; + } - constructor(message : Option, interaction: Option ) { - this.msg = message; - this.interac = interaction; + /** + * Getting the Message object. Crashes if module type is + * CommandType.Slash or the event fired in a Both command was + * ChatInputCommandInteraction + */ + @ExternallyUsed + public get message() { + return this.oMsg.unwrap(); + } + /** + * Getting the ChatInputCommandInteraction object. Crashes if module type is + * CommandType.Text or the event fired in a Both command was + * Message + */ + @ExternallyUsed + public get interaction() { + return this.oInterac.unwrap(); } - get messageUnchecked() { - return this.msg.unwrap(); + @ExternallyUsed + public get id(): Snowflake { + return firstSome( + this.oInterac.map(i => i.id), + this.oMsg.map(m => m.id), + )!; } - get interactionUnchecked() { - return this.interac.unwrap(); + + @ExternallyUsed + public get channel(): Nullish { + return firstSome( + this.oMsg.map(m => m.channel), + this.oInterac.map(i => i.channel), + ); } - get message() { - return this.msg; + + @ExternallyUsed + public get user(): User { + return firstSome( + this.oMsg.map(m => m.author), + this.oInterac.map(i => i.user), + )!; } - get interaction() { - return this.interac; + + @ExternallyUsed + public get createdTimestamp(): number { + return firstSome( + this.oMsg.map(m => m.createdTimestamp), + this.oInterac.map(i => i.createdTimestamp), + )!; + } + + @ExternallyUsed + public get guild(): Guild { + return firstSome( + this.oMsg.map(m => m.guild), + this.oInterac.map(i => i.guild), + )!; + } + + @ExternallyUsed + public get guildId(): Snowflake { + return firstSome( + this.oMsg.map(m => m.guildId), + this.oInterac.map(i => i.guildId), + )!; } -} + /* + * interactions can return APIGuildMember if the guild it is emitted from is not cached + */ + @ExternallyUsed + public get member(): Nullish { + return firstSome( + this.oMsg.map(m => m.member), + this.oInterac.map(i => i.member), + ); + } + + @ExternallyUsed + public get client(): Client { + return firstSome( + this.oMsg.map(m => m.client), + this.oInterac.map(i => i.client), + )!; + } + + @ExternallyUsed + public get inGuild(): boolean { + return firstSome( + this.oMsg.map(m => m.inGuild()), + this.oInterac.map(i => i.inGuild()), + )!; + } + + static wrap(wrappable: ChatInputCommandInteraction | Message): Context { + if ('token' in wrappable) { + return new Context(None, Some(wrappable)); + } + return new Context(Some(wrappable), None); + } + + @ExternallyUsed + public isEmpty() { + return this.oMsg.none && this.oInterac.none; + } + + //TODO: make this queueable + @ExternallyUsed + public reply(content: Omit | ReplyMessageOptions) { + return firstSome( + this.oInterac.map(i => { + return i.reply(content as InteractionReplyOptions).then(() => i.fetchReply()); + }), + this.oMsg.map(m => { + return m.reply(content as ReplyMessageOptions); + }), + )!; + } +} diff --git a/src/handler/structures/enums.ts b/src/handler/structures/enums.ts new file mode 100644 index 00000000..9aefe377 --- /dev/null +++ b/src/handler/structures/enums.ts @@ -0,0 +1,21 @@ +/** + * @enum { number }; + */ +enum CommandType { + Text = 0b00000001, + Slash = 0b00000010, + MenuUser = 0b00000100, + MenuMsg = 0b00001000, + Button = 0b00010000, + MenuSelect = 0b00100000, + Modal = 0b01000000, + Autocomplete = 0b10000000, + Both = 0b0000011, +} + +enum PluginType { + Command = 0b01, + Event = 0b10, +} + +export { CommandType, PluginType }; diff --git a/src/handler/structures/errors.ts b/src/handler/structures/errors.ts new file mode 100644 index 00000000..f95f2cf7 --- /dev/null +++ b/src/handler/structures/errors.ts @@ -0,0 +1,7 @@ +export enum SernError { + NonValidModuleType = 'Detected an unknown module type', + UndefinedModule = `A module could not be detected at`, + MismatchModule = `A module type mismatched with event emitted!`, + NotSupportedInteraction = `This interaction is not supported.`, + PluginFailure = `A plugin failed to call controller.next()`, +} diff --git a/src/handler/structures/module.ts b/src/handler/structures/module.ts index 47f45e07..555e21af 100644 --- a/src/handler/structures/module.ts +++ b/src/handler/structures/module.ts @@ -1,28 +1,201 @@ -import type { Visibility, possibleOutput, Arg } from '../../types/handler'; -import type { CommandType } from '../sern'; -import type Context from './context' ; -import type { Awaitable } from 'discord.js'; -import type { Ok } from 'ts-results'; -import type * as Utils from '../utilities/preprocessors/args'; +import type { + ApplicationCommandAttachmentOption, + ApplicationCommandChannelOptionData, + ApplicationCommandChoicesData, + ApplicationCommandNonOptionsData, + ApplicationCommandNumericOptionData, + ApplicationCommandOptionData, + ApplicationCommandSubCommandData, + ApplicationCommandSubGroupData, + Awaitable, + BaseApplicationCommandOptionsData, + ButtonInteraction, + MessageContextMenuCommandInteraction, + ModalSubmitInteraction, + SelectMenuInteraction, + UserContextMenuCommandInteraction, +} from 'discord.js'; +import type { Args, Override } from '../../types/handler'; +import type { CommandPlugin, EventPlugin } from '../plugins/plugin'; +import type Context from './context'; +import { CommandType, PluginType } from './enums'; +import type { AutocompleteInteraction } from 'discord.js'; +import type { ApplicationCommandOptionType } from 'discord.js'; + +export interface BaseModule { + type: CommandType | PluginType; + name?: string; + description: string; + execute: (ctx: Context, args: Args) => Awaitable; +} + +//possible refactoring types into interfaces and not types +export type TextCommand = Override< + BaseModule, + { + type: CommandType.Text; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + alias?: string[]; + } +>; + +export type SlashCommand = Override< + BaseModule, + { + type: CommandType.Slash; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + options?: SernOptionsData[]; + } +>; + +export type BothCommand = Override< + BaseModule, + { + type: CommandType.Both; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + alias?: string[]; + options?: SernOptionsData[]; + } +>; + +export type ContextMenuUser = Override< + BaseModule, + { + type: CommandType.MenuUser; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: UserContextMenuCommandInteraction) => Awaitable; + } +>; + +export type ContextMenuMsg = Override< + BaseModule, + { + type: CommandType.MenuMsg; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: MessageContextMenuCommandInteraction) => Awaitable; + } +>; + +export type ButtonCommand = Override< + BaseModule, + { + type: CommandType.Button; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: ButtonInteraction) => Awaitable; + } +>; + +export type SelectMenuCommand = Override< + BaseModule, + { + type: CommandType.MenuSelect; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: SelectMenuInteraction) => Awaitable; + } +>; + +export type ModalSubmitCommand = Override< + BaseModule, + { + type: CommandType.Modal; + onEvent: EventPlugin[]; + plugins: CommandPlugin[]; + execute: (ctx: ModalSubmitInteraction) => Awaitable; + } +>; + +// Autocomplete commands are a little different +// They can't have command plugins as they are +// in conjunction with chat input commands +// TODO: possibly in future, allow Autocmp commands in separate files? +export type AutocompleteCommand = Override< + BaseModule, + { + type: CommandType.Autocomplete; + name: string; + onEvent: EventPlugin[]; + execute: (ctx: AutocompleteInteraction) => Awaitable; + } +>; + +export type Module = + | TextCommand + | SlashCommand + | BothCommand + | ContextMenuUser + | ContextMenuMsg + | ButtonCommand + | SelectMenuCommand + | ModalSubmitCommand + | AutocompleteCommand; + +//https://stackoverflow.com/questions/64092736/alternative-to-switch-statement-for-typescript-discriminated-union +// Explicit Module Definitions for mapping +export type ModuleDefs = { + [CommandType.Text]: TextCommand; + [CommandType.Slash]: SlashCommand; + [CommandType.Both]: BothCommand; + [CommandType.MenuMsg]: ContextMenuMsg; + [CommandType.MenuUser]: ContextMenuUser; + [CommandType.Button]: ButtonCommand; + [CommandType.MenuSelect]: SelectMenuCommand; + [CommandType.Modal]: ModalSubmitCommand; + [CommandType.Autocomplete]: AutocompleteCommand; +}; + +//TODO: support deeply nested Autocomplete +// objective: construct union of ApplicationCommandOptionData change any Autocomplete data +// into Sern autocomplete data. + +export type SernAutocompleteData = Override< + BaseApplicationCommandOptionsData, + { + autocomplete: true; + type: + | ApplicationCommandOptionType.String + | ApplicationCommandOptionType.Number + | ApplicationCommandOptionType.Integer; + command: Omit; + } +>; /** - * An object that gets imported and acts as a command. - * @typedef {object} Module - * @property {string} desc - * @property {Visibility} visibility - * @property {CommandType} type - * @property {(eventParams : Context, args : Ok Awaitable)} execute - * @prop {(ctx: Context, args: Arg) => Utils.ArgType} parse + * Type that just uses SernAutocompleteData and not regular autocomplete */ +export type BaseOptions = + | ApplicationCommandChoicesData + | ApplicationCommandNonOptionsData + | ApplicationCommandChannelOptionData + | ApplicationCommandNumericOptionData + | ApplicationCommandAttachmentOption + | SernAutocompleteData; -interface Module { - alias: string[]; - desc: string; - visibility: Visibility; - type: CommandType; - test: boolean; - execute: (eventParams: Context, args: Ok) => Awaitable; - parse?: (ctx: Context, args: Arg) => Utils.ArgType; -} +export type SernSubCommandData = Override< + Omit, + { + type: ApplicationCommandOptionType.Subcommand; + options?: BaseOptions[]; + } +>; + +export type SernSubCommandGroupData = Override< + Omit, + { + type: ApplicationCommandOptionType.SubcommandGroup; + options?: SernSubCommandData[]; + } +>; -export default Module; +export type SernOptionsData = + U extends ApplicationCommandSubCommandData + ? SernSubCommandData + : U extends ApplicationCommandSubGroupData + ? SernSubCommandGroupData + : BaseOptions; diff --git a/src/handler/structures/structxports.ts b/src/handler/structures/structxports.ts new file mode 100644 index 00000000..5396cadd --- /dev/null +++ b/src/handler/structures/structxports.ts @@ -0,0 +1,28 @@ +import Context from './context'; +import type { + BothCommand, + Module, + SlashCommand, + TextCommand, + SernOptionsData, + BaseOptions, + SernAutocompleteData, + SernSubCommandData, + SernSubCommandGroupData, +} from './module'; +import type Wrapper from './wrapper'; + +export * from './enums'; +export { + Context, + SlashCommand, + TextCommand, + BothCommand, + Module, + Wrapper, + SernOptionsData, + BaseOptions, + SernAutocompleteData, + SernSubCommandData, + SernSubCommandGroupData, +}; diff --git a/src/handler/structures/wrapper.ts b/src/handler/structures/wrapper.ts index 43fbaadf..1e19058c 100644 --- a/src/handler/structures/wrapper.ts +++ b/src/handler/structures/wrapper.ts @@ -1,21 +1,21 @@ import type { Client } from 'discord.js'; -import type * as Sern from '../sern'; +import type { DiscordEvent, EventEmitterRegister } from '../../types/handler'; +import type SernEmitter from '../sernEmitter'; /** * An object to be passed into Sern.Handler constructor. * @typedef {object} Wrapper * @property {readonly Client} client - * @property {readonly string} prefix + * @property {readonly string} defaultPrefix * @property {readonly string} commands - * @prop {(handler : Handler) => void)} ini - * @property {readonly {test: boolean, id: string}[]} privateServers + * @prop { readonly DiscordEvent[] } events */ interface Wrapper { readonly client: Client; - readonly prefix: string; + readonly sernEmitter?: SernEmitter; + readonly defaultPrefix?: string; readonly commands: string; - init?: (handler: Sern.Handler) => void; - readonly privateServers: { test: boolean; id: string }[]; + readonly events?: (DiscordEvent | EventEmitterRegister)[]; } export default Wrapper; diff --git a/src/handler/utilities/externallyUsed.ts b/src/handler/utilities/externallyUsed.ts new file mode 100644 index 00000000..0f0fe81a --- /dev/null +++ b/src/handler/utilities/externallyUsed.ts @@ -0,0 +1,18 @@ +/** + * This function denotes usage of decorated method is external + * Also, makes method appear 'used' in IDEs + * @param _target + * @param _propertyKey + * @param _descriptor + * @constructor + */ +export function ExternallyUsed( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _target: unknown, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _propertyKey: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _descriptor: PropertyDescriptor, +) { + return void 0; +} diff --git a/src/handler/utilities/higherOrders.ts b/src/handler/utilities/higherOrders.ts deleted file mode 100644 index 8f49e155..00000000 --- a/src/handler/utilities/higherOrders.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Message } from 'discord.js'; - -type MsgFnArgs = [msgOrInter: Message, prefix?: string]; -type MsgFn = (...args: MsgFnArgs) => boolean; - -/** - * - * @param {MsgFn} fn any function that has argument `MsgFnArgs` returning boolean - * @returns {(message: Message, prefix: string) => boolean} - */ -export function AllTrue(...fns: MsgFn[]): - (message: Message, prefix: string) => boolean { - return (message: Message, prefix: string) => { - return fns.every(g => g(message, prefix)); - }; -} \ No newline at end of file diff --git a/src/handler/utilities/markup.ts b/src/handler/utilities/markup.ts index 4dba8275..6d0879b6 100644 --- a/src/handler/utilities/markup.ts +++ b/src/handler/utilities/markup.ts @@ -1,30 +1,30 @@ - /** - * An enumeration of all the valid Discord timestamp styles. - */ - export enum TimestampStyles { +/** + * An enumeration of all the valid Discord timestamp styles. + */ +export enum TimestampStyles { BOTH_LONG = 'F', BOTH_SHORT = 'f', DATE_LONG = 'D', DATE_SHORT = 'd', RELATIVE = 'R', TIME_LONG = 'T', - TIME_SHORT = 't' - } - /** - * Utility to cut messages by bytes and not characters - */ - export function trueSlice(text: string, limit?: number): string { + TIME_SHORT = 't', +} + +/** + * Utility to cut messages by bytes and not characters + */ +export function trueSlice(text: string, limit?: number): string { if (limit) { - return new TextDecoder().decode( - new TextEncoder().encode(text).slice(0, limit) - ); + return new TextDecoder().decode(new TextEncoder().encode(text).slice(0, limit)); } return text; - } - /** - * Object that holds all the Discord Markup identifiers. - */ - export const Strings = { +} + +/** + * Object that holds all the Discord Markup identifiers. + */ +export const Strings = { BOLD: '**', CODEBLOCK: '```', CODESTRING: '`', @@ -33,12 +33,12 @@ ITALICS: '_', SPOILER: '||', STRIKE: '~~', - UNDERLINE: '__' - }; - /** - * Object that maps all the Discord Markup identifiers to their respective RegExp matchers. - */ - const Regexes = { + UNDERLINE: '__', +}; +/** + * Object that maps all the Discord Markup identifiers to their respective RegExp matchers. + */ +const Regexes = { [Strings.BOLD]: /\*\*/g, [Strings.CODEBLOCK]: new RegExp(Strings.CODEBLOCK, 'g'), [Strings.CODESTRING]: new RegExp(Strings.CODESTRING, 'g'), @@ -51,12 +51,12 @@ LINK: /\]\(/g, MENTION: /<@([!&]?[0-9]{16,21})>/g, MENTION_HARDCORE: /@/g, - URL: /\)/g - }; - /** - * Object to replace Discord Markup identifiers with when escaping strings. - */ - const Replacements = { + URL: /\)/g, +}; +/** + * Object to replace Discord Markup identifiers with when escaping strings. + */ +const Replacements = { [Strings.BOLD]: '\\*\\*', [Strings.CODEBLOCK]: '``\u200b`', [Strings.CODESTRING]: '\\`', @@ -65,42 +65,42 @@ [Strings.SPOILER]: '\\|\\|', [Strings.STRIKE]: '\\~\\~', [Strings.UNDERLINE]: '\\_\\_', - MENTION: '\u200b' - }; - /** - * Utility to escape some Discord Markup Identifier - */ - function EscapeBasic(raw: string, key: keyof typeof Strings) { + MENTION: '\u200b', +}; + +/** + * Utility to escape some Discord Markup Identifier + */ +function EscapeBasic(raw: string, key: keyof typeof Strings) { return raw.replace(Regexes[key], Replacements[key]); - } - /** - * Object of all the Escape functions used to apply mixed markup - */ - export const Escape: Record< - keyof typeof Strings, - typeof EscapeBasic - > = (Object.keys(Strings) as Array).reduce( +} + +/** + * Object of all the Escape functions used to apply mixed markup + */ +export const Escape: Record = ( + Object.keys(Strings) as Array +).reduce( (p, v) => Object.assign(p, { [v]: (raw: string) => EscapeBasic(raw, v) }), - {} as Record - ); - /** - * String formatting for freezing Discord timestamps that have the Relative (R) flag - */ - const FrozenTimestampStyles: Record = { - [TimestampStyles.BOTH_LONG]: - '{day}, {month} {date}, {year} {hour}:{minute} {meridian}', - [TimestampStyles.BOTH_SHORT]: - '{month} {date}, {year} {hour}:{minute} {meridian}', + {} as Record, +); +/** + * String formatting for freezing Discord timestamps that have the Relative (R) flag + */ +const FrozenTimestampStyles: Record = { + [TimestampStyles.BOTH_LONG]: '{day}, {month} {date}, {year} {hour}:{minute} {meridian}', + [TimestampStyles.BOTH_SHORT]: '{month} {date}, {year} {hour}:{minute} {meridian}', [TimestampStyles.DATE_LONG]: '{month} {date}, {year}', [TimestampStyles.DATE_SHORT]: '{month_short}/{date}/{year}', [TimestampStyles.RELATIVE]: '{relative}', [TimestampStyles.TIME_LONG]: '{hour}:{minute}:{second} {meridian}', - [TimestampStyles.TIME_SHORT]: '{hour}:{minute} {meridian}' - }; - /** - * Holds metadata and string conversions of a UNIX Timestamp - */ - interface Timestamp { + [TimestampStyles.TIME_SHORT]: '{hour}:{minute} {meridian}', +}; + +/** + * Holds metadata and string conversions of a UNIX Timestamp + */ +interface Timestamp { raw: number; month: string; month_short: string; @@ -112,23 +112,24 @@ minute: string; day: string; relative: string; - } - /** - * Converter for number to Days of the Week - */ - const Days: Record = { +} + +/** + * Converter for number to Days of the Week + */ +const Days: Record = { 0: 'Sunday', 1: 'Monday', 2: 'Tuesday', 3: 'Wednesday', 4: 'Thursday', 5: 'Friday', - 6: 'Saturday' - }; - /** - * Converter for number to Months of the Year - */ - const Months: Record = { + 6: 'Saturday', +}; +/** + * Converter for number to Months of the Year + */ +const Months: Record = { 0: 'January', 1: 'February', 2: 'March', @@ -140,55 +141,47 @@ 8: 'September', 9: 'October', 10: 'November', - 11: 'December' - }; - /** - * Converts a Date object to a Timestamp object - */ - function formatDate(date: Date): Timestamp { + 11: 'December', +}; + +/** + * Converts a Date object to a Timestamp object + */ +function formatDate(date: Date): Timestamp { return { - relative: toTimeString(date.getTime(), TimestampUnits), - raw: date.getTime(), - date: date - .getDate() - .toString() - .padStart(2, '0'), - day: Days[date.getDay()], - hour: date - .getHours() - .toString() - .padStart(2, '0'), - meridian: date.getHours() > 12 ? 'PM' : 'AM', - minute: date - .getMinutes() - .toString() - .padStart(2, '0'), - month: Months[date.getMonth()], - month_short: (date.getMonth() + 1).toString().padStart(2, '0'), - second: date - .getSeconds() - .toString() - .padStart(2, '0'), - year: date.getFullYear().toString() + relative: toTimeString(date.getTime(), TimestampUnits), + raw: date.getTime(), + date: date.getDate().toString().padStart(2, '0'), + day: Days[date.getDay()], + hour: date.getHours().toString().padStart(2, '0'), + meridian: date.getHours() > 12 ? 'PM' : 'AM', + minute: date.getMinutes().toString().padStart(2, '0'), + month: Months[date.getMonth()], + month_short: (date.getMonth() + 1).toString().padStart(2, '0'), + second: date.getSeconds().toString().padStart(2, '0'), + year: date.getFullYear().toString(), }; - } - /** - * Collectively multiplies bigints together - */ - function multiplyLarge(...nums: Array): bigint { +} + +/** + * Collectively multiplies bigints together + */ +function multiplyLarge(...nums: Array): bigint { return nums.map(BigInt).reduce((p, v) => (p *= v), 1n); - } - /** - * Get the absolute value of a bigint - */ - function bigintAbs(int: bigint) { +} + +/** + * Get the absolute value of a bigint + */ +function bigintAbs(int: bigint) { if (int < 0) return -int; return int; - } - /** - * Object of Units matched with their string representations. - */ - const TimestampUnits = { +} + +/** + * Object of Units matched with their string representations. + */ +const TimestampUnits = { myriad: multiplyLarge(10, 10, 10, 10, 12, 4, 7, 24, 60, 1000), millenium: multiplyLarge(10, 10, 10, 12, 4, 7, 24, 60, 1000), century: multiplyLarge(10, 10, 12, 4, 7, 24, 60, 1000), @@ -200,200 +193,226 @@ hour: multiplyLarge(60, 60, 1000), minute: multiplyLarge(60, 1000), second: multiplyLarge(1000), - millisecond: multiplyLarge(1) - }; - /** - * Utility type. Used to force Object.entries to allow non-strings. - */ - type ObjectEntries = Array<[K, V]>; - /** - * Converts a UNIX timestamp to a Relative String - */ - function toTimeString( + millisecond: multiplyLarge(1), +}; +/** + * Utility type. Used to force Object.entries to allow non-strings. + */ +type ObjectEntries = Array<[K, V]>; + +/** + * Converts a UNIX timestamp to a Relative String + */ +function toTimeString( unix: bigint | number, units: Record, isFromNow = false, - limit?: number - ) { + limit?: number, +) { if (typeof unix === 'number') unix = BigInt(unix); if (isFromNow) unix = bigintAbs(unix - BigInt(Date.now())); if (unix === 0n) return '0 milliseconds'; const formatted: Map = new Map(); - const unitList: ObjectEntries = Object.entries(units) as any; + const unitList: ObjectEntries = Object.entries(units) as ObjectEntries; let run = unix; for (const [unit, value] of unitList) { - if (run < value) continue; - const runs = run / value + 1n; + if (run < value) continue; + const runs = run / value + 1n; - for (let loop = 0; loop <= runs; loop++) { - if (run < value) break; - const item = formatted.get(unit); + for (let loop = 0; loop <= runs; loop++) { + if (run < value) break; + const item = formatted.get(unit); - if (item) formatted.set(unit, item + 1); - else formatted.set(unit, 1); + if (item) formatted.set(unit, item + 1); + else formatted.set(unit, 1); - run -= value; - } + run -= value; + } } let returned: Array = []; for (const [key, value] of formatted) { - const unit = key + (value === 1 ? '' : 's'); - returned.push(`${value} ${unit}`); + const unit = key + (value === 1 ? '' : 's'); + returned.push(`${value} ${unit}`); } if (limit !== undefined) { - returned = returned.slice(0, limit); + returned = returned.slice(0, limit); } return returned.join(', '); - } - /** - * Freezes a UNIT timestamp into some time string based on the Timestamp Style - */ - function freezeUnix(unix: number, style: TimestampStyles) { +} + +/** + * Freezes a UNIT timestamp into some time string based on the Timestamp Style + */ +function freezeUnix(unix: number, style: TimestampStyles) { const date = new Date(unix); const timestamp = formatDate(date); let ret = FrozenTimestampStyles[style]; for (const [key, value] of Object.entries(timestamp)) { - ret = ret.split(`{${key}}`).join(value); + ret = ret.split(`{${key}}`).join(value); } return ret; - } - /** - * Instanced Class for formatting strings into their Markup variants - */ - class FormatInner { +} + +/** + * Instanced Class for formatting strings into their Markup variants + */ +class FormatInner { public raw: string; public static: typeof FormatInner = FormatInner; + constructor(raw: string | FormatInner) { - if (raw instanceof FormatInner) { - raw = raw.raw; - } - this.raw = raw; + if (raw instanceof FormatInner) { + raw = raw.raw; + } + this.raw = raw; } + + static wrap(raw: string, what: string) { + return `${what}${raw}${what}`; + } + toString() { - return this.raw; + return this.raw; } + valueOf() { - return this.raw; + return this.raw; } + italics() { - return this.build('ITALICS', this.raw); + return this.build('ITALICS', this.raw); } + bold() { - return this.build('BOLD', this.raw); + return this.build('BOLD', this.raw); } + codestring() { - const useDouble = this.raw.includes(Strings.CODESTRING); - if (useDouble) { - return this.codestringDouble(); - } - return this.codestringSingle(); + const useDouble = this.raw.includes(Strings.CODESTRING); + if (useDouble) { + return this.codestringDouble(); + } + return this.codestringSingle(); } + codestringDouble() { - return this.build('CODESTRING_DOUBLE', this.raw); + return this.build('CODESTRING_DOUBLE', this.raw); } + codestringSingle() { - return this.build('CODESTRING', this.raw); + return this.build('CODESTRING', this.raw); } + codeblock(language?: string) { - let full = ''; - if (language) { - full += language + '\n'; - } - full += this.raw; - return this.build('CODEBLOCK', full); + let full = ''; + if (language) { + full += language + '\n'; + } + full += this.raw; + return this.build('CODEBLOCK', full); } + spoiler() { - return this.build('SPOILER', this.raw); + return this.build('SPOILER', this.raw); } + strike() { - return this.build('STRIKE', this.raw); + return this.build('STRIKE', this.raw); } + underline() { - return this.build('UNDERLINE', this.raw); + return this.build('UNDERLINE', this.raw); } build(key: keyof typeof Strings, w: string) { - const escaped = Escape[key](w, key); - const ret = this.static.wrap(escaped, Strings[key]); - return new this.static(ret); - } - static wrap(raw: string, what: string) { - return `${what}${raw}${what}`; + const escaped = Escape[key](w, key); + const ret = this.static.wrap(escaped, Strings[key]); + return new this.static(ret); } - } - /** - * Formats strings into their Markup Variants - */ - export class Format extends FormatInner { +} + +/** + * Formats strings into their Markup Variants + */ +export class Format extends FormatInner { static bold(text: string) { - return new this(text).bold(); + return new this(text).bold(); } + static build(text: string, key: keyof typeof Strings) { - return new this(text).build(key, text); + return new this(text).build(key, text); } + static codeblock(text: string, language?: string) { - return new this(text).codeblock(language); + return new this(text).codeblock(language); } + static codestring(text: string) { - return new this(text).codestring(); + return new this(text).codestring(); } + static codestringSingle(text: string) { - return new this(text).codestringSingle(); + return new this(text).codestringSingle(); } + static codestringDouble(text: string) { - return new this(text).codestringDouble(); + return new this(text).codestringDouble(); } + static italics(text: string) { - return new this(text).italics(); + return new this(text).italics(); } + static spoiler(text: string) { - return new this(text).spoiler(); + return new this(text).spoiler(); } + static strike(text: string) { - return new this(text).strike(); + return new this(text).strike(); } + static underline(text: string) { - return new this(text).underline(); + return new this(text).underline(); } + static timestamp( - unix: number | Date | string, - format: TimestampStyles = TimestampStyles.BOTH_SHORT, - isSeconds = false - ) { - if (typeof unix === 'string') unix = Number(unix); - if (unix instanceof Date) unix = unix.getTime(); - - if (!isSeconds) { - unix /= 1000; - } - unix = Math.floor(unix); - return new this(``); - } - static date( - unix: number | Date | string, - format: TimestampStyles = TimestampStyles.BOTH_SHORT, - isSeconds = false + unix: number | Date | string, + format: TimestampStyles = TimestampStyles.BOTH_SHORT, + isSeconds = false, ) { - if (typeof unix === 'string') unix = Number(unix); - if (unix instanceof Date) unix = unix.getTime(); + if (typeof unix === 'string') unix = Number(unix); + if (unix instanceof Date) unix = unix.getTime(); - if (isSeconds) { - unix *= 1000; - } - return new this(freezeUnix(unix, format)); + if (!isSeconds) { + unix /= 1000; + } + unix = Math.floor(unix); + return new this(``); + } + + static date(unix: number | Date | string, format: TimestampStyles = TimestampStyles.BOTH_SHORT, isSeconds = false) { + if (typeof unix === 'string') unix = Number(unix); + if (unix instanceof Date) unix = unix.getTime(); + + if (isSeconds) { + unix *= 1000; + } + return new this(freezeUnix(unix, format)); } + static link(text: string, url: string | URL) { - if (url instanceof URL) url = url.href; - return new this(`[${text}](${url})`); - } - } - /** - * Enumeration of names used in the Matching process - */ - enum DiscordRegexNames { + if (url instanceof URL) url = url.href; + return new this(`[${text}](${url})`); + } +} + +/** + * Enumeration of names used in the Matching process + */ +enum DiscordRegexNames { EMOJI = 'EMOJI', JUMP_CHANNEL = 'JUMP_CHANNEL', JUMP_CHANNEL_MESSAGE = 'JUMP_CHANNEL_MESSAGE', @@ -408,15 +427,18 @@ TEXT_SPOILER = 'TEXT_SPOILER', TEXT_STRIKE = 'TEXT_STRIKE', TEXT_UNDERLINE = 'TEXT_UNDERLINE', - TEXT_URL = 'TEXT_URL' - } - /** - * Mapping of Matching Names to their respective Regular Expressions - */ - export const DiscordRegex = { + TEXT_URL = 'TEXT_URL', +} + +/** + * Mapping of Matching Names to their respective Regular Expressions + */ +export const DiscordRegex = { [DiscordRegexNames.EMOJI]: //g, - [DiscordRegexNames.JUMP_CHANNEL]: /^(?:https?):\/\/(?:(?:(?:canary|ptb)\.)?(?:discord|discordapp)\.com\/channels\/)(\@me|\d+)\/(\d+)$/g, - [DiscordRegexNames.JUMP_CHANNEL_MESSAGE]: /^(?:https?):\/\/(?:(?:(?:canary|ptb)\.)?(?:discord|discordapp)\.com\/channels\/)(\@me|\d+)\/(\d+)\/(\d+)$/g, + [DiscordRegexNames.JUMP_CHANNEL]: + /^(?:https?):\/\/(?:(?:(?:canary|ptb)\.)?(?:discord|discordapp)\.com\/channels\/)(\@me|\d+)\/(\d+)$/g, + [DiscordRegexNames.JUMP_CHANNEL_MESSAGE]: + /^(?:https?):\/\/(?:(?:(?:canary|ptb)\.)?(?:discord|discordapp)\.com\/channels\/)(\@me|\d+)\/(\d+)\/(\d+)$/g, [DiscordRegexNames.MENTION_CHANNEL]: /<#(\d+)>/g, [DiscordRegexNames.MENTION_ROLE]: /<@&(\d+)>/g, [DiscordRegexNames.MENTION_USER]: /<@(!?)(\d+)>/g, @@ -428,12 +450,13 @@ [DiscordRegexNames.TEXT_SPOILER]: /\|\|([\s\S]+?)\|\|/g, [DiscordRegexNames.TEXT_STRIKE]: /~~([\s\S]+?)~~(?!_)/g, [DiscordRegexNames.TEXT_UNDERLINE]: /__([\s\S]+?)__/g, - [DiscordRegexNames.TEXT_URL]: /((?:https?):\/\/[^\s<]+[^<.,:;"'\]\s])/g - }; - /** - * Object containing all the data from some Matching sequence - */ - export interface DiscordRegexMatch { + [DiscordRegexNames.TEXT_URL]: /((?:https?):\/\/[^\s<]+[^<.,:;"'\]\s])/g, +}; + +/** + * Object containing all the data from some Matching sequence + */ +export interface DiscordRegexMatch { animated?: boolean; channelId?: string; guildId?: string; @@ -445,286 +468,315 @@ name?: string; text?: string; species: DiscordRegexNames; - } - /** - * The result of a matched string. - */ - export interface DiscordRegexPayload { +} + +/** + * The result of a matched string. + */ +export interface DiscordRegexPayload { match: { - regex: RegExp; - type: string; + regex: RegExp; + type: string; }; matches: Array; - } - export interface EmojiMatch extends DiscordRegexMatch { +} + +export interface EmojiMatch extends DiscordRegexMatch { name: string; id: string; animated: boolean; species: DiscordRegexNames.EMOJI; - } - export interface JumpMatch extends DiscordRegexMatch { +} + +export interface JumpMatch extends DiscordRegexMatch { guildId: string; - species: - | DiscordRegexNames.JUMP_CHANNEL - | DiscordRegexNames.JUMP_CHANNEL_MESSAGE; - } - export interface JumpChannelMatch extends JumpMatch { + species: DiscordRegexNames.JUMP_CHANNEL | DiscordRegexNames.JUMP_CHANNEL_MESSAGE; +} + +export interface JumpChannelMatch extends JumpMatch { channelId: string; species: DiscordRegexNames.JUMP_CHANNEL; - } - export interface JumpChannelMessageMatch extends JumpMatch { +} + +export interface JumpChannelMessageMatch extends JumpMatch { channelId: string; messageId: string; species: DiscordRegexNames.JUMP_CHANNEL_MESSAGE; - } - export interface MentionableMatch extends DiscordRegexMatch { +} + +export interface MentionableMatch extends DiscordRegexMatch { id: string; - species: - | DiscordRegexNames.MENTION_CHANNEL - | DiscordRegexNames.MENTION_ROLE - | DiscordRegexNames.MENTION_USER; - } - export interface MentionChannelMatch extends MentionableMatch { + species: DiscordRegexNames.MENTION_CHANNEL | DiscordRegexNames.MENTION_ROLE | DiscordRegexNames.MENTION_USER; +} + +export interface MentionChannelMatch extends MentionableMatch { species: DiscordRegexNames.MENTION_CHANNEL; - } - export interface MentionRoleMatch extends MentionableMatch { +} + +export interface MentionRoleMatch extends MentionableMatch { species: DiscordRegexNames.MENTION_ROLE; - } - export interface MentionUserMatch extends MentionableMatch { +} + +export interface MentionUserMatch extends MentionableMatch { mentionType: string; species: DiscordRegexNames.MENTION_USER; - } - export interface TextMatch extends DiscordRegexMatch { +} + +export interface TextMatch extends DiscordRegexMatch { text: string; species: - | DiscordRegexNames.TEXT_BOLD - | DiscordRegexNames.TEXT_CODEBLOCK - | DiscordRegexNames.TEXT_CODESTRING - | DiscordRegexNames.TEXT_ITALICS - | DiscordRegexNames.TEXT_SNOWFLAKE - | DiscordRegexNames.TEXT_SPOILER - | DiscordRegexNames.TEXT_STRIKE - | DiscordRegexNames.TEXT_UNDERLINE - | DiscordRegexNames.TEXT_URL; - } - export interface TextCodeblockMatch extends TextMatch { + | DiscordRegexNames.TEXT_BOLD + | DiscordRegexNames.TEXT_CODEBLOCK + | DiscordRegexNames.TEXT_CODESTRING + | DiscordRegexNames.TEXT_ITALICS + | DiscordRegexNames.TEXT_SNOWFLAKE + | DiscordRegexNames.TEXT_SPOILER + | DiscordRegexNames.TEXT_STRIKE + | DiscordRegexNames.TEXT_UNDERLINE + | DiscordRegexNames.TEXT_URL; +} + +export interface TextCodeblockMatch extends TextMatch { language: string; species: DiscordRegexNames.TEXT_CODEBLOCK; - } - export interface TextBoldMatch extends TextMatch { +} + +export interface TextBoldMatch extends TextMatch { species: DiscordRegexNames.TEXT_BOLD; - } - export interface TextCodestringMatch extends TextMatch { +} + +export interface TextCodestringMatch extends TextMatch { species: DiscordRegexNames.TEXT_CODESTRING; - } - export interface TextItalicsMatch extends TextMatch { +} + +export interface TextItalicsMatch extends TextMatch { species: DiscordRegexNames.TEXT_ITALICS; - } - export interface TextSnowflakeMatch extends TextMatch { +} + +export interface TextSnowflakeMatch extends TextMatch { species: DiscordRegexNames.TEXT_SNOWFLAKE; - } - export interface TextSpoilerMatch extends TextMatch { +} + +export interface TextSpoilerMatch extends TextMatch { species: DiscordRegexNames.TEXT_SPOILER; - } - export interface TextStrikeMatch extends TextMatch { +} + +export interface TextStrikeMatch extends TextMatch { species: DiscordRegexNames.TEXT_STRIKE; - } - export interface TextUnderlineMatch extends TextMatch { +} + +export interface TextUnderlineMatch extends TextMatch { species: DiscordRegexNames.TEXT_UNDERLINE; - } - export interface TextUrlMatch extends TextMatch { +} + +export interface TextUrlMatch extends TextMatch { species: DiscordRegexNames.TEXT_URL; - } +} - class MatchInner { +class MatchInner { public raw: string; public static: typeof MatchInner = MatchInner; constructor(raw: string) { - this.raw = raw; + this.raw = raw; } emoji(): DiscordRegexPayload { - return this.match(DiscordRegexNames.EMOJI); + return this.match(DiscordRegexNames.EMOJI); } + jumpChannel(): DiscordRegexPayload { - return this.match(DiscordRegexNames.JUMP_CHANNEL); + return this.match(DiscordRegexNames.JUMP_CHANNEL); } + jumpChannelMessage(): DiscordRegexPayload { - return this.match(DiscordRegexNames.JUMP_CHANNEL_MESSAGE); + return this.match(DiscordRegexNames.JUMP_CHANNEL_MESSAGE); } + mentionChannel(): DiscordRegexPayload { - return this.match(DiscordRegexNames.MENTION_CHANNEL); + return this.match(DiscordRegexNames.MENTION_CHANNEL); } + mentionRole(): DiscordRegexPayload { - return this.match(DiscordRegexNames.MENTION_ROLE); + return this.match(DiscordRegexNames.MENTION_ROLE); } + mentionUser(): DiscordRegexPayload { - return this.match(DiscordRegexNames.MENTION_USER); + return this.match(DiscordRegexNames.MENTION_USER); } + codeblock(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_CODEBLOCK); + return this.match(DiscordRegexNames.TEXT_CODEBLOCK); } + bold(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_BOLD); + return this.match(DiscordRegexNames.TEXT_BOLD); } + codestring(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_CODESTRING); + return this.match(DiscordRegexNames.TEXT_CODESTRING); } + italics(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_ITALICS); + return this.match(DiscordRegexNames.TEXT_ITALICS); } + snowflake(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_SNOWFLAKE); + return this.match(DiscordRegexNames.TEXT_SNOWFLAKE); } + spoiler(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_SPOILER); + return this.match(DiscordRegexNames.TEXT_SPOILER); } + strike(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_STRIKE); + return this.match(DiscordRegexNames.TEXT_STRIKE); } + underline(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_UNDERLINE); + return this.match(DiscordRegexNames.TEXT_UNDERLINE); } + url(): DiscordRegexPayload { - return this.match(DiscordRegexNames.TEXT_URL); - } - - match( - type: DiscordRegexNames, - onlyFirst = false - ): DiscordRegexPayload { - const regex = DiscordRegex[type]; - if (regex === undefined) { - throw new global.Error(`Unknown regex type: ${type}`); - } - regex.lastIndex = 0; - - const payload: DiscordRegexPayload = { - match: { regex, type }, - matches: [] - }; - - let match: RegExpExecArray | null = null; - while ((match = regex.exec(this.raw))) { - const result: DiscordRegexMatch = { matched: match[0], species: type }; - switch (type) { - case DiscordRegexNames.EMOJI: - { - result.name = match[1] as string; - result.id = match[2] as string; - result.animated = this.raw.startsWith('(type: DiscordRegexNames, onlyFirst = false): DiscordRegexPayload { + const regex = DiscordRegex[type]; + if (regex === undefined) { throw new global.Error(`Unknown regex type: ${type}`); - } } - payload.matches.push(result as T); + regex.lastIndex = 0; - if (onlyFirst) { - break; + const payload: DiscordRegexPayload = { + match: { regex, type }, + matches: [], + }; + + let match: RegExpExecArray | null = null; + while ((match = regex.exec(this.raw))) { + const result: DiscordRegexMatch = { matched: match[0], species: type }; + switch (type) { + case DiscordRegexNames.EMOJI: { + result.name = match[1] as string; + result.id = match[2] as string; + result.animated = this.raw.startsWith('( + plug: Module | undefined, + type: T, +): plug is ModuleDefs[T] { + // Another way to check if type is equivalent, + // It will check based on flag system instead + return plug !== undefined && (plug.type & type) !== 0; +} + +export function isChatInputCommand(i: CommandInteraction): i is ChatInputCommandInteraction { + return i.isChatInputCommand(); +} + +export function isButton(i: MessageComponentInteraction): i is ButtonInteraction { + return i.isButton(); +} + +export function isSelectMenu(i: MessageComponentInteraction): i is SelectMenuInteraction { + return i.isSelectMenu(); +} + +export function isMessageCtxMenuCmd( + i: CommandInteraction, +): i is MessageContextMenuCommandInteraction { + return i.isMessageContextMenuCommand(); +} + +export function isUserContextMenuCmd( + i: CommandInteraction, +): i is UserContextMenuCommandInteraction { + return i.isUserContextMenuCommand(); +} + +export function isPromise(promiseLike: Awaitable): promiseLike is Promise { + const keys = new Set(Object.keys(promiseLike)); + return keys.has('then') && keys.has('catch'); +} + +export function isDiscordEvent(el: DiscordEvent | EventEmitterRegister): el is DiscordEvent { + return el.length === 2; +} diff --git a/src/handler/utilities/preprocessors/args.ts b/src/handler/utilities/preprocessors/args.ts deleted file mode 100644 index d2936095..00000000 --- a/src/handler/utilities/preprocessors/args.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Err, Ok, Result } from 'ts-results'; -import type { possibleOutput } from '../../../types/handler'; - -/** - * Wrapper type taking `Ok(T)` or `Err(possibleOutput)` e.g `Result = Result; - -/** - * - * @param {string} arg - command arguments - * @param {possibleOutput} onFailure - if `Number.parseInt` returns NaN - * @returns {ArgType} Attempts to use `Number.parseInt()` on `arg` - */ - -export function parseInt(arg: string, onFailure: possibleOutput): ArgType { - const val = Number.parseInt(arg); - - return val === NaN ? Err(onFailure) : Ok(val); -} - -/** - * - * @param {string} arg - command arguments - * @param {possibleOutput} onFailure - If cannot parse `arg` into boolean. - * @param { {yesRegex: RegExp, noRegex: RegExp} } regexes - default regexes: yes : `/^(?:y(?:es)?|👍)$/i`, no : /^(?:n(?:o)?|👎)$/i - * @returns { ArgType } attemps to parse `args` as a boolean - */ - -export function parseBool( - arg: string, - onFailure: possibleOutput = `Cannot parse '${arg}' as a boolean`, - regexes: { - yesRegex: RegExp; - noRegex: RegExp; - } = { - yesRegex: /^(?:y(?:es)?|👍)$/i, - noRegex: /^(?:n(?:o)?|👎)$/i, - }, -): ArgType { - if (arg.match(regexes.yesRegex)) return Ok(true); - if (arg.match(regexes.noRegex)) return Ok(false); - - return Err(onFailure); -} - -/** - * - * @param {string} arg - command arguments - * @param {string} sep - default separator = ' ' - * @returns {Ok} - */ - -export function toArr(arg: string, sep = ' '): ArgType { - return Ok(arg.split(sep)); -} - -/** - * - * @param {string} arg - command arguments - * @param {possibleOutput} onFailure - delegates `Utils.parseInt` - * @returns {ArgType} - */ - -export function toPositiveInt(arg: string, onFailure: possibleOutput): ArgType { - return parseInt(arg, onFailure).andThen((num) => Ok(num > 0 ? num : -num)); -} - -/** - * - * @param {string} arg - command arguments - * @param {possibleOutput} onFailure - delegates `parseInt` - * @returns {ArgType} - */ -export function toNegativeInt(arg: string, onFailure: possibleOutput): ArgType { - return parseInt(arg, onFailure).andThen((num) => Ok(num > 0 ? -num : num)); -} diff --git a/src/handler/utilities/readFile.ts b/src/handler/utilities/readFile.ts index 43921319..47dbdffb 100644 --- a/src/handler/utilities/readFile.ts +++ b/src/handler/utilities/readFile.ts @@ -1,56 +1,63 @@ -import type { ApplicationCommandOptionData } from 'discord.js'; -import type * as Sern from '../sern'; -import type Module from '../structures/module'; - +import { ApplicationCommandType, ComponentType } from 'discord.js'; import { readdirSync, statSync } from 'fs'; -import { basename, join } from 'path'; - -export type CommandVal = { - mod: Module & { name : string }; - options: ApplicationCommandOptionData[]; +import { join } from 'path'; +import { from, Observable } from 'rxjs'; +import type { Module } from '../structures/module'; + +//Maybe move this? this probably doesnt belong in utlities/ +export const BothCommands = new Map(); +export const ApplicationCommands = { + [ApplicationCommandType.User]: new Map(), + [ApplicationCommandType.Message]: new Map(), + [ApplicationCommandType.ChatInput]: new Map(), +} as { [K in ApplicationCommandType]: Map }; + +export const MessageCompCommands = { + [ComponentType.Button]: new Map(), + [ComponentType.SelectMenu]: new Map(), + [ComponentType.TextInput]: new Map(), }; - -export const Commands = new Map(); -export const Alias = new Map(); - +export const TextCommands = { + text: new Map(), + aliases: new Map(), +}; +export const ModalSubmitCommands = new Map(); // Courtesy @Townsy45 -async function readPath(dir: string, arrayOfFiles: string[] = []): Promise { - try { - const files = readdirSync(dir); - for (const file of files) { - if (statSync(dir + '/' + file).isDirectory()) await readPath(dir + '/' + file, arrayOfFiles); - else arrayOfFiles.push(join(dir, '/', file)); +function readPath(dir: string, arrayOfFiles: string[] = []): string[] { + try { + const files = readdirSync(dir); + for (const file of files) { + if (statSync(dir + '/' + file).isDirectory()) readPath(dir + '/' + file, arrayOfFiles); + else arrayOfFiles.push(join(dir, '/', file)); + } + } catch (err) { + throw err; } - } catch (err) { - throw err; - } - return arrayOfFiles; + return arrayOfFiles; } export const fmtFileName = (n: string) => n.substring(0, n.length - 3); /** - * - * @param {Sern.Handler} handler an instance of Sern.Handler - * @returns {Promise<{ name: string; mod: Module; absPath: string; }[]>} data from command files + * + * @returns {Observable<{ mod: Module; absPath: string; }[]>} data from command files + * @param commandDir */ -export async function buildData(handler: Sern.Handler): Promise< - { - name: string; - mod: Module; +export function buildData(commandDir: string): Observable<{ + mod: Module; absPath: string; - }[] -> { - const commandDir = handler.commandDir; - return Promise.all( - (await getCommands(commandDir)).map(async (absPath) => { - return { name: basename(absPath), mod: (await import(absPath)).default as Module, absPath }; - }), - ); +}> { + return from( + getCommands(commandDir).map(absPath => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const mod = require(absPath).default; + return { mod, absPath }; + }), + ); } -export async function getCommands(dir: string): Promise { - return readPath(join(process.cwd(), dir)); +export function getCommands(dir: string): string[] { + return readPath(join(process.cwd(), dir)); } diff --git a/src/handler/utilities/utilsExports.ts b/src/handler/utilities/utilsExports.ts deleted file mode 100644 index 6c02f528..00000000 --- a/src/handler/utilities/utilsExports.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as Preprocessors from './preprocessors/args'; - -module.exports = { Preprocessors }; -export { Preprocessors }; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index bb809ac0..4fd70b99 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,4 @@ -import * as Sern from './handler/sern'; -import * as Utils from './handler/utilities/utilsExports'; -import * as Types from './types/handler'; - -module.exports = { Sern, Utils, Types }; -export { Sern, Utils, Types }; +export * as Sern from './handler/sern'; +export * from './types/handler'; +export * from './handler/structures/structxports'; +export * from './handler/plugins/plugin'; diff --git a/src/types/handler.ts b/src/types/handler.ts index b4b998c8..e14f8f06 100644 --- a/src/types/handler.ts +++ b/src/types/handler.ts @@ -1,24 +1,37 @@ - -import type { - CommandInteractionOptionResolver, - MessagePayload, - MessageOptions, -} from 'discord.js'; - -import type Module from '../handler/structures/module'; - -export type Visibility = 'private' | 'public'; - -// Anything that can be sent in a `#send` or `#reply` -export type possibleOutput = T | (MessagePayload & MessageOptions); -export type execute = Module['execute']; +import type { Awaitable, ClientEvents, CommandInteractionOptionResolver } from 'discord.js'; +import type { EventEmitter } from 'events'; +export type Nullish = T | undefined | null; // Thanks @cursorsdottsx export type ParseType = { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never; }[keyof T]; +export type Args = ParseType<{ text: string[]; slash: SlashOptions }>; -export type Arg = ParseType<{ text: string[]; slash: SlashOptions }>; +export type DiscordEvent = ParseType<{ + [K in keyof ClientEvents]: (...args: ClientEvents[K]) => Awaitable; +}>; +export type EventEmitterRegister = [ + emitter: EventEmitter, + k: string, + cb: (...args: unknown[]) => Awaitable, +]; -// TypeAlias for interaction.options export type SlashOptions = Omit; + +//https://dev.to/vborodulin/ts-how-to-override-properties-with-type-intersection-554l +export type Override = Omit & T2; + +export type DefinitelyDefined = T & Override; + +type Reconstruct = T extends Omit ? O & Reconstruct : T; + +type IsOptional = { + [K in keyof T]-?: T[K] extends Required[K] ? false : true; +}; + +export type UnionToIntersection = (T extends unknown ? (x: T) => unknown : never) extends ( + x: infer R, +) => unknown + ? R + : never; diff --git a/tests/functions.test.ts b/tests/functions.test.ts index e142bd28..cb57fe21 100644 --- a/tests/functions.test.ts +++ b/tests/functions.test.ts @@ -1,4 +1,5 @@ -import { hasPrefix, fmt, isNotFromBot } from '../src/handler/utilities/messageHelpers'; +import { fmt, hasPrefix, isNotFromBot } from '../src/handler/utilities/messageHelpers'; + describe('FUNCTIONS', () => { test('If hasPrefix is a function', () => { expect(typeof hasPrefix).toBe('function'); @@ -9,5 +10,4 @@ describe('FUNCTIONS', () => { test('if isBot is a function', () => { expect(typeof isNotFromBot).toBe('function'); }); - }); diff --git a/tsconfig.json b/tsconfig.json index f35ae23e..0e7b5422 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,4 +18,4 @@ }, "exclude": ["node_modules", "tests", "dist"], "include": ["src"], -} \ No newline at end of file +}