@mongodb-js/compass-shell 2.21.0 → 2.24.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/1.js +1903 -2649
- package/lib/2.js +22 -12
- package/lib/index.js +226 -43
- package/package.json +18 -18
package/lib/index.js
CHANGED
|
@@ -752,6 +752,7 @@ exports.MongoMissingDependencyError = MongoMissingDependencyError;
|
|
|
752
752
|
*/
|
|
753
753
|
class MongoSystemError extends MongoError {
|
|
754
754
|
constructor(message, reason) {
|
|
755
|
+
var _a;
|
|
755
756
|
if (reason && reason.error) {
|
|
756
757
|
super(reason.error.message || reason.error);
|
|
757
758
|
}
|
|
@@ -761,6 +762,7 @@ class MongoSystemError extends MongoError {
|
|
|
761
762
|
if (reason) {
|
|
762
763
|
this.reason = reason;
|
|
763
764
|
}
|
|
765
|
+
this.code = (_a = reason.error) === null || _a === void 0 ? void 0 : _a.code;
|
|
764
766
|
}
|
|
765
767
|
get name() {
|
|
766
768
|
return 'MongoSystemError';
|
|
@@ -3754,8 +3756,17 @@ function next(cursor, blocking, callback) {
|
|
|
3754
3756
|
}
|
|
3755
3757
|
if (cursorId == null) {
|
|
3756
3758
|
// All cursors must operate within a session, one must be made implicitly if not explicitly provided
|
|
3757
|
-
if (cursor[kSession] == null
|
|
3758
|
-
|
|
3759
|
+
if (cursor[kSession] == null) {
|
|
3760
|
+
if (cursor[kTopology].shouldCheckForSessionSupport()) {
|
|
3761
|
+
return cursor[kTopology].selectServer(read_preference_1.ReadPreference.primaryPreferred, err => {
|
|
3762
|
+
if (err)
|
|
3763
|
+
return callback(err);
|
|
3764
|
+
return next(cursor, blocking, callback);
|
|
3765
|
+
});
|
|
3766
|
+
}
|
|
3767
|
+
else if (cursor[kTopology].hasSessionSupport()) {
|
|
3768
|
+
cursor[kSession] = cursor[kTopology].startSession({ owner: cursor, explicit: false });
|
|
3769
|
+
}
|
|
3759
3770
|
}
|
|
3760
3771
|
cursor._initialize(cursor[kSession], (err, state) => {
|
|
3761
3772
|
if (state) {
|
|
@@ -8070,7 +8081,7 @@ module.exports.globalAppRegistryEmit = globalAppRegistryEmit;
|
|
|
8070
8081
|
/* 55 */
|
|
8071
8082
|
/***/ (function(module) {
|
|
8072
8083
|
|
|
8073
|
-
module.exports = JSON.parse("{\"name\":\"@mongodb-js/compass-shell\",\"productName\":\"Compass Shell plugin\",\"version\":\"2.
|
|
8084
|
+
module.exports = JSON.parse("{\"name\":\"@mongodb-js/compass-shell\",\"productName\":\"Compass Shell plugin\",\"version\":\"2.24.0\",\"apiVersion\":\"3.0.0\",\"description\":\"Compass Shell Plugin\",\"main\":\"lib/index.js\",\"compass:main\":\"src/index.js\",\"compass:exports\":{\".\":\"./src/index.js\"},\"scripts\":{\"prepublishOnly\":\"npm run compile && compass-scripts check-exports-exist\",\"clean\":\"rimraf lib\",\"precompile\":\"npm run clean\",\"compile\":\"cross-env NODE_ENV=production webpack --config ./config/webpack.prod.config.js\",\"compile:watch\":\"cross-env NODE_ENV=production webpack --config ./config/webpack.prod.config.js --watch\",\"start\":\"cross-env NODE_ENV=development webpack-dev-server --config ./config/webpack.dev.config.js\",\"start:watch\":\"npm run clean && webpack --config ./config/webpack.watch.config.js\",\"test\":\"cross-env NODE_ENV=test mocha-webpack \\\"./src/**/*.spec.js\\\"\",\"test-ci\":\"npm run test\",\"test-ci-electron\":\"echo \\\"TODO(COMPASS-5555): These tests are broken and disabled for now\\\"\",\"test-watch\":\"cross-env NODE_ENV=test mocha-webpack \\\"./src/**/*.spec.js\\\" --watch\",\"test-electron\":\"xvfb-maybe cross-env NODE_ENV=test karma start\",\"test-cov\":\"echo\",\"check\":\"npm run lint && npm run depcheck\",\"lint\":\"eslint \\\"./src/**/*.{js,jsx}\\\" \\\"./test/**/*.js\\\" \\\"./electron/**/*.js\\\" \\\"./config/**/*.{js,jsx}\\\"\",\"depcheck\":\"depcheck\",\"bootstrap\":\"npm run compile\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/mongodb-js/compass.git\"},\"config\":{\"unsafe-perm\":true},\"engines\":{\"node\":\">=14.17.5\"},\"license\":\"SSPL\",\"publishConfig\":{\"access\":\"public\"},\"dependencies\":{\"@leafygreen-ui/code\":\"^9.4.0\",\"@mongodb-js/compass-logging\":\"^0.12.0\",\"@mongodb-js/mongodb-redux-common\":\"^1.12.0\",\"@mongosh/browser-repl\":\"^1.2.3\",\"@mongosh/logging\":\"^1.2.3\",\"@mongosh/node-runtime-worker-thread\":\"^1.2.3\",\"@mongosh/service-provider-core\":\"^1.2.3\"},\"peerDependencies\":{\"@mongodb-js/compass-components\":\"^0.15.0\",\"ace-builds\":\"^1.4.3\",\"hadron-ipc\":\"^2.10.0\",\"hadron-react-components\":\"^5.15.0\",\"prop-types\":\"^15.7.2\",\"react\":\"^16.14.0\",\"react-ace\":\"^9.5.0\",\"react-dom\":\"^16.14.0\"},\"devDependencies\":{\"@babel/cli\":\"^7.14.3\",\"@babel/core\":\"^7.14.3\",\"@babel/plugin-proposal-decorators\":\"^7.14.2\",\"@babel/plugin-syntax-dynamic-import\":\"^7.8.3\",\"@babel/preset-env\":\"^7.14.2\",\"@babel/preset-react\":\"^7.13.13\",\"@babel/register\":\"^7.13.16\",\"@hot-loader/react-dom\":\"^16.9.0\",\"@mongodb-js/compass-components\":\"^0.15.0\",\"ace-builds\":\"^1.4.3\",\"autoprefixer\":\"^9.4.6\",\"babel-loader\":\"^8.2.2\",\"chai\":\"^4.2.0\",\"chai-enzyme\":\"1.0.0-beta.0\",\"core-js\":\"^3.12.1\",\"cross-env\":\"^5.0.1\",\"depcheck\":\"^1.4.1\",\"electron\":\"^13.5.1\",\"electron-devtools-installer\":\"^3.2.0\",\"enzyme\":\"^3.11.0\",\"enzyme-adapter-react-16\":\"^1.15.2\",\"eslint\":\"^7.25.0\",\"eslint-config-mongodb-js\":\"^5.0.3\",\"eslint-plugin-react\":\"^7.24.0\",\"file-loader\":\"^5.1.0\",\"font-awesome\":\"^4.7.0\",\"hadron-app\":\"^4.23.0\",\"hadron-app-registry\":\"^8.12.0\",\"html-webpack-plugin\":\"^3.2.0\",\"ignore-loader\":\"^0.1.2\",\"istanbul-instrumenter-loader\":\"^3.0.1\",\"jsdom\":\"^16.7.0\",\"jsdom-global\":\"^3.0.2\",\"karma\":\"^6.3.4\",\"karma-chai\":\"^0.1.0\",\"karma-chai-sinon\":\"^0.1.5\",\"karma-electron\":\"^7.0.0\",\"karma-mocha\":\"^1.3.0\",\"karma-mocha-reporter\":\"^2.2.5\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"mocha\":\"^5.2.0\",\"mocha-webpack\":\"^2.0.0-beta.0\",\"mongodb\":\"^4.4.0\",\"mongodb-reflux-store\":\"^0.0.1\",\"node-loader\":\"^0.6.0\",\"nyc\":\"^13.1.0\",\"peer-deps-externals-webpack-plugin\":\"^1.0.4\",\"prop-types\":\"^15.7.2\",\"react\":\"^16.14.0\",\"react-ace\":\"^9.5.0\",\"react-dom\":\"^16.14.0\",\"react-hot-loader\":\"^4.13.0\",\"react-redux\":\"^7.1.1\",\"react-tooltip\":\"^3.11.1\",\"redux\":\"^4.1.2\",\"reflux\":\"^0.4.1\",\"reflux-state-mixin\":\"github:mongodb-js/reflux-state-mixin\",\"resolve\":\"^1.15.1\",\"rimraf\":\"^2.6.1\",\"semver\":\"^5.4.1\",\"shebang-loader\":\"^0.0.1\",\"sinon\":\"^7.2.5\",\"sinon-chai\":\"^3.3.0\",\"url-loader\":\"^3.0.0\",\"webpack\":\"^4.46.0\",\"webpack-bundle-analyzer\":\"^3.0.3\",\"webpack-cli\":\"^3.3.12\",\"webpack-dev-server\":\"^3.11.2\",\"webpack-merge\":\"^4.2.2\",\"webpack-node-externals\":\"^3.0.0\"},\"homepage\":\"https://github.com/mongodb-js/compass\",\"bugs\":{\"url\":\"https://jira.mongodb.org/projects/COMPASS/issues\",\"email\":\"compass@mongodb.com\"},\"gitHead\":\"63c32b940f523e4c3e45b86a5aecaeadef93253f\"}");
|
|
8074
8085
|
|
|
8075
8086
|
/***/ }),
|
|
8076
8087
|
/* 56 */
|
|
@@ -11773,6 +11784,7 @@ Object.defineProperty(UUID.prototype, '_bsontype', { value: 'UUID' });
|
|
|
11773
11784
|
/**
|
|
11774
11785
|
* A class representation of the BSON Binary type.
|
|
11775
11786
|
* @public
|
|
11787
|
+
* @category BSONType
|
|
11776
11788
|
*/
|
|
11777
11789
|
var Binary = /** @class */ (function () {
|
|
11778
11790
|
/**
|
|
@@ -12003,6 +12015,7 @@ Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' });
|
|
|
12003
12015
|
/**
|
|
12004
12016
|
* A class representation of the BSON Code type.
|
|
12005
12017
|
* @public
|
|
12018
|
+
* @category BSONType
|
|
12006
12019
|
*/
|
|
12007
12020
|
var Code = /** @class */ (function () {
|
|
12008
12021
|
/**
|
|
@@ -12051,6 +12064,7 @@ function isDBRefLike(value) {
|
|
|
12051
12064
|
/**
|
|
12052
12065
|
* A class representation of the BSON DBRef type.
|
|
12053
12066
|
* @public
|
|
12067
|
+
* @category BSONType
|
|
12054
12068
|
*/
|
|
12055
12069
|
var DBRef = /** @class */ (function () {
|
|
12056
12070
|
/**
|
|
@@ -12155,6 +12169,7 @@ var UINT_CACHE = {};
|
|
|
12155
12169
|
/**
|
|
12156
12170
|
* A class representing a 64-bit integer
|
|
12157
12171
|
* @public
|
|
12172
|
+
* @category BSONType
|
|
12158
12173
|
* @remarks
|
|
12159
12174
|
* The internal representation of a long is the two given signed, 32-bit values.
|
|
12160
12175
|
* We use 32-bit pieces because these are the size of integers on which
|
|
@@ -13117,6 +13132,7 @@ function invalidErr(string, message) {
|
|
|
13117
13132
|
/**
|
|
13118
13133
|
* A class representation of the BSON Decimal128 type.
|
|
13119
13134
|
* @public
|
|
13135
|
+
* @category BSONType
|
|
13120
13136
|
*/
|
|
13121
13137
|
var Decimal128 = /** @class */ (function () {
|
|
13122
13138
|
/**
|
|
@@ -13688,6 +13704,7 @@ Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }
|
|
|
13688
13704
|
/**
|
|
13689
13705
|
* A class representation of the BSON Double type.
|
|
13690
13706
|
* @public
|
|
13707
|
+
* @category BSONType
|
|
13691
13708
|
*/
|
|
13692
13709
|
var Double = /** @class */ (function () {
|
|
13693
13710
|
/**
|
|
@@ -13759,6 +13776,7 @@ Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' });
|
|
|
13759
13776
|
/**
|
|
13760
13777
|
* A class representation of a BSON Int32 type.
|
|
13761
13778
|
* @public
|
|
13779
|
+
* @category BSONType
|
|
13762
13780
|
*/
|
|
13763
13781
|
var Int32 = /** @class */ (function () {
|
|
13764
13782
|
/**
|
|
@@ -13812,6 +13830,7 @@ Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' });
|
|
|
13812
13830
|
/**
|
|
13813
13831
|
* A class representation of the BSON MaxKey type.
|
|
13814
13832
|
* @public
|
|
13833
|
+
* @category BSONType
|
|
13815
13834
|
*/
|
|
13816
13835
|
var MaxKey = /** @class */ (function () {
|
|
13817
13836
|
function MaxKey() {
|
|
@@ -13840,6 +13859,7 @@ Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' });
|
|
|
13840
13859
|
/**
|
|
13841
13860
|
* A class representation of the BSON MinKey type.
|
|
13842
13861
|
* @public
|
|
13862
|
+
* @category BSONType
|
|
13843
13863
|
*/
|
|
13844
13864
|
var MinKey = /** @class */ (function () {
|
|
13845
13865
|
function MinKey() {
|
|
@@ -13873,6 +13893,7 @@ var kId = Symbol('id');
|
|
|
13873
13893
|
/**
|
|
13874
13894
|
* A class representation of the BSON ObjectId type.
|
|
13875
13895
|
* @public
|
|
13896
|
+
* @category BSONType
|
|
13876
13897
|
*/
|
|
13877
13898
|
var ObjectId = /** @class */ (function () {
|
|
13878
13899
|
/**
|
|
@@ -13922,7 +13943,7 @@ var ObjectId = /** @class */ (function () {
|
|
|
13922
13943
|
this[kId] = buffer_1.from(workingId, 'hex');
|
|
13923
13944
|
}
|
|
13924
13945
|
else {
|
|
13925
|
-
throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters');
|
|
13946
|
+
throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer');
|
|
13926
13947
|
}
|
|
13927
13948
|
}
|
|
13928
13949
|
else {
|
|
@@ -14039,7 +14060,7 @@ var ObjectId = /** @class */ (function () {
|
|
|
14039
14060
|
return false;
|
|
14040
14061
|
}
|
|
14041
14062
|
if (otherId instanceof ObjectId) {
|
|
14042
|
-
return this
|
|
14063
|
+
return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]);
|
|
14043
14064
|
}
|
|
14044
14065
|
if (typeof otherId === 'string' &&
|
|
14045
14066
|
ObjectId.isValid(otherId) &&
|
|
@@ -14056,7 +14077,9 @@ var ObjectId = /** @class */ (function () {
|
|
|
14056
14077
|
if (typeof otherId === 'object' &&
|
|
14057
14078
|
'toHexString' in otherId &&
|
|
14058
14079
|
typeof otherId.toHexString === 'function') {
|
|
14059
|
-
|
|
14080
|
+
var otherIdString = otherId.toHexString();
|
|
14081
|
+
var thisIdString = this.toHexString().toLowerCase();
|
|
14082
|
+
return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString;
|
|
14060
14083
|
}
|
|
14061
14084
|
return false;
|
|
14062
14085
|
};
|
|
@@ -14158,6 +14181,7 @@ function alphabetize(str) {
|
|
|
14158
14181
|
/**
|
|
14159
14182
|
* A class representation of the BSON RegExp type.
|
|
14160
14183
|
* @public
|
|
14184
|
+
* @category BSONType
|
|
14161
14185
|
*/
|
|
14162
14186
|
var BSONRegExp = /** @class */ (function () {
|
|
14163
14187
|
/**
|
|
@@ -14223,6 +14247,7 @@ Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }
|
|
|
14223
14247
|
/**
|
|
14224
14248
|
* A class representation of the BSON Symbol type.
|
|
14225
14249
|
* @public
|
|
14250
|
+
* @category BSONType
|
|
14226
14251
|
*/
|
|
14227
14252
|
var BSONSymbol = /** @class */ (function () {
|
|
14228
14253
|
/**
|
|
@@ -14265,7 +14290,10 @@ Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' });
|
|
|
14265
14290
|
|
|
14266
14291
|
/** @public */
|
|
14267
14292
|
var LongWithoutOverridesClass = Long;
|
|
14268
|
-
/**
|
|
14293
|
+
/**
|
|
14294
|
+
* @public
|
|
14295
|
+
* @category BSONType
|
|
14296
|
+
* */
|
|
14269
14297
|
var Timestamp = /** @class */ (function (_super) {
|
|
14270
14298
|
__extends(Timestamp, _super);
|
|
14271
14299
|
function Timestamp(low, high) {
|
|
@@ -44845,8 +44873,9 @@ module.exports = {
|
|
|
44845
44873
|
"use strict";
|
|
44846
44874
|
|
|
44847
44875
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44848
|
-
exports.
|
|
44849
|
-
exports.
|
|
44876
|
+
exports.Collection = exports.CancellationToken = exports.AggregationCursor = exports.Admin = exports.AbstractCursor = exports.MongoWriteConcernError = exports.MongoTransactionError = exports.MongoTopologyClosedError = exports.MongoTailableCursorError = exports.MongoSystemError = exports.MongoServerSelectionError = exports.MongoServerError = exports.MongoServerClosedError = exports.MongoRuntimeError = exports.MongoParseError = exports.MongoNotConnectedError = exports.MongoNetworkTimeoutError = exports.MongoNetworkError = exports.MongoMissingDependencyError = exports.MongoMissingCredentialsError = exports.MongoKerberosError = exports.MongoInvalidArgumentError = exports.MongoGridFSStreamError = exports.MongoGridFSChunkError = exports.MongoExpiredSessionError = exports.MongoError = exports.MongoDriverError = exports.MongoDecompressionError = exports.MongoCursorInUseError = exports.MongoCursorExhaustedError = exports.MongoCompatibilityError = exports.MongoChangeStreamError = exports.MongoBatchReExecutionError = exports.MongoAPIError = exports.MongoBulkWriteError = exports.ObjectID = exports.Timestamp = exports.ObjectId = exports.MinKey = exports.MaxKey = exports.Map = exports.Long = exports.Int32 = exports.Double = exports.Decimal128 = exports.DBRef = exports.Code = exports.BSONSymbol = exports.BSONRegExp = exports.Binary = void 0;
|
|
44877
|
+
exports.TopologyOpeningEvent = exports.TopologyDescriptionChangedEvent = exports.TopologyClosedEvent = exports.ServerOpeningEvent = exports.ServerHeartbeatSucceededEvent = exports.ServerHeartbeatStartedEvent = exports.ServerHeartbeatFailedEvent = exports.ServerDescriptionChangedEvent = exports.ServerClosedEvent = exports.ConnectionReadyEvent = exports.ConnectionPoolMonitoringEvent = exports.ConnectionPoolCreatedEvent = exports.ConnectionPoolClosedEvent = exports.ConnectionPoolClearedEvent = exports.ConnectionCreatedEvent = exports.ConnectionClosedEvent = exports.ConnectionCheckOutStartedEvent = exports.ConnectionCheckOutFailedEvent = exports.ConnectionCheckedOutEvent = exports.ConnectionCheckedInEvent = exports.CommandSucceededEvent = exports.CommandStartedEvent = exports.CommandFailedEvent = exports.WriteConcern = exports.ReadPreference = exports.ReadConcern = exports.TopologyType = exports.ServerType = exports.ReadPreferenceMode = exports.ReadConcernLevel = exports.ProfilingLevel = exports.ReturnDocument = exports.BSONType = exports.ServerApiVersion = exports.LoggerLevel = exports.ExplainVerbosity = exports.AutoEncryptionLoggerLevel = exports.CURSOR_FLAGS = exports.Compressor = exports.AuthMechanism = exports.GSSAPICanonicalizationValue = exports.BatchType = exports.Promise = exports.MongoClient = exports.Logger = exports.ListIndexesCursor = exports.ListCollectionsCursor = exports.GridFSBucket = exports.FindCursor = exports.Db = void 0;
|
|
44878
|
+
exports.SrvPollingEvent = void 0;
|
|
44850
44879
|
const admin_1 = __webpack_require__(126);
|
|
44851
44880
|
Object.defineProperty(exports, "Admin", { enumerable: true, get: function () { return admin_1.Admin; } });
|
|
44852
44881
|
const bson_1 = __webpack_require__(4);
|
|
@@ -44922,6 +44951,7 @@ Object.defineProperty(exports, "MongoServerClosedError", { enumerable: true, get
|
|
|
44922
44951
|
Object.defineProperty(exports, "MongoServerError", { enumerable: true, get: function () { return error_1.MongoServerError; } });
|
|
44923
44952
|
Object.defineProperty(exports, "MongoServerSelectionError", { enumerable: true, get: function () { return error_1.MongoServerSelectionError; } });
|
|
44924
44953
|
Object.defineProperty(exports, "MongoSystemError", { enumerable: true, get: function () { return error_1.MongoSystemError; } });
|
|
44954
|
+
Object.defineProperty(exports, "MongoTailableCursorError", { enumerable: true, get: function () { return error_1.MongoTailableCursorError; } });
|
|
44925
44955
|
Object.defineProperty(exports, "MongoTopologyClosedError", { enumerable: true, get: function () { return error_1.MongoTopologyClosedError; } });
|
|
44926
44956
|
Object.defineProperty(exports, "MongoTransactionError", { enumerable: true, get: function () { return error_1.MongoTransactionError; } });
|
|
44927
44957
|
Object.defineProperty(exports, "MongoWriteConcernError", { enumerable: true, get: function () { return error_1.MongoWriteConcernError; } });
|
|
@@ -49505,13 +49535,13 @@ function Provider(_ref) {
|
|
|
49505
49535
|
if (false) {}
|
|
49506
49536
|
|
|
49507
49537
|
/* harmony default export */ var components_Provider = (Provider);
|
|
49508
|
-
// EXTERNAL MODULE: /Users/
|
|
49538
|
+
// EXTERNAL MODULE: /Users/sergey.petushkov/Projects/MongoDB/compass/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
49509
49539
|
var esm_extends = __webpack_require__(17);
|
|
49510
49540
|
|
|
49511
|
-
// EXTERNAL MODULE: /Users/
|
|
49541
|
+
// EXTERNAL MODULE: /Users/sergey.petushkov/Projects/MongoDB/compass/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
49512
49542
|
var objectWithoutPropertiesLoose = __webpack_require__(24);
|
|
49513
49543
|
|
|
49514
|
-
// EXTERNAL MODULE: /Users/
|
|
49544
|
+
// EXTERNAL MODULE: /Users/sergey.petushkov/Projects/MongoDB/compass/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
|
49515
49545
|
var hoist_non_react_statics_cjs = __webpack_require__(56);
|
|
49516
49546
|
var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs);
|
|
49517
49547
|
|
|
@@ -52792,7 +52822,7 @@ class MongoAutoencryptionUnavailable extends Error {
|
|
|
52792
52822
|
}
|
|
52793
52823
|
exports.MongoAutoencryptionUnavailable = MongoAutoencryptionUnavailable;
|
|
52794
52824
|
async function connectWithFailFast(uri, client, logger) {
|
|
52795
|
-
var _a;
|
|
52825
|
+
var _a, _b;
|
|
52796
52826
|
const failedConnections = new Map();
|
|
52797
52827
|
let failEarlyClosePromise = null;
|
|
52798
52828
|
logger.emit('devtools-connect:connect-attempt-initialized', {
|
|
@@ -52843,7 +52873,9 @@ async function connectWithFailFast(uri, client, logger) {
|
|
|
52843
52873
|
finally {
|
|
52844
52874
|
client.removeListener('serverHeartbeatFailed', heartbeatFailureListener);
|
|
52845
52875
|
client.removeListener('serverHeartbeatSucceeded', heartbeatSucceededListener);
|
|
52846
|
-
logger.emit('devtools-connect:connect-attempt-finished'
|
|
52876
|
+
logger.emit('devtools-connect:connect-attempt-finished', {
|
|
52877
|
+
csfleVersionInfo: (_b = client === null || client === void 0 ? void 0 : client.autoEncrypter) === null || _b === void 0 ? void 0 : _b.csfleVersionInfo
|
|
52878
|
+
});
|
|
52847
52879
|
}
|
|
52848
52880
|
}
|
|
52849
52881
|
let resolveDnsHelpers;
|
|
@@ -52943,8 +52975,8 @@ async function connectMongoClient(uri, clientOptions, logger, MongoClientClass)
|
|
|
52943
52975
|
...clientOptions,
|
|
52944
52976
|
ca: ca.join('\n')
|
|
52945
52977
|
};
|
|
52946
|
-
delete clientOptions.useSystemCA;
|
|
52947
52978
|
}
|
|
52979
|
+
delete clientOptions.useSystemCA;
|
|
52948
52980
|
if (clientOptions.autoEncryption !== undefined &&
|
|
52949
52981
|
!clientOptions.autoEncryption.bypassAutoEncryption) {
|
|
52950
52982
|
const optionsWithoutFLE = { ...clientOptions };
|
|
@@ -52962,6 +52994,9 @@ async function connectMongoClient(uri, clientOptions, logger, MongoClientClass)
|
|
|
52962
52994
|
uri = await resolveMongodbSrv(uri, logger);
|
|
52963
52995
|
const client = new MongoClientClass(uri, clientOptions);
|
|
52964
52996
|
await connectWithFailFast(uri, client, logger);
|
|
52997
|
+
if (client.autoEncrypter) {
|
|
52998
|
+
client.autoEncrypter[Symbol.for('@@mdb.decorateDecryptionResult')] = true;
|
|
52999
|
+
}
|
|
52965
53000
|
return client;
|
|
52966
53001
|
}
|
|
52967
53002
|
exports.connectMongoClient = connectMongoClient;
|
|
@@ -53316,7 +53351,7 @@ module.exports = require("worker_threads");
|
|
|
53316
53351
|
/* 200 */
|
|
53317
53352
|
/***/ (function(module) {
|
|
53318
53353
|
|
|
53319
|
-
module.exports = JSON.parse("{\"name\":\"@mongodb-js/devtools-connect\",\"version\":\"1.
|
|
53354
|
+
module.exports = JSON.parse("{\"name\":\"@mongodb-js/devtools-connect\",\"version\":\"1.3.1\",\"description\":\"A connection establishment utility for MongoDB developer tools\",\"homepage\":\"https://github.com/mongodb-js/devtools-connect\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/mongodb-js/devtools-connect.git\"},\"publishConfig\":{\"access\":\"public\"},\"bugs\":{\"url\":\"https://github.com/mongodb-js/devtools-connect/issues\"},\"main\":\"lib/index.js\",\"exports\":{\"require\":\"./lib/index.js\",\"import\":\"./.esm-wrapper.mjs\"},\"files\":[\"LICENSE\",\"lib\",\"package.json\",\"README.md\",\".esm-wrapper.mjs\"],\"scripts\":{\"lint\":\"eslint src/**/*.ts\",\"testonly\":\"nyc mocha --colors -r ts-node/register src/*.spec.ts\",\"test\":\"npm run lint && npm run build && npm run testonly\",\"build\":\"npm run compile-ts && gen-esm-wrapper . ./.esm-wrapper.mjs\",\"prepack\":\"npm run build\",\"compile-ts\":\"tsc -p tsconfig.json\"},\"license\":\"Apache-2.0\",\"dependencies\":{\"system-ca\":\"^1.0.2\"},\"peerDependencies\":{\"mongodb\":\"^4.2.2\",\"mongodb-log-writer\":\"^1.1.3\"},\"devDependencies\":{\"@types/mocha\":\"^9.0.0\",\"@types/node\":\"^16.4.10\",\"@types/sinon\":\"^10.0.2\",\"@typescript-eslint/eslint-plugin\":\"^4.2.0\",\"@typescript-eslint/parser\":\"^4.2.0\",\"chai\":\"^4.3.4\",\"eslint\":\"^7.9.0\",\"eslint-config-semistandard\":\"^16.0.0\",\"eslint-config-standard\":\"^16.0.3\",\"eslint-plugin-import\":\"^2.22.0\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"5.1.x\",\"eslint-plugin-standard\":\"^5.0.0\",\"gen-esm-wrapper\":\"^1.1.0\",\"mocha\":\"^9.1.1\",\"mongodb\":\"^4.2.2\",\"mongodb-connection-string-url\":\"^2.3.2\",\"mongodb-log-writer\":\"^1.1.3\",\"nyc\":\"^15.1.0\",\"sinon-chai\":\"^3.7.0\",\"ts-node\":\"^10.2.1\",\"ts-sinon\":\"^2.0.1\",\"typescript\":\"^4.5.4\"},\"optionalDependencies\":{\"os-dns-native\":\"^1.2.0\",\"resolve-mongodb-srv\":\"^1.1.1\"}}");
|
|
53320
53355
|
|
|
53321
53356
|
/***/ }),
|
|
53322
53357
|
/* 201 */
|
|
@@ -58868,7 +58903,7 @@ module.exports = __webpack_require__(65).gunzipSync(
|
|
|
58868
58903
|
/* 314 */
|
|
58869
58904
|
/***/ (function(module) {
|
|
58870
58905
|
|
|
58871
|
-
module.exports = JSON.parse("{\"name\":\"mongodb\",\"version\":\"4.4.
|
|
58906
|
+
module.exports = JSON.parse("{\"name\":\"mongodb\",\"version\":\"4.4.1\",\"description\":\"The official MongoDB driver for Node.js\",\"main\":\"lib/index.js\",\"files\":[\"lib\",\"src\",\"etc/prepare.js\",\"mongodb.d.ts\",\"mongodb.ts34.d.ts\"],\"types\":\"mongodb.d.ts\",\"typesVersions\":{\"<=4.0.2\":{\"mongodb.d.ts\":[\"mongodb.ts34.d.ts\"]}},\"repository\":{\"type\":\"git\",\"url\":\"git@github.com:mongodb/node-mongodb-native.git\"},\"keywords\":[\"mongodb\",\"driver\",\"official\"],\"author\":{\"name\":\"The MongoDB NodeJS Team\",\"email\":\"dbx-node@mongodb.com\"},\"dependencies\":{\"bson\":\"^4.6.1\",\"denque\":\"^2.0.1\",\"mongodb-connection-string-url\":\"^2.5.2\",\"socks\":\"^2.6.2\"},\"devDependencies\":{\"@iarna/toml\":\"^2.2.5\",\"@istanbuljs/nyc-config-typescript\":\"^1.0.2\",\"@microsoft/api-extractor\":\"^7.19.4\",\"@microsoft/tsdoc-config\":\"^0.15.2\",\"@types/chai\":\"^4.3.0\",\"@types/chai-subset\":\"^1.3.3\",\"@types/kerberos\":\"^1.1.1\",\"@types/mocha\":\"^9.1.0\",\"@types/node\":\"^17.0.21\",\"@types/saslprep\":\"^1.0.1\",\"@types/semver\":\"^7.3.9\",\"@types/sinon\":\"^10.0.11\",\"@types/whatwg-url\":\"^8.2.1\",\"@typescript-eslint/eslint-plugin\":\"^5.13.0\",\"@typescript-eslint/parser\":\"^5.13.0\",\"bluebird\":\"^3.7.2\",\"chai\":\"^4.3.6\",\"chai-subset\":\"^1.6.0\",\"chalk\":\"^4.1.2\",\"downlevel-dts\":\"^0.9.0\",\"eslint\":\"^8.10.0\",\"eslint-config-prettier\":\"^8.4.0\",\"eslint-plugin-import\":\"^2.25.4\",\"eslint-plugin-prettier\":\"^4.0.0\",\"eslint-plugin-simple-import-sort\":\"^7.0.0\",\"eslint-plugin-tsdoc\":\"^0.2.14\",\"js-yaml\":\"^4.1.0\",\"lodash.camelcase\":\"^4.3.0\",\"mocha\":\"^9.2.1\",\"mocha-sinon\":\"^2.1.2\",\"nyc\":\"^15.1.0\",\"prettier\":\"^2.5.1\",\"rimraf\":\"^3.0.2\",\"semver\":\"^7.3.5\",\"sinon\":\"^13.0.1\",\"sinon-chai\":\"^3.7.0\",\"source-map-support\":\"^0.5.21\",\"standard-version\":\"^9.3.2\",\"ts-node\":\"^10.6.0\",\"tsd\":\"^0.19.1\",\"typescript\":\"^4.6.2\",\"typescript-cached-transpile\":\"^0.0.6\",\"xml2js\":\"^0.4.23\",\"yargs\":\"^17.3.1\"},\"license\":\"Apache-2.0\",\"engines\":{\"node\":\">=12.9.0\"},\"bugs\":{\"url\":\"https://jira.mongodb.org/projects/NODE/issues/\"},\"homepage\":\"https://github.com/mongodb/node-mongodb-native\",\"optionalDependencies\":{\"saslprep\":\"^1.0.3\"},\"scripts\":{\"build:evergreen\":\"node .evergreen/generate_evergreen_tasks.js\",\"build:ts\":\"rimraf lib && node ./node_modules/typescript/bin/tsc\",\"build:dts\":\"npm run build:ts && api-extractor run && rimraf 'lib/**/*.d.ts*' && downlevel-dts mongodb.d.ts mongodb.ts34.d.ts\",\"build:docs\":\"./etc/docs/generate-docs.ts\",\"build:typedoc\":\"typedoc\",\"check:bench\":\"node test/benchmarks/driverBench\",\"check:coverage\":\"nyc npm run test:all\",\"check:integration-coverage\":\"nyc npm run check:test\",\"check:lint\":\"npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd\",\"check:eslint\":\"eslint -v && eslint --max-warnings=0 --ext '.js,.ts' src test\",\"check:tsd\":\"tsd --version && tsd\",\"check:dts\":\"node ./node_modules/typescript/bin/tsc --noEmit mongodb.d.ts && tsd\",\"check:test\":\"mocha --config test/mocha_mongodb.json test/integration\",\"check:unit\":\"mocha test/unit\",\"check:ts\":\"node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit\",\"check:atlas\":\"mocha --config test/manual/mocharc.json test/manual/atlas_connectivity.test.js\",\"check:adl\":\"mocha --config test/mocha_mongodb.json test/manual/atlas-data-lake-testing\",\"check:aws\":\"mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_aws.test.js\",\"check:ocsp\":\"mocha --config test/manual/mocharc.json test/manual/ocsp_support.test.js\",\"check:kerberos\":\"mocha --config test/manual/mocharc.json test/manual/kerberos.test.js\",\"check:tls\":\"mocha --config test/manual/mocharc.json test/manual/tls_support.test.js\",\"check:ldap\":\"mocha --config test/manual/mocharc.json test/manual/ldap.test.js\",\"check:socks5\":\"mocha --config test/manual/mocharc.json test/manual/socks5.test.ts\",\"check:csfle\":\"mocha --config test/mocha_mongodb.json test/integration/client-side-encryption\",\"check:snappy\":\"mocha test/unit/assorted/snappy.test.js\",\"prepare\":\"node etc/prepare.js\",\"preview:docs\":\"python -m http.server --directory etc/docs/build\",\"release\":\"standard-version -i HISTORY.md\",\"test\":\"npm run check:lint && npm run test:all\",\"test:all\":\"npm run check:unit && npm run check:test\"},\"tsd\":{\"directory\":\"test/types\",\"compilerOptions\":{\"strict\":true,\"target\":\"esnext\",\"module\":\"commonjs\",\"moduleResolution\":\"node\"}}}");
|
|
58872
58907
|
|
|
58873
58908
|
/***/ }),
|
|
58874
58909
|
/* 315 */
|
|
@@ -61665,7 +61700,7 @@ class SocksClient extends events_1.EventEmitter {
|
|
|
61665
61700
|
super();
|
|
61666
61701
|
this.options = Object.assign({}, options);
|
|
61667
61702
|
// Validate SocksClientOptions
|
|
61668
|
-
helpers_1.validateSocksClientOptions(options);
|
|
61703
|
+
(0, helpers_1.validateSocksClientOptions)(options);
|
|
61669
61704
|
// Default state
|
|
61670
61705
|
this.setState(constants_1.SocksClientState.Created);
|
|
61671
61706
|
}
|
|
@@ -61681,7 +61716,7 @@ class SocksClient extends events_1.EventEmitter {
|
|
|
61681
61716
|
return new Promise((resolve, reject) => {
|
|
61682
61717
|
// Validate SocksClientOptions
|
|
61683
61718
|
try {
|
|
61684
|
-
helpers_1.validateSocksClientOptions(options, ['connect']);
|
|
61719
|
+
(0, helpers_1.validateSocksClientOptions)(options, ['connect']);
|
|
61685
61720
|
}
|
|
61686
61721
|
catch (err) {
|
|
61687
61722
|
if (typeof callback === 'function') {
|
|
@@ -61730,7 +61765,7 @@ class SocksClient extends events_1.EventEmitter {
|
|
|
61730
61765
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
61731
61766
|
// Validate SocksClientChainOptions
|
|
61732
61767
|
try {
|
|
61733
|
-
helpers_1.validateSocksClientChainOptions(options);
|
|
61768
|
+
(0, helpers_1.validateSocksClientChainOptions)(options);
|
|
61734
61769
|
}
|
|
61735
61770
|
catch (err) {
|
|
61736
61771
|
if (typeof callback === 'function') {
|
|
@@ -61744,7 +61779,7 @@ class SocksClient extends events_1.EventEmitter {
|
|
|
61744
61779
|
let sock;
|
|
61745
61780
|
// Shuffle proxies
|
|
61746
61781
|
if (options.randomizeChain) {
|
|
61747
|
-
util_1.shuffleArray(options.proxies);
|
|
61782
|
+
(0, util_1.shuffleArray)(options.proxies);
|
|
61748
61783
|
}
|
|
61749
61784
|
try {
|
|
61750
61785
|
// tslint:disable-next-line:no-increment-decrement
|
|
@@ -61754,7 +61789,8 @@ class SocksClient extends events_1.EventEmitter {
|
|
|
61754
61789
|
const nextDestination = i === options.proxies.length - 1
|
|
61755
61790
|
? options.destination
|
|
61756
61791
|
: {
|
|
61757
|
-
host: options.proxies[i + 1].
|
|
61792
|
+
host: options.proxies[i + 1].host ||
|
|
61793
|
+
options.proxies[i + 1].ipaddress,
|
|
61758
61794
|
port: options.proxies[i + 1].port,
|
|
61759
61795
|
};
|
|
61760
61796
|
// Creates the next connection in the chain.
|
|
@@ -62190,7 +62226,8 @@ class SocksClient extends events_1.EventEmitter {
|
|
|
62190
62226
|
}
|
|
62191
62227
|
sendSocks5CustomAuthentication() {
|
|
62192
62228
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62193
|
-
this.nextRequiredPacketBufferSize =
|
|
62229
|
+
this.nextRequiredPacketBufferSize =
|
|
62230
|
+
this.options.proxy.custom_auth_response_size;
|
|
62194
62231
|
this.socket.write(yield this.options.proxy.custom_auth_request_handler());
|
|
62195
62232
|
this.setState(constants_1.SocksClientState.SentAuthentication);
|
|
62196
62233
|
});
|
|
@@ -62222,7 +62259,8 @@ class SocksClient extends events_1.EventEmitter {
|
|
|
62222
62259
|
authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2));
|
|
62223
62260
|
}
|
|
62224
62261
|
else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) {
|
|
62225
|
-
authResult =
|
|
62262
|
+
authResult =
|
|
62263
|
+
yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2));
|
|
62226
62264
|
}
|
|
62227
62265
|
else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) {
|
|
62228
62266
|
authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size));
|
|
@@ -62891,7 +62929,7 @@ class SmartBuffer {
|
|
|
62891
62929
|
// Check for initial Buffer
|
|
62892
62930
|
}
|
|
62893
62931
|
else if (options.buff) {
|
|
62894
|
-
if (options.buff
|
|
62932
|
+
if (Buffer.isBuffer(options.buff)) {
|
|
62895
62933
|
this._buff = options.buff;
|
|
62896
62934
|
this.length = options.buff.length;
|
|
62897
62935
|
}
|
|
@@ -66910,6 +66948,7 @@ module.exports = function (modules) {
|
|
|
66910
66948
|
const MONGOCRYPT_CTX_NEED_MONGO_COLLINFO = 1;
|
|
66911
66949
|
const MONGOCRYPT_CTX_NEED_MONGO_MARKINGS = 2;
|
|
66912
66950
|
const MONGOCRYPT_CTX_NEED_MONGO_KEYS = 3;
|
|
66951
|
+
const MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS = 7;
|
|
66913
66952
|
const MONGOCRYPT_CTX_NEED_KMS = 4;
|
|
66914
66953
|
const MONGOCRYPT_CTX_READY = 5;
|
|
66915
66954
|
const MONGOCRYPT_CTX_DONE = 6;
|
|
@@ -66921,6 +66960,7 @@ module.exports = function (modules) {
|
|
|
66921
66960
|
[MONGOCRYPT_CTX_NEED_MONGO_COLLINFO, 'MONGOCRYPT_CTX_NEED_MONGO_COLLINFO'],
|
|
66922
66961
|
[MONGOCRYPT_CTX_NEED_MONGO_MARKINGS, 'MONGOCRYPT_CTX_NEED_MONGO_MARKINGS'],
|
|
66923
66962
|
[MONGOCRYPT_CTX_NEED_MONGO_KEYS, 'MONGOCRYPT_CTX_NEED_MONGO_KEYS'],
|
|
66963
|
+
[MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS, 'MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS'],
|
|
66924
66964
|
[MONGOCRYPT_CTX_NEED_KMS, 'MONGOCRYPT_CTX_NEED_KMS'],
|
|
66925
66965
|
[MONGOCRYPT_CTX_READY, 'MONGOCRYPT_CTX_READY'],
|
|
66926
66966
|
[MONGOCRYPT_CTX_DONE, 'MONGOCRYPT_CTX_DONE']
|
|
@@ -67062,6 +67102,22 @@ module.exports = function (modules) {
|
|
|
67062
67102
|
return;
|
|
67063
67103
|
}
|
|
67064
67104
|
|
|
67105
|
+
case MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS: {
|
|
67106
|
+
autoEncrypter
|
|
67107
|
+
.askForKMSCredentials()
|
|
67108
|
+
.then(kmsProviders => {
|
|
67109
|
+
context.provideKMSProviders(
|
|
67110
|
+
!Buffer.isBuffer(kmsProviders) ? bson.serialize(kmsProviders) : kmsProviders
|
|
67111
|
+
);
|
|
67112
|
+
this.execute(autoEncrypter, context, callback);
|
|
67113
|
+
})
|
|
67114
|
+
.catch(err => {
|
|
67115
|
+
callback(err, null);
|
|
67116
|
+
});
|
|
67117
|
+
|
|
67118
|
+
return;
|
|
67119
|
+
}
|
|
67120
|
+
|
|
67065
67121
|
case MONGOCRYPT_CTX_NEED_KMS: {
|
|
67066
67122
|
const promises = [];
|
|
67067
67123
|
|
|
@@ -67567,20 +67623,13 @@ module.exports = function (modules) {
|
|
|
67567
67623
|
this._client = client;
|
|
67568
67624
|
this._bson = options.bson || client.topology.bson;
|
|
67569
67625
|
this._bypassEncryption = options.bypassAutoEncryption === true;
|
|
67570
|
-
if (!this._bypassAutoEncryption) {
|
|
67571
|
-
this._mongocryptdManager = new MongocryptdManager(options.extraOptions);
|
|
67572
|
-
this._mongocryptdClient = new MongoClient(this._mongocryptdManager.uri, {
|
|
67573
|
-
useNewUrlParser: true,
|
|
67574
|
-
useUnifiedTopology: true,
|
|
67575
|
-
serverSelectionTimeoutMS: 10000
|
|
67576
|
-
});
|
|
67577
|
-
}
|
|
67578
67626
|
|
|
67579
67627
|
this._keyVaultNamespace = options.keyVaultNamespace || 'admin.datakeys';
|
|
67580
67628
|
this._keyVaultClient = options.keyVaultClient || client;
|
|
67581
67629
|
this._metaDataClient = options.metadataClient || client;
|
|
67582
67630
|
this._proxyOptions = options.proxyOptions || {};
|
|
67583
67631
|
this._tlsOptions = options.tlsOptions || {};
|
|
67632
|
+
this._onKmsProviderRefresh = options.onKmsProviderRefresh;
|
|
67584
67633
|
|
|
67585
67634
|
const mongoCryptOptions = {};
|
|
67586
67635
|
if (options.schemaMap) {
|
|
@@ -67589,19 +67638,57 @@ module.exports = function (modules) {
|
|
|
67589
67638
|
: this._bson.serialize(options.schemaMap);
|
|
67590
67639
|
}
|
|
67591
67640
|
|
|
67641
|
+
if (options.encryptedFieldsMap) {
|
|
67642
|
+
mongoCryptOptions.encryptedFieldsMap = Buffer.isBuffer(options.encryptedFieldsMap)
|
|
67643
|
+
? options.encryptedFieldsMap
|
|
67644
|
+
: this._bson.serialize(options.encryptedFieldsMap);
|
|
67645
|
+
}
|
|
67646
|
+
|
|
67592
67647
|
if (options.kmsProviders) {
|
|
67593
67648
|
mongoCryptOptions.kmsProviders = !Buffer.isBuffer(options.kmsProviders)
|
|
67594
67649
|
? this._bson.serialize(options.kmsProviders)
|
|
67595
67650
|
: options.kmsProviders;
|
|
67651
|
+
} else if (!options.onKmsProviderRefresh) {
|
|
67652
|
+
throw new TypeError('Need to specify either kmsProviders ahead of time or when requested');
|
|
67596
67653
|
}
|
|
67597
67654
|
|
|
67598
67655
|
if (options.logger) {
|
|
67599
67656
|
mongoCryptOptions.logger = options.logger;
|
|
67600
67657
|
}
|
|
67601
67658
|
|
|
67659
|
+
if (options.extraOptions && options.extraOptions.csflePath) {
|
|
67660
|
+
mongoCryptOptions.csflePath = options.extraOptions.csflePath;
|
|
67661
|
+
}
|
|
67662
|
+
|
|
67663
|
+
if (options.extraOptions && options.extraOptions.csfleSearchPaths) {
|
|
67664
|
+
// Only for driver testing
|
|
67665
|
+
mongoCryptOptions.csfleSearchPaths = options.extraOptions.csfleSearchPaths;
|
|
67666
|
+
} else if (!this._bypassEncryption) {
|
|
67667
|
+
mongoCryptOptions.csfleSearchPaths = ['$SYSTEM'];
|
|
67668
|
+
}
|
|
67669
|
+
|
|
67670
|
+
if (options.bypassQueryAnalysis) {
|
|
67671
|
+
mongoCryptOptions.bypassQueryAnalysis = options.bypassQueryAnalysis;
|
|
67672
|
+
}
|
|
67673
|
+
|
|
67602
67674
|
Object.assign(mongoCryptOptions, { cryptoCallbacks });
|
|
67603
67675
|
this._mongocrypt = new mc.MongoCrypt(mongoCryptOptions);
|
|
67604
67676
|
this._contextCounter = 0;
|
|
67677
|
+
|
|
67678
|
+
if (options.extraOptions && options.extraOptions.csfleRequired && !this.csfleVersionInfo) {
|
|
67679
|
+
throw new MongoError('`csfleRequired` set but no csfle shared library loaded');
|
|
67680
|
+
}
|
|
67681
|
+
|
|
67682
|
+
// Only instantiate mongocryptd manager/client once we know for sure
|
|
67683
|
+
// that we are not using the CSFLE shared library.
|
|
67684
|
+
if (!this._bypassEncryption && !this.csfleVersionInfo) {
|
|
67685
|
+
this._mongocryptdManager = new MongocryptdManager(options.extraOptions);
|
|
67686
|
+
this._mongocryptdClient = new MongoClient(this._mongocryptdManager.uri, {
|
|
67687
|
+
useNewUrlParser: true,
|
|
67688
|
+
useUnifiedTopology: true,
|
|
67689
|
+
serverSelectionTimeoutMS: 10000
|
|
67690
|
+
});
|
|
67691
|
+
}
|
|
67605
67692
|
}
|
|
67606
67693
|
|
|
67607
67694
|
/**
|
|
@@ -67609,7 +67696,7 @@ module.exports = function (modules) {
|
|
|
67609
67696
|
* @param {Function} callback Invoked when the mongocryptd client either successfully connects or errors
|
|
67610
67697
|
*/
|
|
67611
67698
|
init(callback) {
|
|
67612
|
-
if (this._bypassEncryption) {
|
|
67699
|
+
if (this._bypassEncryption || this.csfleVersionInfo) {
|
|
67613
67700
|
return callback();
|
|
67614
67701
|
}
|
|
67615
67702
|
const _callback = (err, res) => {
|
|
@@ -67641,7 +67728,11 @@ module.exports = function (modules) {
|
|
|
67641
67728
|
* @param {Function} callback Invoked when the mongocryptd client either successfully disconnects or errors
|
|
67642
67729
|
*/
|
|
67643
67730
|
teardown(force, callback) {
|
|
67644
|
-
this._mongocryptdClient
|
|
67731
|
+
if (this._mongocryptdClient) {
|
|
67732
|
+
this._mongocryptdClient.close(force, callback);
|
|
67733
|
+
} else {
|
|
67734
|
+
callback();
|
|
67735
|
+
}
|
|
67645
67736
|
}
|
|
67646
67737
|
|
|
67647
67738
|
/**
|
|
@@ -67730,13 +67821,82 @@ module.exports = function (modules) {
|
|
|
67730
67821
|
proxyOptions: this._proxyOptions,
|
|
67731
67822
|
tlsOptions: this._tlsOptions
|
|
67732
67823
|
});
|
|
67733
|
-
|
|
67824
|
+
|
|
67825
|
+
const decorateResult = this[Symbol.for('@@mdb.decorateDecryptionResult')];
|
|
67826
|
+
stateMachine.execute(this, context, function (err, result) {
|
|
67827
|
+
// Only for testing/internal usage
|
|
67828
|
+
if (!err && result && decorateResult) {
|
|
67829
|
+
err = decorateDecryptionResult(result, response, bson);
|
|
67830
|
+
if (err) return callback(err);
|
|
67831
|
+
}
|
|
67832
|
+
callback(err, result);
|
|
67833
|
+
});
|
|
67834
|
+
}
|
|
67835
|
+
|
|
67836
|
+
/**
|
|
67837
|
+
* Ask the user for KMS credentials.
|
|
67838
|
+
*
|
|
67839
|
+
* This returns anything that looks like the kmsProviders original input
|
|
67840
|
+
* option. It can be empty, and any provider specified here will override
|
|
67841
|
+
* the original ones.
|
|
67842
|
+
*/
|
|
67843
|
+
async askForKMSCredentials() {
|
|
67844
|
+
return this._onKmsProviderRefresh ? this._onKmsProviderRefresh() : {};
|
|
67845
|
+
}
|
|
67846
|
+
|
|
67847
|
+
/**
|
|
67848
|
+
* Return the current libmongocrypt's CSFLE shared library version
|
|
67849
|
+
* as `{ version: bigint, versionStr: string }`, or `null` if no CSFLE
|
|
67850
|
+
* shared library was loaded.
|
|
67851
|
+
*/
|
|
67852
|
+
get csfleVersionInfo() {
|
|
67853
|
+
return this._mongocrypt.csfleVersionInfo;
|
|
67734
67854
|
}
|
|
67735
67855
|
}
|
|
67736
67856
|
|
|
67737
67857
|
return { AutoEncrypter };
|
|
67738
67858
|
};
|
|
67739
67859
|
|
|
67860
|
+
/**
|
|
67861
|
+
* Recurse through the (identically-shaped) `decrypted` and `original`
|
|
67862
|
+
* objects and attach a `decryptedKeys` property on each sub-object that
|
|
67863
|
+
* contained encrypted fields. Because we only call this on BSON responses,
|
|
67864
|
+
* we do not need to worry about circular references.
|
|
67865
|
+
*/
|
|
67866
|
+
function decorateDecryptionResult(decrypted, original, bson, isTopLevelDecorateCall = true) {
|
|
67867
|
+
const decryptedKeys = Symbol.for('@@mdb.decryptedKeys');
|
|
67868
|
+
if (isTopLevelDecorateCall) {
|
|
67869
|
+
// The original value could have been either a JS object or a BSON buffer
|
|
67870
|
+
if (Buffer.isBuffer(original)) {
|
|
67871
|
+
original = bson.deserialize(original);
|
|
67872
|
+
}
|
|
67873
|
+
if (Buffer.isBuffer(decrypted)) {
|
|
67874
|
+
return new Error('Expected result of decryption to be deserialized BSON object');
|
|
67875
|
+
}
|
|
67876
|
+
}
|
|
67877
|
+
|
|
67878
|
+
if (!decrypted || typeof decrypted !== 'object') return;
|
|
67879
|
+
for (const k of Object.keys(decrypted)) {
|
|
67880
|
+
const originalValue = original[k];
|
|
67881
|
+
|
|
67882
|
+
// An object was decrypted by libmongocrypt if and only if it was
|
|
67883
|
+
// a BSON Binary object with subtype 6.
|
|
67884
|
+
if (originalValue && originalValue._bsontype === 'Binary' && originalValue.sub_type === 6) {
|
|
67885
|
+
if (!decrypted[decryptedKeys]) {
|
|
67886
|
+
Object.defineProperty(decrypted, decryptedKeys, {
|
|
67887
|
+
value: [],
|
|
67888
|
+
configurable: true,
|
|
67889
|
+
enumerable: false,
|
|
67890
|
+
writable: false
|
|
67891
|
+
});
|
|
67892
|
+
}
|
|
67893
|
+
decrypted[decryptedKeys].push(k);
|
|
67894
|
+
}
|
|
67895
|
+
|
|
67896
|
+
decorateDecryptionResult(decrypted[k], originalValue, bson, false);
|
|
67897
|
+
}
|
|
67898
|
+
}
|
|
67899
|
+
|
|
67740
67900
|
|
|
67741
67901
|
/***/ }),
|
|
67742
67902
|
/* 362 */
|
|
@@ -67905,8 +68065,11 @@ module.exports = function (modules) {
|
|
|
67905
68065
|
// kmsProviders will be parsed by libmongocrypt, must be provided as BSON binary data
|
|
67906
68066
|
if (options.kmsProviders && !Buffer.isBuffer(options.kmsProviders)) {
|
|
67907
68067
|
options.kmsProviders = this._bson.serialize(options.kmsProviders);
|
|
68068
|
+
} else if (!options.onKmsProviderRefresh) {
|
|
68069
|
+
throw new TypeError('Need to specify either kmsProviders ahead of time or when requested');
|
|
67908
68070
|
}
|
|
67909
68071
|
|
|
68072
|
+
this._onKmsProviderRefresh = options.onKmsProviderRefresh;
|
|
67910
68073
|
this._keyVaultNamespace = options.keyVaultNamespace;
|
|
67911
68074
|
this._keyVaultClient = options.keyVaultClient || client;
|
|
67912
68075
|
this._mongoCrypt = new mc.MongoCrypt(options);
|
|
@@ -68190,6 +68353,17 @@ module.exports = function (modules) {
|
|
|
68190
68353
|
});
|
|
68191
68354
|
});
|
|
68192
68355
|
}
|
|
68356
|
+
|
|
68357
|
+
/**
|
|
68358
|
+
* Ask the user for KMS credentials.
|
|
68359
|
+
*
|
|
68360
|
+
* This returns anything that looks like the kmsProviders original input
|
|
68361
|
+
* option. It can be empty, and any provider specified here will override
|
|
68362
|
+
* the original ones.
|
|
68363
|
+
*/
|
|
68364
|
+
async askForKMSCredentials() {
|
|
68365
|
+
return this._onKmsProviderRefresh ? this._onKmsProviderRefresh() : {};
|
|
68366
|
+
}
|
|
68193
68367
|
}
|
|
68194
68368
|
|
|
68195
68369
|
return { ClientEncryption };
|
|
@@ -68225,8 +68399,17 @@ function hookLogger(emitter, log, contextPrefix, redactURICredentials) {
|
|
|
68225
68399
|
emitter.on('devtools-connect:connect-fail-early', function () {
|
|
68226
68400
|
log.warn('DEVTOOLS-CONNECT', mongoLogId(1000000036), `${contextPrefix}-connect`, 'Aborting connection attempt as irrecoverable');
|
|
68227
68401
|
});
|
|
68228
|
-
emitter.on('devtools-connect:connect-attempt-finished', function () {
|
|
68229
|
-
|
|
68402
|
+
emitter.on('devtools-connect:connect-attempt-finished', function (ev) {
|
|
68403
|
+
let attr;
|
|
68404
|
+
if (ev.csfleVersionInfo) {
|
|
68405
|
+
attr = {
|
|
68406
|
+
csfleVersionInfo: {
|
|
68407
|
+
version: ev.csfleVersionInfo.version.toString(16),
|
|
68408
|
+
versionStr: ev.csfleVersionInfo.versionStr
|
|
68409
|
+
}
|
|
68410
|
+
};
|
|
68411
|
+
}
|
|
68412
|
+
log.info('DEVTOOLS-CONNECT', mongoLogId(1000000037), `${contextPrefix}-connect`, 'Connection attempt finished', attr);
|
|
68230
68413
|
});
|
|
68231
68414
|
emitter.on('devtools-connect:resolve-srv-error', function (ev) {
|
|
68232
68415
|
var _a;
|
|
@@ -69088,7 +69271,7 @@ var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_)
|
|
|
69088
69271
|
// EXTERNAL MODULE: ./node_modules/react-redux/es/index.js + 23 modules
|
|
69089
69272
|
var es = __webpack_require__(159);
|
|
69090
69273
|
|
|
69091
|
-
// CONCATENATED MODULE: /Users/
|
|
69274
|
+
// CONCATENATED MODULE: /Users/sergey.petushkov/Projects/MongoDB/compass/node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
69092
69275
|
function _defineProperty(obj, key, value) {
|
|
69093
69276
|
if (key in obj) {
|
|
69094
69277
|
Object.defineProperty(obj, key, {
|
|
@@ -69103,7 +69286,7 @@ function _defineProperty(obj, key, value) {
|
|
|
69103
69286
|
|
|
69104
69287
|
return obj;
|
|
69105
69288
|
}
|
|
69106
|
-
// CONCATENATED MODULE: /Users/
|
|
69289
|
+
// CONCATENATED MODULE: /Users/sergey.petushkov/Projects/MongoDB/compass/node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
69107
69290
|
|
|
69108
69291
|
|
|
69109
69292
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -69131,7 +69314,7 @@ function _objectSpread2(target) {
|
|
|
69131
69314
|
|
|
69132
69315
|
return target;
|
|
69133
69316
|
}
|
|
69134
|
-
// CONCATENATED MODULE: /Users/
|
|
69317
|
+
// CONCATENATED MODULE: /Users/sergey.petushkov/Projects/MongoDB/compass/node_modules/redux/es/redux.js
|
|
69135
69318
|
|
|
69136
69319
|
|
|
69137
69320
|
/**
|
|
@@ -69932,7 +70115,7 @@ const modules_reducer = combineReducers({
|
|
|
69932
70115
|
runtime: reducer
|
|
69933
70116
|
});
|
|
69934
70117
|
/* harmony default export */ var modules = (modules_reducer);
|
|
69935
|
-
// EXTERNAL MODULE: /Users/
|
|
70118
|
+
// EXTERNAL MODULE: /Users/sergey.petushkov/Projects/MongoDB/compass/node_modules/@mongosh/logging/lib/index.js
|
|
69936
70119
|
var lib = __webpack_require__(161);
|
|
69937
70120
|
|
|
69938
70121
|
// EXTERNAL MODULE: ../compass-logging/dist/index.js
|
|
@@ -70123,7 +70306,7 @@ function createPlugin() {
|
|
|
70123
70306
|
|
|
70124
70307
|
Object(external_react_["useEffect"])(() => {
|
|
70125
70308
|
let mounted = true;
|
|
70126
|
-
Promise.all(/* import() */[__webpack_require__.e(1), __webpack_require__.e(2)]).then(__webpack_require__.bind(null,
|
|
70309
|
+
Promise.all(/* import() */[__webpack_require__.e(1), __webpack_require__.e(2)]).then(__webpack_require__.bind(null, 466)).then(({
|
|
70127
70310
|
default: Component
|
|
70128
70311
|
}) => {
|
|
70129
70312
|
if (mounted) {
|