From 49f931197c7d7906d53d86525b428c61503f3d41 Mon Sep 17 00:00:00 2001 From: afeuerstein <32029275+afeuerstein@users.noreply.github.com> Date: Tue, 6 Apr 2021 21:33:09 +0200 Subject: resolve deprecation warnings --- src/util/Database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/Database.ts b/src/util/Database.ts index fee3cc31..6e774262 100644 --- a/src/util/Database.ts +++ b/src/util/Database.ts @@ -6,7 +6,7 @@ const uri = process.env.MONGO_URL || "mongodb://localhost:27017/fosscord?readPre console.log(`[DB] connect: ${uri}`); -const connection = mongoose.createConnection(uri, { autoIndex: true }); +const connection = mongoose.createConnection(uri, { autoIndex: true , useNewUrlParser: true, useUnifiedTopology: true }); export default connection; -- cgit 1.4.1 From e6830735497f261df1b7e4c56ddb9c7578ef7106 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 6 Apr 2021 23:25:11 +0200 Subject: :arrow_up: update mongodb --- README.md | 10 ++++++- package-lock.json | 85 ++++++++++++++++++++++++++++++++++++++++++++++------ package.json | 2 +- src/util/Database.ts | 3 +- tsconfig.json | 2 +- 5 files changed, 89 insertions(+), 13 deletions(-) (limited to 'src/util') diff --git a/README.md b/README.md index c08a72d5..c2d275c4 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ -# server-util \ No newline at end of file +# server-util + +add to package.json: + +```json +"start": "npm run build:util && npm run build && node dist/", +"build": "tsc -b .", +"build:util": "tsc -b ./node_modules/fosscord-server-util/" +``` diff --git a/package-lock.json b/package-lock.json index 4448c6fb..0e721c0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "jsonwebtoken": "^8.5.1", "lambert-db": "^1.1.7", "missing-native-js-functions": "^1.2.2", - "mongodb": "^3.6.4", + "mongodb": "^3.6.6", "mongoose": "^5.12.3" }, "devDependencies": { @@ -563,14 +563,14 @@ } }, "node_modules/mongodb": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.5.tgz", - "integrity": "sha512-mQlYKw1iGbvJJejcPuyTaytq0xxlYbIoVDm2FODR+OHxyEiMR021vc32bTvamgBjCswsD54XIRwhg3yBaWqJjg==", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.6.tgz", + "integrity": "sha512-WlirMiuV1UPbej5JeCMqE93JRfZ/ZzqE7nJTwP85XzjAF4rRSeq2bGCb1cjfoHLOF06+HxADaPGqT0g3SbVT1w==", "dependencies": { "bl": "^2.2.1", "bson": "^1.1.4", "denque": "^1.4.1", - "require_optional": "^1.0.1", + "optional-require": "^1.0.2", "safe-buffer": "^5.1.2", "saslprep": "^1.0.0" }, @@ -708,6 +708,45 @@ "mongoose": "*" } }, + "node_modules/mongoose/node_modules/mongodb": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.5.tgz", + "integrity": "sha512-mQlYKw1iGbvJJejcPuyTaytq0xxlYbIoVDm2FODR+OHxyEiMR021vc32bTvamgBjCswsD54XIRwhg3yBaWqJjg==", + "dependencies": { + "bl": "^2.2.1", + "bson": "^1.1.4", + "denque": "^1.4.1", + "require_optional": "^1.0.1", + "safe-buffer": "^5.1.2", + "saslprep": "^1.0.0" + }, + "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/mpath": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.8.3.tgz", @@ -762,6 +801,14 @@ "wrappy": "1" } }, + "node_modules/optional-require": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.2.tgz", + "integrity": "sha512-HZubVd6IfHsbnpdNF/ICaSAzBUEW1TievpkjY3tB4Jnk8L7+pJ3conPzUt3Mn/6OZx9uzTDOHYPGA8/AxYHBOg==", + "engines": { + "node": ">=4" + } + }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -1506,14 +1553,14 @@ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, "mongodb": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.5.tgz", - "integrity": "sha512-mQlYKw1iGbvJJejcPuyTaytq0xxlYbIoVDm2FODR+OHxyEiMR021vc32bTvamgBjCswsD54XIRwhg3yBaWqJjg==", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.6.tgz", + "integrity": "sha512-WlirMiuV1UPbej5JeCMqE93JRfZ/ZzqE7nJTwP85XzjAF4rRSeq2bGCb1cjfoHLOF06+HxADaPGqT0g3SbVT1w==", "requires": { "bl": "^2.2.1", "bson": "^1.1.4", "denque": "^1.4.1", - "require_optional": "^1.0.1", + "optional-require": "^1.0.2", "safe-buffer": "^5.1.2", "saslprep": "^1.0.0" } @@ -1591,6 +1638,21 @@ "safe-buffer": "5.2.1", "sift": "7.0.1", "sliced": "1.0.1" + }, + "dependencies": { + "mongodb": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.5.tgz", + "integrity": "sha512-mQlYKw1iGbvJJejcPuyTaytq0xxlYbIoVDm2FODR+OHxyEiMR021vc32bTvamgBjCswsD54XIRwhg3yBaWqJjg==", + "requires": { + "bl": "^2.2.1", + "bson": "^1.1.4", + "denque": "^1.4.1", + "require_optional": "^1.0.1", + "safe-buffer": "^5.1.2", + "saslprep": "^1.0.0" + } + } } }, "mongoose-legacy-pluralize": { @@ -1649,6 +1711,11 @@ "wrappy": "1" } }, + "optional-require": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.2.tgz", + "integrity": "sha512-HZubVd6IfHsbnpdNF/ICaSAzBUEW1TievpkjY3tB4Jnk8L7+pJ3conPzUt3Mn/6OZx9uzTDOHYPGA8/AxYHBOg==" + }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", diff --git a/package.json b/package.json index 0ac2c9ce..7900d301 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "jsonwebtoken": "^8.5.1", "lambert-db": "^1.1.7", "missing-native-js-functions": "^1.2.2", - "mongodb": "^3.6.4", + "mongodb": "^3.6.6", "mongoose": "^5.12.3" }, "devDependencies": { diff --git a/src/util/Database.ts b/src/util/Database.ts index 6e774262..883c8dcd 100644 --- a/src/util/Database.ts +++ b/src/util/Database.ts @@ -6,7 +6,7 @@ const uri = process.env.MONGO_URL || "mongodb://localhost:27017/fosscord?readPre console.log(`[DB] connect: ${uri}`); -const connection = mongoose.createConnection(uri, { autoIndex: true , useNewUrlParser: true, useUnifiedTopology: true }); +const connection = mongoose.createConnection(uri, { autoIndex: true, useNewUrlParser: true, useUnifiedTopology: true }); export default connection; @@ -32,6 +32,7 @@ export class MongooseCache extends EventEmitter { } init = async () => { + // @ts-ignore this.stream = this.collection.watch(this.pipeline, { fullDocument: "updateLookup" }); this.stream.on("change", this.change); diff --git a/tsconfig.json b/tsconfig.json index 6cc2a681..520774d3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "include": ["src"], + "include": ["src/**/*.ts"], "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */ -- cgit 1.4.1