From 7c3e99e36fd97421a1156db1145e9a89030f735f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 10:19:05 +0200 Subject: [PATCH 01/14] Copied files from https://github.com/mongodb-js/mongodb-build-info --- packages/mongodb-build-info/.eslintignore | 1 + packages/mongodb-build-info/.eslintrc | 9 + packages/mongodb-build-info/LICENSE | 201 ++++++++++++ packages/mongodb-build-info/README.md | 77 +++++ packages/mongodb-build-info/index.d.ts | 22 ++ packages/mongodb-build-info/index.js | 122 +++++++ packages/mongodb-build-info/package.json | 41 +++ packages/mongodb-build-info/test/fixtures.js | 132 ++++++++ .../mongodb-build-info/test/index.spec.js | 307 ++++++++++++++++++ 9 files changed, 912 insertions(+) create mode 100644 packages/mongodb-build-info/.eslintignore create mode 100644 packages/mongodb-build-info/.eslintrc create mode 100644 packages/mongodb-build-info/LICENSE create mode 100644 packages/mongodb-build-info/README.md create mode 100644 packages/mongodb-build-info/index.d.ts create mode 100644 packages/mongodb-build-info/index.js create mode 100644 packages/mongodb-build-info/package.json create mode 100644 packages/mongodb-build-info/test/fixtures.js create mode 100644 packages/mongodb-build-info/test/index.spec.js diff --git a/packages/mongodb-build-info/.eslintignore b/packages/mongodb-build-info/.eslintignore new file mode 100644 index 00000000..05d75c56 --- /dev/null +++ b/packages/mongodb-build-info/.eslintignore @@ -0,0 +1 @@ +test/fixtures.js diff --git a/packages/mongodb-build-info/.eslintrc b/packages/mongodb-build-info/.eslintrc new file mode 100644 index 00000000..42452669 --- /dev/null +++ b/packages/mongodb-build-info/.eslintrc @@ -0,0 +1,9 @@ +{ + "env": { + "es6": true + }, + "rules": { + "strict": 0 + }, + "extends": ["mongodb-js/node"] +} diff --git a/packages/mongodb-build-info/LICENSE b/packages/mongodb-build-info/LICENSE new file mode 100644 index 00000000..628cffed --- /dev/null +++ b/packages/mongodb-build-info/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 MongoDB Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/mongodb-build-info/README.md b/packages/mongodb-build-info/README.md new file mode 100644 index 00000000..b64339a3 --- /dev/null +++ b/packages/mongodb-build-info/README.md @@ -0,0 +1,77 @@ +# mongodb-build-info + +Helpful functions to figure out if a connection is on Atlas, Atlas Data Lake, +Enterpise, or DocumentDB/CosmosDB. + +# Usage +```js +const getBuildInfo = require('mongodb-build-info') +const MongoClient = require('mongodb').MongoClient + +MongoClient.connect('localhost:27017', function (err, client) { + const adminDB = client.db('test').admin() + let buildInfo; + + adminDB.command({ buildInfo: 1 }, {}, parseBuildInfo) + adminDB.command({ getCmdLineOpts: 1 }, {}, parseCmdLineOpts) + + function parseBuildInfo (err, res) { + if (err) console.log('Command failed, ', err) + buildInfo = res + + const { isDataLake, dlVersion } = getBuildInfo.getDataLake(buildInfo) + const isEnterprise = getBuildInfo.isEnterprise(buildInfo) + } + + function parseCmdLineOpts (err, res) { + if (err) console.log('Command failed', err.message) + + const { isGenuine, serverName } = getGenuineMongoDB(buildInfo, res) + } +}) +``` + +## API +### getDataLake(buildInfo) +Returns an object: + +__isDataLake__: boolean. +__dlVersion__: version of dataLake, a string. + +### isEnterprise(buildInfo) +Returns a boolean. + +### isAtlas(uri) +Returns a boolean. + +### isLocalAtlas(count: (db: string, coll: string, query: Document) => Promise\) +Returns a Promise\. + +### isAtlasStream(uri) +Returns a boolean. + +### isLocalhost(uri) +Returns a boolean. + +### isDigitalOcean(uri) +Returns a boolean. + +### getGenuineMongoDB(buildInfo, cmdLineOpts) +Returns an object: + +__isGenuine__: boolean. +__serverName__: name of the server (mongoDB, cosmosDB, or documentDB). + +### getBuildEnv(buildInfo) +Returns an object: + +__serverOs__: build's OS version (macOS, linux, windows etc.). +__serverArch__: build's architecture (e.g. x86_64). + +# Installation +``` +npm install -S mongodb-build-info +``` + +# License +Apache-2.0 diff --git a/packages/mongodb-build-info/index.d.ts b/packages/mongodb-build-info/index.d.ts new file mode 100644 index 00000000..b72fbbd6 --- /dev/null +++ b/packages/mongodb-build-info/index.d.ts @@ -0,0 +1,22 @@ +export declare function getDataLake(buildInfo: any): { + isDataLake: boolean; + dlVersion: string; +}; + +export declare function isEnterprise(buildInfo: any): boolean; +export declare function isAtlas(uri: string): boolean; +type IsLocalAtlasCountFn = (db: string, ns: string, query: Record) => Promise; +export declare function isLocalAtlas(countFn: IsLocalAtlasCountFn): Promise; +export declare function isAtlasStream(uri: string): boolean; +export declare function isLocalhost(uri: string): boolean; +export declare function isDigitalOcean(uri: string): boolean; + +export declare function getGenuineMongoDB(uri: string): { + isGenuine: boolean; + serverName: string; +}; + +export declare function getBuildEnv(buildInfo: any): { + serverOs: string; + serverArch: string; +}; diff --git a/packages/mongodb-build-info/index.js b/packages/mongodb-build-info/index.js new file mode 100644 index 00000000..803423ee --- /dev/null +++ b/packages/mongodb-build-info/index.js @@ -0,0 +1,122 @@ +const { default: ConnectionString } = require('mongodb-connection-string-url'); + +const ATLAS_REGEX = /\.mongodb(-dev|-qa|-stage)?\.net$/i; +const ATLAS_STREAM_REGEX = /^atlas-stream-.+/i; +const LOCALHOST_REGEX = /^(localhost|127\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])|0\.0\.0\.0|(?:0*\:)*?:?0*1)$/i; +const DIGITAL_OCEAN_REGEX = /\.mongo\.ondigitalocean\.com$/i; +const COSMOS_DB_REGEX = /\.cosmos\.azure\.com$/i; +const DOCUMENT_DB_REGEX = /docdb(-elastic)?\.amazonaws\.com$/i; + +function getDataLake(buildInfo) { + const res = { + isDataLake: false, + dlVersion: null + }; + + if (buildInfo.dataLake) { + res.isDataLake = true; + res.dlVersion = buildInfo.dataLake.version; + } + + return res; +} + +function isEnterprise(buildInfo) { + if (buildInfo.gitVersion && buildInfo.gitVersion.match(/enterprise/)) { + return true; + } + + if (buildInfo.modules && buildInfo.modules.indexOf('enterprise') !== -1) { + return true; + } + + return false; +} + +function getHostnameFromHost(host) { + if (host.startsWith('[')) { + // If it's ipv6 return what's in the brackets. + return host.substring(1).split(']')[0]; + } + return host.split(':')[0]; +} + +function getHostnameFromUrl(url) { + if (typeof url !== 'string') { + return ''; + } + + try { + const connectionString = new ConnectionString(url); + return getHostnameFromHost(connectionString.hosts[0]); + } catch (e) { + // we assume is already an hostname, will further be checked against regexes + return getHostnameFromHost(url); + } +} + +function isAtlas(uri) { + return !!getHostnameFromUrl(uri).match(ATLAS_REGEX); +} + +function isLocalAtlas(countFn) { + return countFn('admin', 'atlascli', { + managedClusterType: 'atlasCliLocalDevCluster' + }).then(count => count > 0).catch(() => false); +} + +function isAtlasStream(uri) { + const host = getHostnameFromUrl(uri); + return !!(host.match(ATLAS_REGEX) && host.match(ATLAS_STREAM_REGEX)); +} + +function isLocalhost(uri) { + return !!getHostnameFromUrl(uri).match(LOCALHOST_REGEX); +} + +function isDigitalOcean(uri) { + return !!getHostnameFromUrl(uri).match(DIGITAL_OCEAN_REGEX); +} + +function getBuildEnv(buildInfo) { + const serverOs = buildInfo.buildEnvironment ? + buildInfo.buildEnvironment.target_os : null; + const serverArch = buildInfo.buildEnvironment ? + buildInfo.buildEnvironment.target_arch : null; + + return { serverOs, serverArch }; +} + +function getGenuineMongoDB(uri) { + const hostname = getHostnameFromUrl(uri); + if (hostname.match(COSMOS_DB_REGEX)) { + return { + isGenuine: false, + serverName: 'cosmosdb' + }; + } + + if (hostname.match(DOCUMENT_DB_REGEX)) { + return { + isGenuine: false, + serverName: 'documentdb' + }; + } + + return { + isGenuine: true, + serverName: 'mongodb' + }; +} + +module.exports = { + getDataLake, + isEnterprise, + isAtlas, + isLocalAtlas, + isAtlasStream, + isLocalhost, + isDigitalOcean, + getGenuineMongoDB, + getBuildEnv +}; diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json new file mode 100644 index 00000000..e0e53684 --- /dev/null +++ b/packages/mongodb-build-info/package.json @@ -0,0 +1,41 @@ +{ + "name": "mongodb-build-info", + "version": "1.7.2", + "description": "Extract information from mongodb's buildInfo", + "main": "index.js", + "scripts": { + "lint": "eslint .", + "depcheck": "depcheck", + "check": "npm run depcheck && npm run lint", + "test": "mocha test/index.spec.js", + "release": "release-it" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mongodb-js/mongodb-build-info.git" + }, + "keywords": [ + "buildInfo", + "mongodb", + "compass-tools", + "mongodb.js" + ], + "author": "Irina Shestak ", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/mongodb-js/mongodb-build-info/issues" + }, + "homepage": "https://github.com/mongodb-js/mongodb-build-info#readme", + "devDependencies": { + "chai": "^4.2.0", + "depcheck": "^1.4.2", + "eslint": "^8.3.0", + "eslint-config-mongodb-js": "^5.0.3", + "mocha": "^7.1.2", + "release-it": "^14.11.8" + }, + "dependencies": { + "mongodb-connection-string-url": "^3.0.0" + }, + "release-it": {} +} diff --git a/packages/mongodb-build-info/test/fixtures.js b/packages/mongodb-build-info/test/fixtures.js new file mode 100644 index 00000000..70b90aec --- /dev/null +++ b/packages/mongodb-build-info/test/fixtures.js @@ -0,0 +1,132 @@ +const BUILD_INFO_OLD = { + "version" : "2.6.11", + "gitVersion" : "d00c1735675c457f75a12d530bee85421f0c5548 modules: enterprise", + "OpenSSLVersion" : "OpenSSL 1.0.1f 6 Jan 2014", + "sysInfo" : "Linux ip-10-203-203-194 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49", + "loaderFlags" : "-fPIC -pthread -Wl,-z,now -rdynamic -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-E", + "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -fno-builtin-memcmp", + "allocator" : "tcmalloc", + "versionArray" : [ + 2, + 6, + 11, + 0 + ], + "javascriptEngine" : "V8", + "bits" : 64, + "debug" : false, + "maxBsonObjectSize" : 16777216, + "ok" : 1 +}; + +const BUILD_INFO_3_2 = { + "version" : "3.2.0-rc2", + "gitVersion" : "8a3acb42742182c5e314636041c2df368232bbc5", + "modules" : [ + "enterprise" + ], + "allocator" : "system", + "javascriptEngine" : "mozjs", + "sysInfo" : "deprecated", + "versionArray" : [ + 3, + 2, + 0, + -48 + ], + "openssl" : { + "running" : "OpenSSL 0.9.8zg 14 July 2015", + "compiled" : "OpenSSL 0.9.8y 5 Feb 2013" + }, + "buildEnvironment" : { + "distmod" : "", + "distarch" : "x86_64", + "cc" : "gcc: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", + "ccflags" : "-fno-omit-frame-pointer -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -Wno-missing-braces -mmacosx-version-min=10.7 -fno-builtin-memcmp", + "cxx" : "g++: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", + "cxxflags" : "-Wnon-virtual-dtor -Woverloaded-virtual -stdlib=libc++ -std=c++11", + "linkflags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.7 -stdlib=libc++ -fuse-ld=gold", + "target_arch" : "x86_64", + "target_os" : "osx" + }, + "bits" : 64, + "debug" : false, + "maxBsonObjectSize" : 16777216, + "storageEngines" : [ + "devnull", + "ephemeralForTest", + "inMemory", + "mmapv1", + "wiredTiger" + ], + "ok" : 1 +}; + +const CMD_LINE_OPTS = { + "argv" : [ + "/opt/mongodb-osx-x86_64-enterprise-3.6.3/bin/mongod", + "--dbpath=/Users/user/testdata" + ], + "parsed" : { + "storage" : { + "dbPath" : "/Users/user/testdata" + } + }, + "ok" : 1 +}; + +const COSMOS_DB_URI = [ + 'mongodb://x:y@compass-serverless.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass-serverless@', + 'mongodb://x:y@compass.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass@', + 'mongodb+srv://x:y@compass-vcore.mongocluster.cosmos.azure.com/?retrywrites=false&maxIdleTimeMS=120000' +] + +const DOCUMENT_DB_URIS = [ + "mongodb://x:y@docdb-2001-01-01-01-01-01.cluster-abc.eu-central-1.docdb.amazonaws.com:27017/?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false", + "mongodb://x:y@elastic-docdb-123456789.eu-central-1.docdb-elastic.amazonaws.com:27017" +]; + +const COSMOSDB_BUILD_INFO = { + "_t" : "BuildInfoResponse", + "ok" : 1, + "version" : "3.2.0", + "gitVersion" : "45d947729a0315accb6d4f15a6b06be6d9c19fe7", + "targetMinOS" : "Windows 7/Windows Server 2008 R2", + "modules" : [ ], + "allocator" : "tcmalloc", + "javascriptEngine" : "Chakra", + "sysInfo" : "deprecated", + "versionArray" : [ + 3, + 2, + 0, + 0 + ], + "bits" : 64, + "debug" : false, + "maxBsonObjectSize" : 524288, + "openssl" : { + "running" : "OpenSSL 1.0.1p-fips 9 Jul 2015", + "compiled" : "OpenSSL 1.0.1p-fips 9 Jul 2015" + } +}; + +const DATALAKE_BUILD_INFO = { + "ok": 1, + "version": "3.6.0", + "versionArray": [ 3, 6, 0, 0 ], + "dataLake": { + "version": "v20200329", + "gitVersion": "0f318ss78bfad79ede3721e91iasj6f61644f", + "date": "2020-03-29T15:41:22Z" + } +} + +module.exports = { + BUILD_INFO_OLD, + BUILD_INFO_3_2, + CMD_LINE_OPTS, + DOCUMENT_DB_URIS, + COSMOS_DB_URI, + DATALAKE_BUILD_INFO +}; diff --git a/packages/mongodb-build-info/test/index.spec.js b/packages/mongodb-build-info/test/index.spec.js new file mode 100644 index 00000000..0c492530 --- /dev/null +++ b/packages/mongodb-build-info/test/index.spec.js @@ -0,0 +1,307 @@ +const expect = require('chai').expect; +const fixtures = require('./fixtures'); +const { + isAtlas, + isAtlasStream, + getDataLake, + isLocalhost, + isLocalAtlas, + isDigitalOcean, + getBuildEnv, + isEnterprise, + getGenuineMongoDB, +} = require('..'); + +describe('mongodb-build-info', () => { + context('isDataLake', () => { + it('reports on DataLake', () => { + const isDL = getDataLake(fixtures.DATALAKE_BUILD_INFO); + expect(isDL.isDataLake).to.be.true; + expect(isDL.dlVersion).to.equal('v20200329'); + }); + + it('does not report on 3.2', () => { + const isDL = getDataLake(fixtures.BUILD_INFO_3_2); + expect(isDL.isDataLake).to.be.false; + expect(isDL.dlVersion).to.equal(null); + }); + + it('does not report on older versions', () => { + const isDL = getDataLake(fixtures.BUILD_INFO_OLD); + expect(isDL.isDataLake).to.be.false; + expect(isDL.dlVersion).to.equal(null); + }); + }); + + context('isEnterprise', () => { + it('detects enterprise module for 2.6 and 3.0', () => { + expect(isEnterprise(fixtures.BUILD_INFO_OLD)).to.be.true; + }); + + it('detects enterprise module for >= 3.2', () => { + expect(isEnterprise(fixtures.BUILD_INFO_3_2)).to.be.true; + }); + }); + + context('getBuildEnv', () => { + it('returns server os and server arch', () => { + const buildEnv = getBuildEnv(fixtures.BUILD_INFO_3_2); + expect(buildEnv.serverOs).to.equal('osx'); + expect(buildEnv.serverArch).to.equal('x86_64'); + }); + }); + + context('isAtlas', () => { + it('reports on atlas', () => { + expect(isAtlas('mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin')).to.be.true; + expect(isAtlas('mongodb://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin')).to.be.true; + expect(isAtlas('mongodb://admin:catscatscats@cat-data-sets.cats1.mongodb.net,cat-data-sets.cats2.mongodb.net/admin')).to.be.true; + }); + + it('works with host only', () => { + expect(isAtlas('cat-data-sets.cats.mongodb.net:27017')).to.be.true; + }); + + it('works with hostname', () => { + expect(isAtlas('cat-data-sets.cats.mongodb.net')).to.be.true; + }); + + it('returns true with atlas dev', () => { + expect(isAtlas('mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-dev.net/admin')).to.be.true; + expect(isAtlas('cat-data-sets.cats.mongodb-dev.net')).to.be.true; + }); + + it('returns true with atlas qa', () => { + expect(isAtlas('mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-qa.net/admin')).to.be.true; + expect(isAtlas('cat-data-sets.cats.mongodb-qa.net')).to.be.true; + }); + + it('returns true with atlas staging', () => { + expect(isAtlas('mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-stage.net/admin')).to.be.true; + expect(isAtlas('cat-data-sets.cats.mongodb-stage.net')).to.be.true; + }); + + it('returns false if not atlas', () => { + expect(isAtlas('cat-data-sets.cats.mangodb.net')).to.be.false; + expect(isAtlas('cat-data-sets.catsmongodb.net')).to.be.false; + expect(isAtlas('cat-data-sets.cats.mongodb.netx')).to.be.false; + expect(isAtlas('cat-data-sets.cats.mongodb.com')).to.be.false; + expect(isAtlas('localhost')).to.be.false; + }); + + it('does not throw and returns with invalid argument', () => { + expect(isAtlas(123)).to.be.false; + expect(isAtlas('')).to.be.false; + expect(isAtlas({})).to.be.false; + expect(isAtlas(undefined)).to.be.false; + expect(isAtlas(null)).to.be.false; + }); + }); + + context('isLocalAtlas', () => { + it('calls counts function with expected args', (done) => { + isLocalAtlas((db, coll, query) => { + expect(db).to.equal('admin'); + expect(coll).to.equal('atlascli'); + expect(query).to.deep.equal({ + managedClusterType: 'atlasCliLocalDevCluster' + }); + done(); + }); + }); + it('returns false when count resolves to 0', (done) => { + isLocalAtlas(() => Promise.resolve(0)) + .then(res => { + expect(res).to.be.false; + done(); + }); + }); + it('returns false when count throws', (done) => { + isLocalAtlas(() => Promise.reject('No such db')) + .then(res => { + expect(res).to.be.false; + done(); + }); + }); + it('returns true when count resolves to 1', (done) => { + isLocalAtlas(() => Promise.resolve(1)) + .then(res => { + expect(res).to.be.true; + done(); + }); + }); + }); + + context('isAtlasStream', () => { + it('reports on atlas', () => { + expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/')).to.be.true; + expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/')).to.be.true; + }); + + it('works with host only', () => { + expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net:27017')).to.be.true; + }); + + it('works with hostname', () => { + expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net')).to.be.true; + }); + + it('returns true with atlas dev', () => { + expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net/')).to.be.true; + expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net')).to.be.true; + }); + + it('returns true with atlas qa', () => { + expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net/')).to.be.true; + expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net')).to.be.true; + }); + + it('returns true with atlas staging', () => { + expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net/')).to.be.true; + expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net')).to.be.true; + }); + + it('returns false if not atlas stream', () => { + expect(isAtlasStream('cat-data-sets.cats.mangodb.net')).to.be.false; + expect(isAtlasStream('cat-data-sets.catsmongodb.net')).to.be.false; + expect(isAtlasStream('cat-data-sets.cats.mongodb.netx')).to.be.false; + expect(isAtlasStream('cat-data-sets.cats.mongodb.com')).to.be.false; + expect(isAtlasStream('localhost')).to.be.false; + }); + + it('does not throw and returns with invalid argument', () => { + expect(isAtlasStream(123)).to.be.false; + expect(isAtlasStream('')).to.be.false; + expect(isAtlasStream({})).to.be.false; + expect(isAtlasStream(undefined)).to.be.false; + expect(isAtlasStream(null)).to.be.false; + }); + }); + + context('isLocalhost', () => { + it('reports on localhost', () => { + expect(isLocalhost('localhost:27019')).to.be.true; + }); + + it('reports on localhost of type 127.0.0.1', () => { + expect(isLocalhost('127.0.0.1:27019')).to.be.true; + }); + + // Although 127.0.0.1 is usually used for localhost, + // anything in the 127.0.0.1 -> 127.255.255.255 can be used. + it('reports on localhost of type 127.x.x.x', () => { + expect(isLocalhost('127.0.100.1:27019')).to.be.true; + expect(isLocalhost('127.250.100.250:27019')).to.be.true; + expect(isLocalhost('127.10.0.0:27019')).to.be.true; + }); + + // IPv6 loopback addresses. + it('reports on localhost of type [::1]', () => { + expect(isLocalhost('[::1]')).to.be.true; + expect(isLocalhost('mongodb://[::1]/?readPreference=secondary')).to.be.true; + expect(isLocalhost('[0000:0000:0000:0000:0000:0000:0000:0001]')).to.be.true; + expect(isLocalhost('[0:0:0:0:0:0:0:1]')).to.be.true; + expect(isLocalhost('[0::1]')).to.be.true; + expect(isLocalhost('[::1]:27019')).to.be.true; + expect(isLocalhost('[0:0:0:0:0:0:0:1]:27019')).to.be.true; + expect(isLocalhost('[0::1]:27019')).to.be.true; + }); + + it('reports on localhost of type 0.0.0.0', () => { + expect(isLocalhost('0.0.0.0:27019')).to.be.true; + }); + + it('works as url', () => { + expect(isLocalhost('mongodb://127.0.0.1:27019')).to.be.true; + expect(isLocalhost('mongodb+srv://127.0.0.1')).to.be.true; + expect(isLocalhost('mongodb://0.0.0.0:27019')).to.be.true; + expect(isLocalhost('mongodb+srv://0.0.0.0')).to.be.true; + expect(isLocalhost('mongodb://localhost')).to.be.true; + expect(isLocalhost('mongodb://localhost:27019')).to.be.true; + }); + + it('works as hostname', () => { + expect(isLocalhost('127.0.0.1')).to.be.true; + expect(isLocalhost('0.0.0.0')).to.be.true; + expect(isLocalhost('localhost')).to.be.true; + }); + + it('does not report if localhost or 127.0.0.1 is not the hostname', () => { + expect(isLocalhost('127.0.0.500')).to.be.false; + expect(isLocalhost('128.0.0.2')).to.be.false; + expect(isLocalhost('0.0.0.1')).to.be.false; + expect(isLocalhost('remotehost')).to.be.false; + expect(isLocalhost('mongodb://remotelocalhost')).to.be.false; + expect(isLocalhost('[test:ipv6::1]')).to.be.false; + expect(isLocalhost('[1:0:0:0:0:0:0:1]')).to.be.false; + expect(isLocalhost('[test:ipv6::1]:27019')).to.be.false; + expect(isLocalhost('[1:0:0:0:0:0:0:1]:27019')).to.be.false; + }); + + it('does not throw and returns with invalid argument', () => { + expect(isLocalhost(123)).to.be.false; + expect(isLocalhost('')).to.be.false; + expect(isLocalhost({})).to.be.false; + expect(isLocalhost(undefined)).to.be.false; + expect(isLocalhost(null)).to.be.false; + }); + }); + + context('isDigitalOcean', () => { + it('reports on digital ocean', () => { + expect(isDigitalOcean('mongodb+srv://admin:catscatscats@dave-a1234321.mongo.ondigitalocean.com/test?authSource=admin&replicaSet=dave')).to.be.true; + }); + + it('works with hostname only', () => { + expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com')).to.be.true; + }); + + it('works with host only', () => { + expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com:27017')).to.be.true; + }); + + it('returns false if not digitalocean', () => { + expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com2')).to.be.false; + expect(isDigitalOcean('dave-a1234321mongo.ondigitalocean.com')).to.be.false; + expect(isDigitalOcean('dave-a1234321.mongoxondigitalocean.com')).to.be.false; + }); + + it('does not throw and returns with invalid argument', () => { + expect(isDigitalOcean(123)).to.be.false; + expect(isDigitalOcean('')).to.be.false; + expect(isDigitalOcean({})).to.be.false; + expect(isDigitalOcean(undefined)).to.be.false; + expect(isDigitalOcean(null)).to.be.false; + }); + }); + + context('isGenuineMongoDB', () => { + it('reports on CosmosDB', () => { + fixtures.COSMOS_DB_URI.forEach((uri) => { + const isGenuine = getGenuineMongoDB(uri); + expect(isGenuine.isGenuine).to.be.false; + expect(isGenuine.serverName).to.equal('cosmosdb'); + }); + }); + + it('reports on DocumentDB', () => { + fixtures.DOCUMENT_DB_URIS.forEach((uri) => { + const isGenuine = getGenuineMongoDB(uri); + expect(isGenuine.isGenuine).to.be.false; + expect(isGenuine.serverName).to.equal('documentdb'); + }); + }); + + it('does not report on 3.2', () => { + const isGenuine = getGenuineMongoDB(fixtures.BUILD_INFO_3_2, fixtures.CMD_LINE_OPTS); + expect(isGenuine.isGenuine).to.be.true; + expect(isGenuine.serverName).to.equal('mongodb'); + }); + + it('does not report on older versions', () => { + const isGenuine = getGenuineMongoDB(fixtures.BUILD_INFO_OLD, fixtures.CMD_LINE_OPTS); + expect(isGenuine.isGenuine).to.be.true; + expect(isGenuine.serverName).to.equal('mongodb'); + }); + }); +}); From 197a0b77f1cb54e9e3126e9a9a48c6d83bf9557a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 11:01:38 +0200 Subject: [PATCH 02/14] Upgrade dependencies and align testing --- package-lock.json | 1415 +++++++++++++++++++++- packages/mongodb-build-info/.mocharc.js | 1 + packages/mongodb-build-info/package.json | 17 +- 3 files changed, 1415 insertions(+), 18 deletions(-) create mode 100644 packages/mongodb-build-info/.mocharc.js diff --git a/package-lock.json b/package-lock.json index 7be2a8c0..95a83bb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11840,6 +11840,38 @@ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" }, + "node_modules/babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + }, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "eslint": ">= 4.12.1" + } + }, + "node_modules/babel-eslint/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=4" + } + }, "node_modules/babel-plugin-macros": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", @@ -15100,6 +15132,714 @@ "eslint": ">=6.0.0" } }, + "node_modules/eslint-config-mongodb-js": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-mongodb-js/-/eslint-config-mongodb-js-5.0.3.tgz", + "integrity": "sha512-5m17gGJKxI/WktvWN0EuoFqyqeyU2Hz4e3vGHnofBXdcqeHJaaFqY7162e72cynPph7i3Xst9tDLKGPi/QjLzQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "babel-eslint": "^10.0.1", + "eslint": "^5.16.0", + "eslint-plugin-chai-friendly": "^0.4.1", + "eslint-plugin-react": "^7.13.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true, + "license": "ISC" + }, + "node_modules/eslint-config-mongodb-js/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-config-mongodb-js/node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-config-mongodb-js/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true, + "license": "ISC" + }, + "node_modules/eslint-config-mongodb-js/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/inquirer/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/inquirer/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/eslint-config-mongodb-js/node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.5.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/table/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/table/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/table/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint-config-mongodb-js/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/eslint-config-prettier": { "version": "8.5.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", @@ -15199,6 +15939,19 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-chai-friendly": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz", + "integrity": "sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "eslint": ">=3.0.0" + } + }, "node_modules/eslint-plugin-es-x": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz", @@ -22469,13 +23222,8 @@ } }, "node_modules/mongodb-build-info": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/mongodb-build-info/-/mongodb-build-info-1.7.2.tgz", - "integrity": "sha512-eoLFZvCIjcwijYJdxvYupj1c+55VAVm0o4gBJjrcDxxmmpm+bC4Ix9ayZbyhQdVXDZAGDi03NA0GghXjBVXnxg==", - "license": "Apache-2.0", - "dependencies": { - "mongodb-connection-string-url": "^3.0.0" - } + "resolved": "packages/mongodb-build-info", + "link": true }, "node_modules/mongodb-client-encryption": { "version": "6.4.0", @@ -22818,6 +23566,13 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true, + "license": "MIT" + }, "node_modules/nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -24875,6 +25630,13 @@ "node": ">=0.10.0" } }, + "node_modules/path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", + "dev": true, + "license": "(WTFPL OR MIT)" + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -29645,6 +30407,16 @@ "node": ">= 6" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -29695,6 +30467,19 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, + "node_modules/write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "license": "MIT", + "dependencies": { + "mkdirp": "^0.5.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", @@ -29790,6 +30575,19 @@ "node": ">=6" } }, + "node_modules/write/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/ws": { "version": "8.18.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", @@ -30561,6 +31359,22 @@ "typescript": "^5.0.4" } }, + "packages/mongodb-build-info": { + "version": "1.7.2", + "license": "Apache-2.0", + "dependencies": { + "mongodb-connection-string-url": "^3.0.0" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", + "eslint-config-mongodb-js": "^5.0.3", + "mocha": "^8.4.0", + "nyc": "^15.1.0" + } + }, "packages/mongodb-cloud-info": { "version": "2.2.3", "license": "Apache-2.0", @@ -42846,6 +43660,28 @@ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" }, + "babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, "babel-plugin-macros": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", @@ -45307,6 +46143,514 @@ "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", "dev": true }, + "eslint-config-mongodb-js": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-mongodb-js/-/eslint-config-mongodb-js-5.0.3.tgz", + "integrity": "sha512-5m17gGJKxI/WktvWN0EuoFqyqeyU2Hz4e3vGHnofBXdcqeHJaaFqY7162e72cynPph7i3Xst9tDLKGPi/QjLzQ==", + "dev": true, + "requires": { + "babel-eslint": "^10.0.1", + "eslint": "^5.16.0", + "eslint-plugin-chai-friendly": "^0.4.1", + "eslint-plugin-react": "^7.13.0" + }, + "dependencies": { + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "eslint-config-prettier": { "version": "8.5.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", @@ -45366,6 +46710,12 @@ } } }, + "eslint-plugin-chai-friendly": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz", + "integrity": "sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA==", + "dev": true + }, "eslint-plugin-es-x": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz", @@ -50644,11 +51994,16 @@ } }, "mongodb-build-info": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/mongodb-build-info/-/mongodb-build-info-1.7.2.tgz", - "integrity": "sha512-eoLFZvCIjcwijYJdxvYupj1c+55VAVm0o4gBJjrcDxxmmpm+bC4Ix9ayZbyhQdVXDZAGDi03NA0GghXjBVXnxg==", + "version": "file:packages/mongodb-build-info", "requires": { - "mongodb-connection-string-url": "^3.0.0" + "@types/mocha": "^9.1.1", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", + "eslint-config-mongodb-js": "^5.0.3", + "mocha": "^8.4.0", + "mongodb-connection-string-url": "^3.0.0", + "nyc": "^15.1.0" } }, "mongodb-client-encryption": { @@ -51229,6 +52584,12 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -52781,6 +54142,12 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", + "dev": true + }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -56291,6 +57658,12 @@ } } }, + "word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -56328,6 +57701,26 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + } + } + }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", diff --git a/packages/mongodb-build-info/.mocharc.js b/packages/mongodb-build-info/.mocharc.js new file mode 100644 index 00000000..64afeb1f --- /dev/null +++ b/packages/mongodb-build-info/.mocharc.js @@ -0,0 +1 @@ +module.exports = require('@mongodb-js/mocha-config-devtools'); diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json index e0e53684..acf53f68 100644 --- a/packages/mongodb-build-info/package.json +++ b/packages/mongodb-build-info/package.json @@ -8,6 +8,9 @@ "depcheck": "depcheck", "check": "npm run depcheck && npm run lint", "test": "mocha test/index.spec.js", + "test-cov": "nyc -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test", + "test-watch": "npm run test -- --watch", + "test-ci": "npm run test-cov", "release": "release-it" }, "repository": { @@ -27,15 +30,15 @@ }, "homepage": "https://github.com/mongodb-js/mongodb-build-info#readme", "devDependencies": { - "chai": "^4.2.0", - "depcheck": "^1.4.2", - "eslint": "^8.3.0", + "@types/mocha": "^9.1.1", + "chai": "^4.5.0", + "depcheck": "^1.4.7", + "eslint": "^7.25.0", "eslint-config-mongodb-js": "^5.0.3", - "mocha": "^7.1.2", - "release-it": "^14.11.8" + "mocha": "^8.4.0", + "nyc": "^15.1.0" }, "dependencies": { "mongodb-connection-string-url": "^3.0.0" - }, - "release-it": {} + } } From 6e3998d2b8b3f5c1c4f97a7fb862454c58ad5e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 11:04:16 +0200 Subject: [PATCH 03/14] Align package.json with existing packages --- packages/mongodb-build-info/package.json | 37 ++++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json index acf53f68..6d4efd8f 100644 --- a/packages/mongodb-build-info/package.json +++ b/packages/mongodb-build-info/package.json @@ -2,6 +2,27 @@ "name": "mongodb-build-info", "version": "1.7.2", "description": "Extract information from mongodb's buildInfo", + "author": "Irina Shestak ", + "keywords": [ + "buildInfo", + "mongodb", + "compass-tools", + "mongodb.js" + ], + "publishConfig": { + "access": "public" + }, + "bugs": { + "url": "https://jira.mongodb.org/projects/COMPASS/issues", + "email": "compass@mongodb.com" + }, + "homepage": "https://github.com/mongodb-js/devtools-shared", + "repository": { + "type": "git", + "url": "https://github.com/mongodb-js/devtools-shared.git", + "directory": "packages/mongodb-build-info" + }, + "license": "Apache-2.0", "main": "index.js", "scripts": { "lint": "eslint .", @@ -13,22 +34,6 @@ "test-ci": "npm run test-cov", "release": "release-it" }, - "repository": { - "type": "git", - "url": "git+https://github.com/mongodb-js/mongodb-build-info.git" - }, - "keywords": [ - "buildInfo", - "mongodb", - "compass-tools", - "mongodb.js" - ], - "author": "Irina Shestak ", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/mongodb-js/mongodb-build-info/issues" - }, - "homepage": "https://github.com/mongodb-js/mongodb-build-info#readme", "devDependencies": { "@types/mocha": "^9.1.1", "chai": "^4.5.0", From d49d03759ca20ed37a1c8c68c8466adb2dd7f96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 11:05:36 +0200 Subject: [PATCH 04/14] Adding myself as contributor --- packages/mongodb-build-info/package.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json index 6d4efd8f..8a84cadc 100644 --- a/packages/mongodb-build-info/package.json +++ b/packages/mongodb-build-info/package.json @@ -3,6 +3,16 @@ "version": "1.7.2", "description": "Extract information from mongodb's buildInfo", "author": "Irina Shestak ", + "contributors": [ + { + "name": "Irina Shestak", + "email": "shestak.irina@gmail.com" + }, + { + "name": "Kræn Hansen", + "email": "kraen.hansen@mongodb.com" + } + ], "keywords": [ "buildInfo", "mongodb", From 91b7d9337e283b2b05d2608c3728942b3085270b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 11:13:54 +0200 Subject: [PATCH 05/14] Align eslint config with existing packages --- packages/mongodb-build-info/.eslintignore | 3 +++ packages/mongodb-build-info/.eslintrc | 9 --------- packages/mongodb-build-info/.eslintrc.js | 8 ++++++++ packages/mongodb-build-info/package.json | 3 +++ 4 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 packages/mongodb-build-info/.eslintrc create mode 100644 packages/mongodb-build-info/.eslintrc.js diff --git a/packages/mongodb-build-info/.eslintignore b/packages/mongodb-build-info/.eslintignore index 05d75c56..b4893239 100644 --- a/packages/mongodb-build-info/.eslintignore +++ b/packages/mongodb-build-info/.eslintignore @@ -1 +1,4 @@ +.nyc-output +dist + test/fixtures.js diff --git a/packages/mongodb-build-info/.eslintrc b/packages/mongodb-build-info/.eslintrc deleted file mode 100644 index 42452669..00000000 --- a/packages/mongodb-build-info/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "env": { - "es6": true - }, - "rules": { - "strict": 0 - }, - "extends": ["mongodb-js/node"] -} diff --git a/packages/mongodb-build-info/.eslintrc.js b/packages/mongodb-build-info/.eslintrc.js new file mode 100644 index 00000000..83296d73 --- /dev/null +++ b/packages/mongodb-build-info/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + root: true, + extends: ['@mongodb-js/eslint-config-devtools'], + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig-lint.json'], + }, +}; diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json index 8a84cadc..85fb0e72 100644 --- a/packages/mongodb-build-info/package.json +++ b/packages/mongodb-build-info/package.json @@ -45,6 +45,9 @@ "release": "release-it" }, "devDependencies": { + "@mongodb-js/eslint-config-devtools": "0.9.12", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", "@types/mocha": "^9.1.1", "chai": "^4.5.0", "depcheck": "^1.4.7", From 984c2873dbd8a1743d7dc3b69a01092568a1f895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 11:15:09 +0200 Subject: [PATCH 06/14] Prepare for TypeScript --- package-lock.json | 36 +- packages/mongodb-build-info/.eslintignore | 2 - .../{.mocharc.js => .mocharc.cjs} | 0 packages/mongodb-build-info/package.json | 6 +- packages/mongodb-build-info/test/fixtures.js | 132 ------ packages/mongodb-build-info/test/fixtures.ts | 112 +++++ .../mongodb-build-info/test/index.spec.js | 307 ------------- .../mongodb-build-info/test/index.spec.ts | 404 ++++++++++++++++++ .../mongodb-build-info/tsconfig-lint.json | 5 + packages/mongodb-build-info/tsconfig.json | 10 + 10 files changed, 569 insertions(+), 445 deletions(-) rename packages/mongodb-build-info/{.mocharc.js => .mocharc.cjs} (100%) delete mode 100644 packages/mongodb-build-info/test/fixtures.js create mode 100644 packages/mongodb-build-info/test/fixtures.ts delete mode 100644 packages/mongodb-build-info/test/index.spec.js create mode 100644 packages/mongodb-build-info/test/index.spec.ts create mode 100644 packages/mongodb-build-info/tsconfig-lint.json create mode 100644 packages/mongodb-build-info/tsconfig.json diff --git a/package-lock.json b/package-lock.json index 95a83bb4..ec5cae59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31366,13 +31366,32 @@ "mongodb-connection-string-url": "^3.0.0" }, "devDependencies": { + "@mongodb-js/eslint-config-devtools": "0.9.12", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", "@types/mocha": "^9.1.1", "chai": "^4.5.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "eslint-config-mongodb-js": "^5.0.3", "mocha": "^8.4.0", - "nyc": "^15.1.0" + "nyc": "^15.1.0", + "typescript": "^5.0.4" + } + }, + "packages/mongodb-build-info/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, "packages/mongodb-cloud-info": { @@ -51996,6 +52015,10 @@ "mongodb-build-info": { "version": "file:packages/mongodb-build-info", "requires": { + "@mongodb-js/eslint-config-devtools": "0.9.12", + "@mongodb-js/mocha-config-devtools": "^1.0.5", + "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", "@types/mocha": "^9.1.1", "chai": "^4.5.0", "depcheck": "^1.4.7", @@ -52003,7 +52026,16 @@ "eslint-config-mongodb-js": "^5.0.3", "mocha": "^8.4.0", "mongodb-connection-string-url": "^3.0.0", - "nyc": "^15.1.0" + "nyc": "^15.1.0", + "typescript": "^5.0.4" + }, + "dependencies": { + "typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true + } } }, "mongodb-client-encryption": { diff --git a/packages/mongodb-build-info/.eslintignore b/packages/mongodb-build-info/.eslintignore index b4893239..85a8a75e 100644 --- a/packages/mongodb-build-info/.eslintignore +++ b/packages/mongodb-build-info/.eslintignore @@ -1,4 +1,2 @@ .nyc-output dist - -test/fixtures.js diff --git a/packages/mongodb-build-info/.mocharc.js b/packages/mongodb-build-info/.mocharc.cjs similarity index 100% rename from packages/mongodb-build-info/.mocharc.js rename to packages/mongodb-build-info/.mocharc.cjs diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json index 85fb0e72..43bb792a 100644 --- a/packages/mongodb-build-info/package.json +++ b/packages/mongodb-build-info/package.json @@ -38,7 +38,7 @@ "lint": "eslint .", "depcheck": "depcheck", "check": "npm run depcheck && npm run lint", - "test": "mocha test/index.spec.js", + "test": "mocha **/*.spec.ts", "test-cov": "nyc -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test", "test-watch": "npm run test -- --watch", "test-ci": "npm run test-cov", @@ -48,13 +48,15 @@ "@mongodb-js/eslint-config-devtools": "0.9.12", "@mongodb-js/mocha-config-devtools": "^1.0.5", "@mongodb-js/prettier-config-devtools": "^1.0.2", + "@mongodb-js/tsconfig-devtools": "^1.0.3", "@types/mocha": "^9.1.1", "chai": "^4.5.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "eslint-config-mongodb-js": "^5.0.3", "mocha": "^8.4.0", - "nyc": "^15.1.0" + "nyc": "^15.1.0", + "typescript": "^5.0.4" }, "dependencies": { "mongodb-connection-string-url": "^3.0.0" diff --git a/packages/mongodb-build-info/test/fixtures.js b/packages/mongodb-build-info/test/fixtures.js deleted file mode 100644 index 70b90aec..00000000 --- a/packages/mongodb-build-info/test/fixtures.js +++ /dev/null @@ -1,132 +0,0 @@ -const BUILD_INFO_OLD = { - "version" : "2.6.11", - "gitVersion" : "d00c1735675c457f75a12d530bee85421f0c5548 modules: enterprise", - "OpenSSLVersion" : "OpenSSL 1.0.1f 6 Jan 2014", - "sysInfo" : "Linux ip-10-203-203-194 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49", - "loaderFlags" : "-fPIC -pthread -Wl,-z,now -rdynamic -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-E", - "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -fno-builtin-memcmp", - "allocator" : "tcmalloc", - "versionArray" : [ - 2, - 6, - 11, - 0 - ], - "javascriptEngine" : "V8", - "bits" : 64, - "debug" : false, - "maxBsonObjectSize" : 16777216, - "ok" : 1 -}; - -const BUILD_INFO_3_2 = { - "version" : "3.2.0-rc2", - "gitVersion" : "8a3acb42742182c5e314636041c2df368232bbc5", - "modules" : [ - "enterprise" - ], - "allocator" : "system", - "javascriptEngine" : "mozjs", - "sysInfo" : "deprecated", - "versionArray" : [ - 3, - 2, - 0, - -48 - ], - "openssl" : { - "running" : "OpenSSL 0.9.8zg 14 July 2015", - "compiled" : "OpenSSL 0.9.8y 5 Feb 2013" - }, - "buildEnvironment" : { - "distmod" : "", - "distarch" : "x86_64", - "cc" : "gcc: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", - "ccflags" : "-fno-omit-frame-pointer -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -Wno-missing-braces -mmacosx-version-min=10.7 -fno-builtin-memcmp", - "cxx" : "g++: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", - "cxxflags" : "-Wnon-virtual-dtor -Woverloaded-virtual -stdlib=libc++ -std=c++11", - "linkflags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.7 -stdlib=libc++ -fuse-ld=gold", - "target_arch" : "x86_64", - "target_os" : "osx" - }, - "bits" : 64, - "debug" : false, - "maxBsonObjectSize" : 16777216, - "storageEngines" : [ - "devnull", - "ephemeralForTest", - "inMemory", - "mmapv1", - "wiredTiger" - ], - "ok" : 1 -}; - -const CMD_LINE_OPTS = { - "argv" : [ - "/opt/mongodb-osx-x86_64-enterprise-3.6.3/bin/mongod", - "--dbpath=/Users/user/testdata" - ], - "parsed" : { - "storage" : { - "dbPath" : "/Users/user/testdata" - } - }, - "ok" : 1 -}; - -const COSMOS_DB_URI = [ - 'mongodb://x:y@compass-serverless.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass-serverless@', - 'mongodb://x:y@compass.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass@', - 'mongodb+srv://x:y@compass-vcore.mongocluster.cosmos.azure.com/?retrywrites=false&maxIdleTimeMS=120000' -] - -const DOCUMENT_DB_URIS = [ - "mongodb://x:y@docdb-2001-01-01-01-01-01.cluster-abc.eu-central-1.docdb.amazonaws.com:27017/?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false", - "mongodb://x:y@elastic-docdb-123456789.eu-central-1.docdb-elastic.amazonaws.com:27017" -]; - -const COSMOSDB_BUILD_INFO = { - "_t" : "BuildInfoResponse", - "ok" : 1, - "version" : "3.2.0", - "gitVersion" : "45d947729a0315accb6d4f15a6b06be6d9c19fe7", - "targetMinOS" : "Windows 7/Windows Server 2008 R2", - "modules" : [ ], - "allocator" : "tcmalloc", - "javascriptEngine" : "Chakra", - "sysInfo" : "deprecated", - "versionArray" : [ - 3, - 2, - 0, - 0 - ], - "bits" : 64, - "debug" : false, - "maxBsonObjectSize" : 524288, - "openssl" : { - "running" : "OpenSSL 1.0.1p-fips 9 Jul 2015", - "compiled" : "OpenSSL 1.0.1p-fips 9 Jul 2015" - } -}; - -const DATALAKE_BUILD_INFO = { - "ok": 1, - "version": "3.6.0", - "versionArray": [ 3, 6, 0, 0 ], - "dataLake": { - "version": "v20200329", - "gitVersion": "0f318ss78bfad79ede3721e91iasj6f61644f", - "date": "2020-03-29T15:41:22Z" - } -} - -module.exports = { - BUILD_INFO_OLD, - BUILD_INFO_3_2, - CMD_LINE_OPTS, - DOCUMENT_DB_URIS, - COSMOS_DB_URI, - DATALAKE_BUILD_INFO -}; diff --git a/packages/mongodb-build-info/test/fixtures.ts b/packages/mongodb-build-info/test/fixtures.ts new file mode 100644 index 00000000..24e1d677 --- /dev/null +++ b/packages/mongodb-build-info/test/fixtures.ts @@ -0,0 +1,112 @@ +export const BUILD_INFO_OLD = { + version: "2.6.11", + gitVersion: "d00c1735675c457f75a12d530bee85421f0c5548 modules: enterprise", + OpenSSLVersion: "OpenSSL 1.0.1f 6 Jan 2014", + sysInfo: + "Linux ip-10-203-203-194 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49", + loaderFlags: + "-fPIC -pthread -Wl,-z,now -rdynamic -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-E", + compilerFlags: + "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -fno-builtin-memcmp", + allocator: "tcmalloc", + versionArray: [2, 6, 11, 0], + javascriptEngine: "V8", + bits: 64, + debug: false, + maxBsonObjectSize: 16777216, + ok: 1, +}; + +export const BUILD_INFO_3_2 = { + version: "3.2.0-rc2", + gitVersion: "8a3acb42742182c5e314636041c2df368232bbc5", + modules: ["enterprise"], + allocator: "system", + javascriptEngine: "mozjs", + sysInfo: "deprecated", + versionArray: [3, 2, 0, -48], + openssl: { + running: "OpenSSL 0.9.8zg 14 July 2015", + compiled: "OpenSSL 0.9.8y 5 Feb 2013", + }, + buildEnvironment: { + distmod: "", + distarch: "x86_64", + cc: "gcc: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", + ccflags: + "-fno-omit-frame-pointer -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -Wno-missing-braces -mmacosx-version-min=10.7 -fno-builtin-memcmp", + cxx: "g++: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", + cxxflags: + "-Wnon-virtual-dtor -Woverloaded-virtual -stdlib=libc++ -std=c++11", + linkflags: + "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.7 -stdlib=libc++ -fuse-ld=gold", + target_arch: "x86_64", + target_os: "osx", + }, + bits: 64, + debug: false, + maxBsonObjectSize: 16777216, + storageEngines: [ + "devnull", + "ephemeralForTest", + "inMemory", + "mmapv1", + "wiredTiger", + ], + ok: 1, +}; + +export const CMD_LINE_OPTS = { + argv: [ + "/opt/mongodb-osx-x86_64-enterprise-3.6.3/bin/mongod", + "--dbpath=/Users/user/testdata", + ], + parsed: { + storage: { + dbPath: "/Users/user/testdata", + }, + }, + ok: 1, +}; + +export const COSMOS_DB_URI = [ + "mongodb://x:y@compass-serverless.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass-serverless@", + "mongodb://x:y@compass.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass@", + "mongodb+srv://x:y@compass-vcore.mongocluster.cosmos.azure.com/?retrywrites=false&maxIdleTimeMS=120000", +]; + +export const DOCUMENT_DB_URIS = [ + "mongodb://x:y@docdb-2001-01-01-01-01-01.cluster-abc.eu-central-1.docdb.amazonaws.com:27017/?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false", + "mongodb://x:y@elastic-docdb-123456789.eu-central-1.docdb-elastic.amazonaws.com:27017", +]; + +export const COSMOSDB_BUILD_INFO = { + _t: "BuildInfoResponse", + ok: 1, + version: "3.2.0", + gitVersion: "45d947729a0315accb6d4f15a6b06be6d9c19fe7", + targetMinOS: "Windows 7/Windows Server 2008 R2", + modules: [], + allocator: "tcmalloc", + javascriptEngine: "Chakra", + sysInfo: "deprecated", + versionArray: [3, 2, 0, 0], + bits: 64, + debug: false, + maxBsonObjectSize: 524288, + openssl: { + running: "OpenSSL 1.0.1p-fips 9 Jul 2015", + compiled: "OpenSSL 1.0.1p-fips 9 Jul 2015", + }, +}; + +export const DATALAKE_BUILD_INFO = { + ok: 1, + version: "3.6.0", + versionArray: [3, 6, 0, 0], + dataLake: { + version: "v20200329", + gitVersion: "0f318ss78bfad79ede3721e91iasj6f61644f", + date: "2020-03-29T15:41:22Z", + }, +}; diff --git a/packages/mongodb-build-info/test/index.spec.js b/packages/mongodb-build-info/test/index.spec.js deleted file mode 100644 index 0c492530..00000000 --- a/packages/mongodb-build-info/test/index.spec.js +++ /dev/null @@ -1,307 +0,0 @@ -const expect = require('chai').expect; -const fixtures = require('./fixtures'); -const { - isAtlas, - isAtlasStream, - getDataLake, - isLocalhost, - isLocalAtlas, - isDigitalOcean, - getBuildEnv, - isEnterprise, - getGenuineMongoDB, -} = require('..'); - -describe('mongodb-build-info', () => { - context('isDataLake', () => { - it('reports on DataLake', () => { - const isDL = getDataLake(fixtures.DATALAKE_BUILD_INFO); - expect(isDL.isDataLake).to.be.true; - expect(isDL.dlVersion).to.equal('v20200329'); - }); - - it('does not report on 3.2', () => { - const isDL = getDataLake(fixtures.BUILD_INFO_3_2); - expect(isDL.isDataLake).to.be.false; - expect(isDL.dlVersion).to.equal(null); - }); - - it('does not report on older versions', () => { - const isDL = getDataLake(fixtures.BUILD_INFO_OLD); - expect(isDL.isDataLake).to.be.false; - expect(isDL.dlVersion).to.equal(null); - }); - }); - - context('isEnterprise', () => { - it('detects enterprise module for 2.6 and 3.0', () => { - expect(isEnterprise(fixtures.BUILD_INFO_OLD)).to.be.true; - }); - - it('detects enterprise module for >= 3.2', () => { - expect(isEnterprise(fixtures.BUILD_INFO_3_2)).to.be.true; - }); - }); - - context('getBuildEnv', () => { - it('returns server os and server arch', () => { - const buildEnv = getBuildEnv(fixtures.BUILD_INFO_3_2); - expect(buildEnv.serverOs).to.equal('osx'); - expect(buildEnv.serverArch).to.equal('x86_64'); - }); - }); - - context('isAtlas', () => { - it('reports on atlas', () => { - expect(isAtlas('mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin')).to.be.true; - expect(isAtlas('mongodb://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin')).to.be.true; - expect(isAtlas('mongodb://admin:catscatscats@cat-data-sets.cats1.mongodb.net,cat-data-sets.cats2.mongodb.net/admin')).to.be.true; - }); - - it('works with host only', () => { - expect(isAtlas('cat-data-sets.cats.mongodb.net:27017')).to.be.true; - }); - - it('works with hostname', () => { - expect(isAtlas('cat-data-sets.cats.mongodb.net')).to.be.true; - }); - - it('returns true with atlas dev', () => { - expect(isAtlas('mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-dev.net/admin')).to.be.true; - expect(isAtlas('cat-data-sets.cats.mongodb-dev.net')).to.be.true; - }); - - it('returns true with atlas qa', () => { - expect(isAtlas('mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-qa.net/admin')).to.be.true; - expect(isAtlas('cat-data-sets.cats.mongodb-qa.net')).to.be.true; - }); - - it('returns true with atlas staging', () => { - expect(isAtlas('mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-stage.net/admin')).to.be.true; - expect(isAtlas('cat-data-sets.cats.mongodb-stage.net')).to.be.true; - }); - - it('returns false if not atlas', () => { - expect(isAtlas('cat-data-sets.cats.mangodb.net')).to.be.false; - expect(isAtlas('cat-data-sets.catsmongodb.net')).to.be.false; - expect(isAtlas('cat-data-sets.cats.mongodb.netx')).to.be.false; - expect(isAtlas('cat-data-sets.cats.mongodb.com')).to.be.false; - expect(isAtlas('localhost')).to.be.false; - }); - - it('does not throw and returns with invalid argument', () => { - expect(isAtlas(123)).to.be.false; - expect(isAtlas('')).to.be.false; - expect(isAtlas({})).to.be.false; - expect(isAtlas(undefined)).to.be.false; - expect(isAtlas(null)).to.be.false; - }); - }); - - context('isLocalAtlas', () => { - it('calls counts function with expected args', (done) => { - isLocalAtlas((db, coll, query) => { - expect(db).to.equal('admin'); - expect(coll).to.equal('atlascli'); - expect(query).to.deep.equal({ - managedClusterType: 'atlasCliLocalDevCluster' - }); - done(); - }); - }); - it('returns false when count resolves to 0', (done) => { - isLocalAtlas(() => Promise.resolve(0)) - .then(res => { - expect(res).to.be.false; - done(); - }); - }); - it('returns false when count throws', (done) => { - isLocalAtlas(() => Promise.reject('No such db')) - .then(res => { - expect(res).to.be.false; - done(); - }); - }); - it('returns true when count resolves to 1', (done) => { - isLocalAtlas(() => Promise.resolve(1)) - .then(res => { - expect(res).to.be.true; - done(); - }); - }); - }); - - context('isAtlasStream', () => { - it('reports on atlas', () => { - expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/')).to.be.true; - expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/')).to.be.true; - }); - - it('works with host only', () => { - expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net:27017')).to.be.true; - }); - - it('works with hostname', () => { - expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net')).to.be.true; - }); - - it('returns true with atlas dev', () => { - expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net/')).to.be.true; - expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net')).to.be.true; - }); - - it('returns true with atlas qa', () => { - expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net/')).to.be.true; - expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net')).to.be.true; - }); - - it('returns true with atlas staging', () => { - expect(isAtlasStream('mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net/')).to.be.true; - expect(isAtlasStream('atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net')).to.be.true; - }); - - it('returns false if not atlas stream', () => { - expect(isAtlasStream('cat-data-sets.cats.mangodb.net')).to.be.false; - expect(isAtlasStream('cat-data-sets.catsmongodb.net')).to.be.false; - expect(isAtlasStream('cat-data-sets.cats.mongodb.netx')).to.be.false; - expect(isAtlasStream('cat-data-sets.cats.mongodb.com')).to.be.false; - expect(isAtlasStream('localhost')).to.be.false; - }); - - it('does not throw and returns with invalid argument', () => { - expect(isAtlasStream(123)).to.be.false; - expect(isAtlasStream('')).to.be.false; - expect(isAtlasStream({})).to.be.false; - expect(isAtlasStream(undefined)).to.be.false; - expect(isAtlasStream(null)).to.be.false; - }); - }); - - context('isLocalhost', () => { - it('reports on localhost', () => { - expect(isLocalhost('localhost:27019')).to.be.true; - }); - - it('reports on localhost of type 127.0.0.1', () => { - expect(isLocalhost('127.0.0.1:27019')).to.be.true; - }); - - // Although 127.0.0.1 is usually used for localhost, - // anything in the 127.0.0.1 -> 127.255.255.255 can be used. - it('reports on localhost of type 127.x.x.x', () => { - expect(isLocalhost('127.0.100.1:27019')).to.be.true; - expect(isLocalhost('127.250.100.250:27019')).to.be.true; - expect(isLocalhost('127.10.0.0:27019')).to.be.true; - }); - - // IPv6 loopback addresses. - it('reports on localhost of type [::1]', () => { - expect(isLocalhost('[::1]')).to.be.true; - expect(isLocalhost('mongodb://[::1]/?readPreference=secondary')).to.be.true; - expect(isLocalhost('[0000:0000:0000:0000:0000:0000:0000:0001]')).to.be.true; - expect(isLocalhost('[0:0:0:0:0:0:0:1]')).to.be.true; - expect(isLocalhost('[0::1]')).to.be.true; - expect(isLocalhost('[::1]:27019')).to.be.true; - expect(isLocalhost('[0:0:0:0:0:0:0:1]:27019')).to.be.true; - expect(isLocalhost('[0::1]:27019')).to.be.true; - }); - - it('reports on localhost of type 0.0.0.0', () => { - expect(isLocalhost('0.0.0.0:27019')).to.be.true; - }); - - it('works as url', () => { - expect(isLocalhost('mongodb://127.0.0.1:27019')).to.be.true; - expect(isLocalhost('mongodb+srv://127.0.0.1')).to.be.true; - expect(isLocalhost('mongodb://0.0.0.0:27019')).to.be.true; - expect(isLocalhost('mongodb+srv://0.0.0.0')).to.be.true; - expect(isLocalhost('mongodb://localhost')).to.be.true; - expect(isLocalhost('mongodb://localhost:27019')).to.be.true; - }); - - it('works as hostname', () => { - expect(isLocalhost('127.0.0.1')).to.be.true; - expect(isLocalhost('0.0.0.0')).to.be.true; - expect(isLocalhost('localhost')).to.be.true; - }); - - it('does not report if localhost or 127.0.0.1 is not the hostname', () => { - expect(isLocalhost('127.0.0.500')).to.be.false; - expect(isLocalhost('128.0.0.2')).to.be.false; - expect(isLocalhost('0.0.0.1')).to.be.false; - expect(isLocalhost('remotehost')).to.be.false; - expect(isLocalhost('mongodb://remotelocalhost')).to.be.false; - expect(isLocalhost('[test:ipv6::1]')).to.be.false; - expect(isLocalhost('[1:0:0:0:0:0:0:1]')).to.be.false; - expect(isLocalhost('[test:ipv6::1]:27019')).to.be.false; - expect(isLocalhost('[1:0:0:0:0:0:0:1]:27019')).to.be.false; - }); - - it('does not throw and returns with invalid argument', () => { - expect(isLocalhost(123)).to.be.false; - expect(isLocalhost('')).to.be.false; - expect(isLocalhost({})).to.be.false; - expect(isLocalhost(undefined)).to.be.false; - expect(isLocalhost(null)).to.be.false; - }); - }); - - context('isDigitalOcean', () => { - it('reports on digital ocean', () => { - expect(isDigitalOcean('mongodb+srv://admin:catscatscats@dave-a1234321.mongo.ondigitalocean.com/test?authSource=admin&replicaSet=dave')).to.be.true; - }); - - it('works with hostname only', () => { - expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com')).to.be.true; - }); - - it('works with host only', () => { - expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com:27017')).to.be.true; - }); - - it('returns false if not digitalocean', () => { - expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com2')).to.be.false; - expect(isDigitalOcean('dave-a1234321mongo.ondigitalocean.com')).to.be.false; - expect(isDigitalOcean('dave-a1234321.mongoxondigitalocean.com')).to.be.false; - }); - - it('does not throw and returns with invalid argument', () => { - expect(isDigitalOcean(123)).to.be.false; - expect(isDigitalOcean('')).to.be.false; - expect(isDigitalOcean({})).to.be.false; - expect(isDigitalOcean(undefined)).to.be.false; - expect(isDigitalOcean(null)).to.be.false; - }); - }); - - context('isGenuineMongoDB', () => { - it('reports on CosmosDB', () => { - fixtures.COSMOS_DB_URI.forEach((uri) => { - const isGenuine = getGenuineMongoDB(uri); - expect(isGenuine.isGenuine).to.be.false; - expect(isGenuine.serverName).to.equal('cosmosdb'); - }); - }); - - it('reports on DocumentDB', () => { - fixtures.DOCUMENT_DB_URIS.forEach((uri) => { - const isGenuine = getGenuineMongoDB(uri); - expect(isGenuine.isGenuine).to.be.false; - expect(isGenuine.serverName).to.equal('documentdb'); - }); - }); - - it('does not report on 3.2', () => { - const isGenuine = getGenuineMongoDB(fixtures.BUILD_INFO_3_2, fixtures.CMD_LINE_OPTS); - expect(isGenuine.isGenuine).to.be.true; - expect(isGenuine.serverName).to.equal('mongodb'); - }); - - it('does not report on older versions', () => { - const isGenuine = getGenuineMongoDB(fixtures.BUILD_INFO_OLD, fixtures.CMD_LINE_OPTS); - expect(isGenuine.isGenuine).to.be.true; - expect(isGenuine.serverName).to.equal('mongodb'); - }); - }); -}); diff --git a/packages/mongodb-build-info/test/index.spec.ts b/packages/mongodb-build-info/test/index.spec.ts new file mode 100644 index 00000000..0e081a6b --- /dev/null +++ b/packages/mongodb-build-info/test/index.spec.ts @@ -0,0 +1,404 @@ +import { expect } from "chai"; +import * as fixtures from "./fixtures"; +import { + isAtlas, + isAtlasStream, + getDataLake, + isLocalhost, + isLocalAtlas, + isDigitalOcean, + getBuildEnv, + isEnterprise, + getGenuineMongoDB, +} from "../src/index"; + +describe("mongodb-build-info", function () { + context("isDataLake", function () { + it("reports on DataLake", function () { + const isDL = getDataLake(fixtures.DATALAKE_BUILD_INFO); + expect(isDL.isDataLake).to.be.true; + expect(isDL.dlVersion).to.equal("v20200329"); + }); + + it("does not report on 3.2", function () { + const isDL = getDataLake(fixtures.BUILD_INFO_3_2); + expect(isDL.isDataLake).to.be.false; + expect(isDL.dlVersion).to.equal(null); + }); + + it("does not report on older versions", function () { + const isDL = getDataLake(fixtures.BUILD_INFO_OLD); + expect(isDL.isDataLake).to.be.false; + expect(isDL.dlVersion).to.equal(null); + }); + }); + + context("isEnterprise", function () { + it("detects enterprise module for 2.6 and 3.0", function () { + expect(isEnterprise(fixtures.BUILD_INFO_OLD)).to.be.true; + }); + + it("detects enterprise module for >= 3.2", function () { + expect(isEnterprise(fixtures.BUILD_INFO_3_2)).to.be.true; + }); + }); + + context("getBuildEnv", function () { + it("returns server os and server arch", function () { + const buildEnv = getBuildEnv(fixtures.BUILD_INFO_3_2); + expect(buildEnv.serverOs).to.equal("osx"); + expect(buildEnv.serverArch).to.equal("x86_64"); + }); + }); + + context("isAtlas", function () { + it("reports on atlas", function () { + expect( + isAtlas( + "mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin" + ) + ).to.be.true; + expect( + isAtlas( + "mongodb://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin" + ) + ).to.be.true; + expect( + isAtlas( + "mongodb://admin:catscatscats@cat-data-sets.cats1.mongodb.net,cat-data-sets.cats2.mongodb.net/admin" + ) + ).to.be.true; + }); + + it("works with host only", function () { + expect(isAtlas("cat-data-sets.cats.mongodb.net:27017")).to.be.true; + }); + + it("works with hostname", function () { + expect(isAtlas("cat-data-sets.cats.mongodb.net")).to.be.true; + }); + + it("returns true with atlas dev", function () { + expect( + isAtlas( + "mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-dev.net/admin" + ) + ).to.be.true; + expect(isAtlas("cat-data-sets.cats.mongodb-dev.net")).to.be.true; + }); + + it("returns true with atlas qa", function () { + expect( + isAtlas( + "mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-qa.net/admin" + ) + ).to.be.true; + expect(isAtlas("cat-data-sets.cats.mongodb-qa.net")).to.be.true; + }); + + it("returns true with atlas staging", function () { + expect( + isAtlas( + "mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-stage.net/admin" + ) + ).to.be.true; + expect(isAtlas("cat-data-sets.cats.mongodb-stage.net")).to.be.true; + }); + + it("returns false if not atlas", function () { + expect(isAtlas("cat-data-sets.cats.mangodb.net")).to.be.false; + expect(isAtlas("cat-data-sets.catsmongodb.net")).to.be.false; + expect(isAtlas("cat-data-sets.cats.mongodb.netx")).to.be.false; + expect(isAtlas("cat-data-sets.cats.mongodb.com")).to.be.false; + expect(isAtlas("localhost")).to.be.false; + }); + + it("does not throw and returns with invalid argument", function () { + expect(isAtlas("")).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isAtlas(123)).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isAtlas({})).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isAtlas(undefined)).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isAtlas(null)).to.be.false; + }); + }); + + context("isLocalAtlas", function () { + it("calls counts function with expected args", function (done) { + void isLocalAtlas((db, coll, query) => { + expect(db).to.equal("admin"); + expect(coll).to.equal("atlascli"); + expect(query).to.deep.equal({ + managedClusterType: "atlasCliLocalDevCluster", + }); + done(); + throw new Error("Not implemented"); + }); + }); + it("returns false when count resolves to 0", function (done) { + void isLocalAtlas(() => Promise.resolve(0)).then((res) => { + expect(res).to.be.false; + done(); + }); + }); + it("returns false when count throws", function (done) { + void isLocalAtlas(() => Promise.reject("No such db")).then((res) => { + expect(res).to.be.false; + done(); + }); + }); + it("returns true when count resolves to 1", function (done) { + void isLocalAtlas(() => Promise.resolve(1)).then((res) => { + expect(res).to.be.true; + done(); + }); + }); + }); + + context("isAtlasStream", function () { + it("reports on atlas", function () { + expect( + isAtlasStream( + "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/" + ) + ).to.be.true; + expect( + isAtlasStream( + "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/" + ) + ).to.be.true; + }); + + it("works with host only", function () { + expect( + isAtlasStream( + "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net:27017" + ) + ).to.be.true; + }); + + it("works with hostname", function () { + expect( + isAtlasStream( + "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net" + ) + ).to.be.true; + }); + + it("returns true with atlas dev", function () { + expect( + isAtlasStream( + "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net/" + ) + ).to.be.true; + expect( + isAtlasStream( + "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net" + ) + ).to.be.true; + }); + + it("returns true with atlas qa", function () { + expect( + isAtlasStream( + "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net/" + ) + ).to.be.true; + expect( + isAtlasStream( + "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net" + ) + ).to.be.true; + }); + + it("returns true with atlas staging", function () { + expect( + isAtlasStream( + "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net/" + ) + ).to.be.true; + expect( + isAtlasStream( + "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net" + ) + ).to.be.true; + }); + + it("returns false if not atlas stream", function () { + expect(isAtlasStream("cat-data-sets.cats.mangodb.net")).to.be.false; + expect(isAtlasStream("cat-data-sets.catsmongodb.net")).to.be.false; + expect(isAtlasStream("cat-data-sets.cats.mongodb.netx")).to.be.false; + expect(isAtlasStream("cat-data-sets.cats.mongodb.com")).to.be.false; + expect(isAtlasStream("localhost")).to.be.false; + }); + + it("does not throw and returns with invalid argument", function () { + expect(isAtlasStream("")).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isAtlasStream(123)).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isAtlasStream({})).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isAtlasStream(undefined)).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isAtlasStream(null)).to.be.false; + }); + }); + + context("isLocalhost", function () { + it("reports on localhost", function () { + expect(isLocalhost("localhost:27019")).to.be.true; + }); + + it("reports on localhost of type 127.0.0.1", function () { + expect(isLocalhost("127.0.0.1:27019")).to.be.true; + }); + + // Although 127.0.0.1 is usually used for localhost, + // anything in the 127.0.0.1 -> 127.255.255.255 can be used. + it("reports on localhost of type 127.x.x.x", function () { + expect(isLocalhost("127.0.100.1:27019")).to.be.true; + expect(isLocalhost("127.250.100.250:27019")).to.be.true; + expect(isLocalhost("127.10.0.0:27019")).to.be.true; + }); + + // IPv6 loopback addresses. + it("reports on localhost of type [::1]", function () { + expect(isLocalhost("[::1]")).to.be.true; + expect(isLocalhost("mongodb://[::1]/?readPreference=secondary")).to.be + .true; + expect(isLocalhost("[0000:0000:0000:0000:0000:0000:0000:0001]")).to.be + .true; + expect(isLocalhost("[0:0:0:0:0:0:0:1]")).to.be.true; + expect(isLocalhost("[0::1]")).to.be.true; + expect(isLocalhost("[::1]:27019")).to.be.true; + expect(isLocalhost("[0:0:0:0:0:0:0:1]:27019")).to.be.true; + expect(isLocalhost("[0::1]:27019")).to.be.true; + }); + + it("reports on localhost of type 0.0.0.0", function () { + expect(isLocalhost("0.0.0.0:27019")).to.be.true; + }); + + it("works as url", function () { + expect(isLocalhost("mongodb://127.0.0.1:27019")).to.be.true; + expect(isLocalhost("mongodb+srv://127.0.0.1")).to.be.true; + expect(isLocalhost("mongodb://0.0.0.0:27019")).to.be.true; + expect(isLocalhost("mongodb+srv://0.0.0.0")).to.be.true; + expect(isLocalhost("mongodb://localhost")).to.be.true; + expect(isLocalhost("mongodb://localhost:27019")).to.be.true; + }); + + it("works as hostname", function () { + expect(isLocalhost("127.0.0.1")).to.be.true; + expect(isLocalhost("0.0.0.0")).to.be.true; + expect(isLocalhost("localhost")).to.be.true; + }); + + it("does not report if localhost or 127.0.0.1 is not the hostname", function () { + expect(isLocalhost("127.0.0.500")).to.be.false; + expect(isLocalhost("128.0.0.2")).to.be.false; + expect(isLocalhost("0.0.0.1")).to.be.false; + expect(isLocalhost("remotehost")).to.be.false; + expect(isLocalhost("mongodb://remotelocalhost")).to.be.false; + expect(isLocalhost("[test:ipv6::1]")).to.be.false; + expect(isLocalhost("[1:0:0:0:0:0:0:1]")).to.be.false; + expect(isLocalhost("[test:ipv6::1]:27019")).to.be.false; + expect(isLocalhost("[1:0:0:0:0:0:0:1]:27019")).to.be.false; + }); + + it("does not throw and returns with invalid argument", function () { + expect(isLocalhost("")).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isLocalhost(123)).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isLocalhost({})).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isLocalhost(undefined)).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isLocalhost(null)).to.be.false; + }); + }); + + context("isDigitalOcean", function () { + it("reports on digital ocean", function () { + expect( + isDigitalOcean( + "mongodb+srv://admin:catscatscats@dave-a1234321.mongo.ondigitalocean.com/test?authSource=admin&replicaSet=dave" + ) + ).to.be.true; + }); + + it("works with hostname only", function () { + expect(isDigitalOcean("dave-a1234321.mongo.ondigitalocean.com")).to.be + .true; + }); + + it("works with host only", function () { + expect(isDigitalOcean("dave-a1234321.mongo.ondigitalocean.com:27017")).to + .be.true; + }); + + it("returns false if not digitalocean", function () { + expect(isDigitalOcean("dave-a1234321.mongo.ondigitalocean.com2")).to.be + .false; + expect(isDigitalOcean("dave-a1234321mongo.ondigitalocean.com")).to.be + .false; + expect(isDigitalOcean("dave-a1234321.mongoxondigitalocean.com")).to.be + .false; + }); + + it("does not throw and returns with invalid argument", function () { + expect(isDigitalOcean("")).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isDigitalOcean(123)).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isDigitalOcean({})).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isDigitalOcean(undefined)).to.be.false; + /* @ts-expect-error -- passing invalid arguments */ + expect(isDigitalOcean(null)).to.be.false; + }); + }); + + context("isGenuineMongoDB", function () { + it("reports on CosmosDB", function () { + fixtures.COSMOS_DB_URI.forEach((uri) => { + const isGenuine = getGenuineMongoDB(uri); + expect(isGenuine.isGenuine).to.be.false; + expect(isGenuine.serverName).to.equal("cosmosdb"); + }); + }); + + it("reports on DocumentDB", function () { + fixtures.DOCUMENT_DB_URIS.forEach((uri) => { + const isGenuine = getGenuineMongoDB(uri); + expect(isGenuine.isGenuine).to.be.false; + expect(isGenuine.serverName).to.equal("documentdb"); + }); + }); + + it("does not report on 3.2", function () { + const isGenuine = getGenuineMongoDB( + fixtures.BUILD_INFO_3_2, + /* @ts-expect-error -- passing invalid arguments */ + fixtures.CMD_LINE_OPTS + ); + expect(isGenuine.isGenuine).to.be.true; + expect(isGenuine.serverName).to.equal("mongodb"); + }); + + it("does not report on older versions", function () { + const isGenuine = getGenuineMongoDB( + fixtures.BUILD_INFO_OLD, + /* @ts-expect-error -- passing invalid arguments */ + fixtures.CMD_LINE_OPTS + ); + expect(isGenuine.isGenuine).to.be.true; + expect(isGenuine.serverName).to.equal("mongodb"); + }); + }); +}); diff --git a/packages/mongodb-build-info/tsconfig-lint.json b/packages/mongodb-build-info/tsconfig-lint.json new file mode 100644 index 00000000..6bdef84f --- /dev/null +++ b/packages/mongodb-build-info/tsconfig-lint.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.json", + "include": ["**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/mongodb-build-info/tsconfig.json b/packages/mongodb-build-info/tsconfig.json new file mode 100644 index 00000000..d9f9753f --- /dev/null +++ b/packages/mongodb-build-info/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@mongodb-js/tsconfig-devtools/tsconfig.common.json", + "compilerOptions": { + "outDir": "dist", + "allowJs": true, + "strict": true + }, + "include": ["src/**/*", "test/**/*"], + "exclude": ["./src/**/*.spec.*", "./test/**/*.ts"] +} From e8c612198b063e07eabc874b5dfa3a94f8647b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 11:15:41 +0200 Subject: [PATCH 07/14] Migrate to TypeScript --- packages/mongodb-build-info/index.d.ts | 22 ---- packages/mongodb-build-info/index.js | 122 ------------------ packages/mongodb-build-info/src/index.ts | 157 +++++++++++++++++++++++ 3 files changed, 157 insertions(+), 144 deletions(-) delete mode 100644 packages/mongodb-build-info/index.d.ts delete mode 100644 packages/mongodb-build-info/index.js create mode 100644 packages/mongodb-build-info/src/index.ts diff --git a/packages/mongodb-build-info/index.d.ts b/packages/mongodb-build-info/index.d.ts deleted file mode 100644 index b72fbbd6..00000000 --- a/packages/mongodb-build-info/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export declare function getDataLake(buildInfo: any): { - isDataLake: boolean; - dlVersion: string; -}; - -export declare function isEnterprise(buildInfo: any): boolean; -export declare function isAtlas(uri: string): boolean; -type IsLocalAtlasCountFn = (db: string, ns: string, query: Record) => Promise; -export declare function isLocalAtlas(countFn: IsLocalAtlasCountFn): Promise; -export declare function isAtlasStream(uri: string): boolean; -export declare function isLocalhost(uri: string): boolean; -export declare function isDigitalOcean(uri: string): boolean; - -export declare function getGenuineMongoDB(uri: string): { - isGenuine: boolean; - serverName: string; -}; - -export declare function getBuildEnv(buildInfo: any): { - serverOs: string; - serverArch: string; -}; diff --git a/packages/mongodb-build-info/index.js b/packages/mongodb-build-info/index.js deleted file mode 100644 index 803423ee..00000000 --- a/packages/mongodb-build-info/index.js +++ /dev/null @@ -1,122 +0,0 @@ -const { default: ConnectionString } = require('mongodb-connection-string-url'); - -const ATLAS_REGEX = /\.mongodb(-dev|-qa|-stage)?\.net$/i; -const ATLAS_STREAM_REGEX = /^atlas-stream-.+/i; -const LOCALHOST_REGEX = /^(localhost|127\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])|0\.0\.0\.0|(?:0*\:)*?:?0*1)$/i; -const DIGITAL_OCEAN_REGEX = /\.mongo\.ondigitalocean\.com$/i; -const COSMOS_DB_REGEX = /\.cosmos\.azure\.com$/i; -const DOCUMENT_DB_REGEX = /docdb(-elastic)?\.amazonaws\.com$/i; - -function getDataLake(buildInfo) { - const res = { - isDataLake: false, - dlVersion: null - }; - - if (buildInfo.dataLake) { - res.isDataLake = true; - res.dlVersion = buildInfo.dataLake.version; - } - - return res; -} - -function isEnterprise(buildInfo) { - if (buildInfo.gitVersion && buildInfo.gitVersion.match(/enterprise/)) { - return true; - } - - if (buildInfo.modules && buildInfo.modules.indexOf('enterprise') !== -1) { - return true; - } - - return false; -} - -function getHostnameFromHost(host) { - if (host.startsWith('[')) { - // If it's ipv6 return what's in the brackets. - return host.substring(1).split(']')[0]; - } - return host.split(':')[0]; -} - -function getHostnameFromUrl(url) { - if (typeof url !== 'string') { - return ''; - } - - try { - const connectionString = new ConnectionString(url); - return getHostnameFromHost(connectionString.hosts[0]); - } catch (e) { - // we assume is already an hostname, will further be checked against regexes - return getHostnameFromHost(url); - } -} - -function isAtlas(uri) { - return !!getHostnameFromUrl(uri).match(ATLAS_REGEX); -} - -function isLocalAtlas(countFn) { - return countFn('admin', 'atlascli', { - managedClusterType: 'atlasCliLocalDevCluster' - }).then(count => count > 0).catch(() => false); -} - -function isAtlasStream(uri) { - const host = getHostnameFromUrl(uri); - return !!(host.match(ATLAS_REGEX) && host.match(ATLAS_STREAM_REGEX)); -} - -function isLocalhost(uri) { - return !!getHostnameFromUrl(uri).match(LOCALHOST_REGEX); -} - -function isDigitalOcean(uri) { - return !!getHostnameFromUrl(uri).match(DIGITAL_OCEAN_REGEX); -} - -function getBuildEnv(buildInfo) { - const serverOs = buildInfo.buildEnvironment ? - buildInfo.buildEnvironment.target_os : null; - const serverArch = buildInfo.buildEnvironment ? - buildInfo.buildEnvironment.target_arch : null; - - return { serverOs, serverArch }; -} - -function getGenuineMongoDB(uri) { - const hostname = getHostnameFromUrl(uri); - if (hostname.match(COSMOS_DB_REGEX)) { - return { - isGenuine: false, - serverName: 'cosmosdb' - }; - } - - if (hostname.match(DOCUMENT_DB_REGEX)) { - return { - isGenuine: false, - serverName: 'documentdb' - }; - } - - return { - isGenuine: true, - serverName: 'mongodb' - }; -} - -module.exports = { - getDataLake, - isEnterprise, - isAtlas, - isLocalAtlas, - isAtlasStream, - isLocalhost, - isDigitalOcean, - getGenuineMongoDB, - getBuildEnv -}; diff --git a/packages/mongodb-build-info/src/index.ts b/packages/mongodb-build-info/src/index.ts new file mode 100644 index 00000000..5e0707ff --- /dev/null +++ b/packages/mongodb-build-info/src/index.ts @@ -0,0 +1,157 @@ +import ConnectionString from "mongodb-connection-string-url"; + +const ATLAS_REGEX = /\.mongodb(-dev|-qa|-stage)?\.net$/i; +const ATLAS_STREAM_REGEX = /^atlas-stream-.+/i; +const LOCALHOST_REGEX = + /^(localhost|127\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])|0\.0\.0\.0|(?:0*\:)*?:?0*1)$/i; +const DIGITAL_OCEAN_REGEX = /\.mongo\.ondigitalocean\.com$/i; +const COSMOS_DB_REGEX = /\.cosmos\.azure\.com$/i; +const DOCUMENT_DB_REGEX = /docdb(-elastic)?\.amazonaws\.com$/i; + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null; +} + +export function getDataLake(buildInfo: unknown): { + isDataLake: boolean; + dlVersion: string | null; +} { + if ( + isRecord(buildInfo) && + isRecord(buildInfo.dataLake) && + typeof buildInfo.dataLake.version === "string" + ) { + return { + isDataLake: true, + dlVersion: buildInfo.dataLake.version, + }; + } else { + return { + isDataLake: false, + dlVersion: null, + }; + } +} + +export function isEnterprise(buildInfo: unknown): boolean { + if (!isRecord(buildInfo)) { + return false; + } + + if ( + typeof buildInfo.gitVersion === "string" && + buildInfo.gitVersion.match(/enterprise/) + ) { + return true; + } + + if ( + Array.isArray(buildInfo.modules) && + buildInfo.modules.indexOf("enterprise") !== -1 + ) { + return true; + } + + return false; +} + +function getHostnameFromHost(host: string): string { + if (host.startsWith("[")) { + // If it's ipv6 return what's in the brackets. + return host.substring(1).split("]")[0]; + } + return host.split(":")[0]; +} + +function getHostnameFromUrl(url: unknown): string { + if (typeof url !== "string") { + return ""; + } + + try { + const connectionString = new ConnectionString(url); + return getHostnameFromHost(connectionString.hosts[0]); + } catch (e) { + // we assume is already an hostname, will further be checked against regexes + return getHostnameFromHost(url); + } +} + +export function isAtlas(uri: string): boolean { + return !!getHostnameFromUrl(uri).match(ATLAS_REGEX); +} + +type IsLocalAtlasCountFn = ( + db: string, + ns: string, + query: Record +) => Promise; +export async function isLocalAtlas( + countFn: IsLocalAtlasCountFn +): Promise { + try { + const count = await countFn("admin", "atlascli", { + managedClusterType: "atlasCliLocalDevCluster", + }); + return count > 0; + } catch { + return false; + } +} +export function isAtlasStream(uri: string): boolean { + const host = getHostnameFromUrl(uri); + return !!(host.match(ATLAS_REGEX) && host.match(ATLAS_STREAM_REGEX)); +} +export function isLocalhost(uri: string): boolean { + return !!getHostnameFromUrl(uri).match(LOCALHOST_REGEX); +} +export function isDigitalOcean(uri: string): boolean { + return !!getHostnameFromUrl(uri).match(DIGITAL_OCEAN_REGEX); +} + +export function getGenuineMongoDB(uri: string): { + isGenuine: boolean; + serverName: string; +} { + const hostname = getHostnameFromUrl(uri); + if (hostname.match(COSMOS_DB_REGEX)) { + return { + isGenuine: false, + serverName: "cosmosdb", + }; + } + + if (hostname.match(DOCUMENT_DB_REGEX)) { + return { + isGenuine: false, + serverName: "documentdb", + }; + } + + return { + isGenuine: true, + serverName: "mongodb", + }; +} + +export function getBuildEnv(buildInfo: unknown): { + serverOs: string | null; + serverArch: string | null; +} { + if (!isRecord(buildInfo) || !isRecord(buildInfo.buildEnvironment)) { + return { serverOs: null, serverArch: null }; + } + + const { buildEnvironment } = buildInfo; + + return { + serverOs: + typeof buildEnvironment.target_os === "string" + ? buildEnvironment.target_os + : null, + serverArch: + typeof buildEnvironment.target_arch === "string" + ? buildEnvironment.target_arch + : null, + }; +} From 9b0665305992ead3365f698fb07262f561fd482a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 14:59:05 +0200 Subject: [PATCH 08/14] Add tests to increase coverage --- .../mongodb-build-info/test/index.spec.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/mongodb-build-info/test/index.spec.ts b/packages/mongodb-build-info/test/index.spec.ts index 0e081a6b..56d8dc57 100644 --- a/packages/mongodb-build-info/test/index.spec.ts +++ b/packages/mongodb-build-info/test/index.spec.ts @@ -41,6 +41,14 @@ describe("mongodb-build-info", function () { it("detects enterprise module for >= 3.2", function () { expect(isEnterprise(fixtures.BUILD_INFO_3_2)).to.be.true; }); + + it("returns false when passed invalid argument", function () { + expect(isEnterprise("")).to.be.false; + expect(isEnterprise(123)).to.be.false; + expect(isEnterprise({})).to.be.false; + expect(isEnterprise(undefined)).to.be.false; + expect(isEnterprise(null)).to.be.false; + }); }); context("getBuildEnv", function () { @@ -49,6 +57,25 @@ describe("mongodb-build-info", function () { expect(buildEnv.serverOs).to.equal("osx"); expect(buildEnv.serverArch).to.equal("x86_64"); }); + + it("returns null when passed an invalid argument", function () { + expect(getBuildEnv(null)).to.deep.equal({ + serverOs: null, + serverArch: null, + }); + expect(getBuildEnv("")).to.deep.equal({ + serverOs: null, + serverArch: null, + }); + expect(getBuildEnv(undefined)).to.deep.equal({ + serverOs: null, + serverArch: null, + }); + expect(getBuildEnv({ buildEnvironment: {} })).to.deep.equal({ + serverOs: null, + serverArch: null, + }); + }); }); context("isAtlas", function () { From c943d303fb00de088513519bef6594f6ff155f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 16:36:35 +0200 Subject: [PATCH 09/14] Add more package scripts --- packages/mongodb-build-info/.prettierignore | 3 +++ packages/mongodb-build-info/.prettierrc.json | 1 + packages/mongodb-build-info/package.json | 14 +++++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 packages/mongodb-build-info/.prettierignore create mode 100644 packages/mongodb-build-info/.prettierrc.json diff --git a/packages/mongodb-build-info/.prettierignore b/packages/mongodb-build-info/.prettierignore new file mode 100644 index 00000000..4d28df66 --- /dev/null +++ b/packages/mongodb-build-info/.prettierignore @@ -0,0 +1,3 @@ +.nyc_output +dist +coverage diff --git a/packages/mongodb-build-info/.prettierrc.json b/packages/mongodb-build-info/.prettierrc.json new file mode 100644 index 00000000..dfae21d0 --- /dev/null +++ b/packages/mongodb-build-info/.prettierrc.json @@ -0,0 +1 @@ +"@mongodb-js/prettier-config-devtools" diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json index 43bb792a..7046434b 100644 --- a/packages/mongodb-build-info/package.json +++ b/packages/mongodb-build-info/package.json @@ -33,15 +33,23 @@ "directory": "packages/mongodb-build-info" }, "license": "Apache-2.0", - "main": "index.js", + "main": "./dist/index.js", "scripts": { - "lint": "eslint .", + "bootstrap": "npm run compile", + "prepublishOnly": "npm run compile", + "compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs", + "typecheck": "tsc --noEmit", + "eslint": "eslint .", + "prettier": "prettier", + "lint": "npm run eslint . && npm run prettier -- --check .", "depcheck": "depcheck", - "check": "npm run depcheck && npm run lint", + "check": "npm run typecheck && npm run lint && npm run depcheck", + "check-ci": "npm run check", "test": "mocha **/*.spec.ts", "test-cov": "nyc -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test", "test-watch": "npm run test -- --watch", "test-ci": "npm run test-cov", + "reformat": "npm run prettier -- --write .", "release": "release-it" }, "devDependencies": { From aab563cf802ddaa4a1f73c5159bb811b772548d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 16:36:42 +0200 Subject: [PATCH 10/14] Ran reformat --- packages/mongodb-build-info/README.md | 53 +-- packages/mongodb-build-info/src/index.ts | 38 +- packages/mongodb-build-info/test/fixtures.ts | 102 +++--- .../mongodb-build-info/test/index.spec.ts | 330 +++++++++--------- 4 files changed, 268 insertions(+), 255 deletions(-) diff --git a/packages/mongodb-build-info/README.md b/packages/mongodb-build-info/README.md index b64339a3..4d8cbb82 100644 --- a/packages/mongodb-build-info/README.md +++ b/packages/mongodb-build-info/README.md @@ -4,74 +4,87 @@ Helpful functions to figure out if a connection is on Atlas, Atlas Data Lake, Enterpise, or DocumentDB/CosmosDB. # Usage + ```js -const getBuildInfo = require('mongodb-build-info') -const MongoClient = require('mongodb').MongoClient +const getBuildInfo = require('mongodb-build-info'); +const MongoClient = require('mongodb').MongoClient; MongoClient.connect('localhost:27017', function (err, client) { - const adminDB = client.db('test').admin() + const adminDB = client.db('test').admin(); let buildInfo; - adminDB.command({ buildInfo: 1 }, {}, parseBuildInfo) - adminDB.command({ getCmdLineOpts: 1 }, {}, parseCmdLineOpts) + adminDB.command({ buildInfo: 1 }, {}, parseBuildInfo); + adminDB.command({ getCmdLineOpts: 1 }, {}, parseCmdLineOpts); - function parseBuildInfo (err, res) { - if (err) console.log('Command failed, ', err) - buildInfo = res + function parseBuildInfo(err, res) { + if (err) console.log('Command failed, ', err); + buildInfo = res; - const { isDataLake, dlVersion } = getBuildInfo.getDataLake(buildInfo) - const isEnterprise = getBuildInfo.isEnterprise(buildInfo) + const { isDataLake, dlVersion } = getBuildInfo.getDataLake(buildInfo); + const isEnterprise = getBuildInfo.isEnterprise(buildInfo); } - function parseCmdLineOpts (err, res) { - if (err) console.log('Command failed', err.message) + function parseCmdLineOpts(err, res) { + if (err) console.log('Command failed', err.message); - const { isGenuine, serverName } = getGenuineMongoDB(buildInfo, res) + const { isGenuine, serverName } = getGenuineMongoDB(buildInfo, res); } -}) +}); ``` ## API + ### getDataLake(buildInfo) + Returns an object: -__isDataLake__: boolean. -__dlVersion__: version of dataLake, a string. +**isDataLake**: boolean. +**dlVersion**: version of dataLake, a string. ### isEnterprise(buildInfo) + Returns a boolean. ### isAtlas(uri) + Returns a boolean. ### isLocalAtlas(count: (db: string, coll: string, query: Document) => Promise\) + Returns a Promise\. ### isAtlasStream(uri) + Returns a boolean. ### isLocalhost(uri) + Returns a boolean. ### isDigitalOcean(uri) + Returns a boolean. ### getGenuineMongoDB(buildInfo, cmdLineOpts) + Returns an object: -__isGenuine__: boolean. -__serverName__: name of the server (mongoDB, cosmosDB, or documentDB). +**isGenuine**: boolean. +**serverName**: name of the server (mongoDB, cosmosDB, or documentDB). ### getBuildEnv(buildInfo) + Returns an object: -__serverOs__: build's OS version (macOS, linux, windows etc.). -__serverArch__: build's architecture (e.g. x86_64). +**serverOs**: build's OS version (macOS, linux, windows etc.). +**serverArch**: build's architecture (e.g. x86_64). # Installation + ``` npm install -S mongodb-build-info ``` # License + Apache-2.0 diff --git a/packages/mongodb-build-info/src/index.ts b/packages/mongodb-build-info/src/index.ts index 5e0707ff..bd7dd3ee 100644 --- a/packages/mongodb-build-info/src/index.ts +++ b/packages/mongodb-build-info/src/index.ts @@ -1,4 +1,4 @@ -import ConnectionString from "mongodb-connection-string-url"; +import ConnectionString from 'mongodb-connection-string-url'; const ATLAS_REGEX = /\.mongodb(-dev|-qa|-stage)?\.net$/i; const ATLAS_STREAM_REGEX = /^atlas-stream-.+/i; @@ -9,7 +9,7 @@ const COSMOS_DB_REGEX = /\.cosmos\.azure\.com$/i; const DOCUMENT_DB_REGEX = /docdb(-elastic)?\.amazonaws\.com$/i; function isRecord(value: unknown): value is Record { - return typeof value === "object" && value !== null; + return typeof value === 'object' && value !== null; } export function getDataLake(buildInfo: unknown): { @@ -19,7 +19,7 @@ export function getDataLake(buildInfo: unknown): { if ( isRecord(buildInfo) && isRecord(buildInfo.dataLake) && - typeof buildInfo.dataLake.version === "string" + typeof buildInfo.dataLake.version === 'string' ) { return { isDataLake: true, @@ -39,7 +39,7 @@ export function isEnterprise(buildInfo: unknown): boolean { } if ( - typeof buildInfo.gitVersion === "string" && + typeof buildInfo.gitVersion === 'string' && buildInfo.gitVersion.match(/enterprise/) ) { return true; @@ -47,7 +47,7 @@ export function isEnterprise(buildInfo: unknown): boolean { if ( Array.isArray(buildInfo.modules) && - buildInfo.modules.indexOf("enterprise") !== -1 + buildInfo.modules.indexOf('enterprise') !== -1 ) { return true; } @@ -56,16 +56,16 @@ export function isEnterprise(buildInfo: unknown): boolean { } function getHostnameFromHost(host: string): string { - if (host.startsWith("[")) { + if (host.startsWith('[')) { // If it's ipv6 return what's in the brackets. - return host.substring(1).split("]")[0]; + return host.substring(1).split(']')[0]; } - return host.split(":")[0]; + return host.split(':')[0]; } function getHostnameFromUrl(url: unknown): string { - if (typeof url !== "string") { - return ""; + if (typeof url !== 'string') { + return ''; } try { @@ -84,14 +84,14 @@ export function isAtlas(uri: string): boolean { type IsLocalAtlasCountFn = ( db: string, ns: string, - query: Record + query: Record, ) => Promise; export async function isLocalAtlas( - countFn: IsLocalAtlasCountFn + countFn: IsLocalAtlasCountFn, ): Promise { try { - const count = await countFn("admin", "atlascli", { - managedClusterType: "atlasCliLocalDevCluster", + const count = await countFn('admin', 'atlascli', { + managedClusterType: 'atlasCliLocalDevCluster', }); return count > 0; } catch { @@ -117,20 +117,20 @@ export function getGenuineMongoDB(uri: string): { if (hostname.match(COSMOS_DB_REGEX)) { return { isGenuine: false, - serverName: "cosmosdb", + serverName: 'cosmosdb', }; } if (hostname.match(DOCUMENT_DB_REGEX)) { return { isGenuine: false, - serverName: "documentdb", + serverName: 'documentdb', }; } return { isGenuine: true, - serverName: "mongodb", + serverName: 'mongodb', }; } @@ -146,11 +146,11 @@ export function getBuildEnv(buildInfo: unknown): { return { serverOs: - typeof buildEnvironment.target_os === "string" + typeof buildEnvironment.target_os === 'string' ? buildEnvironment.target_os : null, serverArch: - typeof buildEnvironment.target_arch === "string" + typeof buildEnvironment.target_arch === 'string' ? buildEnvironment.target_arch : null, }; diff --git a/packages/mongodb-build-info/test/fixtures.ts b/packages/mongodb-build-info/test/fixtures.ts index 24e1d677..775e010e 100644 --- a/packages/mongodb-build-info/test/fixtures.ts +++ b/packages/mongodb-build-info/test/fixtures.ts @@ -1,16 +1,16 @@ export const BUILD_INFO_OLD = { - version: "2.6.11", - gitVersion: "d00c1735675c457f75a12d530bee85421f0c5548 modules: enterprise", - OpenSSLVersion: "OpenSSL 1.0.1f 6 Jan 2014", + version: '2.6.11', + gitVersion: 'd00c1735675c457f75a12d530bee85421f0c5548 modules: enterprise', + OpenSSLVersion: 'OpenSSL 1.0.1f 6 Jan 2014', sysInfo: - "Linux ip-10-203-203-194 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49", + 'Linux ip-10-203-203-194 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49', loaderFlags: - "-fPIC -pthread -Wl,-z,now -rdynamic -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-E", + '-fPIC -pthread -Wl,-z,now -rdynamic -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-E', compilerFlags: - "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -fno-builtin-memcmp", - allocator: "tcmalloc", + '-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -fno-builtin-memcmp', + allocator: 'tcmalloc', versionArray: [2, 6, 11, 0], - javascriptEngine: "V8", + javascriptEngine: 'V8', bits: 64, debug: false, maxBsonObjectSize: 16777216, @@ -18,95 +18,95 @@ export const BUILD_INFO_OLD = { }; export const BUILD_INFO_3_2 = { - version: "3.2.0-rc2", - gitVersion: "8a3acb42742182c5e314636041c2df368232bbc5", - modules: ["enterprise"], - allocator: "system", - javascriptEngine: "mozjs", - sysInfo: "deprecated", + version: '3.2.0-rc2', + gitVersion: '8a3acb42742182c5e314636041c2df368232bbc5', + modules: ['enterprise'], + allocator: 'system', + javascriptEngine: 'mozjs', + sysInfo: 'deprecated', versionArray: [3, 2, 0, -48], openssl: { - running: "OpenSSL 0.9.8zg 14 July 2015", - compiled: "OpenSSL 0.9.8y 5 Feb 2013", + running: 'OpenSSL 0.9.8zg 14 July 2015', + compiled: 'OpenSSL 0.9.8y 5 Feb 2013', }, buildEnvironment: { - distmod: "", - distarch: "x86_64", - cc: "gcc: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", + distmod: '', + distarch: 'x86_64', + cc: 'gcc: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)', ccflags: - "-fno-omit-frame-pointer -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -Wno-missing-braces -mmacosx-version-min=10.7 -fno-builtin-memcmp", - cxx: "g++: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", + '-fno-omit-frame-pointer -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -Wno-missing-braces -mmacosx-version-min=10.7 -fno-builtin-memcmp', + cxx: 'g++: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)', cxxflags: - "-Wnon-virtual-dtor -Woverloaded-virtual -stdlib=libc++ -std=c++11", + '-Wnon-virtual-dtor -Woverloaded-virtual -stdlib=libc++ -std=c++11', linkflags: - "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.7 -stdlib=libc++ -fuse-ld=gold", - target_arch: "x86_64", - target_os: "osx", + '-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.7 -stdlib=libc++ -fuse-ld=gold', + target_arch: 'x86_64', + target_os: 'osx', }, bits: 64, debug: false, maxBsonObjectSize: 16777216, storageEngines: [ - "devnull", - "ephemeralForTest", - "inMemory", - "mmapv1", - "wiredTiger", + 'devnull', + 'ephemeralForTest', + 'inMemory', + 'mmapv1', + 'wiredTiger', ], ok: 1, }; export const CMD_LINE_OPTS = { argv: [ - "/opt/mongodb-osx-x86_64-enterprise-3.6.3/bin/mongod", - "--dbpath=/Users/user/testdata", + '/opt/mongodb-osx-x86_64-enterprise-3.6.3/bin/mongod', + '--dbpath=/Users/user/testdata', ], parsed: { storage: { - dbPath: "/Users/user/testdata", + dbPath: '/Users/user/testdata', }, }, ok: 1, }; export const COSMOS_DB_URI = [ - "mongodb://x:y@compass-serverless.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass-serverless@", - "mongodb://x:y@compass.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass@", - "mongodb+srv://x:y@compass-vcore.mongocluster.cosmos.azure.com/?retrywrites=false&maxIdleTimeMS=120000", + 'mongodb://x:y@compass-serverless.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass-serverless@', + 'mongodb://x:y@compass.mongo.cosmos.azure.com:19555/?ssl=true&retrywrites=false&maxIdleTimeMS=120000&appName=@compass@', + 'mongodb+srv://x:y@compass-vcore.mongocluster.cosmos.azure.com/?retrywrites=false&maxIdleTimeMS=120000', ]; export const DOCUMENT_DB_URIS = [ - "mongodb://x:y@docdb-2001-01-01-01-01-01.cluster-abc.eu-central-1.docdb.amazonaws.com:27017/?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false", - "mongodb://x:y@elastic-docdb-123456789.eu-central-1.docdb-elastic.amazonaws.com:27017", + 'mongodb://x:y@docdb-2001-01-01-01-01-01.cluster-abc.eu-central-1.docdb.amazonaws.com:27017/?replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false', + 'mongodb://x:y@elastic-docdb-123456789.eu-central-1.docdb-elastic.amazonaws.com:27017', ]; export const COSMOSDB_BUILD_INFO = { - _t: "BuildInfoResponse", + _t: 'BuildInfoResponse', ok: 1, - version: "3.2.0", - gitVersion: "45d947729a0315accb6d4f15a6b06be6d9c19fe7", - targetMinOS: "Windows 7/Windows Server 2008 R2", + version: '3.2.0', + gitVersion: '45d947729a0315accb6d4f15a6b06be6d9c19fe7', + targetMinOS: 'Windows 7/Windows Server 2008 R2', modules: [], - allocator: "tcmalloc", - javascriptEngine: "Chakra", - sysInfo: "deprecated", + allocator: 'tcmalloc', + javascriptEngine: 'Chakra', + sysInfo: 'deprecated', versionArray: [3, 2, 0, 0], bits: 64, debug: false, maxBsonObjectSize: 524288, openssl: { - running: "OpenSSL 1.0.1p-fips 9 Jul 2015", - compiled: "OpenSSL 1.0.1p-fips 9 Jul 2015", + running: 'OpenSSL 1.0.1p-fips 9 Jul 2015', + compiled: 'OpenSSL 1.0.1p-fips 9 Jul 2015', }, }; export const DATALAKE_BUILD_INFO = { ok: 1, - version: "3.6.0", + version: '3.6.0', versionArray: [3, 6, 0, 0], dataLake: { - version: "v20200329", - gitVersion: "0f318ss78bfad79ede3721e91iasj6f61644f", - date: "2020-03-29T15:41:22Z", + version: 'v20200329', + gitVersion: '0f318ss78bfad79ede3721e91iasj6f61644f', + date: '2020-03-29T15:41:22Z', }, }; diff --git a/packages/mongodb-build-info/test/index.spec.ts b/packages/mongodb-build-info/test/index.spec.ts index 56d8dc57..ca5989c6 100644 --- a/packages/mongodb-build-info/test/index.spec.ts +++ b/packages/mongodb-build-info/test/index.spec.ts @@ -1,5 +1,5 @@ -import { expect } from "chai"; -import * as fixtures from "./fixtures"; +import { expect } from 'chai'; +import * as fixtures from './fixtures'; import { isAtlas, isAtlasStream, @@ -10,40 +10,40 @@ import { getBuildEnv, isEnterprise, getGenuineMongoDB, -} from "../src/index"; +} from '../src/index'; -describe("mongodb-build-info", function () { - context("isDataLake", function () { - it("reports on DataLake", function () { +describe('mongodb-build-info', function () { + context('isDataLake', function () { + it('reports on DataLake', function () { const isDL = getDataLake(fixtures.DATALAKE_BUILD_INFO); expect(isDL.isDataLake).to.be.true; - expect(isDL.dlVersion).to.equal("v20200329"); + expect(isDL.dlVersion).to.equal('v20200329'); }); - it("does not report on 3.2", function () { + it('does not report on 3.2', function () { const isDL = getDataLake(fixtures.BUILD_INFO_3_2); expect(isDL.isDataLake).to.be.false; expect(isDL.dlVersion).to.equal(null); }); - it("does not report on older versions", function () { + it('does not report on older versions', function () { const isDL = getDataLake(fixtures.BUILD_INFO_OLD); expect(isDL.isDataLake).to.be.false; expect(isDL.dlVersion).to.equal(null); }); }); - context("isEnterprise", function () { - it("detects enterprise module for 2.6 and 3.0", function () { + context('isEnterprise', function () { + it('detects enterprise module for 2.6 and 3.0', function () { expect(isEnterprise(fixtures.BUILD_INFO_OLD)).to.be.true; }); - it("detects enterprise module for >= 3.2", function () { + it('detects enterprise module for >= 3.2', function () { expect(isEnterprise(fixtures.BUILD_INFO_3_2)).to.be.true; }); - it("returns false when passed invalid argument", function () { - expect(isEnterprise("")).to.be.false; + it('returns false when passed invalid argument', function () { + expect(isEnterprise('')).to.be.false; expect(isEnterprise(123)).to.be.false; expect(isEnterprise({})).to.be.false; expect(isEnterprise(undefined)).to.be.false; @@ -51,19 +51,19 @@ describe("mongodb-build-info", function () { }); }); - context("getBuildEnv", function () { - it("returns server os and server arch", function () { + context('getBuildEnv', function () { + it('returns server os and server arch', function () { const buildEnv = getBuildEnv(fixtures.BUILD_INFO_3_2); - expect(buildEnv.serverOs).to.equal("osx"); - expect(buildEnv.serverArch).to.equal("x86_64"); + expect(buildEnv.serverOs).to.equal('osx'); + expect(buildEnv.serverArch).to.equal('x86_64'); }); - it("returns null when passed an invalid argument", function () { + it('returns null when passed an invalid argument', function () { expect(getBuildEnv(null)).to.deep.equal({ serverOs: null, serverArch: null, }); - expect(getBuildEnv("")).to.deep.equal({ + expect(getBuildEnv('')).to.deep.equal({ serverOs: null, serverArch: null, }); @@ -78,70 +78,70 @@ describe("mongodb-build-info", function () { }); }); - context("isAtlas", function () { - it("reports on atlas", function () { + context('isAtlas', function () { + it('reports on atlas', function () { expect( isAtlas( - "mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin" - ) + 'mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin', + ), ).to.be.true; expect( isAtlas( - "mongodb://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin" - ) + 'mongodb://admin:catscatscats@cat-data-sets.cats.mongodb.net/admin', + ), ).to.be.true; expect( isAtlas( - "mongodb://admin:catscatscats@cat-data-sets.cats1.mongodb.net,cat-data-sets.cats2.mongodb.net/admin" - ) + 'mongodb://admin:catscatscats@cat-data-sets.cats1.mongodb.net,cat-data-sets.cats2.mongodb.net/admin', + ), ).to.be.true; }); - it("works with host only", function () { - expect(isAtlas("cat-data-sets.cats.mongodb.net:27017")).to.be.true; + it('works with host only', function () { + expect(isAtlas('cat-data-sets.cats.mongodb.net:27017')).to.be.true; }); - it("works with hostname", function () { - expect(isAtlas("cat-data-sets.cats.mongodb.net")).to.be.true; + it('works with hostname', function () { + expect(isAtlas('cat-data-sets.cats.mongodb.net')).to.be.true; }); - it("returns true with atlas dev", function () { + it('returns true with atlas dev', function () { expect( isAtlas( - "mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-dev.net/admin" - ) + 'mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-dev.net/admin', + ), ).to.be.true; - expect(isAtlas("cat-data-sets.cats.mongodb-dev.net")).to.be.true; + expect(isAtlas('cat-data-sets.cats.mongodb-dev.net')).to.be.true; }); - it("returns true with atlas qa", function () { + it('returns true with atlas qa', function () { expect( isAtlas( - "mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-qa.net/admin" - ) + 'mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-qa.net/admin', + ), ).to.be.true; - expect(isAtlas("cat-data-sets.cats.mongodb-qa.net")).to.be.true; + expect(isAtlas('cat-data-sets.cats.mongodb-qa.net')).to.be.true; }); - it("returns true with atlas staging", function () { + it('returns true with atlas staging', function () { expect( isAtlas( - "mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-stage.net/admin" - ) + 'mongodb+srv://admin:catscatscats@cat-data-sets.cats.mongodb-stage.net/admin', + ), ).to.be.true; - expect(isAtlas("cat-data-sets.cats.mongodb-stage.net")).to.be.true; + expect(isAtlas('cat-data-sets.cats.mongodb-stage.net')).to.be.true; }); - it("returns false if not atlas", function () { - expect(isAtlas("cat-data-sets.cats.mangodb.net")).to.be.false; - expect(isAtlas("cat-data-sets.catsmongodb.net")).to.be.false; - expect(isAtlas("cat-data-sets.cats.mongodb.netx")).to.be.false; - expect(isAtlas("cat-data-sets.cats.mongodb.com")).to.be.false; - expect(isAtlas("localhost")).to.be.false; + it('returns false if not atlas', function () { + expect(isAtlas('cat-data-sets.cats.mangodb.net')).to.be.false; + expect(isAtlas('cat-data-sets.catsmongodb.net')).to.be.false; + expect(isAtlas('cat-data-sets.cats.mongodb.netx')).to.be.false; + expect(isAtlas('cat-data-sets.cats.mongodb.com')).to.be.false; + expect(isAtlas('localhost')).to.be.false; }); - it("does not throw and returns with invalid argument", function () { - expect(isAtlas("")).to.be.false; + it('does not throw and returns with invalid argument', function () { + expect(isAtlas('')).to.be.false; /* @ts-expect-error -- passing invalid arguments */ expect(isAtlas(123)).to.be.false; /* @ts-expect-error -- passing invalid arguments */ @@ -153,31 +153,31 @@ describe("mongodb-build-info", function () { }); }); - context("isLocalAtlas", function () { - it("calls counts function with expected args", function (done) { + context('isLocalAtlas', function () { + it('calls counts function with expected args', function (done) { void isLocalAtlas((db, coll, query) => { - expect(db).to.equal("admin"); - expect(coll).to.equal("atlascli"); + expect(db).to.equal('admin'); + expect(coll).to.equal('atlascli'); expect(query).to.deep.equal({ - managedClusterType: "atlasCliLocalDevCluster", + managedClusterType: 'atlasCliLocalDevCluster', }); done(); - throw new Error("Not implemented"); + throw new Error('Not implemented'); }); }); - it("returns false when count resolves to 0", function (done) { + it('returns false when count resolves to 0', function (done) { void isLocalAtlas(() => Promise.resolve(0)).then((res) => { expect(res).to.be.false; done(); }); }); - it("returns false when count throws", function (done) { - void isLocalAtlas(() => Promise.reject("No such db")).then((res) => { + it('returns false when count throws', function (done) { + void isLocalAtlas(() => Promise.reject('No such db')).then((res) => { expect(res).to.be.false; done(); }); }); - it("returns true when count resolves to 1", function (done) { + it('returns true when count resolves to 1', function (done) { void isLocalAtlas(() => Promise.resolve(1)).then((res) => { expect(res).to.be.true; done(); @@ -185,85 +185,85 @@ describe("mongodb-build-info", function () { }); }); - context("isAtlasStream", function () { - it("reports on atlas", function () { + context('isAtlasStream', function () { + it('reports on atlas', function () { expect( isAtlasStream( - "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/" - ) + 'mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/', + ), ).to.be.true; expect( isAtlasStream( - "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/" - ) + 'mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net/', + ), ).to.be.true; }); - it("works with host only", function () { + it('works with host only', function () { expect( isAtlasStream( - "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net:27017" - ) + 'atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net:27017', + ), ).to.be.true; }); - it("works with hostname", function () { + it('works with hostname', function () { expect( isAtlasStream( - "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net" - ) + 'atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb.net', + ), ).to.be.true; }); - it("returns true with atlas dev", function () { + it('returns true with atlas dev', function () { expect( isAtlasStream( - "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net/" - ) + 'mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net/', + ), ).to.be.true; expect( isAtlasStream( - "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net" - ) + 'atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-dev.net', + ), ).to.be.true; }); - it("returns true with atlas qa", function () { + it('returns true with atlas qa', function () { expect( isAtlasStream( - "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net/" - ) + 'mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net/', + ), ).to.be.true; expect( isAtlasStream( - "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net" - ) + 'atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-qa.net', + ), ).to.be.true; }); - it("returns true with atlas staging", function () { + it('returns true with atlas staging', function () { expect( isAtlasStream( - "mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net/" - ) + 'mongodb://admin:catscatscats@atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net/', + ), ).to.be.true; expect( isAtlasStream( - "atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net" - ) + 'atlas-stream-64ba1372b2a9f1545031f34d-gkumd.virginia-usa.a.query.mongodb-stage.net', + ), ).to.be.true; }); - it("returns false if not atlas stream", function () { - expect(isAtlasStream("cat-data-sets.cats.mangodb.net")).to.be.false; - expect(isAtlasStream("cat-data-sets.catsmongodb.net")).to.be.false; - expect(isAtlasStream("cat-data-sets.cats.mongodb.netx")).to.be.false; - expect(isAtlasStream("cat-data-sets.cats.mongodb.com")).to.be.false; - expect(isAtlasStream("localhost")).to.be.false; + it('returns false if not atlas stream', function () { + expect(isAtlasStream('cat-data-sets.cats.mangodb.net')).to.be.false; + expect(isAtlasStream('cat-data-sets.catsmongodb.net')).to.be.false; + expect(isAtlasStream('cat-data-sets.cats.mongodb.netx')).to.be.false; + expect(isAtlasStream('cat-data-sets.cats.mongodb.com')).to.be.false; + expect(isAtlasStream('localhost')).to.be.false; }); - it("does not throw and returns with invalid argument", function () { - expect(isAtlasStream("")).to.be.false; + it('does not throw and returns with invalid argument', function () { + expect(isAtlasStream('')).to.be.false; /* @ts-expect-error -- passing invalid arguments */ expect(isAtlasStream(123)).to.be.false; /* @ts-expect-error -- passing invalid arguments */ @@ -275,70 +275,70 @@ describe("mongodb-build-info", function () { }); }); - context("isLocalhost", function () { - it("reports on localhost", function () { - expect(isLocalhost("localhost:27019")).to.be.true; + context('isLocalhost', function () { + it('reports on localhost', function () { + expect(isLocalhost('localhost:27019')).to.be.true; }); - it("reports on localhost of type 127.0.0.1", function () { - expect(isLocalhost("127.0.0.1:27019")).to.be.true; + it('reports on localhost of type 127.0.0.1', function () { + expect(isLocalhost('127.0.0.1:27019')).to.be.true; }); // Although 127.0.0.1 is usually used for localhost, // anything in the 127.0.0.1 -> 127.255.255.255 can be used. - it("reports on localhost of type 127.x.x.x", function () { - expect(isLocalhost("127.0.100.1:27019")).to.be.true; - expect(isLocalhost("127.250.100.250:27019")).to.be.true; - expect(isLocalhost("127.10.0.0:27019")).to.be.true; + it('reports on localhost of type 127.x.x.x', function () { + expect(isLocalhost('127.0.100.1:27019')).to.be.true; + expect(isLocalhost('127.250.100.250:27019')).to.be.true; + expect(isLocalhost('127.10.0.0:27019')).to.be.true; }); // IPv6 loopback addresses. - it("reports on localhost of type [::1]", function () { - expect(isLocalhost("[::1]")).to.be.true; - expect(isLocalhost("mongodb://[::1]/?readPreference=secondary")).to.be + it('reports on localhost of type [::1]', function () { + expect(isLocalhost('[::1]')).to.be.true; + expect(isLocalhost('mongodb://[::1]/?readPreference=secondary')).to.be .true; - expect(isLocalhost("[0000:0000:0000:0000:0000:0000:0000:0001]")).to.be + expect(isLocalhost('[0000:0000:0000:0000:0000:0000:0000:0001]')).to.be .true; - expect(isLocalhost("[0:0:0:0:0:0:0:1]")).to.be.true; - expect(isLocalhost("[0::1]")).to.be.true; - expect(isLocalhost("[::1]:27019")).to.be.true; - expect(isLocalhost("[0:0:0:0:0:0:0:1]:27019")).to.be.true; - expect(isLocalhost("[0::1]:27019")).to.be.true; + expect(isLocalhost('[0:0:0:0:0:0:0:1]')).to.be.true; + expect(isLocalhost('[0::1]')).to.be.true; + expect(isLocalhost('[::1]:27019')).to.be.true; + expect(isLocalhost('[0:0:0:0:0:0:0:1]:27019')).to.be.true; + expect(isLocalhost('[0::1]:27019')).to.be.true; }); - it("reports on localhost of type 0.0.0.0", function () { - expect(isLocalhost("0.0.0.0:27019")).to.be.true; + it('reports on localhost of type 0.0.0.0', function () { + expect(isLocalhost('0.0.0.0:27019')).to.be.true; }); - it("works as url", function () { - expect(isLocalhost("mongodb://127.0.0.1:27019")).to.be.true; - expect(isLocalhost("mongodb+srv://127.0.0.1")).to.be.true; - expect(isLocalhost("mongodb://0.0.0.0:27019")).to.be.true; - expect(isLocalhost("mongodb+srv://0.0.0.0")).to.be.true; - expect(isLocalhost("mongodb://localhost")).to.be.true; - expect(isLocalhost("mongodb://localhost:27019")).to.be.true; + it('works as url', function () { + expect(isLocalhost('mongodb://127.0.0.1:27019')).to.be.true; + expect(isLocalhost('mongodb+srv://127.0.0.1')).to.be.true; + expect(isLocalhost('mongodb://0.0.0.0:27019')).to.be.true; + expect(isLocalhost('mongodb+srv://0.0.0.0')).to.be.true; + expect(isLocalhost('mongodb://localhost')).to.be.true; + expect(isLocalhost('mongodb://localhost:27019')).to.be.true; }); - it("works as hostname", function () { - expect(isLocalhost("127.0.0.1")).to.be.true; - expect(isLocalhost("0.0.0.0")).to.be.true; - expect(isLocalhost("localhost")).to.be.true; + it('works as hostname', function () { + expect(isLocalhost('127.0.0.1')).to.be.true; + expect(isLocalhost('0.0.0.0')).to.be.true; + expect(isLocalhost('localhost')).to.be.true; }); - it("does not report if localhost or 127.0.0.1 is not the hostname", function () { - expect(isLocalhost("127.0.0.500")).to.be.false; - expect(isLocalhost("128.0.0.2")).to.be.false; - expect(isLocalhost("0.0.0.1")).to.be.false; - expect(isLocalhost("remotehost")).to.be.false; - expect(isLocalhost("mongodb://remotelocalhost")).to.be.false; - expect(isLocalhost("[test:ipv6::1]")).to.be.false; - expect(isLocalhost("[1:0:0:0:0:0:0:1]")).to.be.false; - expect(isLocalhost("[test:ipv6::1]:27019")).to.be.false; - expect(isLocalhost("[1:0:0:0:0:0:0:1]:27019")).to.be.false; + it('does not report if localhost or 127.0.0.1 is not the hostname', function () { + expect(isLocalhost('127.0.0.500')).to.be.false; + expect(isLocalhost('128.0.0.2')).to.be.false; + expect(isLocalhost('0.0.0.1')).to.be.false; + expect(isLocalhost('remotehost')).to.be.false; + expect(isLocalhost('mongodb://remotelocalhost')).to.be.false; + expect(isLocalhost('[test:ipv6::1]')).to.be.false; + expect(isLocalhost('[1:0:0:0:0:0:0:1]')).to.be.false; + expect(isLocalhost('[test:ipv6::1]:27019')).to.be.false; + expect(isLocalhost('[1:0:0:0:0:0:0:1]:27019')).to.be.false; }); - it("does not throw and returns with invalid argument", function () { - expect(isLocalhost("")).to.be.false; + it('does not throw and returns with invalid argument', function () { + expect(isLocalhost('')).to.be.false; /* @ts-expect-error -- passing invalid arguments */ expect(isLocalhost(123)).to.be.false; /* @ts-expect-error -- passing invalid arguments */ @@ -350,36 +350,36 @@ describe("mongodb-build-info", function () { }); }); - context("isDigitalOcean", function () { - it("reports on digital ocean", function () { + context('isDigitalOcean', function () { + it('reports on digital ocean', function () { expect( isDigitalOcean( - "mongodb+srv://admin:catscatscats@dave-a1234321.mongo.ondigitalocean.com/test?authSource=admin&replicaSet=dave" - ) + 'mongodb+srv://admin:catscatscats@dave-a1234321.mongo.ondigitalocean.com/test?authSource=admin&replicaSet=dave', + ), ).to.be.true; }); - it("works with hostname only", function () { - expect(isDigitalOcean("dave-a1234321.mongo.ondigitalocean.com")).to.be + it('works with hostname only', function () { + expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com')).to.be .true; }); - it("works with host only", function () { - expect(isDigitalOcean("dave-a1234321.mongo.ondigitalocean.com:27017")).to + it('works with host only', function () { + expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com:27017')).to .be.true; }); - it("returns false if not digitalocean", function () { - expect(isDigitalOcean("dave-a1234321.mongo.ondigitalocean.com2")).to.be + it('returns false if not digitalocean', function () { + expect(isDigitalOcean('dave-a1234321.mongo.ondigitalocean.com2')).to.be .false; - expect(isDigitalOcean("dave-a1234321mongo.ondigitalocean.com")).to.be + expect(isDigitalOcean('dave-a1234321mongo.ondigitalocean.com')).to.be .false; - expect(isDigitalOcean("dave-a1234321.mongoxondigitalocean.com")).to.be + expect(isDigitalOcean('dave-a1234321.mongoxondigitalocean.com')).to.be .false; }); - it("does not throw and returns with invalid argument", function () { - expect(isDigitalOcean("")).to.be.false; + it('does not throw and returns with invalid argument', function () { + expect(isDigitalOcean('')).to.be.false; /* @ts-expect-error -- passing invalid arguments */ expect(isDigitalOcean(123)).to.be.false; /* @ts-expect-error -- passing invalid arguments */ @@ -391,41 +391,41 @@ describe("mongodb-build-info", function () { }); }); - context("isGenuineMongoDB", function () { - it("reports on CosmosDB", function () { + context('isGenuineMongoDB', function () { + it('reports on CosmosDB', function () { fixtures.COSMOS_DB_URI.forEach((uri) => { const isGenuine = getGenuineMongoDB(uri); expect(isGenuine.isGenuine).to.be.false; - expect(isGenuine.serverName).to.equal("cosmosdb"); + expect(isGenuine.serverName).to.equal('cosmosdb'); }); }); - it("reports on DocumentDB", function () { + it('reports on DocumentDB', function () { fixtures.DOCUMENT_DB_URIS.forEach((uri) => { const isGenuine = getGenuineMongoDB(uri); expect(isGenuine.isGenuine).to.be.false; - expect(isGenuine.serverName).to.equal("documentdb"); + expect(isGenuine.serverName).to.equal('documentdb'); }); }); - it("does not report on 3.2", function () { + it('does not report on 3.2', function () { const isGenuine = getGenuineMongoDB( fixtures.BUILD_INFO_3_2, /* @ts-expect-error -- passing invalid arguments */ - fixtures.CMD_LINE_OPTS + fixtures.CMD_LINE_OPTS, ); expect(isGenuine.isGenuine).to.be.true; - expect(isGenuine.serverName).to.equal("mongodb"); + expect(isGenuine.serverName).to.equal('mongodb'); }); - it("does not report on older versions", function () { + it('does not report on older versions', function () { const isGenuine = getGenuineMongoDB( fixtures.BUILD_INFO_OLD, /* @ts-expect-error -- passing invalid arguments */ - fixtures.CMD_LINE_OPTS + fixtures.CMD_LINE_OPTS, ); expect(isGenuine.isGenuine).to.be.true; - expect(isGenuine.serverName).to.equal("mongodb"); + expect(isGenuine.serverName).to.equal('mongodb'); }); }); }); From 1ccb315a385ebb4e838cfe082d088c1ace5f0d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 16:38:25 +0200 Subject: [PATCH 11/14] Fix eslint error --- packages/mongodb-build-info/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mongodb-build-info/src/index.ts b/packages/mongodb-build-info/src/index.ts index bd7dd3ee..ed75e9b6 100644 --- a/packages/mongodb-build-info/src/index.ts +++ b/packages/mongodb-build-info/src/index.ts @@ -3,7 +3,7 @@ import ConnectionString from 'mongodb-connection-string-url'; const ATLAS_REGEX = /\.mongodb(-dev|-qa|-stage)?\.net$/i; const ATLAS_STREAM_REGEX = /^atlas-stream-.+/i; const LOCALHOST_REGEX = - /^(localhost|127\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])|0\.0\.0\.0|(?:0*\:)*?:?0*1)$/i; + /^(localhost|127\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.([01]?[0-9][0-9]?|2[0-4][0-9]|25[0-5])|0\.0\.0\.0|(?:0*:)*?:?0*1)$/i; const DIGITAL_OCEAN_REGEX = /\.mongo\.ondigitalocean\.com$/i; const COSMOS_DB_REGEX = /\.cosmos\.azure\.com$/i; const DOCUMENT_DB_REGEX = /docdb(-elastic)?\.amazonaws\.com$/i; From 083fe4b3ada8a17b18a5f31405cb50e775aed204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 16:42:13 +0200 Subject: [PATCH 12/14] Update exports --- packages/mongodb-build-info/package.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json index 7046434b..8e8f1b98 100644 --- a/packages/mongodb-build-info/package.json +++ b/packages/mongodb-build-info/package.json @@ -33,7 +33,18 @@ "directory": "packages/mongodb-build-info" }, "license": "Apache-2.0", - "main": "./dist/index.js", + "main": "dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + "require": { + "default": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "import": { + "default": "./dist/.esm-wrapper.mjs", + "types": "./dist/index.d.ts" + } + }, "scripts": { "bootstrap": "npm run compile", "prepublishOnly": "npm run compile", From 39fb653a6fe9134a28a8d9f90b0c1c6df315906f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 17:21:58 +0200 Subject: [PATCH 13/14] fixup! Align eslint config with existing packages --- package-lock.json | 1379 ---------------------- packages/mongodb-build-info/package.json | 1 - 2 files changed, 1380 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec5cae59..cce4f37d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11840,38 +11840,6 @@ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" }, - "node_modules/babel-eslint": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", - "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", - "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - }, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "eslint": ">= 4.12.1" - } - }, - "node_modules/babel-eslint/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=4" - } - }, "node_modules/babel-plugin-macros": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", @@ -15132,714 +15100,6 @@ "eslint": ">=6.0.0" } }, - "node_modules/eslint-config-mongodb-js": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/eslint-config-mongodb-js/-/eslint-config-mongodb-js-5.0.3.tgz", - "integrity": "sha512-5m17gGJKxI/WktvWN0EuoFqyqeyU2Hz4e3vGHnofBXdcqeHJaaFqY7162e72cynPph7i3Xst9tDLKGPi/QjLzQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "babel-eslint": "^10.0.1", - "eslint": "^5.16.0", - "eslint-plugin-chai-friendly": "^0.4.1", - "eslint-plugin-react": "^7.13.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "restore-cursor": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true, - "license": "ISC" - }, - "node_modules/eslint-config-mongodb-js/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "license": "MIT" - }, - "node_modules/eslint-config-mongodb-js/node_modules/cross-spawn": { - "version": "6.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", - "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", - "dev": true, - "license": "MIT", - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true, - "license": "MIT" - }, - "node_modules/eslint-config-mongodb-js/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/eslint": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", - "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.9.1", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "eslint-scope": "^4.0.3", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.1", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "inquirer": "^6.2.2", - "js-yaml": "^3.13.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.11", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.2.3", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^6.14.0 || ^8.10.0 || >=9.10.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/espree": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", - "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^2.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true, - "license": "ISC" - }, - "node_modules/eslint-config-mongodb-js/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/inquirer/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/inquirer/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/eslint-config-mongodb-js/node_modules/onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.5.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/table/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/table/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/table/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint-config-mongodb-js/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, "node_modules/eslint-config-prettier": { "version": "8.5.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", @@ -15939,19 +15199,6 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-plugin-chai-friendly": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz", - "integrity": "sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "eslint": ">=3.0.0" - } - }, "node_modules/eslint-plugin-es-x": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz", @@ -23566,13 +22813,6 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true, - "license": "MIT" - }, "node_modules/nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -25630,13 +24870,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", - "dev": true, - "license": "(WTFPL OR MIT)" - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -30407,16 +29640,6 @@ "node": ">= 6" } }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -30467,19 +29690,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, - "node_modules/write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "license": "MIT", - "dependencies": { - "mkdirp": "^0.5.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", @@ -30575,19 +29785,6 @@ "node": ">=6" } }, - "node_modules/write/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/ws": { "version": "8.18.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", @@ -31374,7 +30571,6 @@ "chai": "^4.5.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", - "eslint-config-mongodb-js": "^5.0.3", "mocha": "^8.4.0", "nyc": "^15.1.0", "typescript": "^5.0.4" @@ -43679,28 +42875,6 @@ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==" }, - "babel-eslint": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", - "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0", - "eslint-visitor-keys": "^1.0.0", - "resolve": "^1.12.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, "babel-plugin-macros": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", @@ -46162,514 +45336,6 @@ "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", "dev": true }, - "eslint-config-mongodb-js": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/eslint-config-mongodb-js/-/eslint-config-mongodb-js-5.0.3.tgz", - "integrity": "sha512-5m17gGJKxI/WktvWN0EuoFqyqeyU2Hz4e3vGHnofBXdcqeHJaaFqY7162e72cynPph7i3Xst9tDLKGPi/QjLzQ==", - "dev": true, - "requires": { - "babel-eslint": "^10.0.1", - "eslint": "^5.16.0", - "eslint-plugin-chai-friendly": "^0.4.1", - "eslint-plugin-react": "^7.13.0" - }, - "dependencies": { - "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true - }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "cross-spawn": { - "version": "6.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", - "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "eslint": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", - "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.9.1", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "eslint-scope": "^4.0.3", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.1", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "inquirer": "^6.2.2", - "js-yaml": "^3.13.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.11", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.2.3", - "text-table": "^0.2.0" - } - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - }, - "espree": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", - "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", - "dev": true, - "requires": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" - } - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, - "requires": { - "flat-cache": "^2.0.1" - } - }, - "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, - "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - } - }, - "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", - "dev": true, - "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", - "dev": true - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "dev": true - }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true - }, - "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, "eslint-config-prettier": { "version": "8.5.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", @@ -46729,12 +45395,6 @@ } } }, - "eslint-plugin-chai-friendly": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz", - "integrity": "sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA==", - "dev": true - }, "eslint-plugin-es-x": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz", @@ -52023,7 +50683,6 @@ "chai": "^4.5.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", - "eslint-config-mongodb-js": "^5.0.3", "mocha": "^8.4.0", "mongodb-connection-string-url": "^3.0.0", "nyc": "^15.1.0", @@ -52616,12 +51275,6 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -54174,12 +52827,6 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", - "dev": true - }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -57690,12 +56337,6 @@ } } }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -57733,26 +56374,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - } - } - }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", diff --git a/packages/mongodb-build-info/package.json b/packages/mongodb-build-info/package.json index 8e8f1b98..4f55fd2c 100644 --- a/packages/mongodb-build-info/package.json +++ b/packages/mongodb-build-info/package.json @@ -72,7 +72,6 @@ "chai": "^4.5.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", - "eslint-config-mongodb-js": "^5.0.3", "mocha": "^8.4.0", "nyc": "^15.1.0", "typescript": "^5.0.4" From 4bc2b465710c4af0cf8948123326f669c34eab33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 15 Oct 2025 17:24:51 +0200 Subject: [PATCH 14/14] Add depcheck ignore --- packages/mongodb-build-info/.depcheckrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 packages/mongodb-build-info/.depcheckrc diff --git a/packages/mongodb-build-info/.depcheckrc b/packages/mongodb-build-info/.depcheckrc new file mode 100644 index 00000000..e478a8ff --- /dev/null +++ b/packages/mongodb-build-info/.depcheckrc @@ -0,0 +1,4 @@ +ignores: + - '@mongodb-js/prettier-config-devtools' +ignore-patterns: + - 'dist'