@mongosh/service-provider-core 3.3.7 → 3.5.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.
@@ -1 +1 @@
1
- export type { AggregateOptions, AggregationCursor, AnyBulkWriteOperation, AnyClientBulkWriteModel, Batch, BulkWriteOptions, BulkWriteResult, ClientBulkWriteResult, ClientBulkWriteOptions, ChangeStream, ChangeStreamOptions, ClientSession, CollationOptions, Collection, CommandOperationOptions, CountDocumentsOptions, CountOptions, CreateCollectionOptions, CreateIndexesOptions, ClientSessionOptions, ClusterTime, FindCursor, CursorFlag, RunCommandCursor, Db, DbOptions, DeleteOptions, DeleteResult, DistinctOptions, Document, DropCollectionOptions, DropDatabaseOptions, EstimatedDocumentCountOptions, ExplainOptions, ExplainVerbosityLike, FindOneAndDeleteOptions, FindOneAndUpdateOptions, FindOneAndReplaceOptions, FindOperators, FindOptions, HedgeOptions, IndexDescription, InsertManyResult, InsertOneOptions, InsertOneResult, ListCollectionsOptions, ListDatabasesOptions, ListIndexesOptions, MongoClientOptions, OrderedBulkOperation, ReadConcern, ReadConcernLike, ReadConcernLevel, ReadPreference, ReadPreferenceLike, ReadPreferenceFromOptions, ReadPreferenceMode, RenameOptions, ReplaceOptions, ResumeToken, RunCommandOptions, SearchIndexDescription, ServerSessionId, TagSet, TransactionOptions, UpdateOptions, UpdateResult, UnorderedBulkOperation, WriteConcern, ObjectId as ObjectIdType, Timestamp as TimestampType, Binary as BinaryType, TopologyDescription, TopologyType, ServerType, AutoEncryptionOptions, ServerApi, ServerApiVersion, MongoClient, } from 'mongodb';
1
+ export type { AggregateOptions, AggregationCursor, AnyBulkWriteOperation, AnyClientBulkWriteModel, Batch, BulkWriteOptions, BulkWriteResult, ClientBulkWriteResult, ClientBulkWriteOptions, ChangeStream, ChangeStreamOptions, ClientSession, CollationOptions, Collection, CommandOperationOptions, CountDocumentsOptions, CountOptions, CreateCollectionOptions, CreateIndexesOptions, ClientSessionOptions, ClusterTime, FindCursor, CursorFlag, RunCommandCursor, Db, DbOptions, DeleteOptions, DeleteResult, DistinctOptions, Document, DropCollectionOptions, DropDatabaseOptions, EstimatedDocumentCountOptions, ExplainOptions, ExplainVerbosityLike, FindOneAndDeleteOptions, FindOneAndUpdateOptions, FindOneAndReplaceOptions, FindOperators, FindOptions, HedgeOptions, IndexDescription, InsertManyResult, InsertOneOptions, InsertOneResult, ListCollectionsOptions, ListDatabasesOptions, ListIndexesOptions, MongoClientOptions, OrderedBulkOperation, ReadConcern, ReadConcernLike, ReadConcernLevel, ReadPreference, ReadPreferenceLike, ReadPreferenceFromOptions, ReadPreferenceMode, RenameOptions, ReplaceOptions, ResumeToken, RunCommandOptions, SearchIndexDescription, ServerSessionId, TagSet, TransactionOptions, UpdateOptions, UpdateResult, UnorderedBulkOperation, WriteConcern, ObjectId as ObjectIdType, Timestamp as TimestampType, Binary as BinaryType, TopologyType, ServerType, AutoEncryptionOptions, ServerApi, ServerApiVersion, MongoClient, } from 'mongodb';
package/lib/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import ShellAuthOptions from './shell-auth-options';
8
8
  export * from './all-transport-types';
9
9
  export * from './all-fle-types';
10
10
  export { MapReduceOptions, FinalizeFunction } from './map-reduce-options';
11
+ export { TopologyDescription, ServerDescription } from './readable';
11
12
  export { CreateEncryptedCollectionOptions, CheckMetadataConsistencyOptions, ConnectionInfo, } from './admin';
12
13
  export { bson } from './bson-export';
13
14
  export { ServiceProviderAbstractCursor, ServiceProviderAggregationCursor, ServiceProviderFindCursor, ServiceProviderRunCommandCursor, ServiceProviderChangeStream, } from './cursors';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA0E;AAiCxE,oGAjCwB,sCAAmB,OAiCxB;AAhCrB,kEAA0E;AA6BxE,8BA7BK,sBAAmB,CA6BL;AA3BrB,MAAM,UAAU,GAAG,MAAM,CAAC;AA6BxB,gCAAU;AA5BZ,qDAAoD;AA8BlD,iGA9BO,iCAAgB,OA8BP;AA5BlB,wDAAsC;AACtC,kDAAgC;AAUhC,6CAAqC;AAA5B,mGAAA,IAAI,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA0E;AAmCxE,oGAnCwB,sCAAmB,OAmCxB;AAlCrB,kEAA0E;AA+BxE,8BA/BK,sBAAmB,CA+BL;AA7BrB,MAAM,UAAU,GAAG,MAAM,CAAC;AA+BxB,gCAAU;AA9BZ,qDAAoD;AAgClD,iGAhCO,iCAAgB,OAgCP;AA9BlB,wDAAsC;AACtC,kDAAgC;AAYhC,6CAAqC;AAA5B,mGAAA,IAAI,OAAA"}
package/lib/readable.d.ts CHANGED
@@ -1,6 +1,15 @@
1
- import type { Document, AggregateOptions, CountOptions, CountDocumentsOptions, DistinctOptions, EstimatedDocumentCountOptions, FindOptions, ListCollectionsOptions, ListIndexesOptions, DbOptions, ReadPreferenceFromOptions, ReadPreferenceLike } from './all-transport-types';
1
+ import type { Document, AggregateOptions, CountOptions, CountDocumentsOptions, DistinctOptions, EstimatedDocumentCountOptions, FindOptions, ListCollectionsOptions, ListIndexesOptions, DbOptions, ReadPreferenceFromOptions, ReadPreferenceLike, TopologyType, ServerType } from './all-transport-types';
2
2
  import type { ChangeStreamOptions } from './all-transport-types';
3
3
  import type { ServiceProviderAggregationCursor, ServiceProviderChangeStream, ServiceProviderFindCursor } from './cursors';
4
+ export interface ServerDescription {
5
+ type?: ServerType;
6
+ setName?: string | null;
7
+ }
8
+ export interface TopologyDescription {
9
+ type?: TopologyType;
10
+ setName?: string | null;
11
+ servers?: Map<string, ServerDescription>;
12
+ }
4
13
  export default interface Readable {
5
14
  aggregate(database: string, collection: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): ServiceProviderAggregationCursor;
6
15
  aggregateDb(database: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): ServiceProviderAggregationCursor;
@@ -9,7 +18,7 @@ export default interface Readable {
9
18
  distinct(database: string, collection: string, fieldName: string, filter?: Document, options?: DistinctOptions, dbOptions?: DbOptions): Promise<Document>;
10
19
  estimatedDocumentCount(database: string, collection: string, options?: EstimatedDocumentCountOptions, dbOptions?: DbOptions): Promise<number>;
11
20
  find(database: string, collection: string, filter?: Document, options?: FindOptions, dbOptions?: DbOptions): ServiceProviderFindCursor;
12
- getTopology(): any;
21
+ getTopologyDescription(): TopologyDescription | undefined;
13
22
  getIndexes(database: string, collection: string, options: ListIndexesOptions, dbOptions?: DbOptions): Promise<Document[]>;
14
23
  listCollections(database: string, filter?: Document, options?: ListCollectionsOptions, dbOptions?: DbOptions): Promise<Document[]>;
15
24
  readPreferenceFromOptions(options?: Omit<ReadPreferenceFromOptions, 'session'>): ReadPreferenceLike | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongosh/service-provider-core",
3
- "version": "3.3.7",
3
+ "version": "3.5.0",
4
4
  "description": "MongoDB Shell Core Service Provider Package",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@mongosh/errors": "2.4.4",
40
40
  "bson": "^6.10.4",
41
- "mongodb": "^6.18.0",
41
+ "mongodb": "^6.19.0",
42
42
  "mongodb-build-info": "^1.7.2",
43
43
  "mongodb-connection-string-url": "^3.0.1"
44
44
  },
@@ -50,5 +50,5 @@
50
50
  "eslint": "^7.25.0",
51
51
  "prettier": "^2.8.8"
52
52
  },
53
- "gitHead": "535ab3f767e2a27c05a6be6a299e0285eebfcc9e"
53
+ "gitHead": "e019a30c3021026ff8db296171d7d7f68cdac05e"
54
54
  }
@@ -71,7 +71,6 @@ export type {
71
71
  ObjectId as ObjectIdType,
72
72
  Timestamp as TimestampType,
73
73
  Binary as BinaryType,
74
- TopologyDescription,
75
74
  TopologyType,
76
75
  ServerType,
77
76
  AutoEncryptionOptions,
package/src/index.ts CHANGED
@@ -10,6 +10,8 @@ export * from './all-fle-types';
10
10
 
11
11
  export { MapReduceOptions, FinalizeFunction } from './map-reduce-options';
12
12
 
13
+ export { TopologyDescription, ServerDescription } from './readable';
14
+
13
15
  export {
14
16
  CreateEncryptedCollectionOptions,
15
17
  CheckMetadataConsistencyOptions,
package/src/readable.ts CHANGED
@@ -11,6 +11,8 @@ import type {
11
11
  DbOptions,
12
12
  ReadPreferenceFromOptions,
13
13
  ReadPreferenceLike,
14
+ TopologyType,
15
+ ServerType,
14
16
  } from './all-transport-types';
15
17
  import type { ChangeStreamOptions } from './all-transport-types';
16
18
  import type {
@@ -19,6 +21,17 @@ import type {
19
21
  ServiceProviderFindCursor,
20
22
  } from './cursors';
21
23
 
24
+ // These are trimmed-down versions of the MongoDB driver types
25
+ export interface ServerDescription {
26
+ type?: ServerType;
27
+ setName?: string | null;
28
+ }
29
+ export interface TopologyDescription {
30
+ type?: TopologyType;
31
+ setName?: string | null;
32
+ servers?: Map<string, ServerDescription>;
33
+ }
34
+
22
35
  /**
23
36
  * Interface for read operations in the CRUD specification.
24
37
  */
@@ -160,7 +173,7 @@ export default interface Readable {
160
173
  /**
161
174
  * Get currently known topology information.
162
175
  */
163
- getTopology(): any;
176
+ getTopologyDescription(): TopologyDescription | undefined;
164
177
 
165
178
  /**
166
179
  * Returns an array that holds a list of documents that identify and