diff --git a/package.json b/package.json index cbb2dc9..83fd6b7 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ }, "peerDependencies": { "@mongodb-js/oidc-plugin": "^0.3.0", - "mongodb": "^5.4.0", + "mongodb": "^5.4.0 || ^6.0.0", "mongodb-log-writer": "^1.2.0" }, "devDependencies": { @@ -53,19 +53,19 @@ "@types/react": "^17.0.53", "@types/react-dom": "^17.0.19", "@types/sinon": "^10.0.2", - "@typescript-eslint/eslint-plugin": "^4.2.0", - "@typescript-eslint/parser": "^4.2.0", + "@typescript-eslint/eslint-plugin": "^6.5.0", + "@typescript-eslint/parser": "^6.5.0", "chai": "^4.3.4", - "eslint": "^7.9.0", - "eslint-config-semistandard": "^16.0.0", - "eslint-config-standard": "^16.0.3", + "eslint": "^8.48.0", + "eslint-config-semistandard": "^17.0.0", + "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "5.1.x", + "eslint-plugin-promise": "^6.1.1", "eslint-plugin-standard": "^5.0.0", "gen-esm-wrapper": "^1.1.0", "mocha": "^9.1.1", - "mongodb": "^5.4.0", + "mongodb": "^5.4.0 || ^6.0.0", "mongodb-log-writer": "^1.2.0", "nyc": "^15.1.0", "react": "^17.0.2", diff --git a/src/connect.ts b/src/connect.ts index 6e5e18f..73fff24 100644 --- a/src/connect.ts +++ b/src/connect.ts @@ -98,7 +98,7 @@ async function connectWithFailFast(uri: string, client: MongoClient, logger: Con client.removeListener('serverHeartbeatFailed', heartbeatFailureListener); client.removeListener('serverHeartbeatSucceeded', heartbeatSucceededListener); logger.emit('devtools-connect:connect-attempt-finished', { - cryptSharedLibVersionInfo: (client?.autoEncrypter as any /* NODE-4285 */)?.cryptSharedLibVersionInfo + cryptSharedLibVersionInfo: (client as any)?.autoEncrypter?.cryptSharedLibVersionInfo }); } } @@ -134,7 +134,7 @@ async function resolveMongodbSrv(uri: string, logger: ConnectLogEmitter): Promis resolutionDetails.push({ query: 'SRV', hostname, error: args[0]?.message, wasNativelyLookedUp: wasNativelyLookedUp(args[1]) }); - // eslint-disable-next-line node/no-callback-literal + // eslint-disable-next-line n/no-callback-literal cb(...args); }); }, @@ -143,7 +143,7 @@ async function resolveMongodbSrv(uri: string, logger: ConnectLogEmitter): Promis resolutionDetails.push({ query: 'TXT', hostname, error: args[0]?.message, wasNativelyLookedUp: wasNativelyLookedUp(args[1]) }); - // eslint-disable-next-line node/no-callback-literal + // eslint-disable-next-line n/no-callback-literal cb(...args); }); } @@ -343,9 +343,9 @@ export async function connectMongoClient( const client = new MongoClientClass(uri, mongoClientOptions); closeMongoClientWhenAuthFails(state, client); await connectWithFailFast(uri, client, logger); - if (client.autoEncrypter) { + if ((client as any).autoEncrypter) { // Enable Devtools-specific CSFLE result decoration. - (client.autoEncrypter as any)[Symbol.for('@@mdb.decorateDecryptionResult')] = true; + ((client as any).autoEncrypter)[Symbol.for('@@mdb.decorateDecryptionResult')] = true; } return { client, state }; }