From 5e842189f34522c6d794e8fc4edf0591d4deaa26 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 26 Apr 2021 03:06:19 +0530 Subject: [PATCH 1/2] update server util version --- package-lock.json | 495 +++------------------------------------------- package.json | 2 +- 2 files changed, 23 insertions(+), 474 deletions(-) diff --git a/package-lock.json b/package-lock.json index ea952617..05786b47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "ISC", "dependencies": { - "@fosscord/server-util": "^1.0.4", + "@fosscord/server-util": "^1.0.7", "@types/jest": "^26.0.22", "bcrypt": "^5.0.0", "body-parser": "^1.19.0", @@ -85,10 +85,6 @@ }, "engines": { "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" } }, "node_modules/@babel/core/node_modules/convert-source-map": { @@ -110,11 +106,6 @@ }, "engines": { "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } } }, "node_modules/@babel/core/node_modules/json5": { @@ -186,9 +177,6 @@ "@babel/helper-validator-option": "^7.12.17", "browserslist": "^4.14.5", "semver": "^6.3.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { @@ -352,9 +340,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-bigint": { @@ -364,9 +349,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-class-properties": { @@ -376,9 +358,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-import-meta": { @@ -388,9 +367,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-json-strings": { @@ -400,9 +376,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-logical-assignment-operators": { @@ -412,9 +385,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { @@ -424,9 +394,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-numeric-separator": { @@ -436,9 +403,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-object-rest-spread": { @@ -448,9 +412,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-optional-catch-binding": { @@ -460,9 +421,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-optional-chaining": { @@ -472,9 +430,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/plugin-syntax-top-level-await": { @@ -484,9 +439,6 @@ "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/runtime": { @@ -534,11 +486,6 @@ }, "engines": { "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } } }, "node_modules/@babel/traverse/node_modules/ms": { @@ -581,10 +528,9 @@ } }, "node_modules/@fosscord/server-util": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.0.4.tgz", - "integrity": "sha512-TZPUNyOF/dxmVLDscUPQXmikKS/K209Itv15TGVYGHovCFVIfHVbfXxa+u7EVseQJvX7BL1Kyd45IWDE0Qy1jA==", - "license": "ISC", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.0.7.tgz", + "integrity": "sha512-3vBPCt+lwMS7wk+iRvv+V8qBSnEdNifpPxX97Lfjje/TSWI17Kg29y3BmcGJRC5TwIHTLFtgpNLmZmruhv7ziQ==", "dependencies": { "@types/jsonwebtoken": "^8.5.0", "@types/mongoose-autopopulate": "^0.10.1", @@ -607,34 +553,13 @@ "bson": "^1.1.4", "denque": "^1.4.1", "optional-require": "^1.0.2", - "safe-buffer": "^5.1.2", - "saslprep": "^1.0.0" + "safe-buffer": "^5.1.2" }, "engines": { "node": ">=4" }, "optionalDependencies": { "saslprep": "^1.0.0" - }, - "peerDependenciesMeta": { - "aws4": { - "optional": true - }, - "bson-ext": { - "optional": true - }, - "kerberos": { - "optional": true - }, - "mongodb-client-encryption": { - "optional": true - }, - "mongodb-extjson": { - "optional": true - }, - "snappy": { - "optional": true - } } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -707,9 +632,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/@jest/console/node_modules/chalk": { @@ -723,9 +645,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/@jest/console/node_modules/color-convert": { @@ -834,9 +753,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/@jest/core/node_modules/braces": { @@ -862,9 +778,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/@jest/core/node_modules/color-convert": { @@ -938,9 +851,6 @@ }, "bin": { "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@jest/core/node_modules/slash": { @@ -1059,7 +969,6 @@ "jest-resolve": "^26.6.2", "jest-util": "^26.6.2", "jest-worker": "^26.6.2", - "node-notifier": "^8.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^4.0.1", @@ -1083,9 +992,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/@jest/reporters/node_modules/chalk": { @@ -1099,9 +1005,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/@jest/reporters/node_modules/color-convert": { @@ -1233,9 +1136,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/@jest/transform/node_modules/braces": { @@ -1261,9 +1161,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/@jest/transform/node_modules/color-convert": { @@ -1393,9 +1290,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/@jest/types/node_modules/chalk": { @@ -1408,9 +1302,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/@jest/types/node_modules/color-convert": { @@ -1748,9 +1639,6 @@ "dev": true, "dependencies": { "resolve": "^1.12.0" - }, - "peerDependencies": { - "typescript": ">=3.7.2" } }, "node_modules/@zerollup/ts-transform-paths": { @@ -1760,9 +1648,6 @@ "dev": true, "dependencies": { "@zerollup/ts-helpers": "^1.7.18" - }, - "peerDependencies": { - "typescript": ">=3.7.2" } }, "node_modules/0x": { @@ -1817,11 +1702,6 @@ }, "engines": { "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } } }, "node_modules/0x/node_modules/make-dir": { @@ -1929,10 +1809,6 @@ "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/ansi-escapes": { @@ -1945,9 +1821,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-regex": { @@ -2176,9 +2049,6 @@ }, "engines": { "node": ">= 10.14.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, "node_modules/babel-jest/node_modules/ansi-styles": { @@ -2191,9 +2061,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/babel-jest/node_modules/chalk": { @@ -2207,9 +2074,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/babel-jest/node_modules/color-convert": { @@ -2309,9 +2173,6 @@ "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-syntax-top-level-await": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, "node_modules/babel-preset-jest": { @@ -2325,9 +2186,6 @@ }, "engines": { "node": ">= 10.14.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, "node_modules/balanced-match": { @@ -2674,21 +2532,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "dev": true }, "node_modules/browserify-zlib": { "version": "0.2.0", @@ -2726,10 +2570,6 @@ }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" } }, "node_modules/bser": { @@ -3934,9 +3774,6 @@ "dev": true, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" } }, "node_modules/emoji-regex": { @@ -4017,9 +3854,6 @@ }, "engines": { "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" } }, "node_modules/esprima": { @@ -4109,9 +3943,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, "node_modules/execspawn": { @@ -4284,9 +4115,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/expect/node_modules/color-convert": { @@ -4669,7 +4497,6 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -4742,9 +4569,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/get-value": { @@ -4814,7 +4638,6 @@ "version": "5.1.5", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", "dev": true, "dependencies": { "ajv": "^6.12.3", @@ -4929,21 +4752,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "dev": true }, "node_modules/hash.js": { "version": "1.1.7", @@ -5268,9 +5077,6 @@ "dev": true, "dependencies": { "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-data-descriptor": { @@ -5308,9 +5114,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-extendable": { @@ -5531,11 +5334,6 @@ }, "engines": { "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } } }, "node_modules/istanbul-lib-source-maps/node_modules/ms": { @@ -5625,9 +5423,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-cli/node_modules/chalk": { @@ -5641,9 +5436,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-cli/node_modules/color-convert": { @@ -5712,14 +5504,6 @@ }, "engines": { "node": ">= 10.14.2" - }, - "peerDependencies": { - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "ts-node": { - "optional": true - } } }, "node_modules/jest-config/node_modules/ansi-styles": { @@ -5732,9 +5516,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-config/node_modules/braces": { @@ -5760,9 +5541,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-config/node_modules/color-convert": { @@ -5873,9 +5651,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-diff/node_modules/chalk": { @@ -5888,9 +5663,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-diff/node_modules/color-convert": { @@ -5966,9 +5738,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-each/node_modules/chalk": { @@ -5982,9 +5751,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-each/node_modules/color-convert": { @@ -6080,7 +5846,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -6194,9 +5959,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-jasmine2/node_modules/chalk": { @@ -6210,9 +5972,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-jasmine2/node_modules/color-convert": { @@ -6292,9 +6051,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-matcher-utils/node_modules/chalk": { @@ -6308,9 +6064,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-matcher-utils/node_modules/color-convert": { @@ -6382,9 +6135,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-message-util/node_modules/braces": { @@ -6410,9 +6160,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-message-util/node_modules/color-convert": { @@ -6529,14 +6276,6 @@ "dev": true, "engines": { "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" - }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } } }, "node_modules/jest-regex-util": { @@ -6591,9 +6330,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-resolve/node_modules/chalk": { @@ -6607,9 +6343,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-resolve/node_modules/color-convert": { @@ -6701,9 +6434,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-runner/node_modules/chalk": { @@ -6717,9 +6447,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-runner/node_modules/color-convert": { @@ -6812,9 +6539,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-runtime/node_modules/chalk": { @@ -6828,9 +6552,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-runtime/node_modules/color-convert": { @@ -6931,9 +6652,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-snapshot/node_modules/chalk": { @@ -6947,9 +6665,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-snapshot/node_modules/color-convert": { @@ -7033,9 +6748,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-util/node_modules/braces": { @@ -7061,9 +6773,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-util/node_modules/color-convert": { @@ -7178,9 +6887,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-validate/node_modules/chalk": { @@ -7194,9 +6900,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-validate/node_modules/color-convert": { @@ -7266,9 +6969,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/jest-watcher/node_modules/chalk": { @@ -7282,9 +6982,6 @@ }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/jest-watcher/node_modules/color-convert": { @@ -7420,14 +7117,6 @@ }, "engines": { "node": ">=10" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } } }, "node_modules/jsdom/node_modules/acorn": { @@ -7507,19 +7196,13 @@ "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dependencies": { "graceful-fs": "^4.1.6" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" } }, "node_modules/jsonify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true, - "engines": { - "node": "*" - } + "dev": true }, "node_modules/jsonparse": { "version": "1.3.1", @@ -8144,34 +7827,13 @@ "bson": "^1.1.4", "denque": "^1.4.1", "require_optional": "^1.0.1", - "safe-buffer": "^5.1.2", - "saslprep": "^1.0.0" + "safe-buffer": "^5.1.2" }, "engines": { "node": ">=4" }, "optionalDependencies": { "saslprep": "^1.0.0" - }, - "peerDependenciesMeta": { - "aws4": { - "optional": true - }, - "bson-ext": { - "optional": true - }, - "kerberos": { - "optional": true - }, - "mongodb-client-encryption": { - "optional": true - }, - "mongodb-extjson": { - "optional": true - }, - "snappy": { - "optional": true - } } }, "node_modules/mongoose": { @@ -8194,19 +7856,12 @@ }, "engines": { "node": ">=4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mongoose" } }, "node_modules/mongoose-autopopulate": { "version": "0.12.3", "resolved": "https://registry.npmjs.org/mongoose-autopopulate/-/mongoose-autopopulate-0.12.3.tgz", - "integrity": "sha512-yNmYsfi6OpS/GQ+48mkB0KQ199ExHmmPrt3wt3fyxPHPMtEBGts7yq3wBQR6VgKCPOQaKvCI1URbJCPOtrPeLw==", - "peerDependencies": { - "mongoose": "4.x || 5.x" - } + "integrity": "sha512-yNmYsfi6OpS/GQ+48mkB0KQ199ExHmmPrt3wt3fyxPHPMtEBGts7yq3wBQR6VgKCPOQaKvCI1URbJCPOtrPeLw==" }, "node_modules/mongoose-legacy-pluralize": { "version": "1.0.2", @@ -8216,10 +7871,7 @@ "node_modules/mongoose-long": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/mongoose-long/-/mongoose-long-0.3.2.tgz", - "integrity": "sha512-5gTjPH6HUmtNhamv8MPwExWo01Z4d9CT5njZlupqqbmxzMXTbDOgCuP/jnK+9SV0Fs7nuyYlXv7pJ/nA2pAAuA==", - "peerDependencies": { - "mongoose": "4.x || 5.x" - } + "integrity": "sha512-5gTjPH6HUmtNhamv8MPwExWo01Z4d9CT5njZlupqqbmxzMXTbDOgCuP/jnK+9SV0Fs7nuyYlXv7pJ/nA2pAAuA==" }, "node_modules/mongoose/node_modules/ms": { "version": "2.1.2", @@ -8229,21 +7881,7 @@ "node_modules/mongoose/node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "node_modules/morphdom": { "version": "2.6.1", @@ -8821,9 +8459,6 @@ }, "engines": { "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/opn": { @@ -8901,9 +8536,6 @@ "dev": true, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-finally": { @@ -8989,9 +8621,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/parse5": { @@ -9222,9 +8851,6 @@ "dev": true, "engines": { "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pify": { @@ -9308,9 +8934,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/pretty-format/node_modules/color-convert": { @@ -9618,9 +9241,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/read-pkg-up/node_modules/type-fest": { @@ -9703,7 +9323,6 @@ "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", "dev": true, "dependencies": { "aws-sign2": "~0.7.0", @@ -9741,16 +9360,12 @@ }, "engines": { "node": ">=0.10.0" - }, - "peerDependencies": { - "request": "^2.34" } }, "node_modules/request-promise-native": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", "dev": true, "dependencies": { "request-promise-core": "1.1.4", @@ -9759,9 +9374,6 @@ }, "engines": { "node": ">=0.12.0" - }, - "peerDependencies": { - "request": "^2.34" } }, "node_modules/request-promise-native/node_modules/punycode": { @@ -9872,9 +9484,6 @@ "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-cwd": { @@ -9921,8 +9530,7 @@ "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated" + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" }, "node_modules/ret": { "version": "0.1.15", @@ -10349,21 +9957,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "dev": true }, "node_modules/single-line-log": { "version": "1.1.2", @@ -10711,11 +10305,6 @@ "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, "engines": { "node": ">=0.10.0" } @@ -11120,9 +10709,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/test-exclude": { @@ -11317,20 +10903,6 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], "engines": { "node": ">=4" } @@ -11416,9 +10988,6 @@ "dev": true, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/type-is": { @@ -11593,8 +11162,7 @@ "node_modules/urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated" + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" }, "node_modules/url": { "version": "0.11.0", @@ -11887,9 +11455,6 @@ }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/color-convert": { @@ -11969,18 +11534,6 @@ "dev": true, "engines": { "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } } }, "node_modules/xml-name-validator": { @@ -12564,9 +12117,9 @@ } }, "@fosscord/server-util": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.0.4.tgz", - "integrity": "sha512-TZPUNyOF/dxmVLDscUPQXmikKS/K209Itv15TGVYGHovCFVIfHVbfXxa+u7EVseQJvX7BL1Kyd45IWDE0Qy1jA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.0.7.tgz", + "integrity": "sha512-3vBPCt+lwMS7wk+iRvv+V8qBSnEdNifpPxX97Lfjje/TSWI17Kg29y3BmcGJRC5TwIHTLFtgpNLmZmruhv7ziQ==", "requires": { "@types/jsonwebtoken": "^8.5.0", "@types/mongoose-autopopulate": "^0.10.1", @@ -17408,8 +16961,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "dev": true, - "requires": {} + "dev": true }, "jest-regex-util": { "version": "26.0.0", @@ -18731,8 +18283,7 @@ "mongoose-autopopulate": { "version": "0.12.3", "resolved": "https://registry.npmjs.org/mongoose-autopopulate/-/mongoose-autopopulate-0.12.3.tgz", - "integrity": "sha512-yNmYsfi6OpS/GQ+48mkB0KQ199ExHmmPrt3wt3fyxPHPMtEBGts7yq3wBQR6VgKCPOQaKvCI1URbJCPOtrPeLw==", - "requires": {} + "integrity": "sha512-yNmYsfi6OpS/GQ+48mkB0KQ199ExHmmPrt3wt3fyxPHPMtEBGts7yq3wBQR6VgKCPOQaKvCI1URbJCPOtrPeLw==" }, "mongoose-legacy-pluralize": { "version": "1.0.2", @@ -18742,8 +18293,7 @@ "mongoose-long": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/mongoose-long/-/mongoose-long-0.3.2.tgz", - "integrity": "sha512-5gTjPH6HUmtNhamv8MPwExWo01Z4d9CT5njZlupqqbmxzMXTbDOgCuP/jnK+9SV0Fs7nuyYlXv7pJ/nA2pAAuA==", - "requires": {} + "integrity": "sha512-5gTjPH6HUmtNhamv8MPwExWo01Z4d9CT5njZlupqqbmxzMXTbDOgCuP/jnK+9SV0Fs7nuyYlXv7pJ/nA2pAAuA==" }, "morphdom": { "version": "2.6.1", @@ -21776,8 +21326,7 @@ "version": "7.4.4", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==", - "dev": true, - "requires": {} + "dev": true }, "xml-name-validator": { "version": "3.0.0", diff --git a/package.json b/package.json index f8509916..187aa29e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "homepage": "https://github.com/fosscord/fosscord-api#readme", "dependencies": { - "@fosscord/server-util": "^1.0.4", + "@fosscord/server-util": "^1.0.7", "@types/jest": "^26.0.22", "bcrypt": "^5.0.0", "body-parser": "^1.19.0", From aeecd50b77f7ad26f4f24e1f38d18ef09f875ddf Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 26 Apr 2021 03:40:20 +0530 Subject: [PATCH 2/2] Channel Delete + Update Route --- package-lock.json | 1 - package.json | 2 +- src/Server.ts | 7 ++- src/global.d.ts | 8 ++++ src/routes/channels/#channel_id/index.ts | 55 ++++++++++++++++++------ src/schema/Channel.ts | 2 +- 6 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 src/global.d.ts diff --git a/package-lock.json b/package-lock.json index 47737734..47439e70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2812,7 +2812,6 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", diff --git a/package.json b/package.json index e5f4bb24..36017e31 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "build": "tsc -b .", "build:util": "tsc -b ./node_modules/@fosscord/server-util/", "postinstall": "patch-package", - "dev": "tsnd --respawn src/" + "dev": "tsnd --respawn src/start.ts" }, "repository": { "type": "git", diff --git a/src/Server.ts b/src/Server.ts index c7c52c1f..c7f36233 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -12,8 +12,13 @@ import { ErrorHandler } from "./middlewares/ErrorHandler"; import { BodyParser } from "./middlewares/BodyParser"; import { Router } from "express"; import fetch from "node-fetch"; +import mongoose from "mongoose"; -export interface FosscordServerOptions extends ServerOptions {} +// this will return the new updated document for findOneAndUpdate +mongoose.set('returnOriginal', false); // https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndUpdate + + +export interface FosscordServerOptions extends ServerOptions { } declare global { namespace Express { diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 00000000..3eb70f44 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,8 @@ +declare global { + namespace Express { + interface Request { + user_id: any; + token: any; + } + } +} \ No newline at end of file diff --git a/src/routes/channels/#channel_id/index.ts b/src/routes/channels/#channel_id/index.ts index f6970df3..730c1a67 100644 --- a/src/routes/channels/#channel_id/index.ts +++ b/src/routes/channels/#channel_id/index.ts @@ -1,30 +1,57 @@ -import { ChannelModel, getPermission, toObject } from "@fosscord/server-util"; +import { ChannelDeleteEvent, ChannelModel, ChannelUpdateEvent, getPermission, toObject } from "@fosscord/server-util"; import { Router } from "express"; import { HTTPError } from "lambert-server"; +import { ChannelModifySchema } from "../../../schema/Channel"; +import { emitEvent } from "../../../util/Event"; +import { check } from "../../../util/instanceOf"; const router: Router = Router(); // TODO: delete channel // TODO: Get channel -router.delete("/", async(req,res)=>{ - const {channel_id} = req.params +router.delete("/", async (req, res) => { + const { channel_id } = req.params const channel = await ChannelModel.findOne({ id: channel_id }, { guild_id: true, type: true, permission_overwrites: true }).exec(); if (!channel) throw new HTTPError("Channel not found", 404); - if (channel.guild_id) { - const permission = await getPermission(req.user_id, channel.guild_id) - permission.hasThrow("MANAGE_CHANNELS") - - // TODO Channel Update Gateway event will fire for each of them - await ChannelModel.updateMany({parent_id: channel_id}, {$set: {channel_id: null}}).exec() - - await ChannelModel.deleteOne({id: channel_id}) - } - + const permission = await getPermission(req.user_id, channel.guild_id) + permission.hasThrow("MANAGE_CHANNELS") + + // TODO Channel Update Gateway event will fire for each of them + + + await ChannelModel.deleteOne({ id: channel_id }) + // TODO: Dm channel "close" not delete - + const data = toObject(channel); //TODO: Reload channel list if request successful res.send(data) }) +// should be good now + +router.patch("/", check(ChannelModifySchema), async (req, res) => { + var payload = req.body as ChannelModifySchema //new data + const { channel_id } = req.params + var channel = await ChannelModel.findOne({ id: channel_id }, { guild_id: true }).exec(); + if (!channel) throw new HTTPError("Channel not found", 404); + + const permission = await getPermission(req.user_id, channel.guild_id, channel_id) + permission.hasThrow("MANAGE_CHANNELS") + channel = await ChannelModel.findOneAndUpdate({ id: channel_id }, payload).exec() + if (!channel) throw new HTTPError("Channel not found", 404); + + //const data = toObject(channel); + //TODO: Reload channel list if request successful + + await emitEvent({ + event: "CHANNEL_UPDATE", + data: channel, + guild_id: channel.guild_id, + } as ChannelUpdateEvent) + + res.send(toObject(channel)); +}) + export default router; + diff --git a/src/schema/Channel.ts b/src/schema/Channel.ts index 70e305e4..3189091d 100644 --- a/src/schema/Channel.ts +++ b/src/schema/Channel.ts @@ -37,7 +37,7 @@ export interface ChannelModifySchema { topic?: string; bitrate?: number; user_limit?: number; - rate_limit_per_user?: Number; + rate_limit_per_user?: number; position?: number; permission_overwrites?: { id: string;