mongodb 6.18.0 → 6.19.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/lib/admin.js +2 -1
- package/lib/admin.js.map +1 -1
- package/lib/beta.d.ts +59 -7
- package/lib/bulk/common.js +19 -32
- package/lib/bulk/common.js.map +1 -1
- package/lib/client-side-encryption/client_encryption.js +4 -1
- package/lib/client-side-encryption/client_encryption.js.map +1 -1
- package/lib/client-side-encryption/state_machine.js +4 -0
- package/lib/client-side-encryption/state_machine.js.map +1 -1
- package/lib/cmap/connection.js.map +1 -1
- package/lib/collection.js +62 -19
- package/lib/collection.js.map +1 -1
- package/lib/cursor/aggregation_cursor.js +2 -1
- package/lib/cursor/aggregation_cursor.js.map +1 -1
- package/lib/cursor/explainable_cursor.js +36 -0
- package/lib/cursor/explainable_cursor.js.map +1 -0
- package/lib/cursor/find_cursor.js +2 -1
- package/lib/cursor/find_cursor.js.map +1 -1
- package/lib/cursor/run_command_cursor.js +2 -4
- package/lib/cursor/run_command_cursor.js.map +1 -1
- package/lib/db.js +12 -5
- package/lib/db.js.map +1 -1
- package/lib/explain.js +1 -33
- package/lib/explain.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/index.js.map +1 -1
- package/lib/mongo_client.js +25 -2
- package/lib/mongo_client.js.map +1 -1
- package/lib/operations/aggregate.js +9 -7
- package/lib/operations/aggregate.js.map +1 -1
- package/lib/operations/client_bulk_write/client_bulk_write.js +8 -41
- package/lib/operations/client_bulk_write/client_bulk_write.js.map +1 -1
- package/lib/operations/command.js +16 -19
- package/lib/operations/command.js.map +1 -1
- package/lib/operations/count.js +7 -3
- package/lib/operations/count.js.map +1 -1
- package/lib/operations/create_collection.js +56 -49
- package/lib/operations/create_collection.js.map +1 -1
- package/lib/operations/delete.js +15 -12
- package/lib/operations/delete.js.map +1 -1
- package/lib/operations/distinct.js +18 -26
- package/lib/operations/distinct.js.map +1 -1
- package/lib/operations/drop.js +57 -39
- package/lib/operations/drop.js.map +1 -1
- package/lib/operations/estimated_document_count.js +7 -3
- package/lib/operations/estimated_document_count.js.map +1 -1
- package/lib/operations/execute_operation.js +14 -3
- package/lib/operations/execute_operation.js.map +1 -1
- package/lib/operations/find.js +21 -30
- package/lib/operations/find.js.map +1 -1
- package/lib/operations/find_and_modify.js +52 -41
- package/lib/operations/find_and_modify.js.map +1 -1
- package/lib/operations/get_more.js +10 -11
- package/lib/operations/get_more.js.map +1 -1
- package/lib/operations/indexes.js +21 -12
- package/lib/operations/indexes.js.map +1 -1
- package/lib/operations/insert.js +8 -47
- package/lib/operations/insert.js.map +1 -1
- package/lib/operations/kill_cursors.js +13 -15
- package/lib/operations/kill_cursors.js.map +1 -1
- package/lib/operations/list_collections.js +7 -6
- package/lib/operations/list_collections.js.map +1 -1
- package/lib/operations/list_databases.js +5 -3
- package/lib/operations/list_databases.js.map +1 -1
- package/lib/operations/operation.js +30 -1
- package/lib/operations/operation.js.map +1 -1
- package/lib/operations/profiling_level.js +14 -4
- package/lib/operations/profiling_level.js.map +1 -1
- package/lib/operations/remove_user.js +6 -2
- package/lib/operations/remove_user.js.map +1 -1
- package/lib/operations/rename.js +10 -8
- package/lib/operations/rename.js.map +1 -1
- package/lib/operations/run_command.js +28 -32
- package/lib/operations/run_command.js.map +1 -1
- package/lib/operations/search_indexes/create.js +11 -8
- package/lib/operations/search_indexes/create.js.map +1 -1
- package/lib/operations/search_indexes/drop.js +16 -9
- package/lib/operations/search_indexes/drop.js.map +1 -1
- package/lib/operations/search_indexes/update.js +11 -4
- package/lib/operations/search_indexes/update.js.map +1 -1
- package/lib/operations/set_profiling_level.js +8 -4
- package/lib/operations/set_profiling_level.js.map +1 -1
- package/lib/operations/stats.js +4 -2
- package/lib/operations/stats.js.map +1 -1
- package/lib/operations/update.js +22 -19
- package/lib/operations/update.js.map +1 -1
- package/lib/operations/validate_collection.js +17 -18
- package/lib/operations/validate_collection.js.map +1 -1
- package/lib/sdam/server.js +46 -35
- package/lib/sdam/server.js.map +1 -1
- package/lib/sdam/topology.js +4 -3
- package/lib/sdam/topology.js.map +1 -1
- package/lib/sessions.js +3 -3
- package/lib/sessions.js.map +1 -1
- package/lib/utils.js +8 -13
- package/lib/utils.js.map +1 -1
- package/mongodb.d.ts +59 -7
- package/package.json +18 -18
- package/src/admin.ts +3 -2
- package/src/bulk/common.ts +21 -41
- package/src/client-side-encryption/client_encryption.ts +52 -3
- package/src/client-side-encryption/state_machine.ts +5 -1
- package/src/cmap/connection.ts +0 -1
- package/src/collection.ts +94 -65
- package/src/cursor/aggregation_cursor.ts +1 -1
- package/src/cursor/explainable_cursor.ts +51 -0
- package/src/cursor/find_cursor.ts +1 -1
- package/src/cursor/run_command_cursor.ts +4 -5
- package/src/db.ts +16 -19
- package/src/explain.ts +0 -49
- package/src/index.ts +4 -4
- package/src/mongo_client.ts +24 -9
- package/src/operations/aggregate.ts +15 -20
- package/src/operations/client_bulk_write/client_bulk_write.ts +21 -65
- package/src/operations/command.ts +22 -45
- package/src/operations/count.ts +9 -9
- package/src/operations/create_collection.ts +83 -75
- package/src/operations/delete.ts +27 -35
- package/src/operations/distinct.ts +23 -40
- package/src/operations/drop.ts +76 -60
- package/src/operations/estimated_document_count.ts +8 -9
- package/src/operations/execute_operation.ts +21 -11
- package/src/operations/find.ts +40 -57
- package/src/operations/find_and_modify.ts +78 -54
- package/src/operations/get_more.ts +17 -19
- package/src/operations/indexes.ts +26 -30
- package/src/operations/insert.ts +11 -77
- package/src/operations/kill_cursors.ts +21 -22
- package/src/operations/list_collections.ts +13 -21
- package/src/operations/list_databases.ts +6 -15
- package/src/operations/operation.ts +47 -10
- package/src/operations/profiling_level.ts +17 -11
- package/src/operations/remove_user.ts +9 -9
- package/src/operations/rename.ts +11 -14
- package/src/operations/run_command.ts +40 -68
- package/src/operations/search_indexes/create.ts +15 -15
- package/src/operations/search_indexes/drop.ts +23 -14
- package/src/operations/search_indexes/update.ts +14 -9
- package/src/operations/set_profiling_level.ts +13 -11
- package/src/operations/stats.ts +5 -10
- package/src/operations/update.ts +49 -52
- package/src/operations/validate_collection.ts +19 -27
- package/src/sdam/server.ts +56 -59
- package/src/sdam/topology.ts +5 -4
- package/src/sessions.ts +5 -4
- package/src/utils.ts +10 -25
- package/lib/operations/bulk_write.js +0 -39
- package/lib/operations/bulk_write.js.map +0 -1
- package/lib/operations/collections.js +0 -33
- package/lib/operations/collections.js.map +0 -1
- package/lib/operations/is_capped.js +0 -28
- package/lib/operations/is_capped.js.map +0 -1
- package/lib/operations/options_operation.js +0 -28
- package/lib/operations/options_operation.js.map +0 -1
- package/src/operations/bulk_write.ts +0 -64
- package/src/operations/collections.ts +0 -47
- package/src/operations/is_capped.ts +0 -35
- package/src/operations/options_operation.ts +0 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_databases.js","sourceRoot":"","sources":["../../src/operations/list_databases.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"list_databases.js","sourceRoot":"","sources":["../../src/operations/list_databases.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAGlE,oCAA4D;AAC5D,uCAA2E;AAC3E,2CAAoD;AAoBpD,gBAAgB;AAChB,MAAa,sBAAuB,SAAQ,0BAAqC;IAI/E,YAAY,EAAM,EAAE,OAA8B;QAChD,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAJZ,iCAA4B,GAAG,2BAAe,CAAC;QAKtD,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,EAAE,GAAG,IAAI,wBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,eAAwB,CAAC;IAClC,CAAC;IAEQ,oBAAoB,CAAC,UAAsB,EAAE,QAAwB;QAC5E,MAAM,GAAG,GAAa,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;QAE3C,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC/C,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACvC,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACxB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QACnC,CAAC;QAED,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAC1D,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC;QAC7D,CAAC;QAED,iEAAiE;QACjE,gDAAgD;QAChD,IAAI,IAAA,sBAAc,EAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1E,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACrC,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AArCD,wDAqCC;AAED,IAAA,yBAAa,EAAC,sBAAsB,EAAE,CAAC,kBAAM,CAAC,cAAc,EAAE,kBAAM,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
|
@@ -31,7 +31,6 @@ class AbstractOperation {
|
|
|
31
31
|
this._session = options.session != null ? options.session : undefined;
|
|
32
32
|
this.options = options;
|
|
33
33
|
this.bypassPinningCheck = !!options.bypassPinningCheck;
|
|
34
|
-
this.trySecondaryWrite = false;
|
|
35
34
|
}
|
|
36
35
|
hasAspect(aspect) {
|
|
37
36
|
const ctor = this.constructor;
|
|
@@ -44,6 +43,9 @@ class AbstractOperation {
|
|
|
44
43
|
get session() {
|
|
45
44
|
return this._session;
|
|
46
45
|
}
|
|
46
|
+
set session(session) {
|
|
47
|
+
this._session = session;
|
|
48
|
+
}
|
|
47
49
|
clearSession() {
|
|
48
50
|
this._session = undefined;
|
|
49
51
|
}
|
|
@@ -56,6 +58,33 @@ class AbstractOperation {
|
|
|
56
58
|
get canRetryWrite() {
|
|
57
59
|
return this.hasAspect(exports.Aspect.RETRYABLE) && this.hasAspect(exports.Aspect.WRITE_OPERATION);
|
|
58
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Given an instance of a MongoDBResponse, map the response to the correct result type. For
|
|
63
|
+
* example, a `CountOperation` might map the response as follows:
|
|
64
|
+
*
|
|
65
|
+
* ```typescript
|
|
66
|
+
* override handleOk(response: InstanceType<typeof this.SERVER_COMMAND_RESPONSE_TYPE>): TResult {
|
|
67
|
+
* return response.toObject(this.bsonOptions).n ?? 0;
|
|
68
|
+
* }
|
|
69
|
+
*
|
|
70
|
+
* // or, with type safety:
|
|
71
|
+
* override handleOk(response: InstanceType<typeof this.SERVER_COMMAND_RESPONSE_TYPE>): TResult {
|
|
72
|
+
* return response.getNumber('n') ?? 0;
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
handleOk(response) {
|
|
77
|
+
return response.toObject(this.bsonOptions);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Optional.
|
|
81
|
+
*
|
|
82
|
+
* If the operation performs error handling, such as wrapping, renaming the error, or squashing errors
|
|
83
|
+
* this method can be overridden.
|
|
84
|
+
*/
|
|
85
|
+
handleError(error) {
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
59
88
|
}
|
|
60
89
|
exports.AbstractOperation = AbstractOperation;
|
|
61
90
|
function defineAspects(operation, aspects) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/operations/operation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/operations/operation.ts"],"names":[],"mappings":";;;AAoKA,sCAeC;AAlLD,kCAAuF;AAGvF,wDAA6E;AAMhE,QAAA,MAAM,GAAG;IACpB,cAAc,EAAE,MAAM,CAAC,gBA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
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProfilingLevelOperation = void 0;
|
|
4
|
+
const bson_1 = require("../bson");
|
|
5
|
+
const responses_1 = require("../cmap/wire_protocol/responses");
|
|
4
6
|
const error_1 = require("../error");
|
|
5
7
|
const command_1 = require("./command");
|
|
8
|
+
class ProfilingLevelResponse extends responses_1.MongoDBResponse {
|
|
9
|
+
get was() {
|
|
10
|
+
return this.get('was', bson_1.BSONType.int, true);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
6
13
|
/** @internal */
|
|
7
14
|
class ProfilingLevelOperation extends command_1.CommandOperation {
|
|
8
15
|
constructor(db, options) {
|
|
9
16
|
super(db, options);
|
|
17
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = ProfilingLevelResponse;
|
|
10
18
|
this.options = options;
|
|
11
19
|
}
|
|
12
20
|
get commandName() {
|
|
13
21
|
return 'profile';
|
|
14
22
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
buildCommandDocument(_connection) {
|
|
24
|
+
return { profile: -1 };
|
|
25
|
+
}
|
|
26
|
+
handleOk(response) {
|
|
27
|
+
if (response.ok === 1) {
|
|
28
|
+
const was = response.was;
|
|
19
29
|
if (was === 0)
|
|
20
30
|
return 'off';
|
|
21
31
|
if (was === 1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiling_level.js","sourceRoot":"","sources":["../../src/operations/profiling_level.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"profiling_level.js","sourceRoot":"","sources":["../../src/operations/profiling_level.ts"],"names":[],"mappings":";;;AAAA,kCAAkD;AAElD,+DAAkE;AAElE,oCAA8D;AAC9D,uCAA2E;AAK3E,MAAM,sBAAuB,SAAQ,2BAAe;IAClD,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,eAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,0BAAwB;IAInE,YAAY,EAAM,EAAE,OAA8B;QAChD,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAJZ,iCAA4B,GAAG,sBAAsB,CAAC;QAK7D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,SAAkB,CAAC;IAC5B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC;IACzB,CAAC;IAEQ,QAAQ,CAAC,QAAgE;QAChF,IAAI,QAAQ,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;YACzB,IAAI,GAAG,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;YAC5B,IAAI,GAAG,KAAK,CAAC;gBAAE,OAAO,WAAW,CAAC;YAClC,IAAI,GAAG,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;YAC5B,MAAM,IAAI,0CAAkC,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;QACvF,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,0CAAkC,CAAC,4BAA4B,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;CACF;AA5BD,0DA4BC"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RemoveUserOperation = void 0;
|
|
4
|
+
const responses_1 = require("../cmap/wire_protocol/responses");
|
|
4
5
|
const command_1 = require("./command");
|
|
5
6
|
const operation_1 = require("./operation");
|
|
6
7
|
/** @internal */
|
|
7
8
|
class RemoveUserOperation extends command_1.CommandOperation {
|
|
8
9
|
constructor(db, username, options) {
|
|
9
10
|
super(db, options);
|
|
11
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
|
|
10
12
|
this.options = options;
|
|
11
13
|
this.username = username;
|
|
12
14
|
}
|
|
13
15
|
get commandName() {
|
|
14
16
|
return 'dropUser';
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
buildCommandDocument(_connection) {
|
|
19
|
+
return { dropUser: this.username };
|
|
20
|
+
}
|
|
21
|
+
handleOk(_response) {
|
|
18
22
|
return true;
|
|
19
23
|
}
|
|
20
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove_user.js","sourceRoot":"","sources":["../../src/operations/remove_user.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"remove_user.js","sourceRoot":"","sources":["../../src/operations/remove_user.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAElE,uCAA2E;AAC3E,2CAAoD;AAKpD,gBAAgB;AAChB,MAAa,mBAAoB,SAAQ,0BAAyB;IAKhE,YAAY,EAAM,EAAE,QAAgB,EAAE,OAA0B;QAC9D,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QALZ,iCAA4B,GAAG,2BAAe,CAAC;QAMtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,UAAmB,CAAC;IAC7B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;IACrC,CAAC;IAEQ,QAAQ,CAAC,SAAiE;QACjF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtBD,kDAsBC;AAED,IAAA,yBAAa,EAAC,mBAAmB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"}
|
package/lib/operations/rename.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RenameOperation = void 0;
|
|
4
|
+
const responses_1 = require("../cmap/wire_protocol/responses");
|
|
4
5
|
const collection_1 = require("../collection");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
const command_1 = require("./command");
|
|
@@ -9,6 +10,7 @@ const operation_1 = require("./operation");
|
|
|
9
10
|
class RenameOperation extends command_1.CommandOperation {
|
|
10
11
|
constructor(collection, newName, options) {
|
|
11
12
|
super(collection, options);
|
|
13
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
|
|
12
14
|
this.collection = collection;
|
|
13
15
|
this.newName = newName;
|
|
14
16
|
this.options = options;
|
|
@@ -17,17 +19,17 @@ class RenameOperation extends command_1.CommandOperation {
|
|
|
17
19
|
get commandName() {
|
|
18
20
|
return 'renameCollection';
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
// Build the command
|
|
22
|
+
buildCommandDocument(_connection, _session) {
|
|
22
23
|
const renameCollection = this.collection.namespace;
|
|
23
|
-
const
|
|
24
|
+
const to = this.collection.s.namespace.withCollection(this.newName).toString();
|
|
24
25
|
const dropTarget = typeof this.options.dropTarget === 'boolean' ? this.options.dropTarget : false;
|
|
25
|
-
|
|
26
|
-
renameCollection
|
|
27
|
-
to
|
|
28
|
-
dropTarget
|
|
26
|
+
return {
|
|
27
|
+
renameCollection,
|
|
28
|
+
to,
|
|
29
|
+
dropTarget
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
}
|
|
32
|
+
handleOk(_response) {
|
|
31
33
|
return new collection_1.Collection(this.collection.s.db, this.newName, this.collection.s.options);
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename.js","sourceRoot":"","sources":["../../src/operations/rename.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"rename.js","sourceRoot":"","sources":["../../src/operations/rename.ts"],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AAA,yBAAa,EAAC,eAAe,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -1,51 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
const operation_1 = require("
|
|
3
|
+
exports.RunCursorCommandOperation = exports.RunCommandOperation = void 0;
|
|
4
|
+
const responses_1 = require("../cmap/wire_protocol/responses");
|
|
5
|
+
const operation_1 = require("../operations/operation");
|
|
6
6
|
/** @internal */
|
|
7
7
|
class RunCommandOperation extends operation_1.AbstractOperation {
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(namespace, command, options) {
|
|
9
9
|
super(options);
|
|
10
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
|
|
10
11
|
this.command = command;
|
|
11
12
|
this.options = options;
|
|
12
|
-
this.ns =
|
|
13
|
+
this.ns = namespace.withCollection('$cmd');
|
|
13
14
|
}
|
|
14
15
|
get commandName() {
|
|
15
16
|
return 'runCommand';
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
18
|
+
buildCommand(_connection, _session) {
|
|
19
|
+
return this.command;
|
|
20
|
+
}
|
|
21
|
+
buildOptions(timeoutContext) {
|
|
22
|
+
return {
|
|
20
23
|
...this.options,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
session: this.session,
|
|
25
|
+
timeoutContext,
|
|
26
|
+
signal: this.options.signal,
|
|
27
|
+
readPreference: this.options.readPreference
|
|
28
|
+
};
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
exports.RunCommandOperation = RunCommandOperation;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*
|
|
35
|
+
* A specialized subclass of RunCommandOperation for cursor-creating commands.
|
|
36
|
+
*/
|
|
37
|
+
class RunCursorCommandOperation extends RunCommandOperation {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse;
|
|
35
41
|
}
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
async execute(server, session, timeoutContext) {
|
|
40
|
-
this.server = server;
|
|
41
|
-
const res = await server.command(this.ns, this.command, {
|
|
42
|
-
...this.options,
|
|
43
|
-
readPreference: this.readPreference,
|
|
44
|
-
session,
|
|
45
|
-
timeoutContext
|
|
46
|
-
});
|
|
47
|
-
return res;
|
|
42
|
+
handleOk(response) {
|
|
43
|
+
return response;
|
|
48
44
|
}
|
|
49
45
|
}
|
|
50
|
-
exports.
|
|
46
|
+
exports.RunCursorCommandOperation = RunCursorCommandOperation;
|
|
51
47
|
//# sourceMappingURL=run_command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run_command.js","sourceRoot":"","sources":["../../src/operations/run_command.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"run_command.js","sourceRoot":"","sources":["../../src/operations/run_command.ts"],"names":[],"mappings":";;;AAGA,+DAAkF;AAClF,uDAA4D;AA6B5D,gBAAgB;AAChB,MAAa,mBAAkC,SAAQ,6BAAoB;IAKzE,YAAY,SAA2B,EAAE,OAAiB,EAAE,OAA0B;QACpF,KAAK,CAAC,OAAO,CAAC,CAAC;QALR,iCAA4B,GAAG,2BAAe,CAAC;QAMtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,YAAqB,CAAC;IAC/B,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO;YACL,GAAG,IAAI,CAAC,OAAO;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,cAAc;YACd,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc;SAC5C,CAAC;IACJ,CAAC;CACF;AA7BD,kDA6BC;AAED;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,mBAAmB;IAAlE;;QACW,iCAA4B,GAAG,0BAAc,CAAC;IAOzD,CAAC;IALU,QAAQ,CACf,QAAgE;QAEhE,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AARD,8DAQC"}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateSearchIndexesOperation = void 0;
|
|
4
|
+
const responses_1 = require("../../cmap/wire_protocol/responses");
|
|
4
5
|
const operation_1 = require("../operation");
|
|
5
6
|
/** @internal */
|
|
6
7
|
class CreateSearchIndexesOperation extends operation_1.AbstractOperation {
|
|
7
8
|
constructor(collection, descriptions) {
|
|
8
9
|
super();
|
|
10
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
|
|
9
11
|
this.collection = collection;
|
|
10
12
|
this.descriptions = descriptions;
|
|
13
|
+
this.ns = collection.fullNamespace;
|
|
11
14
|
}
|
|
12
15
|
get commandName() {
|
|
13
16
|
return 'createSearchIndexes';
|
|
14
17
|
}
|
|
15
|
-
|
|
18
|
+
buildCommand(_connection, _session) {
|
|
16
19
|
const namespace = this.collection.fullNamespace;
|
|
17
|
-
|
|
20
|
+
return {
|
|
18
21
|
createSearchIndexes: namespace.collection,
|
|
19
22
|
indexes: this.descriptions
|
|
20
23
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
24
|
+
}
|
|
25
|
+
handleOk(response) {
|
|
26
|
+
return super.handleOk(response).indexesCreated.map((val) => val.name);
|
|
27
|
+
}
|
|
28
|
+
buildOptions(timeoutContext) {
|
|
29
|
+
return { session: this.session, timeoutContext };
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
exports.CreateSearchIndexesOperation = CreateSearchIndexesOperation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/create.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/create.ts"],"names":[],"mappings":";;;AAEA,kEAAqE;AAKrE,4CAAiD;AAgBjD,gBAAgB;AAChB,MAAa,4BAA6B,SAAQ,6BAA2B;IAK3E,YAAY,UAAsB,EAAE,YAAmD;QACrF,KAAK,EAAE,CAAC;QALD,iCAA4B,GAAG,2BAAe,CAAC;QAMtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC;IACrC,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,qBAA8B,CAAC;IACxC,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAChD,OAAO;YACL,mBAAmB,EAAE,SAAS,CAAC,UAAU;YACzC,OAAO,EAAE,IAAI,CAAC,YAAY;SAC3B,CAAC;IACJ,CAAC;IAEQ,QAAQ,CAAC,QAAgE;QAChF,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAqB,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1F,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnD,CAAC;CACF;AA/BD,oEA+BC"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DropSearchIndexOperation = void 0;
|
|
4
|
+
const responses_1 = require("../../cmap/wire_protocol/responses");
|
|
4
5
|
const error_1 = require("../../error");
|
|
5
6
|
const operation_1 = require("../operation");
|
|
6
7
|
/** @internal */
|
|
7
8
|
class DropSearchIndexOperation extends operation_1.AbstractOperation {
|
|
8
9
|
constructor(collection, name) {
|
|
9
10
|
super();
|
|
11
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
|
|
10
12
|
this.collection = collection;
|
|
11
13
|
this.name = name;
|
|
14
|
+
this.ns = collection.fullNamespace;
|
|
12
15
|
}
|
|
13
16
|
get commandName() {
|
|
14
17
|
return 'dropSearchIndex';
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
buildCommand(_connection, _session) {
|
|
17
20
|
const namespace = this.collection.fullNamespace;
|
|
18
21
|
const command = {
|
|
19
22
|
dropSearchIndex: namespace.collection
|
|
@@ -21,14 +24,18 @@ class DropSearchIndexOperation extends operation_1.AbstractOperation {
|
|
|
21
24
|
if (typeof this.name === 'string') {
|
|
22
25
|
command.name = this.name;
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
return command;
|
|
28
|
+
}
|
|
29
|
+
handleOk(_response) {
|
|
30
|
+
// do nothing
|
|
31
|
+
}
|
|
32
|
+
buildOptions(timeoutContext) {
|
|
33
|
+
return { session: this.session, timeoutContext };
|
|
34
|
+
}
|
|
35
|
+
handleError(error) {
|
|
36
|
+
const isNamespaceNotFoundError = error instanceof error_1.MongoServerError && error.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound;
|
|
37
|
+
if (!isNamespaceNotFoundError) {
|
|
38
|
+
throw error;
|
|
32
39
|
}
|
|
33
40
|
}
|
|
34
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/drop.ts"],"names":[],"mappings":";;;AAEA,uCAAoE;AAIpE,4CAAiD;AAEjD,gBAAgB;AAChB,MAAa,wBAAyB,SAAQ,6BAAuB;
|
|
1
|
+
{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/drop.ts"],"names":[],"mappings":";;;AAEA,kEAAqE;AAErE,uCAAoE;AAIpE,4CAAiD;AAEjD,gBAAgB;AAChB,MAAa,wBAAyB,SAAQ,6BAAuB;IAMnE,YAAY,UAAsB,EAAE,IAAY;QAC9C,KAAK,EAAE,CAAC;QAND,iCAA4B,GAAG,2BAAe,CAAC;QAOtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC;IACrC,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,iBAA0B,CAAC;IACpC,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAEhD,MAAM,OAAO,GAAa;YACxB,eAAe,EAAE,SAAS,CAAC,UAAU;SACtC,CAAC;QAEF,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEQ,QAAQ,CAAC,SAA0B;QAC1C,aAAa;IACf,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnD,CAAC;IAEQ,WAAW,CAAC,KAAiB;QACpC,MAAM,wBAAwB,GAC5B,KAAK,YAAY,wBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,2BAAmB,CAAC,iBAAiB,CAAC;QAC5F,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA9CD,4DA8CC"}
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateSearchIndexOperation = void 0;
|
|
4
|
+
const responses_1 = require("../../cmap/wire_protocol/responses");
|
|
4
5
|
const operation_1 = require("../operation");
|
|
5
6
|
/** @internal */
|
|
6
7
|
class UpdateSearchIndexOperation extends operation_1.AbstractOperation {
|
|
7
8
|
constructor(collection, name, definition) {
|
|
8
9
|
super();
|
|
10
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
|
|
9
11
|
this.collection = collection;
|
|
10
12
|
this.name = name;
|
|
11
13
|
this.definition = definition;
|
|
14
|
+
this.ns = collection.fullNamespace;
|
|
12
15
|
}
|
|
13
16
|
get commandName() {
|
|
14
17
|
return 'updateSearchIndex';
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
buildCommand(_connection, _session) {
|
|
17
20
|
const namespace = this.collection.fullNamespace;
|
|
18
|
-
|
|
21
|
+
return {
|
|
19
22
|
updateSearchIndex: namespace.collection,
|
|
20
23
|
name: this.name,
|
|
21
24
|
definition: this.definition
|
|
22
25
|
};
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
}
|
|
27
|
+
handleOk(_response) {
|
|
28
|
+
// no response.
|
|
29
|
+
}
|
|
30
|
+
buildOptions(timeoutContext) {
|
|
31
|
+
return { session: this.session, timeoutContext };
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
34
|
exports.UpdateSearchIndexOperation = UpdateSearchIndexOperation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/update.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/operations/search_indexes/update.ts"],"names":[],"mappings":";;;AAEA,kEAAqE;AAKrE,4CAAiD;AAEjD,gBAAgB;AAChB,MAAa,0BAA2B,SAAQ,6BAAuB;IAMrE,YAAY,UAAsB,EAAE,IAAY,EAAE,UAAoB;QACpE,KAAK,EAAE,CAAC;QAND,iCAA4B,GAAG,2BAAe,CAAC;QAOtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC;IACrC,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,mBAA4B,CAAC;IACtC,CAAC;IAEQ,YAAY,CAAC,WAAuB,EAAE,QAAwB;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAChD,OAAO;YACL,iBAAiB,EAAE,SAAS,CAAC,UAAU;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC;IAEQ,QAAQ,CAAC,SAA0B;QAC1C,eAAe;IACjB,CAAC;IAEQ,YAAY,CAAC,cAA8B;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnD,CAAC;CACF;AAlCD,gEAkCC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetProfilingLevelOperation = exports.ProfilingLevel = void 0;
|
|
4
|
+
const responses_1 = require("../cmap/wire_protocol/responses");
|
|
4
5
|
const error_1 = require("../error");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
const command_1 = require("./command");
|
|
@@ -15,6 +16,7 @@ exports.ProfilingLevel = Object.freeze({
|
|
|
15
16
|
class SetProfilingLevelOperation extends command_1.CommandOperation {
|
|
16
17
|
constructor(db, level, options) {
|
|
17
18
|
super(db, options);
|
|
19
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
|
|
18
20
|
this.options = options;
|
|
19
21
|
switch (level) {
|
|
20
22
|
case exports.ProfilingLevel.off:
|
|
@@ -35,14 +37,16 @@ class SetProfilingLevelOperation extends command_1.CommandOperation {
|
|
|
35
37
|
get commandName() {
|
|
36
38
|
return 'profile';
|
|
37
39
|
}
|
|
38
|
-
|
|
40
|
+
buildCommandDocument(_connection) {
|
|
39
41
|
const level = this.level;
|
|
40
42
|
if (!levelValues.has(level)) {
|
|
43
|
+
// TODO(NODE-3483): Determine error to put here
|
|
41
44
|
throw new error_1.MongoInvalidArgumentError(`Profiling level must be one of "${(0, utils_1.enumToString)(exports.ProfilingLevel)}"`);
|
|
42
45
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
return { profile: this.profile };
|
|
47
|
+
}
|
|
48
|
+
handleOk(_response) {
|
|
49
|
+
return this.level;
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
exports.SetProfilingLevelOperation = SetProfilingLevelOperation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_profiling_level.js","sourceRoot":"","sources":["../../src/operations/set_profiling_level.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"set_profiling_level.js","sourceRoot":"","sources":["../../src/operations/set_profiling_level.ts"],"names":[],"mapp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AAc,CAAC,GAAG,CACnE,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAEQ,QAAQ,CACf,SAAiE;QAEjE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAjDD,gEAiDC"}
|
package/lib/operations/stats.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DbStatsOperation = void 0;
|
|
4
|
+
const responses_1 = require("../cmap/wire_protocol/responses");
|
|
4
5
|
const command_1 = require("./command");
|
|
5
6
|
const operation_1 = require("./operation");
|
|
6
7
|
/** @internal */
|
|
7
8
|
class DbStatsOperation extends command_1.CommandOperation {
|
|
8
9
|
constructor(db, options) {
|
|
9
10
|
super(db, options);
|
|
11
|
+
this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse;
|
|
10
12
|
this.options = options;
|
|
11
13
|
}
|
|
12
14
|
get commandName() {
|
|
13
15
|
return 'dbStats';
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
buildCommandDocument(_connection) {
|
|
16
18
|
const command = { dbStats: true };
|
|
17
19
|
if (this.options.scale != null) {
|
|
18
20
|
command.scale = this.options.scale;
|
|
19
21
|
}
|
|
20
|
-
return
|
|
22
|
+
return command;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
exports.DbStatsOperation = DbStatsOperation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/operations/stats.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/operations/stats.ts"],"names":[],"mappings":";;;AAEA,+DAAkE;AAElE,uCAA2E;AAC3E,2CAAoD;AAQpD,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,0BAA0B;IAI9D,YAAY,EAAM,EAAE,OAAuB;QACzC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAJZ,iCAA4B,GAAG,2BAAe,CAAC;QAKtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAa,WAAW;QACtB,OAAO,SAAkB,CAAC;IAC5B,CAAC;IAEQ,oBAAoB,CAAC,WAAuB;QACnD,MAAM,OAAO,GAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC5C,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YAC/B,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QACrC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AApBD,4CAoBC;AAED,IAAA,yBAAa,EAAC,gBAAgB,EAAE,CAAC,kBAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
|