mongodb 6.8.2 → 6.9.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.
Files changed (242) hide show
  1. package/README.md +14 -1
  2. package/lib/beta.d.ts +7905 -0
  3. package/lib/beta.js +21 -0
  4. package/lib/beta.js.map +1 -0
  5. package/lib/bson.js +5 -5
  6. package/lib/bson.js.map +1 -1
  7. package/lib/bulk/common.js +16 -21
  8. package/lib/bulk/common.js.map +1 -1
  9. package/lib/bulk/ordered.js.map +1 -1
  10. package/lib/bulk/unordered.js.map +1 -1
  11. package/lib/change_stream.js +10 -8
  12. package/lib/change_stream.js.map +1 -1
  13. package/lib/client-side-encryption/auto_encrypter.js +14 -3
  14. package/lib/client-side-encryption/auto_encrypter.js.map +1 -1
  15. package/lib/client-side-encryption/client_encryption.js +25 -7
  16. package/lib/client-side-encryption/client_encryption.js.map +1 -1
  17. package/lib/client-side-encryption/crypto_callbacks.js +6 -6
  18. package/lib/client-side-encryption/crypto_callbacks.js.map +1 -1
  19. package/lib/client-side-encryption/mongocryptd_manager.js +9 -5
  20. package/lib/client-side-encryption/mongocryptd_manager.js.map +1 -1
  21. package/lib/client-side-encryption/providers/aws.js +1 -2
  22. package/lib/client-side-encryption/providers/aws.js.map +1 -1
  23. package/lib/client-side-encryption/providers/azure.js +5 -5
  24. package/lib/client-side-encryption/providers/azure.js.map +1 -1
  25. package/lib/client-side-encryption/providers/gcp.js +1 -2
  26. package/lib/client-side-encryption/providers/gcp.js.map +1 -1
  27. package/lib/client-side-encryption/providers/index.js +2 -3
  28. package/lib/client-side-encryption/providers/index.js.map +1 -1
  29. package/lib/client-side-encryption/state_machine.js +9 -4
  30. package/lib/client-side-encryption/state_machine.js.map +1 -1
  31. package/lib/cmap/auth/auth_provider.js.map +1 -1
  32. package/lib/cmap/auth/aws_temporary_credentials.js.map +1 -1
  33. package/lib/cmap/auth/gssapi.js +4 -4
  34. package/lib/cmap/auth/gssapi.js.map +1 -1
  35. package/lib/cmap/auth/mongo_credentials.js.map +1 -1
  36. package/lib/cmap/auth/mongocr.js.map +1 -1
  37. package/lib/cmap/auth/mongodb_aws.js.map +1 -1
  38. package/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js.map +1 -1
  39. package/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js.map +1 -1
  40. package/lib/cmap/auth/mongodb_oidc/callback_workflow.js +0 -2
  41. package/lib/cmap/auth/mongodb_oidc/callback_workflow.js.map +1 -1
  42. package/lib/cmap/auth/mongodb_oidc/command_builders.js +2 -3
  43. package/lib/cmap/auth/mongodb_oidc/command_builders.js.map +1 -1
  44. package/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js.map +1 -1
  45. package/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js.map +1 -1
  46. package/lib/cmap/auth/mongodb_oidc/machine_workflow.js +0 -2
  47. package/lib/cmap/auth/mongodb_oidc/machine_workflow.js.map +1 -1
  48. package/lib/cmap/auth/mongodb_oidc/token_cache.js.map +1 -1
  49. package/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js.map +1 -1
  50. package/lib/cmap/auth/mongodb_oidc.js.map +1 -1
  51. package/lib/cmap/auth/plain.js.map +1 -1
  52. package/lib/cmap/auth/scram.js.map +1 -1
  53. package/lib/cmap/auth/x509.js.map +1 -1
  54. package/lib/cmap/command_monitoring_events.js.map +1 -1
  55. package/lib/cmap/commands.js +62 -5
  56. package/lib/cmap/commands.js.map +1 -1
  57. package/lib/cmap/connect.js +10 -7
  58. package/lib/cmap/connect.js.map +1 -1
  59. package/lib/cmap/connection.js +3 -5
  60. package/lib/cmap/connection.js.map +1 -1
  61. package/lib/cmap/connection_pool.js +11 -9
  62. package/lib/cmap/connection_pool.js.map +1 -1
  63. package/lib/cmap/connection_pool_events.js +7 -3
  64. package/lib/cmap/connection_pool_events.js.map +1 -1
  65. package/lib/cmap/handshake/client_metadata.js +5 -5
  66. package/lib/cmap/handshake/client_metadata.js.map +1 -1
  67. package/lib/cmap/metrics.js +1 -1
  68. package/lib/cmap/metrics.js.map +1 -1
  69. package/lib/cmap/stream_description.js.map +1 -1
  70. package/lib/cmap/wire_protocol/compression.js +5 -5
  71. package/lib/cmap/wire_protocol/compression.js.map +1 -1
  72. package/lib/cmap/wire_protocol/constants.js +2 -2
  73. package/lib/cmap/wire_protocol/on_data.js +1 -2
  74. package/lib/cmap/wire_protocol/on_data.js.map +1 -1
  75. package/lib/cmap/wire_protocol/on_demand/document.js.map +1 -1
  76. package/lib/cmap/wire_protocol/responses.js +4 -4
  77. package/lib/cmap/wire_protocol/responses.js.map +1 -1
  78. package/lib/cmap/wire_protocol/shared.js +2 -3
  79. package/lib/cmap/wire_protocol/shared.js.map +1 -1
  80. package/lib/collection.js.map +1 -1
  81. package/lib/connection_string.js +12 -6
  82. package/lib/connection_string.js.map +1 -1
  83. package/lib/constants.js +1 -0
  84. package/lib/constants.js.map +1 -1
  85. package/lib/cursor/abstract_cursor.js +21 -6
  86. package/lib/cursor/abstract_cursor.js.map +1 -1
  87. package/lib/cursor/aggregation_cursor.js +1 -1
  88. package/lib/cursor/aggregation_cursor.js.map +1 -1
  89. package/lib/cursor/change_stream_cursor.js.map +1 -1
  90. package/lib/cursor/find_cursor.js +3 -3
  91. package/lib/cursor/find_cursor.js.map +1 -1
  92. package/lib/db.js +1 -1
  93. package/lib/db.js.map +1 -1
  94. package/lib/deps.js +16 -8
  95. package/lib/deps.js.map +1 -1
  96. package/lib/encrypter.js.map +1 -1
  97. package/lib/error.js +19 -14
  98. package/lib/error.js.map +1 -1
  99. package/lib/explain.js.map +1 -1
  100. package/lib/gridfs/download.js +1 -4
  101. package/lib/gridfs/download.js.map +1 -1
  102. package/lib/gridfs/index.js +1 -1
  103. package/lib/gridfs/index.js.map +1 -1
  104. package/lib/gridfs/upload.js +0 -4
  105. package/lib/gridfs/upload.js.map +1 -1
  106. package/lib/index.js +4 -2
  107. package/lib/index.js.map +1 -1
  108. package/lib/mongo_client.js +15 -1
  109. package/lib/mongo_client.js.map +1 -1
  110. package/lib/mongo_client_auth_providers.js.map +1 -1
  111. package/lib/mongo_logger.js +8 -8
  112. package/lib/mongo_logger.js.map +1 -1
  113. package/lib/mongo_types.js +1 -0
  114. package/lib/mongo_types.js.map +1 -1
  115. package/lib/operations/aggregate.js +1 -0
  116. package/lib/operations/aggregate.js.map +1 -1
  117. package/lib/operations/bulk_write.js.map +1 -1
  118. package/lib/operations/client_bulk_write/command_builder.js +198 -0
  119. package/lib/operations/client_bulk_write/command_builder.js.map +1 -0
  120. package/lib/operations/client_bulk_write/common.js +3 -0
  121. package/lib/operations/client_bulk_write/common.js.map +1 -0
  122. package/lib/operations/collections.js.map +1 -1
  123. package/lib/operations/command.js +1 -1
  124. package/lib/operations/command.js.map +1 -1
  125. package/lib/operations/count.js.map +1 -1
  126. package/lib/operations/create_collection.js.map +1 -1
  127. package/lib/operations/delete.js +2 -2
  128. package/lib/operations/delete.js.map +1 -1
  129. package/lib/operations/distinct.js.map +1 -1
  130. package/lib/operations/drop.js.map +1 -1
  131. package/lib/operations/estimated_document_count.js.map +1 -1
  132. package/lib/operations/execute_operation.js +111 -109
  133. package/lib/operations/execute_operation.js.map +1 -1
  134. package/lib/operations/find.js.map +1 -1
  135. package/lib/operations/find_and_modify.js +2 -8
  136. package/lib/operations/find_and_modify.js.map +1 -1
  137. package/lib/operations/get_more.js.map +1 -1
  138. package/lib/operations/indexes.js.map +1 -1
  139. package/lib/operations/insert.js.map +1 -1
  140. package/lib/operations/is_capped.js.map +1 -1
  141. package/lib/operations/kill_cursors.js.map +1 -1
  142. package/lib/operations/list_collections.js.map +1 -1
  143. package/lib/operations/list_databases.js.map +1 -1
  144. package/lib/operations/operation.js +5 -5
  145. package/lib/operations/operation.js.map +1 -1
  146. package/lib/operations/options_operation.js.map +1 -1
  147. package/lib/operations/profiling_level.js.map +1 -1
  148. package/lib/operations/search_indexes/drop.js.map +1 -1
  149. package/lib/operations/set_profiling_level.js.map +1 -1
  150. package/lib/operations/stats.js.map +1 -1
  151. package/lib/operations/update.js +2 -2
  152. package/lib/operations/update.js.map +1 -1
  153. package/lib/operations/validate_collection.js.map +1 -1
  154. package/lib/read_concern.js.map +1 -1
  155. package/lib/read_preference.js +1 -1
  156. package/lib/read_preference.js.map +1 -1
  157. package/lib/resource_management.js +58 -0
  158. package/lib/resource_management.js.map +1 -0
  159. package/lib/sdam/common.js +3 -3
  160. package/lib/sdam/common.js.map +1 -1
  161. package/lib/sdam/monitor.js +1 -5
  162. package/lib/sdam/monitor.js.map +1 -1
  163. package/lib/sdam/server.js +2 -2
  164. package/lib/sdam/server.js.map +1 -1
  165. package/lib/sdam/server_description.js +3 -3
  166. package/lib/sdam/server_description.js.map +1 -1
  167. package/lib/sdam/server_selection.js +5 -5
  168. package/lib/sdam/server_selection.js.map +1 -1
  169. package/lib/sdam/srv_polling.js +2 -3
  170. package/lib/sdam/srv_polling.js.map +1 -1
  171. package/lib/sdam/topology.js +1 -1
  172. package/lib/sdam/topology.js.map +1 -1
  173. package/lib/sdam/topology_description.js.map +1 -1
  174. package/lib/sessions.js +221 -218
  175. package/lib/sessions.js.map +1 -1
  176. package/lib/sort.js +2 -3
  177. package/lib/sort.js.map +1 -1
  178. package/lib/timeout.js +0 -1
  179. package/lib/timeout.js.map +1 -1
  180. package/lib/transactions.js +2 -2
  181. package/lib/transactions.js.map +1 -1
  182. package/lib/utils.js +49 -51
  183. package/lib/utils.js.map +1 -1
  184. package/lib/write_concern.js +2 -2
  185. package/lib/write_concern.js.map +1 -1
  186. package/mongodb.d.ts +150 -142
  187. package/package.json +26 -27
  188. package/src/beta.ts +22 -0
  189. package/src/bson.ts +1 -2
  190. package/src/bulk/common.ts +18 -18
  191. package/src/change_stream.ts +33 -15
  192. package/src/client-side-encryption/auto_encrypter.ts +18 -82
  193. package/src/client-side-encryption/client_encryption.ts +51 -54
  194. package/src/client-side-encryption/mongocryptd_manager.ts +10 -6
  195. package/src/client-side-encryption/state_machine.ts +28 -6
  196. package/src/cmap/auth/gssapi.ts +1 -1
  197. package/src/cmap/auth/mongodb_aws.ts +2 -2
  198. package/src/cmap/auth/mongodb_oidc/callback_workflow.ts +2 -2
  199. package/src/cmap/auth/mongodb_oidc/machine_workflow.ts +2 -2
  200. package/src/cmap/commands.ts +70 -5
  201. package/src/cmap/connect.ts +4 -1
  202. package/src/cmap/connection.ts +2 -2
  203. package/src/cmap/connection_pool.ts +17 -9
  204. package/src/cmap/connection_pool_events.ts +34 -2
  205. package/src/cmap/handshake/client_metadata.ts +1 -1
  206. package/src/cmap/wire_protocol/constants.ts +2 -2
  207. package/src/cmap/wire_protocol/shared.ts +1 -2
  208. package/src/collection.ts +16 -15
  209. package/src/connection_string.ts +10 -3
  210. package/src/constants.ts +1 -0
  211. package/src/cursor/abstract_cursor.ts +38 -13
  212. package/src/cursor/aggregation_cursor.ts +6 -4
  213. package/src/deps.ts +8 -1
  214. package/src/error.ts +33 -14
  215. package/src/gridfs/download.ts +28 -4
  216. package/src/gridfs/upload.ts +1 -6
  217. package/src/index.ts +5 -1
  218. package/src/mongo_client.ts +29 -5
  219. package/src/mongo_logger.ts +5 -3
  220. package/src/mongo_types.ts +69 -68
  221. package/src/operations/aggregate.ts +2 -1
  222. package/src/operations/bulk_write.ts +2 -2
  223. package/src/operations/client_bulk_write/command_builder.ts +283 -0
  224. package/src/operations/client_bulk_write/common.ts +146 -0
  225. package/src/operations/command.ts +1 -1
  226. package/src/operations/execute_operation.ts +137 -131
  227. package/src/operations/find_and_modify.ts +2 -7
  228. package/src/operations/insert.ts +3 -4
  229. package/src/operations/operation.ts +7 -10
  230. package/src/operations/search_indexes/drop.ts +4 -1
  231. package/src/resource_management.ts +74 -0
  232. package/src/sdam/monitor.ts +3 -5
  233. package/src/sdam/server.ts +1 -1
  234. package/src/sdam/server_description.ts +5 -6
  235. package/src/sdam/srv_polling.ts +1 -2
  236. package/src/sessions.ts +291 -277
  237. package/src/sort.ts +1 -1
  238. package/src/timeout.ts +0 -1
  239. package/src/transactions.ts +1 -2
  240. package/src/utils.ts +9 -4
  241. package/src/write_concern.ts +2 -2
  242. package/tsconfig.json +2 -1
package/mongodb.d.ts CHANGED
@@ -1,15 +1,37 @@
1
- /// <reference types="node" />
2
-
3
- import type { DeserializeOptions,ObjectIdLike , SerializeOptions } from 'bson';
4
- import { Binary , BSON , BSONRegExp , BSONSymbol , BSONType , Code , DBRef , Decimal128 , deserialize , Document , Double , Int32 , Long , MaxKey , MinKey , ObjectId , serialize , Timestamp , UUID } from 'bson';
1
+ import type { ObjectIdLike } from 'bson';
2
+ import type { DeserializeOptions } from 'bson';
3
+ import type { SerializeOptions } from 'bson';
4
+ import { Binary } from 'bson';
5
+ import { BSON } from 'bson';
6
+ import { BSONRegExp } from 'bson';
7
+ import { BSONSymbol } from 'bson';
8
+ import { BSONType } from 'bson';
9
+ import { Code } from 'bson';
10
+ import { DBRef } from 'bson';
11
+ import { Decimal128 } from 'bson';
12
+ import { deserialize } from 'bson';
13
+ import { Document } from 'bson';
14
+ import { Double } from 'bson';
15
+ import { Int32 } from 'bson';
16
+ import { Long } from 'bson';
17
+ import { MaxKey } from 'bson';
18
+ import { MinKey } from 'bson';
19
+ import { ObjectId } from 'bson';
20
+ import { serialize } from 'bson';
21
+ import { Timestamp } from 'bson';
22
+ import { UUID } from 'bson';
5
23
  import type { SrvRecord } from 'dns';
6
24
  import { EventEmitter } from 'events';
7
- import type { Socket , TcpNetConnectOpts } from 'net';
8
- import { Readable , Writable } from 'stream';
9
- import type { ConnectionOptions as ConnectionOptions_2 , TLSSocket , TLSSocketOptions } from 'tls';
25
+ import type { Socket } from 'net';
26
+ import type { TcpNetConnectOpts } from 'net';
27
+ import { Readable } from 'stream';
28
+ import { Writable } from 'stream';
29
+ import type { ConnectionOptions as ConnectionOptions_2 } from 'tls';
30
+ import type { TLSSocket } from 'tls';
31
+ import type { TLSSocketOptions } from 'tls';
10
32
 
11
33
  /** @public */
12
- export declare abstract class AbstractCursor<TSchema = any, CursorEvents extends AbstractCursorEvents = AbstractCursorEvents> extends TypedEventEmitter<CursorEvents> {
34
+ export declare abstract class AbstractCursor<TSchema = any, CursorEvents extends AbstractCursorEvents = AbstractCursorEvents> extends TypedEventEmitter<CursorEvents> implements AsyncDisposable_2 {
13
35
  /* Excluded from this release type: cursorId */
14
36
  /* Excluded from this release type: cursorSession */
15
37
  /* Excluded from this release type: selectedServer */
@@ -51,10 +73,12 @@ export declare abstract class AbstractCursor<TSchema = any, CursorEvents extends
51
73
  */
52
74
  get killed(): boolean;
53
75
  get loadBalanced(): boolean;
76
+ /* Excluded from this release type: [Symbol.asyncDispose] */
77
+ /* Excluded from this release type: asyncDispose */
54
78
  /** Returns current buffered documents length */
55
79
  bufferedCount(): number;
56
80
  /** Returns current buffered documents */
57
- readBufferedDocuments(number?: number): TSchema[];
81
+ readBufferedDocuments(number?: number): NonNullable<TSchema>[];
58
82
  [Symbol.asyncIterator](): AsyncGenerator<TSchema, void, void>;
59
83
  stream(options?: CursorStreamOptions): Readable & AsyncIterable<TSchema>;
60
84
  hasNext(): Promise<boolean>;
@@ -73,6 +97,9 @@ export declare abstract class AbstractCursor<TSchema = any, CursorEvents extends
73
97
  * @deprecated - Will be removed in a future release. Use for await...of instead.
74
98
  */
75
99
  forEach(iterator: (doc: TSchema) => boolean | void): Promise<void>;
100
+ /**
101
+ * Frees any client-side resources used by the cursor.
102
+ */
76
103
  close(): Promise<void>;
77
104
  /**
78
105
  * Returns an array of documents. The caller is responsible for making sure that there
@@ -501,6 +528,15 @@ export declare type ArrayOperator<Type> = {
501
528
  $sort?: Sort;
502
529
  };
503
530
 
531
+ /**
532
+ * @public
533
+ */
534
+ declare interface AsyncDisposable_2 {
535
+ /* Excluded from this release type: [Symbol.asyncDispose] */
536
+ /* Excluded from this release type: asyncDispose */
537
+ }
538
+ export { AsyncDisposable_2 as AsyncDisposable }
539
+
504
540
  /** @public */
505
541
  export declare interface Auth {
506
542
  /** The username for auth */
@@ -589,77 +625,7 @@ export declare interface AutoEncryptionOptions {
589
625
  /** The namespace where keys are stored in the key vault */
590
626
  keyVaultNamespace?: string;
591
627
  /** Configuration options that are used by specific KMS providers during key generation, encryption, and decryption. */
592
- kmsProviders?: {
593
- /** Configuration options for using 'aws' as your KMS provider */
594
- aws?: {
595
- /** The access key used for the AWS KMS provider */
596
- accessKeyId: string;
597
- /** The secret access key used for the AWS KMS provider */
598
- secretAccessKey: string;
599
- /**
600
- * An optional AWS session token that will be used as the
601
- * X-Amz-Security-Token header for AWS requests.
602
- */
603
- sessionToken?: string;
604
- } | Record<string, never>;
605
- /** Configuration options for using 'local' as your KMS provider */
606
- local?: {
607
- /**
608
- * The master key used to encrypt/decrypt data keys.
609
- * A 96-byte long Buffer or base64 encoded string.
610
- */
611
- key: Buffer | string;
612
- };
613
- /** Configuration options for using 'azure' as your KMS provider */
614
- azure?: {
615
- /** The tenant ID identifies the organization for the account */
616
- tenantId: string;
617
- /** The client ID to authenticate a registered application */
618
- clientId: string;
619
- /** The client secret to authenticate a registered application */
620
- clientSecret: string;
621
- /**
622
- * If present, a host with optional port. E.g. "example.com" or "example.com:443".
623
- * This is optional, and only needed if customer is using a non-commercial Azure instance
624
- * (e.g. a government or China account, which use different URLs).
625
- * Defaults to "login.microsoftonline.com"
626
- */
627
- identityPlatformEndpoint?: string | undefined;
628
- } | {
629
- /**
630
- * If present, an access token to authenticate with Azure.
631
- */
632
- accessToken: string;
633
- } | Record<string, never>;
634
- /** Configuration options for using 'gcp' as your KMS provider */
635
- gcp?: {
636
- /** The service account email to authenticate */
637
- email: string;
638
- /** A PKCS#8 encrypted key. This can either be a base64 string or a binary representation */
639
- privateKey: string | Buffer;
640
- /**
641
- * If present, a host with optional port. E.g. "example.com" or "example.com:443".
642
- * Defaults to "oauth2.googleapis.com"
643
- */
644
- endpoint?: string | undefined;
645
- } | {
646
- /**
647
- * If present, an access token to authenticate with GCP.
648
- */
649
- accessToken: string;
650
- } | Record<string, never>;
651
- /**
652
- * Configuration options for using 'kmip' as your KMS provider
653
- */
654
- kmip?: {
655
- /**
656
- * The output endpoint string.
657
- * The endpoint consists of a hostname and port separated by a colon.
658
- * E.g. "example.com:123". A port is always present.
659
- */
660
- endpoint?: string;
661
- };
662
- };
628
+ kmsProviders?: KMSProviders;
663
629
  /**
664
630
  * A map of namespaces to a local JSON schema for encryption
665
631
  *
@@ -951,6 +917,7 @@ export declare abstract class BulkOperationBase {
951
917
  find(selector: Document): FindOperators;
952
918
  /** Specifies a raw operation to perform in the bulk write. */
953
919
  raw(op: AnyBulkWriteOperation): this;
920
+ get length(): number;
954
921
  get bsonOptions(): BSONSerializeOptions;
955
922
  get writeConcern(): WriteConcern | undefined;
956
923
  get batches(): Batch[];
@@ -1058,7 +1025,9 @@ export declare class CancellationToken extends TypedEventEmitter<{
1058
1025
  * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}.
1059
1026
  * @public
1060
1027
  */
1061
- export declare class ChangeStream<TSchema extends Document = Document, TChange extends Document = ChangeStreamDocument<TSchema>> extends TypedEventEmitter<ChangeStreamEvents<TSchema, TChange>> {
1028
+ export declare class ChangeStream<TSchema extends Document = Document, TChange extends Document = ChangeStreamDocument<TSchema>> extends TypedEventEmitter<ChangeStreamEvents<TSchema, TChange>> implements AsyncDisposable_2 {
1029
+ /* Excluded from this release type: [Symbol.asyncDispose] */
1030
+ /* Excluded from this release type: asyncDispose */
1062
1031
  pipeline: Document[];
1063
1032
  /**
1064
1033
  * @remarks WriteConcern can still be present on the options because
@@ -1117,7 +1086,9 @@ export declare class ChangeStream<TSchema extends Document = Document, TChange e
1117
1086
  [Symbol.asyncIterator](): AsyncGenerator<TChange, void, void>;
1118
1087
  /** Is the cursor closed */
1119
1088
  get closed(): boolean;
1120
- /** Close the Change Stream */
1089
+ /**
1090
+ * Frees the internal resources used by the change stream.
1091
+ */
1121
1092
  close(): Promise<void>;
1122
1093
  /**
1123
1094
  * Return a modified Readable stream including a possible transform method.
@@ -1773,9 +1744,7 @@ export declare class ClientEncryption {
1773
1744
  /**
1774
1745
  * Encrypts a Match Expression or Aggregate Expression to query a range index.
1775
1746
  *
1776
- * Only supported when queryType is "rangePreview" and algorithm is "RangePreview".
1777
- *
1778
- * @experimental The Range algorithm is experimental only. It is not intended for production use. It is subject to breaking changes.
1747
+ * Only supported when queryType is "range" and algorithm is "Range".
1779
1748
  *
1780
1749
  * @param expression - a BSON document of one of the following forms:
1781
1750
  * 1. A Match Expression of this form:
@@ -1847,7 +1816,7 @@ export declare interface ClientEncryptionEncryptOptions {
1847
1816
  /**
1848
1817
  * The algorithm to use for encryption.
1849
1818
  */
1850
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'RangePreview';
1819
+ algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'Range';
1851
1820
  /**
1852
1821
  * The id of the Binary dataKey to use for encryption
1853
1822
  */
@@ -1859,41 +1828,10 @@ export declare interface ClientEncryptionEncryptOptions {
1859
1828
  /** The contention factor. */
1860
1829
  contentionFactor?: bigint | number;
1861
1830
  /**
1862
- * The query type supported. Only the queryType `equality` is stable.
1863
- *
1864
- * @experimental Public Technical Preview: The queryType `rangePreview` is experimental.
1831
+ * The query type.
1865
1832
  */
1866
- queryType?: 'equality' | 'rangePreview';
1867
- /** @experimental Public Technical Preview: The index options for a Queryable Encryption field supporting "rangePreview" queries.*/
1868
- rangeOptions?: RangeOptions;
1869
- }
1870
-
1871
- /**
1872
- * @public
1873
- * Options to provide when encrypting data.
1874
- */
1875
- export declare interface ClientEncryptionEncryptOptions {
1876
- /**
1877
- * The algorithm to use for encryption.
1878
- */
1879
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'RangePreview';
1880
- /**
1881
- * The id of the Binary dataKey to use for encryption
1882
- */
1883
- keyId?: Binary;
1884
- /**
1885
- * A unique string name corresponding to an already existing dataKey.
1886
- */
1887
- keyAltName?: string;
1888
- /** The contention factor. */
1889
- contentionFactor?: bigint | number;
1890
- /**
1891
- * The query type supported. Only the queryType `equality` is stable.
1892
- *
1893
- * @experimental Public Technical Preview: The queryType `rangePreview` is experimental.
1894
- */
1895
- queryType?: 'equality' | 'rangePreview';
1896
- /** @experimental Public Technical Preview: The index options for a Queryable Encryption field supporting "rangePreview" queries.*/
1833
+ queryType?: 'equality' | 'range';
1834
+ /** The index options for a Queryable Encryption field supporting "range" queries.*/
1897
1835
  rangeOptions?: RangeOptions;
1898
1836
  }
1899
1837
 
@@ -1942,6 +1880,13 @@ export declare interface ClientEncryptionRewrapManyDataKeyResult {
1942
1880
  bulkWriteResult?: BulkWriteResult;
1943
1881
  }
1944
1882
 
1883
+ /**
1884
+ * @public
1885
+ *
1886
+ * Socket options to use for KMS requests.
1887
+ */
1888
+ export declare type ClientEncryptionSocketOptions = Pick<MongoClientOptions, 'autoSelectFamily' | 'autoSelectFamilyAttemptTimeout'>;
1889
+
1945
1890
  /**
1946
1891
  * @public
1947
1892
  *
@@ -2001,7 +1946,7 @@ export declare interface ClientMetadataOptions {
2001
1946
  * NOTE: not meant to be instantiated directly.
2002
1947
  * @public
2003
1948
  */
2004
- export declare class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
1949
+ export declare class ClientSession extends TypedEventEmitter<ClientSessionEvents> implements AsyncDisposable_2 {
2005
1950
  /* Excluded from this release type: client */
2006
1951
  /* Excluded from this release type: sessionPool */
2007
1952
  hasEnded: boolean;
@@ -2033,11 +1978,16 @@ export declare class ClientSession extends TypedEventEmitter<ClientSessionEvents
2033
1978
  /* Excluded from this release type: unpin */
2034
1979
  get isPinned(): boolean;
2035
1980
  /**
2036
- * Ends this session on the server
1981
+ * Frees any client-side resources held by the current session. If a session is in a transaction,
1982
+ * the transaction is aborted.
1983
+ *
1984
+ * Does not end the session on the server.
2037
1985
  *
2038
1986
  * @param options - Optional settings. Currently reserved for future use
2039
1987
  */
2040
1988
  endSession(options?: EndSessionOptions): Promise<void>;
1989
+ /* Excluded from this release type: [Symbol.asyncDispose] */
1990
+ /* Excluded from this release type: asyncDispose */
2041
1991
  /**
2042
1992
  * Advances the operationTime for a ClientSession.
2043
1993
  *
@@ -2272,7 +2222,7 @@ export declare class Collection<TSchema extends Document = Document> {
2272
2222
  * @param docs - The documents to insert
2273
2223
  * @param options - Optional settings for the command
2274
2224
  */
2275
- insertMany(docs: OptionalUnlessRequiredId<TSchema>[], options?: BulkWriteOptions): Promise<InsertManyResult<TSchema>>;
2225
+ insertMany(docs: ReadonlyArray<OptionalUnlessRequiredId<TSchema>>, options?: BulkWriteOptions): Promise<InsertManyResult<TSchema>>;
2276
2226
  /**
2277
2227
  * Perform a bulkWrite operation without a fluent API
2278
2228
  *
@@ -2292,7 +2242,7 @@ export declare class Collection<TSchema extends Document = Document> {
2292
2242
  * @param options - Optional settings for the command
2293
2243
  * @throws MongoDriverError if operations is not an array
2294
2244
  */
2295
- bulkWrite(operations: AnyBulkWriteOperation<TSchema>[], options?: BulkWriteOptions): Promise<BulkWriteResult>;
2245
+ bulkWrite(operations: ReadonlyArray<AnyBulkWriteOperation<TSchema>>, options?: BulkWriteOptions): Promise<BulkWriteResult>;
2296
2246
  /**
2297
2247
  * Update a single document in a collection
2298
2248
  *
@@ -2879,6 +2829,8 @@ export declare type CompressorName = keyof typeof Compressor;
2879
2829
  /** @public */
2880
2830
  export declare type Condition<T> = AlternativeType<T> | FilterOperators<AlternativeType<T>>;
2881
2831
 
2832
+ /* Excluded from this release type: configureExplicitResourceManagement */
2833
+
2882
2834
  /* Excluded from this release type: Connection */
2883
2835
 
2884
2836
  /* Excluded from this release type: CONNECTION_CHECK_OUT_FAILED */
@@ -2924,6 +2876,14 @@ export declare class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringE
2924
2876
  /** The id of the connection */
2925
2877
  connectionId: number | '<monitor>';
2926
2878
  /* Excluded from this release type: name */
2879
+ /**
2880
+ * The time it took to check out the connection.
2881
+ * More specifically, the time elapsed between
2882
+ * emitting a `ConnectionCheckOutStartedEvent`
2883
+ * and emitting this event as part of the same checking out.
2884
+ *
2885
+ */
2886
+ durationMS: number;
2927
2887
  /* Excluded from this release type: __constructor */
2928
2888
  }
2929
2889
 
@@ -2937,6 +2897,13 @@ export declare class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitor
2937
2897
  reason: string;
2938
2898
  /* Excluded from this release type: error */
2939
2899
  /* Excluded from this release type: name */
2900
+ /**
2901
+ * The time it took to check out the connection.
2902
+ * More specifically, the time elapsed between
2903
+ * emitting a `ConnectionCheckOutStartedEvent`
2904
+ * and emitting this event as part of the same check out.
2905
+ */
2906
+ durationMS: number;
2940
2907
  /* Excluded from this release type: __constructor */
2941
2908
  }
2942
2909
 
@@ -3112,6 +3079,18 @@ export declare class ConnectionPoolReadyEvent extends ConnectionPoolMonitoringEv
3112
3079
  export declare class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent {
3113
3080
  /** The id of the connection */
3114
3081
  connectionId: number | '<monitor>';
3082
+ /**
3083
+ * The time it took to establish the connection.
3084
+ * In accordance with the definition of establishment of a connection
3085
+ * specified by `ConnectionPoolOptions.maxConnecting`,
3086
+ * it is the time elapsed between emitting a `ConnectionCreatedEvent`
3087
+ * and emitting this event as part of the same checking out.
3088
+ *
3089
+ * Naturally, when establishing a connection is part of checking out,
3090
+ * this duration is not greater than
3091
+ * `ConnectionCheckedOutEvent.duration`.
3092
+ */
3093
+ durationMS: number;
3115
3094
  /* Excluded from this release type: name */
3116
3095
  /* Excluded from this release type: __constructor */
3117
3096
  }
@@ -4663,10 +4642,10 @@ export declare interface KMSProviders {
4663
4642
  /* Excluded from this release type: kWaitQueue_2 */
4664
4643
 
4665
4644
  /** @public */
4666
- export declare const LEGAL_TCP_SOCKET_OPTIONS: readonly ["family", "hints", "localAddress", "localPort", "lookup"];
4645
+ export declare const LEGAL_TCP_SOCKET_OPTIONS: readonly ["autoSelectFamily", "autoSelectFamilyAttemptTimeout", "family", "hints", "localAddress", "localPort", "lookup"];
4667
4646
 
4668
4647
  /** @public */
4669
- export declare const LEGAL_TLS_SOCKET_OPTIONS: readonly ["ALPNProtocols", "ca", "cert", "checkServerIdentity", "ciphers", "crl", "ecdhCurve", "key", "minDHSize", "passphrase", "pfx", "rejectUnauthorized", "secureContext", "secureProtocol", "servername", "session"];
4648
+ export declare const LEGAL_TLS_SOCKET_OPTIONS: readonly ["allowPartialTrustChain", "ALPNProtocols", "ca", "cert", "checkServerIdentity", "ciphers", "crl", "ecdhCurve", "key", "minDHSize", "passphrase", "pfx", "rejectUnauthorized", "secureContext", "secureProtocol", "servername", "session"];
4670
4649
 
4671
4650
  /* Excluded from this release type: List */
4672
4651
 
@@ -4967,13 +4946,15 @@ export declare class MongoChangeStreamError extends MongoRuntimeError {
4967
4946
  * await client.insertOne({ name: 'spot', kind: 'dog' });
4968
4947
  * ```
4969
4948
  */
4970
- export declare class MongoClient extends TypedEventEmitter<MongoClientEvents> {
4949
+ export declare class MongoClient extends TypedEventEmitter<MongoClientEvents> implements AsyncDisposable_2 {
4971
4950
  /* Excluded from this release type: s */
4972
4951
  /* Excluded from this release type: topology */
4973
4952
  /* Excluded from this release type: mongoLogger */
4974
4953
  /* Excluded from this release type: connectionLock */
4975
4954
  /* Excluded from this release type: [kOptions] */
4976
4955
  constructor(url: string, options?: MongoClientOptions);
4956
+ /* Excluded from this release type: [Symbol.asyncDispose] */
4957
+ /* Excluded from this release type: asyncDispose */
4977
4958
  /* Excluded from this release type: checkForNonGenuineHosts */
4978
4959
  /** @see MongoOptions */
4979
4960
  get options(): Readonly<MongoOptions>;
@@ -4993,7 +4974,15 @@ export declare class MongoClient extends TypedEventEmitter<MongoClientEvents> {
4993
4974
  connect(): Promise<this>;
4994
4975
  /* Excluded from this release type: _connect */
4995
4976
  /**
4996
- * Close the client and its underlying connections
4977
+ * Cleans up client-side resources used by the MongoCLient and . This includes:
4978
+ *
4979
+ * - Closes all open, unused connections (see note).
4980
+ * - Ends all in-use sessions with {@link ClientSession#endSession|ClientSession.endSession()}.
4981
+ * - Ends all unused sessions server-side.
4982
+ * - Cleans up any resources being used for auto encryption if auto encryption is enabled.
4983
+ *
4984
+ * @remarks Any in-progress operations are not killed and any connections used by in progress operations
4985
+ * will be cleaned up lazily as operations finish.
4997
4986
  *
4998
4987
  * @param force - Force close, emitting no events
4999
4988
  */
@@ -6244,15 +6233,7 @@ export declare class MongoWriteConcernError extends MongoServerError {
6244
6233
  *
6245
6234
  * @public
6246
6235
  **/
6247
- constructor(result: {
6248
- writeConcernError: {
6249
- code: number;
6250
- errmsg: string;
6251
- codeName?: string;
6252
- errInfo?: Document;
6253
- };
6254
- errorLabels?: string[];
6255
- });
6236
+ constructor(result: WriteConcernErrorResult);
6256
6237
  get name(): string;
6257
6238
  }
6258
6239
 
@@ -6504,14 +6485,19 @@ export declare type PushOperator<TSchema> = ({
6504
6485
 
6505
6486
  /**
6506
6487
  * @public
6507
- * RangeOptions specifies index options for a Queryable Encryption field supporting "rangePreview" queries.
6508
- * min, max, sparsity, and range must match the values set in the encryptedFields of the destination collection.
6488
+ * RangeOptions specifies index options for a Queryable Encryption field supporting "range" queries.
6489
+ * min, max, sparsity, trimFactor and range must match the values set in the encryptedFields of the destination collection.
6509
6490
  * For double and decimal128, min/max/precision must all be set, or all be unset.
6510
6491
  */
6511
6492
  export declare interface RangeOptions {
6493
+ /** min is the minimum value for the encrypted index. Required if precision is set. */
6512
6494
  min?: any;
6495
+ /** max is the minimum value for the encrypted index. Required if precision is set. */
6513
6496
  max?: any;
6514
- sparsity: Long;
6497
+ /** sparsity may be used to tune performance. must be non-negative. When omitted, a default value is used. */
6498
+ sparsity?: Long | bigint;
6499
+ /** trimFactor may be used to tune performance. must be non-negative. When omitted, a default value is used. */
6500
+ trimFactor?: Int32 | number;
6515
6501
  precision?: number;
6516
6502
  }
6517
6503
 
@@ -7254,10 +7240,15 @@ export declare type StrictUpdateFilter<TSchema> = {
7254
7240
  export declare type SupportedNodeConnectionOptions = SupportedTLSConnectionOptions & SupportedTLSSocketOptions & SupportedSocketOptions;
7255
7241
 
7256
7242
  /** @public */
7257
- export declare type SupportedSocketOptions = Pick<TcpNetConnectOpts, (typeof LEGAL_TCP_SOCKET_OPTIONS)[number]>;
7243
+ export declare type SupportedSocketOptions = Pick<TcpNetConnectOpts & {
7244
+ autoSelectFamily?: boolean;
7245
+ autoSelectFamilyAttemptTimeout?: number;
7246
+ }, (typeof LEGAL_TCP_SOCKET_OPTIONS)[number]>;
7258
7247
 
7259
7248
  /** @public */
7260
- export declare type SupportedTLSConnectionOptions = Pick<ConnectionOptions_2, Extract<keyof ConnectionOptions_2, (typeof LEGAL_TLS_SOCKET_OPTIONS)[number]>>;
7249
+ export declare type SupportedTLSConnectionOptions = Pick<ConnectionOptions_2 & {
7250
+ allowPartialTrustChain?: boolean;
7251
+ }, (typeof LEGAL_TLS_SOCKET_OPTIONS)[number]>;
7261
7252
 
7262
7253
  /** @public */
7263
7254
  export declare type SupportedTLSSocketOptions = Pick<TLSSocketOptions, Extract<keyof TLSSocketOptions, (typeof LEGAL_TLS_SOCKET_OPTIONS)[number]>>;
@@ -7787,6 +7778,23 @@ export declare interface WriteConcernErrorData {
7787
7778
  errInfo?: Document;
7788
7779
  }
7789
7780
 
7781
+ /**
7782
+ * The type of the result property of MongoWriteConcernError
7783
+ * @public
7784
+ */
7785
+ export declare interface WriteConcernErrorResult {
7786
+ writeConcernError: {
7787
+ code: number;
7788
+ errmsg: string;
7789
+ codeName?: string;
7790
+ errInfo?: Document;
7791
+ };
7792
+ ok: number;
7793
+ code?: number;
7794
+ errorLabels?: string[];
7795
+ [x: string | number]: unknown;
7796
+ }
7797
+
7790
7798
  /** @public */
7791
7799
  export declare interface WriteConcernOptions {
7792
7800
  /** Write Concern as an object */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mongodb",
3
- "version": "6.8.2",
3
+ "version": "6.9.0",
4
4
  "description": "The official MongoDB driver for Node.js",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -62,55 +62,53 @@
62
62
  }
63
63
  },
64
64
  "devDependencies": {
65
- "@aws-sdk/credential-providers": "^3.515.0",
65
+ "@aws-sdk/credential-providers": "^3.632.0",
66
66
  "@iarna/toml": "^2.2.5",
67
67
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
68
- "@microsoft/api-extractor": "^7.43.1",
69
- "@microsoft/tsdoc-config": "^0.16.2",
68
+ "@microsoft/api-extractor": "^7.47.5",
69
+ "@microsoft/tsdoc-config": "^0.17.0",
70
70
  "@mongodb-js/zstd": "^1.2.0",
71
- "@types/chai": "^4.3.14",
71
+ "@types/chai": "^4.3.17",
72
72
  "@types/chai-subset": "^1.3.5",
73
73
  "@types/express": "^4.17.21",
74
74
  "@types/kerberos": "^1.1.5",
75
- "@types/mocha": "^10.0.6",
76
- "@types/node": "^20.12.7",
75
+ "@types/mocha": "^10.0.7",
76
+ "@types/node": "^22.4.1",
77
77
  "@types/saslprep": "^1.0.3",
78
78
  "@types/semver": "^7.5.8",
79
79
  "@types/sinon": "^17.0.3",
80
80
  "@types/sinon-chai": "^3.2.12",
81
- "@types/whatwg-url": "^11.0.4",
82
- "@typescript-eslint/eslint-plugin": "^5.62.0",
83
- "@typescript-eslint/parser": "^5.62.0",
81
+ "@types/whatwg-url": "^11.0.5",
82
+ "@typescript-eslint/eslint-plugin": "^8.2.0",
83
+ "@typescript-eslint/parser": "^8.2.0",
84
84
  "chai": "^4.4.1",
85
85
  "chai-subset": "^1.6.0",
86
86
  "chalk": "^4.1.2",
87
- "eslint": "^8.56.0",
88
- "eslint-config-prettier": "^8.10.0",
89
- "eslint-plugin-github": "^4.10.2",
90
- "eslint-plugin-import": "^2.29.1",
87
+ "eslint": "^9.0.0",
88
+ "eslint-config-prettier": "^9.1.0",
91
89
  "eslint-plugin-mocha": "^10.4.1",
92
- "eslint-plugin-prettier": "^4.2.1",
93
- "eslint-plugin-simple-import-sort": "^10.0.0",
94
- "eslint-plugin-tsdoc": "^0.2.17",
95
- "eslint-plugin-unused-imports": "^2.0.0",
90
+ "eslint-plugin-prettier": "^5.2.1",
91
+ "eslint-plugin-simple-import-sort": "^12.1.1",
92
+ "eslint-plugin-tsdoc": "^0.3.0",
93
+ "eslint-plugin-unused-imports": "^4.0.0",
96
94
  "express": "^4.19.2",
97
95
  "gcp-metadata": "^5.3.0",
98
96
  "js-yaml": "^4.1.0",
99
97
  "mocha": "^10.4.0",
100
98
  "mocha-sinon": "^2.1.2",
101
- "mongodb-client-encryption": "^6.0.1",
102
- "mongodb-legacy": "^6.0.1",
99
+ "mongodb-client-encryption": "^6.1.0",
100
+ "mongodb-legacy": "^6.1.0",
103
101
  "nyc": "^15.1.0",
104
- "prettier": "^2.8.8",
105
- "semver": "^7.6.0",
106
- "sinon": "^17.0.1",
102
+ "prettier": "^3.3.3",
103
+ "semver": "^7.6.3",
104
+ "sinon": "^18.0.0",
107
105
  "sinon-chai": "^3.7.0",
108
106
  "snappy": "^7.2.2",
109
107
  "socks": "^2.8.1",
110
108
  "source-map-support": "^0.5.21",
111
109
  "ts-node": "^10.9.2",
112
- "tsd": "^0.31.0",
113
- "typescript": "5.0",
110
+ "tsd": "^0.31.1",
111
+ "typescript": "5.5",
114
112
  "typescript-cached-transpile": "^0.0.6",
115
113
  "v8-heapsnapshot": "^1.3.1",
116
114
  "yargs": "^17.7.2"
@@ -126,7 +124,7 @@
126
124
  "scripts": {
127
125
  "build:evergreen": "node .evergreen/generate_evergreen_tasks.js",
128
126
  "build:ts": "node ./node_modules/typescript/bin/tsc",
129
- "build:dts": "npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && eslint mongodb.d.ts --fix",
127
+ "build:dts": "npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts lib/beta.d.ts",
130
128
  "build:docs": "./etc/docs/build.ts",
131
129
  "build:typedoc": "typedoc",
132
130
  "build:nightly": "node ./.github/scripts/nightly.mjs",
@@ -136,7 +134,7 @@
136
134
  "check:lambda": "mocha --config test/mocha_lambda.json test/integration/node-specific/examples/handler.test.js",
137
135
  "check:lambda:aws": "mocha --config test/mocha_lambda.json test/integration/node-specific/examples/aws_handler.test.js",
138
136
  "check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd",
139
- "check:eslint": "eslint -v && eslint --max-warnings=0 --ext '.js,.ts' src test",
137
+ "check:eslint": "npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test",
140
138
  "check:tsd": "tsd --version && tsd",
141
139
  "check:dependencies": "mocha test/action/dependency.test.ts",
142
140
  "check:dts": "node ./node_modules/typescript/bin/tsc --noEmit mongodb.d.ts && tsd",
@@ -145,6 +143,7 @@
145
143
  "check:unit": "mocha test/unit",
146
144
  "check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit",
147
145
  "check:atlas": "mocha --config test/manual/mocharc.json test/manual/atlas_connectivity.test.ts",
146
+ "check:resource-management": "mocha --config test/manual/mocharc.json test/manual/resource_management.test.ts",
148
147
  "check:drivers-atlas-testing": "mocha --config test/mocha_mongodb.json test/atlas/drivers_atlas_testing.test.ts",
149
148
  "check:adl": "mocha --config test/mocha_mongodb.json test/manual/atlas-data-lake-testing",
150
149
  "check:aws": "nyc mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_aws.test.ts",
package/src/beta.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { type Document } from 'bson';
2
+
3
+ export * from './index';
4
+
5
+ /**
6
+ * @internal
7
+ *
8
+ * Since we don't bundle tslib helpers, we need to polyfill this method.
9
+ *
10
+ * This is used in the generated JS. Adapted from https://github.com/microsoft/TypeScript/blob/aafdfe5b3f76f5c41abeec412ce73c86da94c75f/src/compiler/factory/emitHelpers.ts#L1202.
11
+ */
12
+
13
+ function __exportStar(mod: Document) {
14
+ for (const key of Object.keys(mod)) {
15
+ Object.defineProperty(exports, key, {
16
+ enumerable: true,
17
+ get: function () {
18
+ return mod[key];
19
+ }
20
+ });
21
+ }
22
+ }
package/src/bson.ts CHANGED
@@ -1,5 +1,4 @@
1
- import type { DeserializeOptions, SerializeOptions } from 'bson';
2
- import { BSON } from 'bson';
1
+ import { BSON, type DeserializeOptions, type SerializeOptions } from 'bson';
3
2
 
4
3
  export {
5
4
  Binary,