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

feat: allow usage with [email protected] #34

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment on lines +44 to 45
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know that you could use || in there. TIL.

},
"devDependencies": {
Expand All @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
}
Expand Down Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity: why was this renamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cb(...args);
});
},
Expand All @@ -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);
});
}
Expand Down Expand Up @@ -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 };
}
Expand Down