mongodb 6.20.0-dev.20251008.sha.cfbada66 → 6.20.0-dev.20251010.sha.c5f74abe

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 (41) hide show
  1. package/lib/change_stream.js +5 -4
  2. package/lib/change_stream.js.map +1 -1
  3. package/lib/cmap/connect.js +1 -1
  4. package/lib/cmap/connect.js.map +1 -1
  5. package/lib/cmap/connection.js.map +1 -1
  6. package/lib/cmap/connection_pool.js +4 -4
  7. package/lib/cmap/connection_pool.js.map +1 -1
  8. package/lib/cmap/handshake/client_metadata.js +7 -5
  9. package/lib/cmap/handshake/client_metadata.js.map +1 -1
  10. package/lib/cursor/abstract_cursor.js +5 -4
  11. package/lib/cursor/abstract_cursor.js.map +1 -1
  12. package/lib/index.js +2 -4
  13. package/lib/index.js.map +1 -1
  14. package/lib/mongo_client.js +34 -27
  15. package/lib/mongo_client.js.map +1 -1
  16. package/lib/operations/aggregate.js +0 -3
  17. package/lib/operations/aggregate.js.map +1 -1
  18. package/lib/sdam/topology.js +1 -4
  19. package/lib/sdam/topology.js.map +1 -1
  20. package/lib/sessions.js +5 -4
  21. package/lib/sessions.js.map +1 -1
  22. package/mongodb.d.ts +58 -82
  23. package/package.json +2 -3
  24. package/src/change_stream.ts +1 -7
  25. package/src/cmap/connect.ts +1 -1
  26. package/src/cmap/connection.ts +1 -2
  27. package/src/cmap/connection_pool.ts +4 -4
  28. package/src/cmap/handshake/client_metadata.ts +18 -13
  29. package/src/cursor/abstract_cursor.ts +1 -7
  30. package/src/index.ts +0 -2
  31. package/src/mongo_client.ts +38 -62
  32. package/src/operations/aggregate.ts +0 -6
  33. package/src/sdam/topology.ts +2 -7
  34. package/src/sessions.ts +1 -7
  35. package/lib/beta.d.ts +0 -9094
  36. package/lib/beta.js +0 -21
  37. package/lib/beta.js.map +0 -1
  38. package/lib/resource_management.js +0 -58
  39. package/lib/resource_management.js.map +0 -1
  40. package/src/beta.ts +0 -22
  41. package/src/resource_management.ts +0 -74
package/lib/beta.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- __exportStar(require("./index"), exports);
4
- /**
5
- * @internal
6
- *
7
- * Since we don't bundle tslib helpers, we need to polyfill this method.
8
- *
9
- * This is used in the generated JS. Adapted from https://github.com/microsoft/TypeScript/blob/aafdfe5b3f76f5c41abeec412ce73c86da94c75f/src/compiler/factory/emitHelpers.ts#L1202.
10
- */
11
- function __exportStar(mod) {
12
- for (const key of Object.keys(mod)) {
13
- Object.defineProperty(exports, key, {
14
- enumerable: true,
15
- get: function () {
16
- return mod[key];
17
- }
18
- });
19
- }
20
- }
21
- //# sourceMappingURL=beta.js.map
package/lib/beta.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"beta.js","sourceRoot":"","sources":["../src/beta.ts"],"names":[],"mappings":";;AAEA,0CAAwB;AAExB;;;;;;GAMG;AAEH,SAAS,YAAY,CAAC,GAAa;IACjC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE;YAClC,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE;gBACH,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.configureResourceManagement = configureResourceManagement;
4
- exports.configureExplicitResourceManagement = configureExplicitResourceManagement;
5
- /** @internal */
6
- function configureResourceManagement(target) {
7
- Symbol.asyncDispose &&
8
- Object.defineProperty(target, Symbol.asyncDispose, {
9
- value: async function asyncDispose() {
10
- await this.asyncDispose();
11
- },
12
- enumerable: false,
13
- configurable: true,
14
- writable: true
15
- });
16
- }
17
- /**
18
- * @beta
19
- * @experimental
20
- *
21
- * Attaches `Symbol.asyncDispose` methods to the MongoClient, Cursors, sessions and change streams
22
- * if Symbol.asyncDispose is defined.
23
- *
24
- * It's usually not necessary to call this method - the driver attempts to attach these methods
25
- * itself when its loaded. However, sometimes the driver may be loaded before `Symbol.asyncDispose`
26
- * is defined, in which case it is necessary to call this method directly. This can happen if the
27
- * application is polyfilling `Symbol.asyncDispose`.
28
- *
29
- * Example:
30
- *
31
- * ```typescript
32
- * import { configureExplicitResourceManagement, MongoClient } from 'mongodb/lib/beta';
33
- *
34
- * Symbol.asyncDispose ??= Symbol('dispose');
35
- * load();
36
- *
37
- * await using client = new MongoClient(...);
38
- * ```
39
- */
40
- function configureExplicitResourceManagement() {
41
- // We must import lazily here, because there's a circular dependency between the resource management
42
- // file and each resources' file. We could move `configureResourceManagement` to a separate
43
- // function, but keeping all resource-management related code together seemed preferable and I chose
44
- // lazy requiring of resources instead.
45
- // eslint-disable-next-line @typescript-eslint/no-require-imports
46
- const { MongoClient } = require('./mongo_client');
47
- // eslint-disable-next-line @typescript-eslint/no-require-imports
48
- const { ClientSession } = require('./sessions');
49
- // eslint-disable-next-line @typescript-eslint/no-require-imports
50
- const { AbstractCursor } = require('./cursor/abstract_cursor');
51
- // eslint-disable-next-line @typescript-eslint/no-require-imports
52
- const { ChangeStream } = require('./change_stream');
53
- configureResourceManagement(MongoClient.prototype);
54
- configureResourceManagement(ClientSession.prototype);
55
- configureResourceManagement(AbstractCursor.prototype);
56
- configureResourceManagement(ChangeStream.prototype);
57
- }
58
- //# sourceMappingURL=resource_management.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource_management.js","sourceRoot":"","sources":["../src/resource_management.ts"],"names":[],"mappings":";;AAmBA,kEAUC;AAyBD,kFAmBC;AAvDD,gBAAgB;AAChB,SAAgB,2BAA2B,CAAC,MAAuB;IACjE,MAAM,CAAC,YAAY;QACjB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE;YACjD,KAAK,EAAE,KAAK,UAAU,YAAY;gBAChC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;YAC5B,CAAC;YACD,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,mCAAmC;IACjD,oGAAoG;IACpG,4FAA4F;IAC5F,oGAAoG;IACpG,uCAAuC;IAEvC,iEAAiE;IACjE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAClD,iEAAiE;IACjE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAChD,iEAAiE;IACjE,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAC/D,iEAAiE;IACjE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEpD,2BAA2B,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACnD,2BAA2B,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACrD,2BAA2B,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACtD,2BAA2B,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC"}
package/src/beta.ts DELETED
@@ -1,22 +0,0 @@
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
- }
@@ -1,74 +0,0 @@
1
- /**
2
- * @public
3
- */
4
- export interface AsyncDisposable {
5
- /**
6
- * @beta
7
- * @experimental
8
- */
9
- [Symbol.asyncDispose](): Promise<void>;
10
-
11
- /**
12
- * @internal
13
- *
14
- * A method that wraps disposal semantics for a given resource in the class.
15
- */
16
- asyncDispose(): Promise<void>;
17
- }
18
-
19
- /** @internal */
20
- export function configureResourceManagement(target: AsyncDisposable) {
21
- Symbol.asyncDispose &&
22
- Object.defineProperty(target, Symbol.asyncDispose, {
23
- value: async function asyncDispose(this: AsyncDisposable) {
24
- await this.asyncDispose();
25
- },
26
- enumerable: false,
27
- configurable: true,
28
- writable: true
29
- });
30
- }
31
-
32
- /**
33
- * @beta
34
- * @experimental
35
- *
36
- * Attaches `Symbol.asyncDispose` methods to the MongoClient, Cursors, sessions and change streams
37
- * if Symbol.asyncDispose is defined.
38
- *
39
- * It's usually not necessary to call this method - the driver attempts to attach these methods
40
- * itself when its loaded. However, sometimes the driver may be loaded before `Symbol.asyncDispose`
41
- * is defined, in which case it is necessary to call this method directly. This can happen if the
42
- * application is polyfilling `Symbol.asyncDispose`.
43
- *
44
- * Example:
45
- *
46
- * ```typescript
47
- * import { configureExplicitResourceManagement, MongoClient } from 'mongodb/lib/beta';
48
- *
49
- * Symbol.asyncDispose ??= Symbol('dispose');
50
- * load();
51
- *
52
- * await using client = new MongoClient(...);
53
- * ```
54
- */
55
- export function configureExplicitResourceManagement() {
56
- // We must import lazily here, because there's a circular dependency between the resource management
57
- // file and each resources' file. We could move `configureResourceManagement` to a separate
58
- // function, but keeping all resource-management related code together seemed preferable and I chose
59
- // lazy requiring of resources instead.
60
-
61
- // eslint-disable-next-line @typescript-eslint/no-require-imports
62
- const { MongoClient } = require('./mongo_client');
63
- // eslint-disable-next-line @typescript-eslint/no-require-imports
64
- const { ClientSession } = require('./sessions');
65
- // eslint-disable-next-line @typescript-eslint/no-require-imports
66
- const { AbstractCursor } = require('./cursor/abstract_cursor');
67
- // eslint-disable-next-line @typescript-eslint/no-require-imports
68
- const { ChangeStream } = require('./change_stream');
69
-
70
- configureResourceManagement(MongoClient.prototype);
71
- configureResourceManagement(ClientSession.prototype);
72
- configureResourceManagement(AbstractCursor.prototype);
73
- configureResourceManagement(ChangeStream.prototype);
74
- }