@mongosh/service-provider-core 3.3.5 → 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/closable.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export default interface Closable {
2
- close(force: boolean): Promise<void>;
2
+ close(): Promise<void>;
3
3
  suspend(): Promise<() => Promise<void>>;
4
4
  }
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/lib/writable.d.ts CHANGED
@@ -17,7 +17,9 @@ export default interface Writable {
17
17
  insertOne(database: string, collection: string, doc: Document, options: InsertOneOptions, dbOptions?: DbOptions): Promise<InsertOneResult>;
18
18
  replaceOne(database: string, collection: string, filter: Document, replacement: Document, options?: ReplaceOptions, dbOptions?: DbOptions): Promise<UpdateResult>;
19
19
  updateMany(database: string, collection: string, filter: Document, update: Document, options?: UpdateOptions, dbOptions?: DbOptions): Promise<UpdateResult>;
20
- updateOne(database: string, collection: string, filter: Document, update: Document, options?: UpdateOptions, dbOptions?: DbOptions): Promise<UpdateResult>;
20
+ updateOne(database: string, collection: string, filter: Document, update: Document, options?: UpdateOptions & {
21
+ sort?: Document;
22
+ }, dbOptions?: DbOptions): Promise<UpdateResult>;
21
23
  createIndexes(database: string, collection: string, indexSpecs: Document[], options?: CreateIndexesOptions, dbOptions?: DbOptions): Promise<string[]>;
22
24
  dropCollection(database: string, collection: string, options: DropCollectionOptions, dbOptions?: DbOptions): Promise<boolean>;
23
25
  renameCollection(database: string, oldName: string, newName: string, options?: RenameOptions, dbOptions?: DbOptions): Promise<Collection>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongosh/service-provider-core",
3
- "version": "3.3.5",
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",
@@ -33,27 +33,15 @@
33
33
  "node": ">=14.15.1"
34
34
  },
35
35
  "mongosh": {
36
- "unitTestsOnly": true,
37
- "ciRequiredOptionalDependencies": {
38
- "mongodb-client-encryption": [
39
- "darwin",
40
- "linux",
41
- "win32"
42
- ]
43
- }
36
+ "unitTestsOnly": true
44
37
  },
45
38
  "dependencies": {
46
- "@aws-sdk/credential-providers": "^3.525.0",
47
- "@mongosh/errors": "2.4.2",
48
- "bson": "^6.10.3",
49
- "mongodb": "^6.16.0",
39
+ "@mongosh/errors": "2.4.4",
40
+ "bson": "^6.10.4",
41
+ "mongodb": "^6.19.0",
50
42
  "mongodb-build-info": "^1.7.2",
51
- "mongodb-client-encryption": "^6.3.0",
52
43
  "mongodb-connection-string-url": "^3.0.1"
53
44
  },
54
- "optionalDependencies": {
55
- "mongodb-client-encryption": "^6.3.0"
56
- },
57
45
  "devDependencies": {
58
46
  "@mongodb-js/eslint-config-mongosh": "^1.0.0",
59
47
  "@mongodb-js/prettier-config-devtools": "^1.0.1",
@@ -62,5 +50,5 @@
62
50
  "eslint": "^7.25.0",
63
51
  "prettier": "^2.8.8"
64
52
  },
65
- "gitHead": "511befbaf032b589d7f3e81325e5e389d360cc3f"
53
+ "gitHead": "e019a30c3021026ff8db296171d7d7f68cdac05e"
66
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/closable.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  export default interface Closable {
2
2
  /**
3
3
  * Close the connection.
4
- *
5
- * @param {boolean} force - Whether to force close.
6
4
  */
7
- close(force: boolean): Promise<void>;
5
+ close(): Promise<void>;
8
6
 
9
7
  /**
10
8
  * Suspends the connection, i.e. temporarily force-closes it
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
package/src/writable.ts CHANGED
@@ -319,7 +319,7 @@ export default interface Writable {
319
319
  collection: string,
320
320
  filter: Document,
321
321
  update: Document,
322
- options?: UpdateOptions,
322
+ options?: UpdateOptions & { sort?: Document },
323
323
  dbOptions?: DbOptions
324
324
  ): Promise<UpdateResult>;
325
325