Skip to content

Commit ab925de

Browse files
authored
chore: update node driver to 4.0.0-beta.5 MONGOSH-795 (#912)
1 parent 591dd71 commit ab925de

16 files changed

+60
-58
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"karma-typescript": "^4.1.1",
118118
"lerna": "^3.10.7",
119119
"mocha": "^7.1.2",
120-
"mongodb": "4.0.0-beta.4",
120+
"mongodb": "4.0.0-beta.5",
121121
"mongodb-download-url": "^1.0.1",
122122
"mongodb-js-precommit": "^2.0.0",
123123
"nock": "^13.0.11",

packages/service-provider-core/package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/service-provider-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@mongosh/errors": "0.0.0-dev.0",
3131
"@mongosh/i18n": "0.0.0-dev.0",
3232
"bson": "^4.4.0",
33-
"mongodb": "4.0.0-beta.4",
33+
"mongodb": "4.0.0-beta.5",
3434
"mongodb-build-info": "^1.1.1",
3535
"whatwg-url": "^8.4.0"
3636
},

packages/service-provider-core/src/all-transport-types.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ export type {
5151
OrderedBulkOperation,
5252
ReadConcern,
5353
ReadConcernLike,
54-
ReadConcernLevelId,
54+
ReadConcernLevel,
5555
ReadPreference,
5656
ReadPreferenceLike,
5757
ReadPreferenceFromOptions,
58-
ReadPreferenceModeId,
58+
ReadPreferenceMode,
5959
RenameOptions,
6060
ReplaceOptions,
6161
ResumeToken,
@@ -70,12 +70,11 @@ export type {
7070
ObjectId as ObjectIdType,
7171
Timestamp as TimestampType,
7272
Binary as BinaryType,
73-
Topology,
7473
TopologyDescription,
75-
TopologyTypeId,
76-
ServerTypeId,
74+
TopologyType,
75+
ServerType,
7776
AutoEncryptionOptions,
7877
ServerApi,
79-
ServerApiVersionId,
78+
ServerApiVersion,
8079
MongoClient // mostly for testing
8180
} from 'mongodb';

packages/service-provider-server/package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/service-provider-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@types/sinon": "^7.5.1",
4444
"@types/sinon-chai": "^3.2.3",
4545
"aws4": "^1.11.0",
46-
"mongodb": "4.0.0-beta.4",
46+
"mongodb": "4.0.0-beta.5",
4747
"saslprep": "mongodb-js/saslprep#v1.0.4"
4848
},
4949
"devDependencies": {

packages/service-provider-server/src/cli-service-provider.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
Auth,
3-
AuthMechanismId,
3+
AuthMechanism,
44
MongoClient,
55
ReadPreference,
66
Binary,
@@ -16,7 +16,6 @@ import {
1616
Decimal128,
1717
BSONSymbol,
1818
ClientMetadata,
19-
Topology,
2019
ReadPreferenceFromOptions,
2120
ReadPreferenceLike,
2221
OperationOptions,
@@ -110,7 +109,7 @@ type DropDatabaseResult = {
110109

111110
type ConnectionInfo = {
112111
buildInfo: any;
113-
topology: Topology;
112+
topology: any;
114113
extraInfo: ExtraConnectionInfo;
115114
};
116115
type ExtraConnectionInfo = ReturnType<typeof getConnectInfo>;
@@ -315,7 +314,7 @@ class CliServiceProvider extends ServiceProviderCore implements ServiceProvider
315314
}
316315
}
317316
}
318-
const topology = this.getTopology() as Topology;
317+
const topology = this.getTopology();
319318
const { version } = require('../package.json');
320319
const [cmdLineOpts = null, atlasVersion = null] = await Promise.all([
321320
this.runCommandWithCheck('admin', { getCmdLineOpts: 1 }, this.baseCmdOptions).catch(() => {}),
@@ -972,8 +971,8 @@ class CliServiceProvider extends ServiceProviderCore implements ServiceProvider
972971
/**
973972
* Get currently known topology information.
974973
*/
975-
getTopology(): Topology | undefined {
976-
return this.mongoClient.topology;
974+
getTopology(): any | undefined {
975+
return (this.mongoClient as any).topology;
977976
}
978977

979978
/**
@@ -1120,7 +1119,7 @@ class CliServiceProvider extends ServiceProviderCore implements ServiceProvider
11201119
const auth: Auth = { username: authDoc.user, password: authDoc.pwd };
11211120
await this.resetConnectionOptions({
11221121
auth,
1123-
...(authDoc.mechanism ? { authMechanism: authDoc.mechanism as AuthMechanismId } : {}),
1122+
...(authDoc.mechanism ? { authMechanism: authDoc.mechanism as AuthMechanism } : {}),
11241123
...(authDoc.authDb ? { authSource: authDoc.authDb } : {})
11251124
});
11261125
return { ok: 1 };

packages/service-provider-server/src/mongodb-patches.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { MongoshInternalError } from '@mongosh/errors';
2-
import { Callback, CloseOptions, Connection, ConnectionPool } from 'mongodb';
2+
import { Callback, CloseOptions } from 'mongodb';
3+
4+
// We "rename" any here for more clarity below
5+
type ConnectionPool = any;
6+
type Connection = any;
37

48
let alreadyPatched = false;
59

@@ -26,7 +30,7 @@ function patchConnectionPoolTracking(): void {
2630
const newCheckOut: typeof originalCheckOut = function(this: ConnectionPool, cb: Callback<Connection>): void {
2731
// eslint-disable-next-line @typescript-eslint/no-this-alias
2832
const pool = this;
29-
originalCheckOut.call(this, function(this: any, error, connection) {
33+
originalCheckOut.call(this, function(this: any, error: any, connection: Connection) {
3034
if (connection) {
3135
let connections = poolToConnections.get(pool);
3236
if (!connections) {

packages/shell-api/src/cursor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type {
1616
Document,
1717
CollationOptions,
1818
ReadPreferenceLike,
19-
ReadConcernLevelId,
19+
ReadConcernLevel,
2020
TagSet,
2121
HedgeOptions
2222
} from '@mongosh/service-provider-core';
@@ -225,7 +225,7 @@ export default class Cursor extends AbstractCursor {
225225
}
226226

227227
@returnType('Cursor')
228-
readConcern(level: ReadConcernLevelId): Cursor {
228+
readConcern(level: ReadConcernLevel): Cursor {
229229
this._cursor = this._cursor.withReadConcern({ level });
230230
return this;
231231
}

0 commit comments

Comments
 (0)