Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit 23f2b7b

Browse files
committed
chore: allow usage with [email protected]
1 parent 74deb5e commit 23f2b7b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"peerDependencies": {
4343
"@mongodb-js/oidc-plugin": "^0.3.0",
44-
"mongodb": "^5.4.0",
44+
"mongodb": "^5.4.0 || ^6.0.0",
4545
"mongodb-log-writer": "^1.2.0"
4646
},
4747
"devDependencies": {
@@ -53,19 +53,19 @@
5353
"@types/react": "^17.0.53",
5454
"@types/react-dom": "^17.0.19",
5555
"@types/sinon": "^10.0.2",
56-
"@typescript-eslint/eslint-plugin": "^4.2.0",
57-
"@typescript-eslint/parser": "^4.2.0",
56+
"@typescript-eslint/eslint-plugin": "^6.5.0",
57+
"@typescript-eslint/parser": "^6.5.0",
5858
"chai": "^4.3.4",
59-
"eslint": "^7.9.0",
60-
"eslint-config-semistandard": "^16.0.0",
61-
"eslint-config-standard": "^16.0.3",
59+
"eslint": "^8.48.0",
60+
"eslint-config-semistandard": "^17.0.0",
61+
"eslint-config-standard": "^17.1.0",
6262
"eslint-plugin-import": "^2.22.0",
6363
"eslint-plugin-node": "^11.1.0",
64-
"eslint-plugin-promise": "5.1.x",
64+
"eslint-plugin-promise": "^6.1.1",
6565
"eslint-plugin-standard": "^5.0.0",
6666
"gen-esm-wrapper": "^1.1.0",
6767
"mocha": "^9.1.1",
68-
"mongodb": "^5.4.0",
68+
"mongodb": "^5.4.0 || ^6.0.0",
6969
"mongodb-log-writer": "^1.2.0",
7070
"nyc": "^15.1.0",
7171
"react": "^17.0.2",

src/connect.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async function connectWithFailFast(uri: string, client: MongoClient, logger: Con
9898
client.removeListener('serverHeartbeatFailed', heartbeatFailureListener);
9999
client.removeListener('serverHeartbeatSucceeded', heartbeatSucceededListener);
100100
logger.emit('devtools-connect:connect-attempt-finished', {
101-
cryptSharedLibVersionInfo: (client?.autoEncrypter as any /* NODE-4285 */)?.cryptSharedLibVersionInfo
101+
cryptSharedLibVersionInfo: (client as any)?.autoEncrypter?.cryptSharedLibVersionInfo
102102
});
103103
}
104104
}
@@ -134,7 +134,7 @@ async function resolveMongodbSrv(uri: string, logger: ConnectLogEmitter): Promis
134134
resolutionDetails.push({
135135
query: 'SRV', hostname, error: args[0]?.message, wasNativelyLookedUp: wasNativelyLookedUp(args[1])
136136
});
137-
// eslint-disable-next-line node/no-callback-literal
137+
// eslint-disable-next-line n/no-callback-literal
138138
cb(...args);
139139
});
140140
},
@@ -143,7 +143,7 @@ async function resolveMongodbSrv(uri: string, logger: ConnectLogEmitter): Promis
143143
resolutionDetails.push({
144144
query: 'TXT', hostname, error: args[0]?.message, wasNativelyLookedUp: wasNativelyLookedUp(args[1])
145145
});
146-
// eslint-disable-next-line node/no-callback-literal
146+
// eslint-disable-next-line n/no-callback-literal
147147
cb(...args);
148148
});
149149
}
@@ -343,9 +343,9 @@ export async function connectMongoClient(
343343
const client = new MongoClientClass(uri, mongoClientOptions);
344344
closeMongoClientWhenAuthFails(state, client);
345345
await connectWithFailFast(uri, client, logger);
346-
if (client.autoEncrypter) {
346+
if ((client as any).autoEncrypter) {
347347
// Enable Devtools-specific CSFLE result decoration.
348-
(client.autoEncrypter as any)[Symbol.for('@@mdb.decorateDecryptionResult')] = true;
348+
((client as any).autoEncrypter)[Symbol.for('@@mdb.decorateDecryptionResult')] = true;
349349
}
350350
return { client, state };
351351
}

0 commit comments

Comments
 (0)