@mongosh/service-provider-core 3.6.5 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.mocharc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "require": ["../../scripts/import-expansions.js", "ts-node/register"],
3
+ "timeout": 60000,
4
+ "reporter": "../../configs/mocha-config-mongosh/reporter.ts",
5
+ "spec": ["./src/**/*.spec.ts"],
6
+ "exclude": ["**/node_modules/**"]
7
+ }
package/lib/admin.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type ShellAuthOptions from './shell-auth-options';
2
2
  import type { MongoClientOptions, ReadConcern, ReadPreference, WriteConcern, Document, CreateCollectionOptions, ClientSession, DbOptions, ClientSessionOptions, ListDatabasesOptions, AutoEncryptionOptions, Collection } from './all-transport-types';
3
- import type { ConnectionExtraInfo } from './index';
3
+ import type { ConnectionExtraInfo, ServiceProvider } from './index';
4
4
  import type { ReplPlatform } from './platform';
5
5
  import type { AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, ClientEncryption as MongoCryptClientEncryption, ClientEncryptionDataKeyProvider, GCPEncryptionKeyOptions, ClientEncryption, ClientEncryptionOptions } from './all-fle-types';
6
6
  import type { BSON } from '@mongosh/shell-bson';
@@ -30,7 +30,7 @@ export default interface Admin {
30
30
  bsonLibrary: BSON;
31
31
  computeLegacyHexMD5?(str: string): Promise<string>;
32
32
  listDatabases(database: string, options?: ListDatabasesOptions): Promise<Document>;
33
- getNewConnection(uri: string, options: MongoClientOptions): Promise<any>;
33
+ getNewConnection(uri: string, options: MongoClientOptions): Promise<ServiceProvider>;
34
34
  getURI(): string | undefined;
35
35
  getConnectionInfo(): Promise<ConnectionInfo>;
36
36
  authenticate(authDoc: ShellAuthOptions): Promise<{
package/lib/cursors.d.ts CHANGED
@@ -5,7 +5,7 @@ export interface ServiceProviderBaseCursor<TSchema = Document> {
5
5
  next(): Promise<TSchema | null>;
6
6
  tryNext(): Promise<TSchema | null>;
7
7
  readonly closed: boolean;
8
- [Symbol.asyncIterator](): AsyncGenerator<TSchema, void, void>;
8
+ [Symbol.asyncIterator]?(): AsyncGenerator<TSchema, void, void>;
9
9
  }
10
10
  export interface ServiceProviderAbstractCursor<TSchema = Document> extends ServiceProviderBaseCursor<TSchema> {
11
11
  batchSize(number: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongosh/service-provider-core",
3
- "version": "3.6.5",
3
+ "version": "3.7.0",
4
4
  "description": "MongoDB Shell Core Service Provider Package",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "scripts": {
15
15
  "compile": "tsc -p tsconfig.json",
16
16
  "prepublish": "npm run compile",
17
- "test": "mocha -r \"../../scripts/import-expansions.js\" --timeout 60000 -r ts-node/register --reporter \"../../configs/mocha-config-mongosh/reporter.ts\" \"./src/**/*.spec.ts\"",
17
+ "test": "mocha",
18
18
  "test-ci": "node ../../scripts/run-if-package-requested.js npm test",
19
19
  "test-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test",
20
20
  "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci",
@@ -36,8 +36,8 @@
36
36
  "unitTestsOnly": true
37
37
  },
38
38
  "dependencies": {
39
- "@mongosh/errors": "2.4.4",
40
- "@mongosh/shell-bson": "1.0.6",
39
+ "@mongosh/errors": "2.4.5",
40
+ "@mongosh/shell-bson": "1.1.0",
41
41
  "bson": "^6.10.4",
42
42
  "mongodb": "^6.19.0",
43
43
  "mongodb-build-info": "^1.8.1",
@@ -51,5 +51,5 @@
51
51
  "eslint": "^7.25.0",
52
52
  "prettier": "^2.8.8"
53
53
  },
54
- "gitHead": "3d71822f423fd44a7307cbf8265e5f9853795828"
54
+ "gitHead": "d2069810a846a535c51c88929224a57e49960778"
55
55
  }
package/src/admin.ts CHANGED
@@ -13,7 +13,7 @@ import type {
13
13
  AutoEncryptionOptions,
14
14
  Collection,
15
15
  } from './all-transport-types';
16
- import type { ConnectionExtraInfo } from './index';
16
+ import type { ConnectionExtraInfo, ServiceProvider } from './index';
17
17
  import type { ReplPlatform } from './platform';
18
18
  import type {
19
19
  AWSEncryptionKeyOptions,
@@ -90,7 +90,10 @@ export default interface Admin {
90
90
  * @param uri
91
91
  * @param options
92
92
  */
93
- getNewConnection(uri: string, options: MongoClientOptions): Promise<any>; // returns the ServiceProvider instance
93
+ getNewConnection(
94
+ uri: string,
95
+ options: MongoClientOptions
96
+ ): Promise<ServiceProvider>;
94
97
 
95
98
  /**
96
99
  * Return the URI for the current connection, if this ServiceProvider is connected.
package/src/cursors.ts CHANGED
@@ -15,7 +15,7 @@ export interface ServiceProviderBaseCursor<TSchema = Document> {
15
15
  next(): Promise<TSchema | null>;
16
16
  tryNext(): Promise<TSchema | null>;
17
17
  readonly closed: boolean;
18
- [Symbol.asyncIterator](): AsyncGenerator<TSchema, void, void>;
18
+ [Symbol.asyncIterator]?(): AsyncGenerator<TSchema, void, void>;
19
19
  }
20
20
 
21
21
  export interface ServiceProviderAbstractCursor<TSchema = Document>