diff --git a/.eslintrc.json b/.eslintrc.json index 5bd15af3ce1..c16caa0174d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -51,5 +51,9 @@ "files": ["*.mjs"], "parserOptions": {"sourceType": "module"} + },{ + "files": ["*.ts"], + "parserOptions": {"sourceType": "module"} + }] } diff --git a/.gitignore b/.gitignore index 817b4eb3bb6..3f1ca6aec56 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,8 @@ yarn.lock lib/ *.tgz *.d.ts +# type definition tests +!test/types .vscode output diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d0d09bf33a3..87f85a4e1d7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,53 +1,101 @@ # Contributors - - Christian Kvalheim - - Matt Broadstone <> - - Dan Aprahamian <> - - Katherine Walker <> - - Aaron Heckmann - - Christoph Pojer - - Pau Ramon Revilla - - Nathan White - - Emmerman - - Seth LaForge - - Boris Filipov - - Stefan Schärmeli - - Tedde Lundgren - - renctan - - Sergey Ukustov - - Ciaran Jessup - - kuno - - srimonti - - Erik Abele - - Pratik Daga - - Slobodan Utvic - - Kristina Chodorow - - Yonathan Randolph - - Brian Noguchi - - Sam Epstein - - James Harrison Fisher - - Vladimir Dronnikov - - Ben Hockey - - Henrik Johansson - - Simon Weare - - Alex Gorbatchev - - Shimon Doodkin - - Kyle Mueller - - Eran Hammer-Lahav - - Marcin Ciszak - - François de Metz - - Vinay Pulim - - nstielau - - Adam Wiggins - - entrinzikyl - - Jeremy Selier - - Ian Millington - - Public Keating - - andrewjstone - - Christopher Stott - - Corey Jewett - - brettkiefer - - Rob Holland - - Senmiao Liu - - heroic - - gitfy +- Christian Kvalheim +- Matt Broadstone +- Dan Aprahamian +- Katherine Walker +- Aaron Heckmann +- Christoph Pojer +- Pau Ramon Revilla +- Nathan White +- Emmerman +- Seth LaForge +- Boris Filipov +- Stefan Schärmeli +- Tedde Lundgren +- renctan +- Sergey Ukustov +- Ciaran Jessup +- kuno +- srimonti +- Erik Abele +- Pratik Daga +- Slobodan Utvic +- Kristina Chodorow +- Yonathan Randolph +- Brian Noguchi +- Sam Epstein +- James Harrison Fisher +- Vladimir Dronnikov +- Ben Hockey +- Henrik Johansson +- Simon Weare +- Alex Gorbatchev +- Shimon Doodkin +- Kyle Mueller +- Eran Hammer-Lahav +- Marcin Ciszak +- François de Metz +- Vinay Pulim +- nstielau +- Adam Wiggins +- entrinzikyl +- Jeremy Selier +- Ian Millington +- Public Keating +- andrewjstone +- Christopher Stott +- Corey Jewett +- brettkiefer +- Rob Holland +- Senmiao Liu +- heroic +- gitfy + +## Maintainers + +- Neal Beeken <> +- Eric Adum <> +- Durran Jordan <> +- Daria Pardue <> + +## Community Types + +This release of the driver draws inspiration from the community contributed types to reduce upgrade friction as much as possible. +We thank those listed below who contributed to the open source types, still available at `@types/mongodb` for versions prior to v4. + +**Thank you!** + +- Federico Caselli +- Alan Marcell +- Gaurav Lahoti +- Mariano Cortesi +- Enrico Picci +- Alexander Christie +- Julien Chaumond +- Dan Aprahamian +- Denys Bushulyak +- Bastien Arata +- Wan Bachtiar +- Geraldine Lemeur +- Dominik Heigl +- Angela-1 +- Hector Ribes +- Florian Richter +- Erik Christensen +- Nick Zahn +- Jarom Loveridge +- Luis Pais +- Hossein Saniei +- Alberto Silva +- Piotr Błażejewicz +- Linus Unnebäck +- Richard Bateman +- Igor Strebezhev +- Valentin Agachi +- HitkoDev +- TJT +- Julien TASSIN +- Anna Henningsen +- Emmanuel Gautier +- Wyatt Johnson diff --git a/package-lock.json b/package-lock.json index ee0b05efd32..6a894bbf8f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,26 +14,26 @@ } }, "@babel/compat-data": { - "version": "7.13.15", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.15.tgz", - "integrity": "sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz", + "integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==", "dev": true }, "@babel/core": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.16.tgz", - "integrity": "sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.0.tgz", + "integrity": "sha512-8YqpRig5NmIHlMLw09zMlPTvUVMILjqCOtVgu+TVNWEBvy9b5I3RRyhqnrV4hjgEK7n8P9OqvkWJAFmEL6Wwfw==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.16", + "@babel/generator": "^7.14.0", "@babel/helper-compilation-targets": "^7.13.16", - "@babel/helper-module-transforms": "^7.13.14", - "@babel/helpers": "^7.13.16", - "@babel/parser": "^7.13.16", + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helpers": "^7.14.0", + "@babel/parser": "^7.14.0", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.15", - "@babel/types": "^7.13.16", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -66,12 +66,12 @@ } }, "@babel/generator": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.16.tgz", - "integrity": "sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz", + "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==", "dev": true, "requires": { - "@babel/types": "^7.13.16", + "@babel/types": "^7.14.1", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -143,19 +143,19 @@ } }, "@babel/helper-module-transforms": { - "version": "7.13.14", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz", - "integrity": "sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz", + "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.13.12", "@babel/helper-replace-supers": "^7.13.12", "@babel/helper-simple-access": "^7.13.12", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.0", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.13", - "@babel/types": "^7.13.14" + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" } }, "@babel/helper-optimise-call-expression": { @@ -198,9 +198,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", "dev": true }, "@babel/helper-validator-option": { @@ -210,23 +210,23 @@ "dev": true }, "@babel/helpers": { - "version": "7.13.17", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.17.tgz", - "integrity": "sha512-Eal4Gce4kGijo1/TGJdqp3WuhllaMLSrW6XcL0ulyUAQOuxHcCafZE8KHg9857gcTehsm/v7RcOx2+jp0Ryjsg==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz", + "integrity": "sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg==", "dev": true, "requires": { "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.17", - "@babel/types": "^7.13.17" + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" } }, "@babel/highlight": { - "version": "7.13.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", - "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.0", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -284,9 +284,9 @@ } }, "@babel/parser": { - "version": "7.13.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.16.tgz", - "integrity": "sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", "dev": true }, "@babel/template": { @@ -312,17 +312,17 @@ } }, "@babel/traverse": { - "version": "7.13.17", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.17.tgz", - "integrity": "sha512-BMnZn0R+X6ayqm3C3To7o1j7Q020gWdqdyP50KEoVqaCO2c/Im7sYZSmVgvefp8TTMQ+9CtwuBp0Z1CZ8V3Pvg==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz", + "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.16", + "@babel/generator": "^7.14.0", "@babel/helper-function-name": "^7.12.13", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.13.16", - "@babel/types": "^7.13.17", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -345,19 +345,19 @@ } }, "@babel/types": { - "version": "7.13.17", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.17.tgz", - "integrity": "sha512-RawydLgxbOPDlTLJNtoIypwdmAy//uQIzlKt2+iBiJaRlVuI6QLUxVAyWGNfOzp8Yu4L4lLIacoCyTNtpb4wiA==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.0", "to-fast-properties": "^2.0.0" } }, "@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", + "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -459,15 +459,15 @@ "dev": true }, "@microsoft/api-extractor": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.14.0.tgz", - "integrity": "sha512-R9B0ic8EIcHhwSFQWYTyQX7QDi7kXONeKdIjJI8R+WzVJMA3r0Je9XxSQxxZ9MZIBUxv3fB7pXC2CPIsSkI/BA==", + "version": "7.15.1", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.15.1.tgz", + "integrity": "sha512-PYbGAvxbM5B6HbafXY7tJ4ObYpeUZrZFt9vlN68tpYG/7aeldMLAZSjTyB30VFXaGlArjeEooKZIcs2ZnVAbNg==", "dev": true, "requires": { - "@microsoft/api-extractor-model": "7.13.0", + "@microsoft/api-extractor-model": "7.13.1", "@microsoft/tsdoc": "0.13.2", "@microsoft/tsdoc-config": "~0.15.2", - "@rushstack/node-core-library": "3.36.2", + "@rushstack/node-core-library": "3.37.0", "@rushstack/rig-package": "0.2.12", "@rushstack/ts-command-line": "4.7.10", "colors": "~1.2.1", @@ -475,7 +475,7 @@ "resolve": "~1.17.0", "semver": "~7.3.0", "source-map": "~0.6.1", - "typescript": "~4.1.3" + "typescript": "~4.2.4" }, "dependencies": { "semver": { @@ -486,24 +486,18 @@ "requires": { "lru-cache": "^6.0.0" } - }, - "typescript": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz", - "integrity": "sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA==", - "dev": true } } }, "@microsoft/api-extractor-model": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.13.0.tgz", - "integrity": "sha512-HnIbXpNiF/a+tTnGVJFq4aaxWEGI5XN7vpm1YjNLc+CY5C0s/bdT0LV9o9NzWSpQdHVUaYhQEVLviaDpusu6dg==", + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.13.1.tgz", + "integrity": "sha512-PKAjDmAJ6X07tvqCHSN1PRaKq8bZQXF9QI6WGEMnCHNFWwXUoITOAcvFW0Ol3TzwHO5rLbuy/CqWebfhv8eOtw==", "dev": true, "requires": { "@microsoft/tsdoc": "0.13.2", "@microsoft/tsdoc-config": "~0.15.2", - "@rushstack/node-core-library": "3.36.2" + "@rushstack/node-core-library": "3.37.0" } }, "@microsoft/tsdoc": { @@ -563,9 +557,9 @@ } }, "@rushstack/node-core-library": { - "version": "3.36.2", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.36.2.tgz", - "integrity": "sha512-5J8xSY/PuCKR+yfxS497l0PP43kBUeD86S4eS3RzrmMle04J4522MWal8mk1T1EIDpYpgi8qScannU9oVxoStA==", + "version": "3.37.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.37.0.tgz", + "integrity": "sha512-b0OGvl20zfepytLBnKsOtemtiadNZAVolXxaSYssV9VjXaLPF97oLvtLfwc58BX05ufIsrKZgXatnRo8YeffNg==", "dev": true, "requires": { "@types/node": "10.17.13", @@ -618,6 +612,12 @@ "string-argv": "~0.3.1" } }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, "@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -653,6 +653,15 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, "@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", @@ -675,9 +684,9 @@ } }, "@types/chai": { - "version": "4.2.16", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.16.tgz", - "integrity": "sha512-vI5iOAsez9+roLS3M3+Xx7w+WRuDtSmF8bQkrbcIJ2sC1PcDgVoA0WGpa+bIrJ+y8zqY2oi//fUctkxtIcXJCw==", + "version": "4.2.18", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.18.tgz", + "integrity": "sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ==", "dev": true }, "@types/chai-subset": { @@ -714,9 +723,9 @@ "dev": true }, "@types/node": { - "version": "14.14.41", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.41.tgz", - "integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==", + "version": "14.14.44", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.44.tgz", + "integrity": "sha512-+gaugz6Oce6ZInfI/tK4Pq5wIIkJMEJUu92RB3Eu93mtj4wjjjz9EB5mLp5s1pSsLXdC/CPut/xF20ZzAQJbTA==", "dev": true }, "@types/normalize-package-data": { @@ -732,19 +741,19 @@ "dev": true }, "@types/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-+nVsLKlcUCeMzD2ufHEYuJ9a2ovstb6Dp52A5VsoKxDXgvE051XgHI/33I1EymwkRGQkwnA0LkhnUzituGs4EQ==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-iotVxtCCsPLRAvxMFFgxL8HD2l4mAZ2Oin7/VJ2ooWO0VOK4EGOGmZWZn1uCq7RofR3I/1IOSjCHlFT71eVK0Q==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.0.tgz", - "integrity": "sha512-U8SP9VOs275iDXaL08Ln1Fa/wLXfj5aTr/1c0t0j6CdbOnxh+TruXu1p4I0NAvdPBQgoPjHsgKn28mOi0FzfoA==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.23.0.tgz", + "integrity": "sha512-tGK1y3KIvdsQEEgq6xNn1DjiFJtl+wn8JJQiETtCbdQxw1vzjXyAaIkEmO2l6Nq24iy3uZBMFQjZ6ECf1QdgGw==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.22.0", - "@typescript-eslint/scope-manager": "4.22.0", + "@typescript-eslint/experimental-utils": "4.23.0", + "@typescript-eslint/scope-manager": "4.23.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "lodash": "^4.17.15", @@ -765,55 +774,55 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.0.tgz", - "integrity": "sha512-xJXHHl6TuAxB5AWiVrGhvbGL8/hbiCQ8FiWwObO3r0fnvBdrbWEDy1hlvGQOAWc6qsCWuWMKdVWlLAEMpxnddg==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.23.0.tgz", + "integrity": "sha512-WAFNiTDnQfrF3Z2fQ05nmCgPsO5o790vOhmWKXbbYQTO9erE1/YsFot5/LnOUizLzU2eeuz6+U/81KV5/hFTGA==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.22.0", - "@typescript-eslint/types": "4.22.0", - "@typescript-eslint/typescript-estree": "4.22.0", + "@typescript-eslint/scope-manager": "4.23.0", + "@typescript-eslint/types": "4.23.0", + "@typescript-eslint/typescript-estree": "4.23.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.22.0.tgz", - "integrity": "sha512-z/bGdBJJZJN76nvAY9DkJANYgK3nlRstRRi74WHm3jjgf2I8AglrSY+6l7ogxOmn55YJ6oKZCLLy+6PW70z15Q==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.23.0.tgz", + "integrity": "sha512-wsvjksHBMOqySy/Pi2Q6UuIuHYbgAMwLczRl4YanEPKW5KVxI9ZzDYh3B5DtcZPQTGRWFJrfcbJ6L01Leybwug==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.22.0", - "@typescript-eslint/types": "4.22.0", - "@typescript-eslint/typescript-estree": "4.22.0", + "@typescript-eslint/scope-manager": "4.23.0", + "@typescript-eslint/types": "4.23.0", + "@typescript-eslint/typescript-estree": "4.23.0", "debug": "^4.1.1" } }, "@typescript-eslint/scope-manager": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.22.0.tgz", - "integrity": "sha512-OcCO7LTdk6ukawUM40wo61WdeoA7NM/zaoq1/2cs13M7GyiF+T4rxuA4xM+6LeHWjWbss7hkGXjFDRcKD4O04Q==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.23.0.tgz", + "integrity": "sha512-ZZ21PCFxPhI3n0wuqEJK9omkw51wi2bmeKJvlRZPH5YFkcawKOuRMQMnI8mH6Vo0/DoHSeZJnHiIx84LmVQY+w==", "dev": true, "requires": { - "@typescript-eslint/types": "4.22.0", - "@typescript-eslint/visitor-keys": "4.22.0" + "@typescript-eslint/types": "4.23.0", + "@typescript-eslint/visitor-keys": "4.23.0" } }, "@typescript-eslint/types": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.22.0.tgz", - "integrity": "sha512-sW/BiXmmyMqDPO2kpOhSy2Py5w6KvRRsKZnV0c4+0nr4GIcedJwXAq+RHNK4lLVEZAJYFltnnk1tJSlbeS9lYA==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.23.0.tgz", + "integrity": "sha512-oqkNWyG2SLS7uTWLZf6Sr7Dm02gA5yxiz1RP87tvsmDsguVATdpVguHr4HoGOcFOpCvx9vtCSCyQUGfzq28YCw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.22.0.tgz", - "integrity": "sha512-TkIFeu5JEeSs5ze/4NID+PIcVjgoU3cUQUIZnH3Sb1cEn1lBo7StSV5bwPuJQuoxKXlzAObjYTilOEKRuhR5yg==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.23.0.tgz", + "integrity": "sha512-5Sty6zPEVZF5fbvrZczfmLCOcby3sfrSPu30qKoY1U3mca5/jvU5cwsPb/CO6Q3ByRjixTMIVsDkqwIxCf/dMw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.22.0", - "@typescript-eslint/visitor-keys": "4.22.0", + "@typescript-eslint/types": "4.23.0", + "@typescript-eslint/visitor-keys": "4.23.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -833,12 +842,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.22.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.0.tgz", - "integrity": "sha512-nnMu4F+s4o0sll6cBSsTeVsT4cwxB7zECK3dFxzEjPBii9xLpq4yqqsy/FU5zMfan6G60DKZSCXAa3sHJZrcYw==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.23.0.tgz", + "integrity": "sha512-5PNe5cmX9pSifit0H+nPoQBXdbNzi5tOEec+3riK+ku4e3er37pKxMKDH5Ct5Y4fhWxcD4spnlYjxi9vXbSpwg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.22.0", + "@typescript-eslint/types": "4.23.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -892,12 +901,78 @@ "uri-js": "^4.2.2" } }, + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dev": true, + "requires": { + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "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 + }, + "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": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "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" + } + } + } + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", @@ -958,6 +1033,38 @@ "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "arg": { @@ -1106,19 +1213,6 @@ "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } } }, "bluebird": { @@ -1127,6 +1221,34 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, + "boxen": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", + "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "dev": true, + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^3.0.0", + "cli-boxes": "^2.2.0", + "string-width": "^4.1.0", + "term-size": "^2.1.0", + "type-fest": "^0.8.1", + "widest-line": "^3.1.0" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1153,14 +1275,14 @@ "dev": true }, "browserslist": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.4.tgz", - "integrity": "sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001208", + "caniuse-lite": "^1.0.30001219", "colorette": "^1.2.2", - "electron-to-chromium": "^1.3.712", + "electron-to-chromium": "^1.3.723", "escalade": "^3.1.1", "node-releases": "^1.1.71" } @@ -1210,35 +1332,60 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", "dev": true, "requires": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" }, "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "requires": { - "semver": "^6.0.0" + "pump": "^3.0.0" } }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } } } }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -1273,9 +1420,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001214", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001214.tgz", - "integrity": "sha512-O2/SCpuaU3eASWVaesQirZv1MSjUNOvmugaD8zNSJqw6Vv5SGwoOpA9LJs3pNPfM745nxqPvfZY3MQKY4AKHYg==", + "version": "1.0.30001228", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz", + "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==", "dev": true }, "caseless": { @@ -1351,12 +1498,24 @@ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, + "cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true + }, "cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -1429,6 +1588,15 @@ "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -1521,19 +1689,20 @@ "inherits": "^2.0.3", "readable-stream": "^3.0.2", "typedarray": "^0.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } + } + }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" } }, "console-control-strings": { @@ -1543,21 +1712,21 @@ "dev": true }, "conventional-changelog": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.21.tgz", - "integrity": "sha512-ZGecVZPEo3aC75VVE4nu85589dDhpMyqfqgUM5Myq6wfKWiNqhDJLSDMsc8qKXshZoY7dqs1hR0H/15kI/G2jQ==", - "dev": true, - "requires": { - "conventional-changelog-angular": "^5.0.10", - "conventional-changelog-atom": "^2.0.7", - "conventional-changelog-codemirror": "^2.0.7", - "conventional-changelog-conventionalcommits": "^4.3.0", - "conventional-changelog-core": "^4.1.7", - "conventional-changelog-ember": "^2.0.8", - "conventional-changelog-eslint": "^3.0.8", - "conventional-changelog-express": "^2.0.5", - "conventional-changelog-jquery": "^3.0.10", - "conventional-changelog-jshint": "^2.0.7", + "version": "3.1.24", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.24.tgz", + "integrity": "sha512-ed6k8PO00UVvhExYohroVPXcOJ/K1N0/drJHx/faTH37OIZthlecuLIRX/T6uOp682CAoVoFpu+sSEaeuH6Asg==", + "dev": true, + "requires": { + "conventional-changelog-angular": "^5.0.12", + "conventional-changelog-atom": "^2.0.8", + "conventional-changelog-codemirror": "^2.0.8", + "conventional-changelog-conventionalcommits": "^4.5.0", + "conventional-changelog-core": "^4.2.1", + "conventional-changelog-ember": "^2.0.9", + "conventional-changelog-eslint": "^3.0.9", + "conventional-changelog-express": "^2.0.6", + "conventional-changelog-jquery": "^3.0.11", + "conventional-changelog-jshint": "^2.0.9", "conventional-changelog-preset-loader": "^2.3.4" } }, @@ -1596,35 +1765,14 @@ "dev": true }, "conventional-changelog-conventionalcommits": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.3.0.tgz", - "integrity": "sha512-oYHydvZKU+bS8LnGqTMlNrrd7769EsuEHKy4fh1oMdvvDi7fem8U+nvfresJ1IDB8K00Mn4LpiA/lR+7Gs6rgg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz", + "integrity": "sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "lodash": "^4.17.15", "q": "^1.5.1" - }, - "dependencies": { - "compare-func": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", - "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", - "dev": true, - "requires": { - "array-ify": "^1.0.0", - "dot-prop": "^3.0.0" - } - }, - "dot-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", - "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - } } }, "conventional-changelog-core": { @@ -1650,17 +1798,6 @@ "through2": "^4.0.0" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "through2": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", @@ -1742,17 +1879,6 @@ "through2": "^4.0.0" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -1795,17 +1921,6 @@ "trim-off-newlines": "^1.0.0" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "through2": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", @@ -1818,370 +1933,34 @@ } }, "conventional-recommended-bump": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.0.9.tgz", - "integrity": "sha512-DpRmW1k8CpRrcsXHOPGgHgOd4BMGiq2gtXAveGM8B9pSd9b4r4WKnqp1Fd0vkDtk8l973mIk8KKKUYnKRr9SFw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", + "integrity": "sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw==", "dev": true, "requires": { "concat-stream": "^2.0.0", "conventional-changelog-preset-loader": "^2.3.4", - "conventional-commits-filter": "^2.0.6", - "conventional-commits-parser": "^3.1.0", - "git-raw-commits": "2.0.0", - "git-semver-tags": "^4.0.0", - "meow": "^7.0.0", + "conventional-commits-filter": "^2.0.7", + "conventional-commits-parser": "^3.2.0", + "git-raw-commits": "^2.0.8", + "git-semver-tags": "^4.1.1", + "meow": "^8.0.0", "q": "^1.5.1" + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" }, "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, - "dargs": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", - "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "git-raw-commits": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", - "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", - "dev": true, - "requires": { - "dargs": "^4.0.1", - "lodash.template": "^4.0.2", - "meow": "^4.0.0", - "split2": "^2.0.0", - "through2": "^2.0.0" - }, - "dependencies": { - "meow": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "dev": true, - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist": "^1.1.3", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - } - } - } - }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", - "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", - "dev": true, - "requires": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^2.5.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.13.1", - "yargs-parser": "^18.1.3" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" - } - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, - "map-obj": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", - "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", - "dev": true - }, - "minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - } - }, - "quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "dev": true - }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } - }, - "redent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, - "requires": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - } - }, - "strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "requires": { - "min-indent": "^1.0.0" - } - }, - "trim-newlines": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", - "dev": true - } - } - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "split2": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", - "dev": true, - "requires": { - "through2": "^2.0.2" - } - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - }, - "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } - } - } - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true } } @@ -2222,6 +2001,12 @@ "which": "^2.0.1" } }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -2342,6 +2127,12 @@ "clone": "^1.0.2" } }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -2369,15 +2160,15 @@ "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==" }, "dependency-tree": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/dependency-tree/-/dependency-tree-7.2.2.tgz", - "integrity": "sha512-WWZJpNuMWqEM97CGykmyKLjjUWGVGkRRMSIEBWk5izmugxmivnItg4MMHkDzuvmB/7vglhudEoc5wyMp5ODD+Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/dependency-tree/-/dependency-tree-8.1.0.tgz", + "integrity": "sha512-YKFK+1KXJOqVpsW6MkrIl/DyiW+KVG25V8NfRs27ANe+oSeCkQx2ROW1mBpp1bcm++5zj3Xv8wyFxHgX6TbM1w==", "dev": true, "requires": { "commander": "^2.20.3", - "debug": "^4.2.1", - "filing-cabinet": "^2.6.0", - "precinct": "^6.3.1", + "debug": "^4.3.1", + "filing-cabinet": "^3.0.0", + "precinct": "^7.0.0", "typescript": "^3.9.7" }, "dependencies": { @@ -2450,15 +2241,15 @@ } }, "detective-postcss": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-3.0.1.tgz", - "integrity": "sha512-tfTS2GdpUal5NY0aCqI4dpEy8Xfr88AehYKB0iBIZvo8y2g3UsrcDnrp9PR2FbzoW7xD5Rip3NJW7eCSvtqdUw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-4.0.0.tgz", + "integrity": "sha512-Fwc/g9VcrowODIAeKRWZfVA/EufxYL7XfuqJQFroBKGikKX83d2G7NFw6kDlSYGG3LNQIyVa+eWv1mqre+v4+A==", "dev": true, "requires": { "debug": "^4.1.1", "is-url": "^1.2.4", - "postcss": "^7.0.2", - "postcss-values-parser": "^1.5.0" + "postcss": "^8.1.7", + "postcss-values-parser": "^2.0.1" } }, "detective-sass": { @@ -2490,47 +2281,17 @@ "dev": true }, "detective-typescript": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-5.8.0.tgz", - "integrity": "sha512-SrsUCfCaDTF64QVMHMidRal+kmkbIc5zP8cxxZPsomWx9vuEUjBlSJNhf7/ypE5cLdJJDI4qzKDmyzqQ+iz/xg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-7.0.0.tgz", + "integrity": "sha512-y/Ev98AleGvl43YKTNcA2Q+lyFmsmCfTTNWy4cjEJxoLkbobcXtRS0Kvx06daCgr2GdtlwLfNzL553BkktfJoA==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "^2.29.0", - "ast-module-types": "^2.6.0", + "@typescript-eslint/typescript-estree": "^4.8.2", + "ast-module-types": "^2.7.1", "node-source-walk": "^4.2.0", - "typescript": "^3.8.3" + "typescript": "^3.9.7" }, "dependencies": { - "@typescript-eslint/typescript-estree": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", - "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "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 - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, "typescript": { "version": "3.9.9", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", @@ -2590,6 +2351,12 @@ "minimatch": "^3.0.4" } }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -2601,9 +2368,9 @@ } }, "electron-to-chromium": { - "version": "1.3.719", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.719.tgz", - "integrity": "sha512-heM78GKSqrIzO9Oz0/y22nTBN7bqSP1Pla2SyU9DiSnQD+Ea9SyyN5RWWlgqsqeBLNDkSlE9J9EHFmdMPzxB/g==", + "version": "1.3.727", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz", + "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==", "dev": true }, "emoji-regex": { @@ -2622,14 +2389,13 @@ } }, "enhanced-resolve": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", - "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz", + "integrity": "sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" } }, "enquirer": { @@ -2726,6 +2492,12 @@ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -2793,13 +2565,13 @@ } }, "eslint": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.24.0.tgz", - "integrity": "sha512-k9gaHeHiFmGCDQ2rEfvULlSLruz6tgfA8DEn+rY9/oYPFFTlz55mM/Q/Rij1b2Y42jwZiK3lXvNTw6w6TXzcKQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.26.0.tgz", + "integrity": "sha512-4R1ieRf52/izcZE7AlLy56uIHHDLT74Yzz2Iv2l6kDaYvEu9x+wMB5dZArVL8SYGXSYV2YAg70FcW5Y5nGGNIg==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "@eslint/eslintrc": "^0.4.1", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -2863,6 +2635,21 @@ "get-stdin": "^6.0.0" } }, + "eslint-formatter-pretty": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-formatter-pretty/-/eslint-formatter-pretty-4.0.0.tgz", + "integrity": "sha512-QgdeZxQwWcN0TcXXNZJiS6BizhAANFhCzkE7Yl9HKB7WjElzwED6+FbbZB2gji8ofgJTGPqKm6VRCNT3OGCeEw==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "eslint-rule-docs": "^1.1.5", + "log-symbols": "^4.0.0", + "plur": "^4.0.0", + "string-width": "^4.2.0", + "supports-hyperlinks": "^2.0.0" + } + }, "eslint-plugin-jsdoc": { "version": "30.7.13", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.13.tgz", @@ -2908,6 +2695,12 @@ "@microsoft/tsdoc-config": "0.15.2" } }, + "eslint-rule-docs": { + "version": "1.1.226", + "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.226.tgz", + "integrity": "sha512-Wnn0ETzE2v2UT0OdRCcdMNPkQtbzyZr3pPPXnkreP0l6ZJaKqnl88dL1DqZ6nCCZZwDGBAnN0Y+nCvGxxLPQLQ==", + "dev": true + }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -2936,9 +2729,9 @@ } }, "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true }, "espree": { @@ -3095,12 +2888,6 @@ "flat-cache": "^3.0.4" } }, - "file-exists-dazinatorfork": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/file-exists-dazinatorfork/-/file-exists-dazinatorfork-1.0.2.tgz", - "integrity": "sha512-r70c72ln2YHzQINNfxDp02hAhbGkt1HffZ+Du8oetWDLjDtFja/Lm10lUaSh9e+wD+7VDvPee0b0C9SAy8pWZg==", - "dev": true - }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -3108,26 +2895,36 @@ "dev": true }, "filing-cabinet": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/filing-cabinet/-/filing-cabinet-2.6.0.tgz", - "integrity": "sha512-7kSlTScEkxoYKXCix7tAQ52ZeIHcx7ZWWArEZgXY+eTMe6yDYFdDhHdkXm9rSmvrrpzdZeR1wiufS1rUt4OzMA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filing-cabinet/-/filing-cabinet-3.0.0.tgz", + "integrity": "sha512-o8Qac5qxZ1uVidR4Sd7ZQbbqObFZlqXU4xu1suAYg9PQPcQFNTzOmxQa/MehIDMgIvXHTb42mWPNV9l3eHBPSw==", "dev": true, "requires": { "app-module-path": "^2.2.0", - "commander": "^2.13.0", - "debug": "^4.1.1", - "decomment": "^0.9.2", - "enhanced-resolve": "^4.1.0", + "commander": "^2.20.3", + "debug": "^4.3.1", + "decomment": "^0.9.3", + "enhanced-resolve": "^5.3.2", "is-relative-path": "^1.0.2", - "module-definition": "^3.0.0", - "module-lookup-amd": "^6.1.0", - "resolve": "^1.11.1", + "module-definition": "^3.3.1", + "module-lookup-amd": "^7.0.0", + "resolve": "^1.19.0", "resolve-dependency-path": "^2.0.0", "sass-lookup": "^3.0.0", "stylus-lookup": "^3.0.1", - "typescript": "^3.0.3" + "typescript": "^3.9.7" }, "dependencies": { + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, "typescript": { "version": "3.9.9", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", @@ -3145,15 +2942,6 @@ "to-regex-range": "^5.0.1" } }, - "find": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", - "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", - "dev": true, - "requires": { - "traverse-chain": "~0.1.0" - } - }, "find-cache-dir": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", @@ -3163,23 +2951,6 @@ "commondir": "^1.0.1", "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" - }, - "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "find-up": { @@ -3526,12 +3297,6 @@ "pinkie-promise": "^2.0.0" } }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", @@ -3553,6 +3318,21 @@ "read-pkg": "^1.0.0" } }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, "redent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", @@ -3563,6 +3343,21 @@ "strip-indent": "^1.0.1" } }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", @@ -3596,6 +3391,27 @@ "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + }, + "dependencies": { + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -3618,17 +3434,6 @@ "through2": "^4.0.0" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "through2": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", @@ -3648,14 +3453,6 @@ "requires": { "gitconfiglocal": "^1.0.0", "pify": "^2.3.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } } }, "git-semver-tags": { @@ -3692,9 +3489,9 @@ "dev": true }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -3714,6 +3511,23 @@ "is-glob": "^4.0.1" } }, + "global-dirs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", + "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", + "dev": true, + "requires": { + "ini": "1.3.7" + }, + "dependencies": { + "ini": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", + "dev": true + } + } + }, "globals": { "version": "13.8.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", @@ -3754,6 +3568,25 @@ "minimist": "^1.2.5" } }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, "graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", @@ -3843,6 +3676,12 @@ "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true + }, "hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", @@ -3874,6 +3713,12 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -3958,6 +3803,12 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, + "irregular-plurals": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.3.0.tgz", + "integrity": "sha512-MVBLKUTangM3EfRPFROhmWQQKRDsrgI83J8GS3jXy+OwYqiR2/aoWndYQ5416jLE3uaGgLH7ncme3X9y09gZ3g==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -3965,9 +3816,9 @@ "dev": true }, "is-bigint": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz", - "integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", + "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==", "dev": true }, "is-binary-path": { @@ -3980,12 +3831,12 @@ } }, "is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", + "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", "dev": true, "requires": { - "call-bind": "^1.0.0" + "call-bind": "^1.0.2" } }, "is-buffer": { @@ -4000,19 +3851,28 @@ "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", "dev": true }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", "dev": true, "requires": { "has": "^1.0.3" } }, "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", + "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", "dev": true }, "is-extglob": { @@ -4042,6 +3902,16 @@ "is-extglob": "^2.1.1" } }, + "is-installed-globally": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", + "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", + "dev": true, + "requires": { + "global-dirs": "^2.0.1", + "is-path-inside": "^3.0.1" + } + }, "is-interactive": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", @@ -4054,6 +3924,12 @@ "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", "dev": true }, + "is-npm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", + "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -4061,9 +3937,9 @@ "dev": true }, "is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", + "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", "dev": true }, "is-obj": { @@ -4072,6 +3948,12 @@ "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -4079,13 +3961,13 @@ "dev": true }, "is-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", - "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", "dev": true, "requires": { "call-bind": "^1.0.2", - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.2" } }, "is-regexp": { @@ -4107,18 +3989,18 @@ "dev": true }, "is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", + "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==", "dev": true }, "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, "requires": { - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.2" } }, "is-text-path": { @@ -4160,6 +4042,12 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -4226,23 +4114,6 @@ "p-map": "^3.0.0", "rimraf": "^3.0.0", "uuid": "^3.3.3" - }, - "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "istanbul-lib-report": { @@ -4254,23 +4125,6 @@ "istanbul-lib-coverage": "^3.0.0", "make-dir": "^3.0.0", "supports-color": "^7.1.0" - }, - "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "istanbul-lib-source-maps": { @@ -4373,6 +4227,12 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -4451,6 +4311,15 @@ "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -4466,6 +4335,15 @@ "graceful-fs": "^4.1.9" } }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "requires": { + "package-json": "^6.3.0" + } + }, "lcov-parse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", @@ -4519,12 +4397,6 @@ "error-ex": "^1.2.0" } }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, "strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", @@ -4552,12 +4424,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, "lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -4570,12 +4436,6 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", @@ -4600,25 +4460,6 @@ "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", "dev": true }, - "lodash.template": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0" - } - }, "lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", @@ -4657,6 +4498,12 @@ "signal-exit": "^3.0.0" } }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -4673,29 +4520,29 @@ "dev": true }, "madge": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/madge/-/madge-3.12.0.tgz", - "integrity": "sha512-9kA2W5RIbvH25CWc8tzPNn1X47AOcHEEwZJxWAMxhEOKEziVR1iMCbGCFUea5tWXs/A+xgJF59o/oSbNkOXpeg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/madge/-/madge-4.0.2.tgz", + "integrity": "sha512-l5bnA2dvyk0azLKDbOTCI+wDZ6nB007PhvPdmiYlPmqwVi49JPbhQrH/t4u8E6Akp3gwji1GZuA+v/F5q6yoWQ==", "dev": true, "requires": { "chalk": "^4.1.0", - "commander": "^5.1.0", + "commander": "^6.2.1", "commondir": "^1.0.1", "debug": "^4.0.1", - "dependency-tree": "^7.2.2", - "detective-amd": "^3.0.0", + "dependency-tree": "^8.0.0", + "detective-amd": "^3.0.1", "detective-cjs": "^3.1.1", "detective-es6": "^2.1.0", "detective-less": "^1.0.2", - "detective-postcss": "^3.0.1", + "detective-postcss": "^4.0.0", "detective-sass": "^3.0.1", "detective-scss": "^2.0.1", "detective-stylus": "^1.0.0", - "detective-typescript": "^5.8.0", + "detective-typescript": "^7.0.0", "graphviz": "0.0.9", "ora": "^5.1.0", "pluralize": "^8.0.0", - "precinct": "^6.3.1", + "precinct": "^7.0.0", "pretty-ms": "^7.0.0", "rc": "^1.2.7", "typescript": "^3.9.5", @@ -4703,9 +4550,9 @@ }, "dependencies": { "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true }, "typescript": { @@ -4717,13 +4564,20 @@ } }, "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "make-error": { @@ -4769,16 +4623,6 @@ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, - "memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, "memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", @@ -5242,17 +5086,16 @@ } }, "module-lookup-amd": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/module-lookup-amd/-/module-lookup-amd-6.2.0.tgz", - "integrity": "sha512-uxHCj5Pw9psZiC1znjU2qPsubt6haCSsN9m7xmIdoTciEgfxUkE1vhtDvjHPuOXEZrVJhjKgkmkP+w73rRuelQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/module-lookup-amd/-/module-lookup-amd-7.0.1.tgz", + "integrity": "sha512-w9mCNlj0S8qviuHzpakaLVc+/7q50jl9a/kmJ/n8bmXQZgDPkQHnPBb8MUOYh3WpAYkXuNc2c+khsozhIp/amQ==", "dev": true, "requires": { "commander": "^2.8.1", "debug": "^4.1.0", - "file-exists-dazinatorfork": "^1.0.2", - "find": "^0.3.0", + "glob": "^7.1.6", "requirejs": "^2.3.5", - "requirejs-config-file": "^3.1.1" + "requirejs-config-file": "^4.0.0" } }, "mongodb-mock-server": { @@ -5277,6 +5120,12 @@ "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", "dev": true }, + "nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true + }, "napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -5417,6 +5266,12 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", @@ -5506,15 +5361,6 @@ "p-locate": "^4.1.0" } }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, "p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", @@ -5536,12 +5382,6 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -5597,9 +5437,9 @@ "dev": true }, "object-inspect": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", - "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", + "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", "dev": true }, "object-keys": { @@ -5712,6 +5552,12 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -5757,6 +5603,26 @@ "release-zalgo": "^1.0.0" } }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5856,9 +5722,9 @@ "dev": true }, "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { @@ -5921,6 +5787,15 @@ } } }, + "plur": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-4.0.0.tgz", + "integrity": "sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==", + "dev": true, + "requires": { + "irregular-plurals": "^3.2.0" + } + }, "pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -5928,83 +5803,20 @@ "dev": true }, "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "8.2.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.15.tgz", + "integrity": "sha512-2zO3b26eJD/8rb106Qu2o7Qgg52ND5HPjcyQiK2B98O388h43A448LCslC0dI2P97wCAQRJsFvwTRcXxTKds+Q==", "dev": true, "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - }, - "dependencies": { - "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" - } - }, - "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" - }, - "dependencies": { - "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" - } - } - } - }, - "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": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "colorette": "^1.2.2", + "nanoid": "^3.1.23", + "source-map": "^0.6.1" } }, "postcss-values-parser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-1.5.0.tgz", - "integrity": "sha512-3M3p+2gMp0AH3da530TlX8kiO1nxdTnc3C6vr8dMxRLIlh8UYkz0/wcwptSXjhtx2Fr0TySI7a+BHDQ8NL7LaQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz", + "integrity": "sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg==", "dev": true, "requires": { "flatten": "^1.0.2", @@ -6048,24 +5860,44 @@ } }, "precinct": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/precinct/-/precinct-6.3.1.tgz", - "integrity": "sha512-JAwyLCgTylWminoD7V0VJwMElWmwrVSR6r9HaPWCoswkB4iFzX7aNtO7VBfAVPy+NhmjKb8IF8UmlWJXzUkOIQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-7.1.0.tgz", + "integrity": "sha512-I1RkW5PX51/q6Xl39//D7x9NgaKNGHpR5DCNaoxP/b2+KbzzXDNhauJUMV17KSYkJA41CSpwYUPRtRoNxbshWA==", "dev": true, "requires": { "commander": "^2.20.3", - "debug": "^4.1.1", - "detective-amd": "^3.0.0", + "debug": "^4.3.1", + "detective-amd": "^3.0.1", "detective-cjs": "^3.1.1", - "detective-es6": "^2.1.0", + "detective-es6": "^2.2.0", "detective-less": "^1.0.2", - "detective-postcss": "^3.0.1", + "detective-postcss": "^4.0.0", "detective-sass": "^3.0.1", "detective-scss": "^2.0.1", "detective-stylus": "^1.0.0", - "detective-typescript": "^5.8.0", - "module-definition": "^3.3.0", + "detective-typescript": "^6.0.0", + "module-definition": "^3.3.1", "node-source-walk": "^4.2.0" + }, + "dependencies": { + "detective-typescript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-6.0.0.tgz", + "integrity": "sha512-vTidcSDK3QostdbrH2Rwf9FhvrgJ4oIaVw5jbolgruTejexk6nNa9DShGpuS8CFVDb1IP86jct5BaZt1wSxpkA==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "^4.8.2", + "ast-module-types": "^2.7.1", + "node-source-walk": "^4.2.0", + "typescript": "^3.9.7" + } + }, + "typescript": { + "version": "3.9.9", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", + "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==", + "dev": true + } } }, "prelude-ls": { @@ -6074,6 +5906,12 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, "prettier": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz", @@ -6147,6 +5985,15 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "dev": true, + "requires": { + "escape-goat": "^2.0.0" + } + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", @@ -6321,26 +6168,14 @@ } }, "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "readdirp": { @@ -6383,6 +6218,24 @@ "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==", "dev": true }, + "registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -6454,13 +6307,12 @@ "dev": true }, "requirejs-config-file": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/requirejs-config-file/-/requirejs-config-file-3.1.2.tgz", - "integrity": "sha512-sdLWywcDuNz7EIOhenSbRfT4YF84nItDv90coN2htbokjmU2QeyQuSBZILQUKNksepl8UPVU+hgYySFaDxbJPQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz", + "integrity": "sha512-jnIre8cbWOyvr8a5F2KuqBnY+SDA4NXr/hzEZJG79Mxm2WiFQz2dzhC8ibtPJS7zkmBEl1mxSwp5HhC1W4qpxw==", "dev": true, "requires": { "esprima": "^4.0.0", - "make-dir": "^2.1.0", "stringify-object": "^3.2.1" } }, @@ -6494,6 +6346,15 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6576,6 +6437,23 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -6744,23 +6622,6 @@ "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "which": "^2.0.1" - }, - "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "spdx-correct": { @@ -6811,19 +6672,6 @@ "dev": true, "requires": { "readable-stream": "^3.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } } }, "sprintf-js": { @@ -6850,26 +6698,26 @@ } }, "standard-version": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-8.0.2.tgz", - "integrity": "sha512-L8X9KFq2SmVmaeZgUmWHFJMOsEWpjgFAwqic6yIIoveM1kdw1vH4Io03WWxUDjypjGqGU6qUtcJoR8UvOv5w3g==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-9.3.0.tgz", + "integrity": "sha512-cYxxKXhYfI3S9+CA84HmrJa9B88H56V5FQ302iFF2TNwJukJCNoU8FgWt+11YtwKFXRkQQFpepC2QOF7aDq2Ow==", "dev": true, "requires": { "chalk": "^2.4.2", - "conventional-changelog": "3.1.21", + "conventional-changelog": "3.1.24", "conventional-changelog-config-spec": "2.1.0", - "conventional-changelog-conventionalcommits": "4.3.0", - "conventional-recommended-bump": "6.0.9", + "conventional-changelog-conventionalcommits": "4.5.0", + "conventional-recommended-bump": "6.1.0", "detect-indent": "^6.0.0", "detect-newline": "^3.1.0", "dotgitignore": "^2.1.0", "figures": "^3.1.0", - "find-up": "^4.1.0", + "find-up": "^5.0.0", "fs-access": "^1.0.1", "git-semver-tags": "^4.0.0", "semver": "^7.1.1", "stringify-package": "^1.0.1", - "yargs": "^15.3.1" + "yargs": "^16.0.0" }, "dependencies": { "ansi-styles": { @@ -6893,14 +6741,14 @@ } }, "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "wrap-ansi": "^7.0.0" } }, "color-convert": { @@ -6919,12 +6767,12 @@ "dev": true }, "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, @@ -6934,22 +6782,31 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" } }, "path-exists": { @@ -6977,9 +6834,9 @@ } }, "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", @@ -7013,34 +6870,32 @@ } } }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" } }, "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "dev": true } } }, @@ -7082,20 +6937,12 @@ } }, "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } + "safe-buffer": "~5.2.0" } }, "stringify-object": { @@ -7164,27 +7011,34 @@ "has-flag": "^4.0.0" } }, + "supports-hyperlinks": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", + "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "dev": true, + "requires": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + } + }, "table": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/table/-/table-6.3.2.tgz", - "integrity": "sha512-I9/Ca6Huf2oxFag7crD0DhA+arIdfLtWunSn0NIXSzjtUlDgIBGVZY7SsMkNPNT3Psd/z4gza0nuEpmra9eRbg==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.0.tgz", + "integrity": "sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw==", "dev": true, "requires": { "ajv": "^8.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", "lodash.clonedeep": "^4.5.0", - "lodash.flatten": "^4.4.0", "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" }, "dependencies": { "ajv": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.1.0.tgz", - "integrity": "sha512-B/Sk2Ix7A36fs/ZkuGLIR86EdjbgR6fsAcbx9lOP/QBSXujDNbVmIS/U4Itz5k8fPFDeVZl/zQ/gJW4Jrq6XjQ==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.3.0.tgz", + "integrity": "sha512-RYE7B5An83d7eWnDR8kbdaIFqmKCNsP16ay1hDbJEU+sa0e3H9SebskCt0Uufem6cfAVu7Col6ubcn/W+Sm8/Q==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -7208,9 +7062,9 @@ "dev": true }, "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", + "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", "dev": true }, "tar-fs": { @@ -7270,6 +7124,46 @@ "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } } } }, @@ -7279,6 +7173,12 @@ "integrity": "sha1-ZxrWPVe+D+nXKUZks/xABjZnimA=", "dev": true }, + "term-size": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", + "dev": true + }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -7336,6 +7236,12 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7355,12 +7261,6 @@ "punycode": "^2.1.1" } }, - "traverse-chain": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", - "integrity": "sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE=", - "dev": true - }, "trim-newlines": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", @@ -7395,6 +7295,148 @@ } } }, + "tsd": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/tsd/-/tsd-0.14.0.tgz", + "integrity": "sha512-fl1gS5orAwqIb0P2xMdppgCrwv1BfCJn67wBzRBCV9OUaWHVXHqiIqL6yX/519xFgT1ZOaLMhr5W9XDo8kuuRA==", + "dev": true, + "requires": { + "eslint-formatter-pretty": "^4.0.0", + "globby": "^11.0.1", + "meow": "^7.0.1", + "path-exists": "^4.0.0", + "read-pkg-up": "^7.0.0", + "update-notifier": "^4.1.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "meow": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -7462,9 +7504,9 @@ } }, "typedoc": { - "version": "0.20.35", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.35.tgz", - "integrity": "sha512-7sNca19LXg2hgyGHq3b33tQ1YFApmd8aBDEzWQ2ry4VDkw/NdFWkysGiGRY1QckDCB0gVH8+MlXA4K71IB3azg==", + "version": "0.20.36", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.36.tgz", + "integrity": "sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw==", "dev": true, "requires": { "colors": "^1.4.0", @@ -7472,12 +7514,12 @@ "handlebars": "^4.7.7", "lodash": "^4.17.21", "lunr": "^2.3.9", - "marked": "^2.0.1", + "marked": "^2.0.3", "minimatch": "^3.0.0", "progress": "^2.0.3", "shelljs": "^0.8.4", "shiki": "^0.9.3", - "typedoc-default-themes": "^0.12.9" + "typedoc-default-themes": "^0.12.10" }, "dependencies": { "colors": { @@ -7546,9 +7588,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.10.tgz", - "integrity": "sha512-TxCmnSSppKBBOzYzPR2BR25YlX5Oay8z2XGwFBInuA/Co0V9xJhLlW4kjbxKtgeNo3NOMbQP1A5Rc03y+XecPw==", + "version": "12.20.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.12.tgz", + "integrity": "sha512-KQZ1al2hKOONAs2MFv+yTQP1LkDWMrRJ9YCVRalXltOfXsBmH5IownLxQaiq0lnAHwAViLnh2aTYqrPcRGEbgg==", "dev": true }, "fs-extra": { @@ -7571,9 +7613,9 @@ "dev": true }, "uglify-js": { - "version": "3.13.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.4.tgz", - "integrity": "sha512-kv7fCkIXyQIilD5/yQy8O+uagsYIOt5cZvs890W40/e/rvjMSzJw81o9Bg0tkURxzZBROtDQhW2LFjOGoK3RZw==", + "version": "3.13.6", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.6.tgz", + "integrity": "sha512-rRprLwl8RVaS+Qvx3Wh5hPfPBn9++G6xkGlUupya0s5aDmNjI7z3lnRLB3u7sN4OmbB0pWgzhM9BEJyiWAwtAA==", "dev": true, "optional": true }, @@ -7601,12 +7643,60 @@ "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, + "update-notifier": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", + "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", + "dev": true, + "requires": { + "boxen": "^4.2.0", + "chalk": "^3.0.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.1", + "is-npm": "^4.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "pupa": "^2.0.1", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + } + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -7616,6 +7706,15 @@ "punycode": "^2.1.0" } }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -7758,6 +7857,15 @@ } } }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "requires": { + "string-width": "^4.0.0" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -7878,6 +7986,12 @@ "integrity": "sha512-64GEKtMt/MUBuAm+8kHqP74ojjafzu00aT0JKsmkIwYmjRQ/odO0yhbzKLm+Z9v1gMla+8dwITRKzTAlHsB+Og==", "dev": true }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true + }, "xml2js": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", @@ -8072,6 +8186,12 @@ "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + }, "z-schema": { "version": "3.18.4", "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-3.18.4.tgz", diff --git a/package.json b/package.json index c0883e8baab..78205672af2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "bson-ext": "^2.0.0" }, "dependencies": { - "bson": "^4.2.2", + "bson": "^4.2.3", "denque": "^1.4.1" }, "devDependencies": { @@ -42,8 +42,8 @@ "@types/node": "^14.14.41", "@types/saslprep": "^1.0.0", "@types/semver": "^7.3.4", - "@typescript-eslint/eslint-plugin": "^4.15.1", - "@typescript-eslint/parser": "^4.15.1", + "@typescript-eslint/eslint-plugin": "^4.19.0", + "@typescript-eslint/parser": "^4.19.0", "chai": "^4.2.0", "chai-subset": "^1.6.0", "chalk": "^4.1.0", @@ -57,7 +57,7 @@ "js-yaml": "^3.14.0", "jsdoc": "^3.6.4", "lodash.camelcase": "^4.3.0", - "madge": "^3.9.0", + "madge": "^4.0.2", "mocha": "^7.1.1", "mocha-sinon": "^2.1.0", "mongodb-mock-server": "^2.0.1", @@ -69,9 +69,10 @@ "sinon-chai": "^3.2.0", "snappy": "^6.3.0", "source-map-support": "^0.5.19", - "standard-version": "^8.0.2", + "standard-version": "^9.1.1", "through2": "^3.0.1", "ts-node": "^9.1.1", + "tsd": "^0.14.0", "typedoc": "^0.20.35", "typescript": "^4.2.4", "typescript-cached-transpile": "^0.0.6", @@ -87,6 +88,10 @@ "bugs": { "url": "https://github.com/mongodb/node-mongodb-native/issues" }, + "homepage": "https://github.com/mongodb/node-mongodb-native", + "optionalDependencies": { + "saslprep": "^1.0.0" + }, "scripts": { "build:evergreen": "node .evergreen/generate_evergreen_tasks.js", "build:ts": "rimraf lib && tsc", @@ -109,8 +114,7 @@ "release": "standard-version -i HISTORY.md", "test": "npm run check:lint && npm run check:test" }, - "homepage": "https://github.com/mongodb/node-mongodb-native", - "optionalDependencies": { - "saslprep": "^1.0.0" + "tsd": { + "directory": "test/types" } } diff --git a/src/bson.ts b/src/bson.ts index 03266cbfaeb..1d0ce701ab0 100644 --- a/src/bson.ts +++ b/src/bson.ts @@ -1,4 +1,3 @@ -import type { OperationParent } from './operations/command'; // import type * as _BSON from 'bson'; // let BSON: typeof _BSON = require('bson'); // try { @@ -86,7 +85,7 @@ export function pluckBSONSerializeOptions(options: BSONSerializeOptions): BSONSe */ export function resolveBSONOptions( options?: BSONSerializeOptions, - parent?: OperationParent + parent?: { bsonOptions?: BSONSerializeOptions } ): BSONSerializeOptions { const parentOptions = parent?.bsonOptions; return { diff --git a/src/bulk/common.ts b/src/bulk/common.ts index 4afcecf20c2..c93230fbd0e 100644 --- a/src/bulk/common.ts +++ b/src/bulk/common.ts @@ -19,6 +19,7 @@ import type { Collection } from '../collection'; import type { Topology } from '../sdam/topology'; import type { CommandOperationOptions, CollationOptions } from '../operations/command'; import type { Hint } from '../operations/operation'; +import type { Filter, OptionalId, UpdateQuery } from '../mongo_types'; /** @public */ export const BatchType = { @@ -31,15 +32,15 @@ export const BatchType = { export type BatchTypeId = typeof BatchType[keyof typeof BatchType]; /** @public */ -export interface InsertOneModel { +export interface InsertOneModel { /** The document to insert. */ - document: Document; + document: OptionalId; } /** @public */ -export interface DeleteOneModel { +export interface DeleteOneModel { /** The filter to limit the deleted documents. */ - filter: Document; + filter: Filter; /** Specifies a collation. */ collation?: CollationOptions; /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ @@ -47,9 +48,9 @@ export interface DeleteOneModel { } /** @public */ -export interface DeleteManyModel { +export interface DeleteManyModel { /** The filter to limit the deleted documents. */ - filter: Document; + filter: Filter; /** Specifies a collation. */ collation?: CollationOptions; /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ @@ -57,11 +58,11 @@ export interface DeleteManyModel { } /** @public */ -export interface ReplaceOneModel { +export interface ReplaceOneModel { /** The filter to limit the replaced document. */ - filter: Document; + filter: Filter; /** The document with which to replace the matched document. */ - replacement: Document; + replacement: TSchema; /** Specifies a collation. */ collation?: CollationOptions; /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ @@ -71,11 +72,11 @@ export interface ReplaceOneModel { } /** @public */ -export interface UpdateOneModel { +export interface UpdateOneModel { /** The filter to limit the updated documents. */ - filter: Document; + filter: Filter; /** A document or pipeline containing update operators. */ - update: Document | Document[]; + update: UpdateQuery | UpdateQuery[]; /** A set of filters specifying to which array elements an update should apply. */ arrayFilters?: Document[]; /** Specifies a collation. */ @@ -87,11 +88,11 @@ export interface UpdateOneModel { } /** @public */ -export interface UpdateManyModel { +export interface UpdateManyModel { /** The filter to limit the updated documents. */ - filter: Document; + filter: Filter; /** A document or pipeline containing update operators. */ - update: Document | Document[]; + update: UpdateQuery | UpdateQuery[]; /** A set of filters specifying to which array elements an update should apply. */ arrayFilters?: Document[]; /** Specifies a collation. */ @@ -103,13 +104,13 @@ export interface UpdateManyModel { } /** @public */ -export type AnyBulkWriteOperation = - | { insertOne: InsertOneModel } - | { replaceOne: ReplaceOneModel } - | { updateOne: UpdateOneModel } - | { updateMany: UpdateManyModel } - | { deleteOne: DeleteOneModel } - | { deleteMany: DeleteManyModel }; +export type AnyBulkWriteOperation = + | { insertOne: InsertOneModel } + | { replaceOne: ReplaceOneModel } + | { updateOne: UpdateOneModel } + | { updateMany: UpdateManyModel } + | { deleteOne: DeleteOneModel } + | { deleteMany: DeleteManyModel }; /** @public */ export interface BulkResult { diff --git a/src/change_stream.ts b/src/change_stream.ts index 0ab04295c63..6f0dae674a5 100644 --- a/src/change_stream.ts +++ b/src/change_stream.ts @@ -26,7 +26,7 @@ import { } from './cursor/abstract_cursor'; import type { ClientSession } from './sessions'; import { executeOperation, ExecutionResult } from './operations/execute_operation'; -import { TypedEventEmitter } from './mongo_types'; +import { InferIdType, Nullable, TypedEventEmitter } from './mongo_types'; const kResumeQueue = Symbol('resumeQueue'); const kCursorStream = Symbol('cursorStream'); @@ -97,12 +97,12 @@ export interface ChangeStreamOptions extends AggregateOptions { } /** @public */ -export interface ChangeStreamDocument { +export interface ChangeStreamDocument { /** * The id functions as an opaque token for use when resuming an interrupted * change stream. */ - _id: Document; + _id: InferIdType; /** * Describes the type of operation represented in this change notification. @@ -121,7 +121,7 @@ export interface ChangeStreamDocument { * Contains two fields: “db” and “coll” containing the database and * collection name in which the change happened. */ - ns: Document; + ns: { db: string; coll: string }; /** * Only present for ops of type ‘insert’, ‘update’, ‘replace’, and @@ -132,7 +132,7 @@ export interface ChangeStreamDocument { * this will contain all the components of the shard key in order, * followed by the _id if the _id isn’t part of the shard key. */ - documentKey?: Document; + documentKey?: InferIdType; /** * Only present for ops of type ‘update’. @@ -140,7 +140,7 @@ export interface ChangeStreamDocument { * Contains a description of updated and removed fields in this * operation. */ - updateDescription?: UpdateDescription; + updateDescription?: UpdateDescription; /** * Always present for operations of type ‘insert’ and ‘replace’. Also @@ -155,16 +155,16 @@ export interface ChangeStreamDocument { * version of the document from some point after the update occurred. If the * document was deleted since the updated happened, it will be null. */ - fullDocument?: Document; + fullDocument?: TSchema; } /** @public */ -export interface UpdateDescription { +export interface UpdateDescription { /** * A document containing key:value pairs of names of the fields that were * changed, and the new value for those fields. */ - updatedFields: Document; + updatedFields: Partial; /** * An array of field names that were removed from the document. @@ -187,14 +187,14 @@ export type ChangeStreamEvents = { * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}. * @public */ -export class ChangeStream extends TypedEventEmitter { +export class ChangeStream extends TypedEventEmitter { pipeline: Document[]; options: ChangeStreamOptions; parent: MongoClient | Db | Collection; namespace: MongoDBNamespace; type: symbol; /** @internal */ - cursor?: ChangeStreamCursor; + cursor?: ChangeStreamCursor; streamOptions?: CursorStreamOptions; /** @internal */ [kResumeQueue]: Denque; @@ -304,7 +304,11 @@ export class ChangeStream extends TypedEventEmitter { } /** Get the next available document from the Change Stream. */ - next(callback?: Callback): Promise | void { + next(): Promise>; + next(callback: Callback>): void; + next( + callback?: Callback> + ): Promise> | void { return maybePromise(callback, cb => { getCursor(this, (err, cursor) => { if (err || !cursor) return cb(err); // failed to resume, raise an error @@ -314,7 +318,7 @@ export class ChangeStream extends TypedEventEmitter { processError(this, error, cb); return; } - processNewChange(this, change as ChangeStreamDocument, cb); + processNewChange(this, change, cb); }); }); }); @@ -376,7 +380,10 @@ export interface ChangeStreamCursorOptions extends AbstractCursorOptions { } /** @internal */ -export class ChangeStreamCursor extends AbstractCursor { +export class ChangeStreamCursor extends AbstractCursor< + ChangeStreamDocument, + ChangeStreamEvents +> { _resumeToken: ResumeToken; startAtOperationTime?: OperationTime; hasReceived?: boolean; @@ -461,7 +468,7 @@ export class ChangeStreamCursor extends AbstractCursor { } } - clone(): ChangeStreamCursor { + clone(): AbstractCursor> { return new ChangeStreamCursor(this.topology, this.namespace, this.pipeline, { ...this.cursorOptions }); @@ -528,10 +535,10 @@ const CHANGE_STREAM_EVENTS = [ * Create a new change stream cursor based on self's configuration * @internal */ -function createChangeStreamCursor( - changeStream: ChangeStream, +function createChangeStreamCursor( + changeStream: ChangeStream, options: ChangeStreamOptions -): ChangeStreamCursor { +): ChangeStreamCursor { const changeStreamStageOptions: Document = { fullDocument: options.fullDocument || 'default' }; applyKnownOptions(changeStreamStageOptions, options, CHANGE_STREAM_OPTIONS); if (changeStream.type === CHANGE_DOMAIN_TYPES.CLUSTER) { @@ -543,7 +550,7 @@ function createChangeStreamCursor( ); const cursorOptions = applyKnownOptions({}, options, CURSOR_OPTIONS); - const changeStreamCursor = new ChangeStreamCursor( + const changeStreamCursor = new ChangeStreamCursor( getTopology(changeStream.parent), changeStream.namespace, pipeline, @@ -603,7 +610,11 @@ function waitForTopologyConnected( }, 500); // this is an arbitrary wait time to allow SDAM to transition } -function closeWithError(changeStream: ChangeStream, error: AnyError, callback?: Callback): void { +function closeWithError( + changeStream: ChangeStream, + error: AnyError, + callback?: Callback +): void { if (!callback) { changeStream.emit(ChangeStream.ERROR, error); } @@ -611,14 +622,17 @@ function closeWithError(changeStream: ChangeStream, error: AnyError, callback?: changeStream.close(() => callback && callback(error)); } -function streamEvents(changeStream: ChangeStream, cursor: ChangeStreamCursor): void { +function streamEvents( + changeStream: ChangeStream, + cursor: ChangeStreamCursor +): void { const stream = changeStream[kCursorStream] || cursor.stream(); changeStream[kCursorStream] = stream; stream.on('data', change => processNewChange(changeStream, change)); stream.on('error', error => processError(changeStream, error)); } -function endStream(changeStream: ChangeStream): void { +function endStream(changeStream: ChangeStream): void { const cursorStream = changeStream[kCursorStream]; if (cursorStream) { ['data', 'close', 'end', 'error'].forEach(event => cursorStream.removeAllListeners(event)); @@ -628,10 +642,10 @@ function endStream(changeStream: ChangeStream): void { changeStream[kCursorStream] = undefined; } -function processNewChange( - changeStream: ChangeStream, - change: ChangeStreamDocument, - callback?: Callback +function processNewChange( + changeStream: ChangeStream, + change: Nullable>, + callback?: Callback> ) { if (changeStream[kClosed]) { if (callback) callback(CHANGESTREAM_CLOSED_ERROR); @@ -659,7 +673,11 @@ function processNewChange( return callback(undefined, change); } -function processError(changeStream: ChangeStream, error: AnyError, callback?: Callback) { +function processError( + changeStream: ChangeStream, + error: AnyError, + callback?: Callback +) { const cursor = changeStream.cursor; // If the change stream has been closed explicitly, do not process error. @@ -669,7 +687,7 @@ function processError(changeStream: ChangeStream, error: AnyError, callback?: Ca } // if the resume succeeds, continue with the new cursor - function resumeWithCursor(newCursor: ChangeStreamCursor) { + function resumeWithCursor(newCursor: ChangeStreamCursor) { changeStream.cursor = newCursor; processResumeQueue(changeStream); } @@ -722,7 +740,7 @@ function processError(changeStream: ChangeStream, error: AnyError, callback?: Ca * * @param changeStream - the parent ChangeStream */ -function getCursor(changeStream: ChangeStream, callback: Callback) { +function getCursor(changeStream: ChangeStream, callback: Callback>) { if (changeStream[kClosed]) { callback(CHANGESTREAM_CLOSED_ERROR); return; @@ -744,7 +762,7 @@ function getCursor(changeStream: ChangeStream, callback: Callback(changeStream: ChangeStream, err?: Error) { while (changeStream[kResumeQueue].length) { const request = changeStream[kResumeQueue].pop(); if (!err) { diff --git a/src/collection.ts b/src/collection.ts index 8b1f172d2c1..6040e574ebe 100644 --- a/src/collection.ts +++ b/src/collection.ts @@ -89,6 +89,14 @@ import type { PkFactory } from './mongo_client'; import type { Logger, LoggerOptions } from './logger'; import { FindCursor } from './cursor/find_cursor'; import type { CountOptions } from './operations/count'; +import type { Filter, TODO_NODE_3286, UpdateQuery, WithId, OptionalId } from './mongo_types'; + +/** @public */ +export interface ModifyResult { + value?: TSchema; + lastErrorObject?: Document; + ok: 0 | 1; +} /** @public */ export interface CollectionOptions @@ -146,7 +154,7 @@ export interface CollectionPrivate { * }); * ``` */ -export class Collection { +export class Collection { /** @internal */ s: CollectionPrivate; @@ -249,15 +257,19 @@ export class Collection { * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - insertOne(doc: Document): Promise; - insertOne(doc: Document, callback: Callback): void; - insertOne(doc: Document, options: InsertOneOptions): Promise; - insertOne(doc: Document, options: InsertOneOptions, callback: Callback): void; + insertOne(doc: OptionalId): Promise>; + insertOne(doc: OptionalId, callback: Callback>): void; + insertOne(doc: OptionalId, options: InsertOneOptions): Promise>; + insertOne( + doc: OptionalId, + options: InsertOneOptions, + callback: Callback> + ): void; insertOne( - doc: Document, - options?: InsertOneOptions | Callback, - callback?: Callback - ): Promise | void { + doc: OptionalId, + options?: InsertOneOptions | Callback>, + callback?: Callback> + ): Promise> | void { if (typeof options === 'function') { callback = options; options = {}; @@ -271,7 +283,11 @@ export class Collection { return executeOperation( getTopology(this), - new InsertOneOperation(this, doc, resolveOptions(this, options)), + new InsertOneOperation( + this as TODO_NODE_3286, + doc, + resolveOptions(this, options) + ) as TODO_NODE_3286, callback ); } @@ -285,25 +301,32 @@ export class Collection { * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - insertMany(docs: Document[]): Promise; - insertMany(docs: Document[], callback: Callback): void; - insertMany(docs: Document[], options: BulkWriteOptions): Promise; + insertMany(docs: OptionalId[]): Promise>; + insertMany(docs: OptionalId[], callback: Callback>): void; + insertMany( + docs: OptionalId[], + options: BulkWriteOptions + ): Promise>; insertMany( - docs: Document[], + docs: OptionalId[], options: BulkWriteOptions, - callback: Callback + callback: Callback> ): void; insertMany( - docs: Document[], - options?: BulkWriteOptions | Callback, - callback?: Callback - ): Promise | void { + docs: OptionalId[], + options?: BulkWriteOptions | Callback>, + callback?: Callback> + ): Promise> | void { if (typeof options === 'function') (callback = options), (options = {}); options = options ? Object.assign({}, options) : { ordered: true }; return executeOperation( getTopology(this), - new InsertManyOperation(this, docs, resolveOptions(this, options)), + new InsertManyOperation( + this as TODO_NODE_3286, + docs, + resolveOptions(this, options) + ) as TODO_NODE_3286, callback ); } @@ -339,19 +362,22 @@ export class Collection { * @param callback - An optional callback, a Promise will be returned if none is provided * @throws MongoError if operations is not an array */ - bulkWrite(operations: AnyBulkWriteOperation[]): Promise; - bulkWrite(operations: AnyBulkWriteOperation[], callback: Callback): void; + bulkWrite(operations: AnyBulkWriteOperation[]): Promise; bulkWrite( - operations: AnyBulkWriteOperation[], + operations: AnyBulkWriteOperation[], + callback: Callback + ): void; + bulkWrite( + operations: AnyBulkWriteOperation[], options: BulkWriteOptions ): Promise; bulkWrite( - operations: AnyBulkWriteOperation[], + operations: AnyBulkWriteOperation[], options: BulkWriteOptions, callback: Callback ): void; bulkWrite( - operations: AnyBulkWriteOperation[], + operations: AnyBulkWriteOperation[], options?: BulkWriteOptions | Callback, callback?: Callback ): Promise | void { @@ -364,7 +390,11 @@ export class Collection { return executeOperation( getTopology(this), - new BulkWriteOperation(this, operations, resolveOptions(this, options)), + new BulkWriteOperation( + this as TODO_NODE_3286, + operations as TODO_NODE_3286, + resolveOptions(this, options) + ), callback ); } @@ -372,27 +402,34 @@ export class Collection { /** * Update a single document in a collection * - * @param filter - The Filter used to select the document to update + * @param filter - The filter used to select the document to update * @param update - The update operations to be applied to the document * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - updateOne(filter: Document, update: Document): Promise; - updateOne(filter: Document, update: Document, callback: Callback): void; updateOne( - filter: Document, - update: Document, + filter: Filter, + update: UpdateQuery | Partial + ): Promise; + updateOne( + filter: Filter, + update: UpdateQuery | Partial, + callback: Callback + ): void; + updateOne( + filter: Filter, + update: UpdateQuery | Partial, options: UpdateOptions ): Promise; updateOne( - filter: Document, - update: Document, + filter: Filter, + update: UpdateQuery | Partial, options: UpdateOptions, callback: Callback ): void; updateOne( - filter: Document, - update: Document, + filter: Filter, + update: UpdateQuery | Partial, options?: UpdateOptions | Callback, callback?: Callback ): Promise | void { @@ -400,7 +437,7 @@ export class Collection { return executeOperation( getTopology(this), - new UpdateOneOperation(this, filter, update, resolveOptions(this, options)), + new UpdateOneOperation(this as TODO_NODE_3286, filter, update, resolveOptions(this, options)), callback ); } @@ -408,31 +445,31 @@ export class Collection { /** * Replace a document in a collection with another document * - * @param filter - The Filter used to select the document to replace + * @param filter - The filter used to select the document to replace * @param replacement - The Document that replaces the matching document * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - replaceOne(filter: Document, replacement: Document): Promise; + replaceOne(filter: Filter, replacement: TSchema): Promise; replaceOne( - filter: Document, - replacement: Document, + filter: Filter, + replacement: TSchema, callback: Callback ): void; replaceOne( - filter: Document, - replacement: Document, + filter: Filter, + replacement: TSchema, options: ReplaceOptions ): Promise; replaceOne( - filter: Document, - replacement: Document, + filter: Filter, + replacement: TSchema, options: ReplaceOptions, callback: Callback ): void; replaceOne( - filter: Document, - replacement: Document, + filter: Filter, + replacement: TSchema, options?: ReplaceOptions | Callback, callback?: Callback ): Promise | void { @@ -440,7 +477,12 @@ export class Collection { return executeOperation( getTopology(this), - new ReplaceOneOperation(this, filter, replacement, resolveOptions(this, options)), + new ReplaceOneOperation( + this as TODO_NODE_3286, + filter, + replacement, + resolveOptions(this, options) + ), callback ); } @@ -448,27 +490,34 @@ export class Collection { /** * Update multiple documents in a collection * - * @param filter - The Filter used to select the documents to update + * @param filter - The filter used to select the documents to update * @param update - The update operations to be applied to the documents * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - updateMany(filter: Document, update: Document): Promise; - updateMany(filter: Document, update: Document, callback: Callback): void; updateMany( - filter: Document, - update: Document, + filter: Filter, + update: UpdateQuery + ): Promise; + updateMany( + filter: Filter, + update: UpdateQuery, + callback: Callback + ): void; + updateMany( + filter: Filter, + update: UpdateQuery, options: UpdateOptions ): Promise; updateMany( - filter: Document, - update: Document, + filter: Filter, + update: UpdateQuery, options: UpdateOptions, callback: Callback ): void; updateMany( - filter: Document, - update: Document, + filter: Filter, + update: UpdateQuery, options?: UpdateOptions | Callback, callback?: Callback ): Promise | void { @@ -476,7 +525,12 @@ export class Collection { return executeOperation( getTopology(this), - new UpdateManyOperation(this, filter, update, resolveOptions(this, options)), + new UpdateManyOperation( + this as TODO_NODE_3286, + filter, + update, + resolveOptions(this, options) + ), callback ); } @@ -484,16 +538,20 @@ export class Collection { /** * Delete a document from a collection * - * @param filter - The Filter used to select the document to remove + * @param filter - The filter used to select the document to remove * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - deleteOne(filter: Document): Promise; - deleteOne(filter: Document, callback: Callback): void; - deleteOne(filter: Document, options: DeleteOptions): Promise; - deleteOne(filter: Document, options: DeleteOptions, callback?: Callback): void; + deleteOne(filter: Filter): Promise; + deleteOne(filter: Filter, callback: Callback): void; + deleteOne(filter: Filter, options: DeleteOptions): Promise; deleteOne( - filter: Document, + filter: Filter, + options: DeleteOptions, + callback?: Callback + ): void; + deleteOne( + filter: Filter, options?: DeleteOptions | Callback, callback?: Callback ): Promise | void { @@ -501,7 +559,7 @@ export class Collection { return executeOperation( getTopology(this), - new DeleteOneOperation(this, filter, resolveOptions(this, options)), + new DeleteOneOperation(this as TODO_NODE_3286, filter, resolveOptions(this, options)), callback ); } @@ -509,16 +567,20 @@ export class Collection { /** * Delete multiple documents from a collection * - * @param filter - The Filter used to select the documents to remove + * @param filter - The filter used to select the documents to remove * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - deleteMany(filter: Document): Promise; - deleteMany(filter: Document, callback: Callback): void; - deleteMany(filter: Document, options: DeleteOptions): Promise; - deleteMany(filter: Document, options: DeleteOptions, callback: Callback): void; + deleteMany(filter: Filter): Promise; + deleteMany(filter: Filter, callback: Callback): void; + deleteMany(filter: Filter, options: DeleteOptions): Promise; deleteMany( - filter: Document, + filter: Filter, + options: DeleteOptions, + callback: Callback + ): void; + deleteMany( + filter: Filter, options?: DeleteOptions | Callback, callback?: Callback ): Promise | void { @@ -537,7 +599,7 @@ export class Collection { return executeOperation( getTopology(this), - new DeleteManyOperation(this, filter, resolveOptions(this, options)), + new DeleteManyOperation(this as TODO_NODE_3286, filter, resolveOptions(this, options)), callback ); } @@ -566,7 +628,10 @@ export class Collection { // Intentionally, we do not inherit options from parent for this operation. return executeOperation( getTopology(this), - new RenameOperation(this, newName, { ...options, readPreference: ReadPreference.PRIMARY }), + new RenameOperation(this as TODO_NODE_3286, newName, { + ...options, + readPreference: ReadPreference.PRIMARY + }), callback ); } @@ -596,48 +661,52 @@ export class Collection { } /** - * Fetches the first document that matches the query + * Fetches the first document that matches the filter * - * @param query - Query for find Operation + * @param filter - Query for find Operation * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - findOne(): Promise; - findOne(callback: Callback): void; - findOne(query: Document): Promise; - findOne(query: Document, callback?: Callback): void; - findOne(query: Document, options: FindOptions): Promise; - findOne(query: Document, options: FindOptions, callback: Callback): void; + findOne(): Promise; + findOne(callback: Callback): void; + findOne(filter: Filter): Promise; + findOne(filter: Filter, callback?: Callback): void; + findOne(filter: Filter, options: FindOptions): Promise; + findOne(filter: Filter, options: FindOptions, callback: Callback): void; findOne( - query?: Document | Callback, - options?: FindOptions | Callback, - callback?: Callback - ): Promise | void { + filter?: Filter | Callback, + options?: FindOptions | Callback, + callback?: Callback + ): Promise | void { if (callback !== undefined && typeof callback !== 'function') { throw new TypeError('Third parameter to `findOne()` must be a callback or undefined'); } - if (typeof query === 'function') - (callback = query as Callback), (query = {}), (options = {}); + if (typeof filter === 'function') + (callback = filter as Callback), (filter = {}), (options = {}); if (typeof options === 'function') (callback = options), (options = {}); - query = query || {}; + filter = filter || {}; return executeOperation( getTopology(this), - new FindOneOperation(this, query, resolveOptions(this, options)), + new FindOneOperation( + this as TODO_NODE_3286, + filter, + resolveOptions(this, options) + ) as TODO_NODE_3286, callback ); } /** - * Creates a cursor for a query that can be used to iterate over results from MongoDB + * Creates a cursor for a filter that can be used to iterate over results from MongoDB * - * @param filter - The query predicate. If unspecified, then all documents in the collection will match the predicate + * @param filter - The filter predicate. If unspecified, then all documents in the collection will match the predicate */ - find(): FindCursor; - find(filter: Document): FindCursor; - find(filter: Document, options: FindOptions): FindCursor; - find(filter?: Document, options?: FindOptions): FindCursor { + find(): FindCursor; + find(filter: Filter): FindCursor; + find(filter: Filter, options: FindOptions): FindCursor; + find(filter?: Filter, options?: FindOptions): FindCursor { if (arguments.length > 2) { throw new TypeError('Third parameter to `collection.find()` must be undefined'); } @@ -645,11 +714,11 @@ export class Collection { throw new TypeError('`options` parameter must not be function'); } - return new FindCursor( + return new FindCursor( getTopology(this), this.s.namespace, filter, - resolveOptions(this, options) + resolveOptions(this as TODO_NODE_3286, options) ); } @@ -671,7 +740,7 @@ export class Collection { return executeOperation( getTopology(this), - new OptionsOperation(this, resolveOptions(this, options)), + new OptionsOperation(this as TODO_NODE_3286, resolveOptions(this, options)), callback ); } @@ -694,7 +763,7 @@ export class Collection { return executeOperation( getTopology(this), - new IsCappedOperation(this, resolveOptions(this, options)), + new IsCappedOperation(this as TODO_NODE_3286, resolveOptions(this, options)), callback ); } @@ -745,7 +814,12 @@ export class Collection { return executeOperation( getTopology(this), - new CreateIndexOperation(this, this.collectionName, indexSpec, resolveOptions(this, options)), + new CreateIndexOperation( + this as TODO_NODE_3286, + this.collectionName, + indexSpec, + resolveOptions(this, options) + ), callback ); } @@ -802,7 +876,7 @@ export class Collection { return executeOperation( getTopology(this), new CreateIndexesOperation( - this, + this as TODO_NODE_3286, this.collectionName, indexSpecs, resolveOptions(this, options) @@ -835,7 +909,7 @@ export class Collection { return executeOperation( getTopology(this), - new DropIndexOperation(this, indexName, options), + new DropIndexOperation(this as TODO_NODE_3286, indexName, options), callback ); } @@ -858,7 +932,7 @@ export class Collection { return executeOperation( getTopology(this), - new DropIndexesOperation(this, resolveOptions(this, options)), + new DropIndexesOperation(this as TODO_NODE_3286, resolveOptions(this, options)), callback ); } @@ -869,7 +943,7 @@ export class Collection { * @param options - Optional settings for the command */ listIndexes(options?: ListIndexesOptions): ListIndexesCursor { - return new ListIndexesCursor(this, resolveOptions(this, options)); + return new ListIndexesCursor(this as TODO_NODE_3286, resolveOptions(this, options)); } /** @@ -896,7 +970,7 @@ export class Collection { return executeOperation( getTopology(this), - new IndexExistsOperation(this, indexes, resolveOptions(this, options)), + new IndexExistsOperation(this as TODO_NODE_3286, indexes, resolveOptions(this, options)), callback ); } @@ -941,7 +1015,7 @@ export class Collection { if (typeof options === 'function') (callback = options), (options = {}); return executeOperation( getTopology(this), - new EstimatedDocumentCountOperation(this, resolveOptions(this, options)), + new EstimatedDocumentCountOperation(this as TODO_NODE_3286, resolveOptions(this, options)), callback ); } @@ -963,7 +1037,7 @@ export class Collection { * [3]: https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center * [4]: https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere * - * @param query - The query for the count + * @param filter - The filter for the count * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided * @@ -974,31 +1048,35 @@ export class Collection { */ countDocuments(): Promise; countDocuments(callback: Callback): void; - countDocuments(query: Document): Promise; + countDocuments(filter: Filter): Promise; countDocuments(callback: Callback): void; - countDocuments(query: Document, options: CountDocumentsOptions): Promise; - countDocuments(query: Document, options: CountDocumentsOptions, callback: Callback): void; + countDocuments(filter: Filter, options: CountDocumentsOptions): Promise; + countDocuments( + filter: Filter, + options: CountDocumentsOptions, + callback: Callback + ): void; countDocuments( - query?: Document | CountDocumentsOptions | Callback, + filter?: Document | CountDocumentsOptions | Callback, options?: CountDocumentsOptions | Callback, callback?: Callback ): Promise | void { - if (typeof query === 'undefined') { - (query = {}), (options = {}), (callback = undefined); - } else if (typeof query === 'function') { - (callback = query as Callback), (query = {}), (options = {}); + if (typeof filter === 'undefined') { + (filter = {}), (options = {}), (callback = undefined); + } else if (typeof filter === 'function') { + (callback = filter as Callback), (filter = {}), (options = {}); } else { if (arguments.length === 2) { if (typeof options === 'function') (callback = options), (options = {}); } } - query = query || {}; + filter ??= {}; return executeOperation( getTopology(this), new CountDocumentsOperation( - this, - query as Document, + this as TODO_NODE_3286, + filter as Document, resolveOptions(this, options as CountDocumentsOptions) ), callback @@ -1009,37 +1087,50 @@ export class Collection { * The distinct command returns a list of distinct values for the given key across a collection. * * @param key - Field of the document to find distinct values for - * @param query - The query for filtering the set of documents to which we apply the distinct filter. + * @param filter - The filter for filtering the set of documents to which we apply the distinct filter. * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - distinct(key: string): Promise; - distinct(key: string, callback: Callback): void; - distinct(key: string, query: Document): Promise; - distinct(key: string, query: Document, callback: Callback): void; - distinct(key: string, query: Document, options: DistinctOptions): Promise; - distinct(key: string, query: Document, options: DistinctOptions, callback: Callback): void; - distinct( - key: string, - query?: Document | DistinctOptions | Callback, + distinct>(key: Key): Promise; + distinct>(key: Key, callback: Callback): void; + distinct>(key: Key, filter: Filter): Promise; + distinct>( + key: Key, + filter: Filter, + callback: Callback + ): void; + distinct>( + key: Key, + filter: Filter, + options: DistinctOptions + ): Promise; + distinct>( + key: Key, + filter: Filter, + options: DistinctOptions, + callback: Callback + ): void; + distinct>( + key: Key, + filter?: Filter | DistinctOptions | Callback, options?: DistinctOptions | Callback, callback?: Callback ): Promise | void { - if (typeof query === 'function') { - (callback = query as Callback), (query = {}), (options = {}); + if (typeof filter === 'function') { + (callback = filter as Callback), (filter = {}), (options = {}); } else { if (arguments.length === 3 && typeof options === 'function') { (callback = options), (options = {}); } } - query = query || {}; + filter ??= {}; return executeOperation( getTopology(this), new DistinctOperation( - this, - key, - query as Document, + this as TODO_NODE_3286, + key as TODO_NODE_3286, + filter, resolveOptions(this, options as DistinctOptions) ), callback @@ -1064,7 +1155,7 @@ export class Collection { return executeOperation( getTopology(this), - new IndexesOperation(this, resolveOptions(this, options)), + new IndexesOperation(this as TODO_NODE_3286, resolveOptions(this, options)), callback ); } @@ -1086,34 +1177,45 @@ export class Collection { if (typeof options === 'function') (callback = options), (options = {}); options = options ?? {}; - return executeOperation(getTopology(this), new CollStatsOperation(this, options), callback); + return executeOperation( + getTopology(this), + new CollStatsOperation(this as TODO_NODE_3286, options), + callback + ); } /** * Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation. * - * @param filter - The Filter used to select the document to remove + * @param filter - The filter used to select the document to remove * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - findOneAndDelete(filter: Document): Promise; - findOneAndDelete(filter: Document, callback: Callback): void; - findOneAndDelete(filter: Document, options: FindOneAndDeleteOptions): Promise; + findOneAndDelete(filter: Filter): Promise>; + findOneAndDelete(filter: Filter, callback: Callback>): void; findOneAndDelete( - filter: Document, + filter: Filter, + options: FindOneAndDeleteOptions + ): Promise>; + findOneAndDelete( + filter: Filter, options: FindOneAndDeleteOptions, - callback: Callback + callback: Callback> ): void; findOneAndDelete( - filter: Document, - options?: FindOneAndDeleteOptions | Callback, - callback?: Callback + filter: Filter, + options?: FindOneAndDeleteOptions | Callback>, + callback?: Callback> ): Promise | void { if (typeof options === 'function') (callback = options), (options = {}); return executeOperation( getTopology(this), - new FindOneAndDeleteOperation(this, filter, resolveOptions(this, options)), + new FindOneAndDeleteOperation( + this as TODO_NODE_3286, + filter, + resolveOptions(this, options) + ) as TODO_NODE_3286, callback ); } @@ -1121,35 +1223,44 @@ export class Collection { /** * Find a document and replace it in one atomic operation. Requires a write lock for the duration of the operation. * - * @param filter - The Filter used to select the document to replace + * @param filter - The filter used to select the document to replace * @param replacement - The Document that replaces the matching document * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - findOneAndReplace(filter: Document, replacement: Document): Promise; - findOneAndReplace(filter: Document, replacement: Document, callback: Callback): void; + findOneAndReplace(filter: Filter, replacement: Document): Promise>; + findOneAndReplace( + filter: Filter, + replacement: Document, + callback: Callback> + ): void; findOneAndReplace( - filter: Document, + filter: Filter, replacement: Document, options: FindOneAndReplaceOptions - ): Promise; + ): Promise>; findOneAndReplace( - filter: Document, + filter: Filter, replacement: Document, options: FindOneAndReplaceOptions, - callback: Callback + callback: Callback> ): void; findOneAndReplace( - filter: Document, + filter: Filter, replacement: Document, - options?: FindOneAndReplaceOptions | Callback, - callback?: Callback - ): Promise | void { + options?: FindOneAndReplaceOptions | Callback>, + callback?: Callback> + ): Promise> | void { if (typeof options === 'function') (callback = options), (options = {}); return executeOperation( getTopology(this), - new FindOneAndReplaceOperation(this, filter, replacement, resolveOptions(this, options)), + new FindOneAndReplaceOperation( + this as TODO_NODE_3286, + filter, + replacement, + resolveOptions(this, options) + ) as TODO_NODE_3286, callback ); } @@ -1157,35 +1268,47 @@ export class Collection { /** * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation. * - * @param filter - The Filter used to select the document to update + * @param filter - The filter used to select the document to update * @param update - Update operations to be performed on the document * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - findOneAndUpdate(filter: Document, update: Document): Promise; - findOneAndUpdate(filter: Document, update: Document, callback: Callback): void; findOneAndUpdate( - filter: Document, - update: Document, + filter: Filter, + update: UpdateQuery + ): Promise>; + findOneAndUpdate( + filter: Filter, + update: UpdateQuery, + callback: Callback> + ): void; + findOneAndUpdate( + filter: Filter, + update: UpdateQuery, options: FindOneAndUpdateOptions - ): Promise; + ): Promise>; findOneAndUpdate( - filter: Document, - update: Document, + filter: Filter, + update: UpdateQuery, options: FindOneAndUpdateOptions, - callback: Callback + callback: Callback> ): void; findOneAndUpdate( - filter: Document, - update: Document, - options?: FindOneAndUpdateOptions | Callback, - callback?: Callback - ): Promise | void { + filter: Filter, + update: UpdateQuery, + options?: FindOneAndUpdateOptions | Callback>, + callback?: Callback> + ): Promise> | void { if (typeof options === 'function') (callback = options), (options = {}); return executeOperation( getTopology(this), - new FindOneAndUpdateOperation(this, filter, update, resolveOptions(this, options)), + new FindOneAndUpdateOperation( + this as TODO_NODE_3286, + filter, + update, + resolveOptions(this, options) + ) as TODO_NODE_3286, callback ); } @@ -1196,7 +1319,10 @@ export class Collection { * @param pipeline - An array of aggregation pipelines to execute * @param options - Optional settings for the command */ - aggregate(pipeline: Document[] = [], options?: AggregateOptions): AggregationCursor { + aggregate( + pipeline: Document[] = [], + options?: AggregateOptions + ): AggregationCursor { if (arguments.length > 2) { throw new TypeError('Third parameter to `collection.aggregate()` must be undefined'); } @@ -1208,7 +1334,7 @@ export class Collection { } return new AggregationCursor( - this, + this as TODO_NODE_3286, getTopology(this), this.s.namespace, pipeline, @@ -1223,8 +1349,11 @@ export class Collection { * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. * @param options - Optional settings for the command */ - watch(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream { - pipeline = pipeline || []; + watch( + pipeline: Document[] = [], + options: ChangeStreamOptions = {} + ): ChangeStream { + pipeline = pipeline ?? []; options = options ?? {}; // Allow optionally not specifying a pipeline @@ -1233,7 +1362,7 @@ export class Collection { pipeline = []; } - return new ChangeStream(this, pipeline, resolveOptions(this, options)); + return new ChangeStream(this, pipeline, resolveOptions(this, options)); } /** @@ -1244,30 +1373,30 @@ export class Collection { * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - mapReduce( - map: string | MapFunction, - reduce: string | ReduceFunction + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction ): Promise; - mapReduce( - map: string | MapFunction, - reduce: string | ReduceFunction, + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction, callback: Callback ): void; - mapReduce( - map: string | MapFunction, - reduce: string | ReduceFunction, - options: MapReduceOptions + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction, + options: MapReduceOptions ): Promise; - mapReduce( - map: string | MapFunction, - reduce: string | ReduceFunction, - options: MapReduceOptions, + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction, + options: MapReduceOptions, callback: Callback ): void; - mapReduce( - map: string | MapFunction, - reduce: string | ReduceFunction, - options?: MapReduceOptions | Callback, + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction, + options?: MapReduceOptions | Callback, callback?: Callback ): Promise | void { if ('function' === typeof options) (callback = options), (options = {}); @@ -1292,19 +1421,24 @@ export class Collection { return executeOperation( getTopology(this), - new MapReduceOperation(this, map, reduce, resolveOptions(this, options)), + new MapReduceOperation( + this as TODO_NODE_3286, + map, + reduce, + resolveOptions(this, options) as TODO_NODE_3286 + ), callback ); } /** Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. */ initializeUnorderedBulkOp(options?: BulkWriteOptions): UnorderedBulkOperation { - return new UnorderedBulkOperation(this, resolveOptions(this, options)); + return new UnorderedBulkOperation(this as TODO_NODE_3286, resolveOptions(this, options)); } /** Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. */ initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation { - return new OrderedBulkOperation(this, resolveOptions(this, options)); + return new OrderedBulkOperation(this as TODO_NODE_3286, resolveOptions(this, options)); } /** Get the db scoped logger */ @@ -1327,10 +1461,10 @@ export class Collection { * @param callback - An optional callback, a Promise will be returned if none is provided */ insert( - docs: Document[], + docs: OptionalId[], options: BulkWriteOptions, - callback: Callback - ): Promise | void { + callback: Callback> + ): Promise> | void { emitWarningOnce( 'collection.insert is deprecated. Use insertOne, insertMany or bulkWrite instead.' ); @@ -1355,8 +1489,8 @@ export class Collection { * @param callback - An optional callback, a Promise will be returned if none is provided */ update( - selector: Document, - update: Document, + selector: Filter, + update: UpdateQuery, options: UpdateOptions, callback: Callback ): Promise | void { @@ -1378,7 +1512,7 @@ export class Collection { * @param callback - An optional callback, a Promise will be returned if none is provided */ remove( - selector: Document, + selector: Filter, options: DeleteOptions, callback: Callback ): Promise | void { @@ -1392,7 +1526,7 @@ export class Collection { } /** - * An estimated count of matching documents in the db to a query. + * An estimated count of matching documents in the db to a filter. * * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments| countDocuments}. @@ -1400,31 +1534,35 @@ export class Collection { * * @deprecated use {@link Collection#countDocuments| countDocuments} or {@link Collection#estimatedDocumentCount| estimatedDocumentCount} instead * - * @param query - The query for the count. + * @param filter - The filter for the count. * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ count(): Promise; count(callback: Callback): void; - count(query: Document): Promise; - count(query: Document, callback: Callback): void; - count(query: Document, options: CountOptions): Promise; - count(query: Document, options: CountOptions, callback: Callback): Promise | void; + count(filter: Filter): Promise; + count(filter: Filter, callback: Callback): void; + count(filter: Filter, options: CountOptions): Promise; + count( + filter: Filter, + options: CountOptions, + callback: Callback + ): Promise | void; count( - query?: Document | CountOptions | Callback, + filter?: Filter | CountOptions | Callback, options?: CountOptions | Callback, callback?: Callback ): Promise | void { - if (typeof query === 'function') { - (callback = query as Callback), (query = {}), (options = {}); + if (typeof filter === 'function') { + (callback = filter as Callback), (filter = {}), (options = {}); } else { if (typeof options === 'function') (callback = options), (options = {}); } - query = query || {}; + filter ??= {}; return executeOperation( getTopology(this), - new CountDocumentsOperation(this, query, resolveOptions(this, options)), + new CountDocumentsOperation(this as TODO_NODE_3286, filter, resolveOptions(this, options)), callback ); } diff --git a/src/cursor/abstract_cursor.ts b/src/cursor/abstract_cursor.ts index 376c1e95b94..ff465fcb106 100644 --- a/src/cursor/abstract_cursor.ts +++ b/src/cursor/abstract_cursor.ts @@ -8,7 +8,7 @@ import type { Topology } from '../sdam/topology'; import { Readable, Transform } from 'stream'; import type { ExecutionResult } from '../operations/execute_operation'; import { ReadConcern, ReadConcernLike } from '../read_concern'; -import { TypedEventEmitter } from '../mongo_types'; +import { TODO_NODE_3286, TypedEventEmitter } from '../mongo_types'; const kId = Symbol('id'); const kDocuments = Symbol('documents'); @@ -79,6 +79,7 @@ export type AbstractCursorEvents = { /** @public */ export abstract class AbstractCursor< + TSchema = any, CursorEvents extends AbstractCursorEvents = AbstractCursorEvents > extends TypedEventEmitter { /** @internal */ @@ -90,11 +91,11 @@ export abstract class AbstractCursor< /** @internal */ [kNamespace]: MongoDBNamespace; /** @internal */ - [kDocuments]: Document[]; + [kDocuments]: TSchema[]; /** @internal */ [kTopology]: Topology; /** @internal */ - [kTransform]?: (doc: Document) => Document; + [kTransform]?: (doc: TSchema) => Document; /** @internal */ [kInitialized]: boolean; /** @internal */ @@ -197,13 +198,13 @@ export abstract class AbstractCursor< } /** Returns current buffered documents */ - readBufferedDocuments(number?: number): Document[] { + readBufferedDocuments(number?: number): TSchema[] { return this[kDocuments].splice(0, number ?? this[kDocuments].length); } - [Symbol.asyncIterator](): AsyncIterator { + [Symbol.asyncIterator](): AsyncIterator { return { - next: () => this.next().then(value => ({ value, done: value === null })) + next: () => this.next().then(value => ({ value, done: value === null })) }; } @@ -243,7 +244,8 @@ export abstract class AbstractCursor< return done(undefined, true); } - next(this, true, (err, doc) => { + next(this, true, (err, doc) => { + // FIXME(NODE): if (err) return done(err); if (doc) { @@ -258,9 +260,9 @@ export abstract class AbstractCursor< } /** Get the next available document from the cursor, returns null if no more documents are available. */ - next(): Promise; - next(callback: Callback): void; - next(callback?: Callback): Promise | void { + next(): Promise; + next(callback: Callback): void; + next(callback?: Callback): Promise | void { return maybePromise(callback, done => { if (this[kId] === Long.ZERO) { return done(new MongoError('Cursor is exhausted')); @@ -273,9 +275,9 @@ export abstract class AbstractCursor< /** * Try to get the next available document from the cursor or `null` if an empty batch is returned */ - tryNext(): Promise; - tryNext(callback: Callback): void; - tryNext(callback?: Callback): Promise | void { + tryNext(): Promise; + tryNext(callback: Callback): void; + tryNext(callback?: Callback): Promise | void { return maybePromise(callback, done => { if (this[kId] === Long.ZERO) { return done(new MongoError('Cursor is exhausted')); @@ -291,32 +293,33 @@ export abstract class AbstractCursor< * @param iterator - The iteration callback. * @param callback - The end callback. */ - forEach(iterator: (doc: Document) => boolean | void): Promise; - forEach(iterator: (doc: Document) => boolean | void, callback: Callback): void; - forEach( - iterator: (doc: Document) => boolean | void, + forEach(iterator: (doc: T) => boolean | void): Promise; + forEach(iterator: (doc: T) => boolean | void, callback: Callback): void; + forEach( + iterator: (doc: T) => boolean | void, callback?: Callback ): Promise | void { if (typeof iterator !== 'function') { throw new TypeError('Missing required parameter `iterator`'); } - return maybePromise(callback, done => { const transform = this[kTransform]; const fetchDocs = () => { - next(this, true, (err, doc) => { + next(this, true, (err, doc) => { if (err || doc == null) return done(err); if (doc == null) return done(); // NOTE: no need to transform because `next` will do this automatically - let result = iterator(doc); + let result = iterator(doc); // TODO(NODE-3283): Improve transform typing if (result === false) return done(); // these do need to be transformed since they are copying the rest of the batch const internalDocs = this[kDocuments].splice(0, this[kDocuments].length); if (internalDocs) { for (let i = 0; i < internalDocs.length; ++i) { - result = iterator(transform ? transform(internalDocs[i]) : internalDocs[i]); + result = iterator( + (transform ? transform(internalDocs[i]) : internalDocs[i]) as T // TODO(NODE-3283): Improve transform typing + ); if (result === false) return done(); } } @@ -393,15 +396,15 @@ export abstract class AbstractCursor< * * @param callback - The result callback. */ - toArray(): Promise; - toArray(callback: Callback): void; - toArray(callback?: Callback): Promise | void { + toArray(): Promise; + toArray(callback: Callback): void; + toArray(callback?: Callback): Promise | void { return maybePromise(callback, done => { - const docs: Document[] = []; + const docs: T[] = []; const transform = this[kTransform]; const fetchDocs = () => { // NOTE: if we add a `nextBatch` then we should use it here - next(this, true, (err, doc) => { + next(this, true, (err, doc) => { if (err) return done(err); if (doc == null) return done(undefined, docs); @@ -409,9 +412,9 @@ export abstract class AbstractCursor< docs.push(doc); // these do need to be transformed since they are copying the rest of the batch - const internalDocs = transform + const internalDocs = (transform ? this[kDocuments].splice(0, this[kDocuments].length).map(transform) - : this[kDocuments].splice(0, this[kDocuments].length); + : this[kDocuments].splice(0, this[kDocuments].length)) as T[]; // TODO(NODE-3283): Improve transform typing if (internalDocs) { docs.push(...internalDocs); @@ -447,12 +450,14 @@ export abstract class AbstractCursor< /** * Map all documents using the provided function + * If there is a transform set on the cursor, that will be called first and the result passed to + * this function's transform. * * @param transform - The mapping transformation method. */ - map(transform: (doc: Document) => Document): this { + map(transform: (doc: TSchema) => any): this { assertUninitialized(this); - const oldTransform = this[kTransform]; + const oldTransform = this[kTransform] as (doc: TSchema) => TSchema; // TODO(NODE-3283): Improve transform typing if (oldTransform) { this[kTransform] = doc => { return transform(oldTransform(doc)); @@ -561,7 +566,7 @@ export abstract class AbstractCursor< /** * Returns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance */ - abstract clone(): AbstractCursor; + abstract clone(): AbstractCursor; /** @internal */ abstract _initialize( @@ -598,7 +603,7 @@ export abstract class AbstractCursor< } } -function nextDocument(cursor: AbstractCursor): Document | null | undefined { +function nextDocument(cursor: AbstractCursor): T | null | undefined { if (cursor[kDocuments] == null || !cursor[kDocuments].length) { return null; } @@ -607,7 +612,7 @@ function nextDocument(cursor: AbstractCursor): Document | null | undefined { if (doc) { const transform = cursor[kTransform]; if (transform) { - return transform(doc); + return transform(doc) as T; } return doc; @@ -616,11 +621,7 @@ function nextDocument(cursor: AbstractCursor): Document | null | undefined { return null; } -function next( - cursor: AbstractCursor, - blocking: boolean, - callback: Callback -): void { +function next(cursor: AbstractCursor, blocking: boolean, callback: Callback): void { const cursorId = cursor[kId]; if (cursor.closed) { return callback(undefined, null); @@ -668,7 +669,8 @@ function next( // for example if (cursor[kId] == null) { cursor[kId] = Long.ZERO; - cursor[kDocuments] = [state.response]; + // TODO(NODE-3286): ExecutionResult needs to accept a generic parameter + cursor[kDocuments] = [state.response as TODO_NODE_3286]; } } @@ -740,7 +742,7 @@ export function assertUninitialized(cursor: AbstractCursor): void { } } -function makeCursorStream(cursor: AbstractCursor) { +function makeCursorStream(cursor: AbstractCursor) { const readable = new Readable({ objectMode: true, autoDestroy: false, diff --git a/src/cursor/aggregation_cursor.ts b/src/cursor/aggregation_cursor.ts index 706299eb95e..182410fa9e8 100644 --- a/src/cursor/aggregation_cursor.ts +++ b/src/cursor/aggregation_cursor.ts @@ -25,7 +25,7 @@ const kOptions = Symbol('options'); * or higher stream * @public */ -export class AggregationCursor extends AbstractCursor { +export class AggregationCursor extends AbstractCursor { /** @internal */ [kParent]: OperationParent; // TODO: NODE-2883 /** @internal */ @@ -52,7 +52,7 @@ export class AggregationCursor extends AbstractCursor { return this[kPipeline]; } - clone(): AggregationCursor { + clone(): AggregationCursor { const clonedOptions = mergeOptions({}, this[kOptions]); delete clonedOptions.session; return new AggregationCursor(this[kParent], this.topology, this.namespace, this[kPipeline], { diff --git a/src/cursor/find_cursor.ts b/src/cursor/find_cursor.ts index 9b225fbf737..a1266d4e22f 100644 --- a/src/cursor/find_cursor.ts +++ b/src/cursor/find_cursor.ts @@ -28,7 +28,7 @@ export const FLAGS = [ ] as const; /** @public */ -export class FindCursor extends AbstractCursor { +export class FindCursor extends AbstractCursor { /** @internal */ [kFilter]: Document; /** @internal */ @@ -52,7 +52,7 @@ export class FindCursor extends AbstractCursor { } } - clone(): FindCursor { + clone(): FindCursor { const clonedOptions = mergeOptions({}, this[kBuiltOptions]); delete clonedOptions.session; return new FindCursor(this.topology, this.namespace, this[kFilter], { diff --git a/src/db.ts b/src/db.ts index 1403fb07c11..76da12f68b3 100644 --- a/src/db.ts +++ b/src/db.ts @@ -6,7 +6,6 @@ import { getTopology, DEFAULT_PK_FACTORY } from './utils'; -import { loadAdmin } from './dynamic_loaders'; import { AggregationCursor } from './cursor/aggregation_cursor'; import { Document, BSONSerializeOptions, resolveBSONOptions } from './bson'; import { ReadPreference, ReadPreferenceLike } from './read_preference'; @@ -47,7 +46,8 @@ import { import { executeOperation } from './operations/execute_operation'; import type { IndexInformationOptions } from './operations/common_functions'; import type { MongoClient, PkFactory } from './mongo_client'; -import type { Admin } from './admin'; +import { Admin } from './admin'; +import type { TODO_NODE_3286 } from './mongo_types'; // Allowed parameters const DB_OPTIONS_ALLOW_LIST = [ @@ -222,26 +222,32 @@ export class Db { * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - createCollection(name: string): Promise; - createCollection(name: string, callback: Callback): void; - createCollection(name: string, options: CreateCollectionOptions): Promise; - createCollection( + createCollection(name: string): Promise>; + createCollection( + name: string, + callback: Callback> + ): void; + createCollection( + name: string, + options: CreateCollectionOptions + ): Promise>; + createCollection( name: string, options: CreateCollectionOptions, - callback: Callback + callback: Callback> ): void; - createCollection( + createCollection( name: string, options?: CreateCollectionOptions | Callback, callback?: Callback - ): Promise | void { + ): Promise> | void { if (typeof options === 'function') (callback = options), (options = {}); return executeOperation( getTopology(this), - new CreateCollectionOperation(this, name, resolveOptions(this, options)), + new CreateCollectionOperation(this, name, resolveOptions(this, options)) as TODO_NODE_3286, callback - ); + ) as TODO_NODE_3286; } /** @@ -301,8 +307,7 @@ export class Db { /** Return the Admin db instance */ admin(): Admin { - const AdminClass = loadAdmin(); - return new AdminClass(this); + return new Admin(this); } /** @@ -312,22 +317,32 @@ export class Db { * @param name - the collection name we wish to access. * @returns return the new Collection instance if not in strict mode */ - collection(name: string): Collection; - collection(name: string, options: CollectionOptions): Collection; - collection(name: string, callback: Callback): void; - collection(name: string, options: CollectionOptions, callback: Callback): void; - collection( + collection(name: string): Collection; + collection( name: string, - options?: CollectionOptions | Callback, - callback?: Callback - ): Collection | void { + options: CollectionOptions + ): Collection; + collection( + name: string, + callback: Callback> + ): void; + collection( + name: string, + options: CollectionOptions, + callback: Callback> + ): void; + collection( + name: string, + options?: CollectionOptions | Callback>, + callback?: Callback> + ): Collection | void { if (typeof options === 'function') (callback = options), (options = {}); const finalOptions = resolveOptions(this, options); // Execute if (!finalOptions.strict) { try { - const collection = new Collection(this, name, finalOptions); + const collection = new Collection(this, name, finalOptions); if (callback) callback(undefined, collection); return collection; } catch (err) { @@ -412,29 +427,32 @@ export class Db { * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - renameCollection(fromCollection: string, toCollection: string): Promise; - renameCollection( + renameCollection( + fromCollection: string, + toCollection: string + ): Promise>; + renameCollection( fromCollection: string, toCollection: string, - callback: Callback + callback: Callback> ): void; - renameCollection( + renameCollection( fromCollection: string, toCollection: string, options: RenameOptions - ): Promise; - renameCollection( + ): Promise>; + renameCollection( fromCollection: string, toCollection: string, options: RenameOptions, - callback: Callback + callback: Callback> ): void; - renameCollection( + renameCollection( fromCollection: string, toCollection: string, - options?: RenameOptions | Callback, - callback?: Callback - ): Promise | void { + options?: RenameOptions | Callback>, + callback?: Callback> + ): Promise> | void { if (typeof options === 'function') (callback = options), (options = {}); // Intentionally, we do not inherit options from parent for this operation. @@ -445,7 +463,11 @@ export class Db { return executeOperation( getTopology(this), - new RenameOperation(this.collection(fromCollection), toCollection, options), + new RenameOperation( + this.collection(fromCollection) as TODO_NODE_3286, + toCollection, + options + ) as TODO_NODE_3286, callback ); } @@ -725,10 +747,13 @@ export class Db { * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. * @param options - Optional settings for the command */ - watch(): ChangeStream; - watch(pipeline?: Document[]): ChangeStream; - watch(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream { - pipeline = pipeline || []; + watch(): ChangeStream; + watch(pipeline?: Document[]): ChangeStream; + watch( + pipeline?: Document[], + options?: ChangeStreamOptions + ): ChangeStream { + pipeline = pipeline ?? []; options = options ?? {}; // Allow optionally not specifying a pipeline @@ -737,7 +762,7 @@ export class Db { pipeline = []; } - return new ChangeStream(this, pipeline, resolveOptions(this, options)); + return new ChangeStream(this, pipeline, resolveOptions(this, options)); } /** Return the db logger */ diff --git a/src/dynamic_loaders.ts b/src/dynamic_loaders.ts deleted file mode 100644 index 62cbc9b97fe..00000000000 --- a/src/dynamic_loaders.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -import type { Admin } from './admin'; -import type { Collection } from './collection'; -import type { Db } from './db'; -import type { MongoClient } from './mongo_client'; - -let collection: typeof Collection; -let db: typeof Db; -let client: typeof MongoClient; -let admin: typeof Admin; - -export function loadCollection(): typeof Collection { - if (!collection) { - collection = require('./collection').Collection; - } - return collection; -} - -export function loadDb(): typeof Db { - if (!db) { - db = require('./db').Db; - } - return db; -} - -export function loadMongoClient(): typeof MongoClient { - if (!client) { - client = require('./mongo_client').MongoClient; - } - return client; -} - -export function loadAdmin(): typeof Admin { - if (!admin) { - admin = require('./admin').Admin; - } - return admin; -} diff --git a/src/gridfs-stream/download.ts b/src/gridfs-stream/download.ts index 72e3a095077..ace6e398e3c 100644 --- a/src/gridfs-stream/download.ts +++ b/src/gridfs-stream/download.ts @@ -6,7 +6,7 @@ import type { Sort } from '../sort'; import type { Callback } from '../utils'; import type { Collection } from '../collection'; import type { ReadPreference } from '../read_preference'; -import type { GridFSBucketWriteStream } from './upload'; +import type { GridFSBucketWriteStream, GridFSChunk } from './upload'; import type { FindCursor } from '../cursor/find_cursor'; /** @public */ @@ -32,7 +32,7 @@ export interface GridFSFile { _id: GridFSBucketWriteStream['id']; length: GridFSBucketWriteStream['length']; chunkSize: GridFSBucketWriteStream['chunkSizeBytes']; - md5?: boolean | string; + md5?: string; filename: GridFSBucketWriteStream['filename']; contentType?: GridFSBucketWriteStream['options']['contentType']; aliases?: GridFSBucketWriteStream['options']['aliases']; @@ -45,10 +45,10 @@ export interface GridFSBucketReadStreamPrivate { bytesRead: number; bytesToTrim: number; bytesToSkip: number; - chunks: Collection; - cursor?: FindCursor; + chunks: Collection; + cursor?: FindCursor; expected: number; - files: Collection; + files: Collection; filter: Document; init: boolean; expectedEnd: number; @@ -102,11 +102,11 @@ export class GridFSBucketReadStream extends Readable { * @param chunks - Handle for chunks collection * @param files - Handle for files collection * @param readPreference - The read preference to use - * @param filter - The query to use to find the file document + * @param filter - The filter to use to find the file document */ constructor( - chunks: Collection, - files: Collection, + chunks: Collection, + files: Collection, readPreference: ReadPreference | undefined, filter: Document, options?: GridFSBucketReadStreamOptions @@ -246,20 +246,23 @@ function doRead(stream: GridFSBucketReadStream): void { let buf = Buffer.isBuffer(doc.data) ? doc.data : doc.data.buffer; - if (buf.length !== expectedLength) { + if (buf.byteLength !== expectedLength) { if (bytesRemaining <= 0) { errmsg = 'ExtraChunk: Got unexpected n: ' + doc.n; return __handleError(stream, new Error(errmsg)); } errmsg = - 'ChunkIsWrongSize: Got unexpected length: ' + buf.length + ', expected: ' + expectedLength; + 'ChunkIsWrongSize: Got unexpected length: ' + + buf.byteLength + + ', expected: ' + + expectedLength; return __handleError(stream, new Error(errmsg)); } - stream.s.bytesRead += buf.length; + stream.s.bytesRead += buf.byteLength; - if (buf.length === 0) { + if (buf.byteLength === 0) { return stream.push(null); } @@ -275,12 +278,12 @@ function doRead(stream: GridFSBucketReadStream): void { const bytesLeftToRead = stream.s.options.end - stream.s.bytesToSkip; if (atEndOfStream && stream.s.bytesToTrim != null) { sliceEnd = stream.s.file.chunkSize - stream.s.bytesToTrim; - } else if (stream.s.options.end && bytesLeftToRead < doc.data.length()) { + } else if (stream.s.options.end && bytesLeftToRead < doc.data.byteLength) { sliceEnd = bytesLeftToRead; } if (sliceStart != null || sliceEnd != null) { - buf = buf.slice(sliceStart || 0, sliceEnd || buf.length); + buf = buf.slice(sliceStart || 0, sliceEnd || buf.byteLength); } stream.push(buf); @@ -421,7 +424,7 @@ function handleStartOption( function handleEndOption( stream: GridFSBucketReadStream, doc: Document, - cursor: FindCursor, + cursor: FindCursor, options: GridFSBucketReadStreamOptions ) { if (options && options.end != null) { diff --git a/src/gridfs-stream/index.ts b/src/gridfs-stream/index.ts index 79b41a5d5c1..ec4ce476d59 100644 --- a/src/gridfs-stream/index.ts +++ b/src/gridfs-stream/index.ts @@ -2,12 +2,13 @@ import { MongoError } from '../error'; import { GridFSBucketReadStream, GridFSBucketReadStreamOptions, - GridFSBucketReadStreamOptionsWithRevision + GridFSBucketReadStreamOptionsWithRevision, + GridFSFile } from './download'; -import { GridFSBucketWriteStream, GridFSBucketWriteStreamOptions, TFileId } from './upload'; +import { GridFSBucketWriteStream, GridFSBucketWriteStreamOptions, GridFSChunk } from './upload'; import { executeLegacyOperation, Callback, getTopology } from '../utils'; import { WriteConcernOptions, WriteConcern } from '../write_concern'; -import type { Document } from '../bson'; +import type { ObjectId } from '../bson'; import type { Db } from '../db'; import type { ReadPreference } from '../read_preference'; import type { Collection } from '../collection'; @@ -15,7 +16,7 @@ import type { FindOptions } from './../operations/find'; import type { Sort } from '../sort'; import type { Logger } from '../logger'; import type { FindCursor } from '../cursor/find_cursor'; -import { TypedEventEmitter } from '../mongo_types'; +import { Filter, TypedEventEmitter } from '../mongo_types'; const DEFAULT_GRIDFS_BUCKET_OPTIONS: { bucketName: string; @@ -44,8 +45,8 @@ export interface GridFSBucketPrivate { readPreference?: ReadPreference; writeConcern: WriteConcern | undefined; }; - _chunksCollection: Collection; - _filesCollection: Collection; + _chunksCollection: Collection; + _filesCollection: Collection; checkedIndexes: boolean; calledOpenUploadStream: boolean; } @@ -84,8 +85,8 @@ export class GridFSBucket extends TypedEventEmitter { this.s = { db, options: privateOptions, - _chunksCollection: db.collection(privateOptions.bucketName + '.chunks'), - _filesCollection: db.collection(privateOptions.bucketName + '.files'), + _chunksCollection: db.collection(privateOptions.bucketName + '.chunks'), + _filesCollection: db.collection(privateOptions.bucketName + '.files'), checkedIndexes: false, calledOpenUploadStream: false }; @@ -113,7 +114,7 @@ export class GridFSBucket extends TypedEventEmitter { * file's id. */ openUploadStreamWithId( - id: TFileId, + id: ObjectId, filename: string, options?: GridFSBucketWriteStreamOptions ): GridFSBucketWriteStream { @@ -121,7 +122,10 @@ export class GridFSBucket extends TypedEventEmitter { } /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */ - openDownloadStream(id: TFileId, options?: GridFSBucketReadStreamOptions): GridFSBucketReadStream { + openDownloadStream( + id: ObjectId, + options?: GridFSBucketReadStreamOptions + ): GridFSBucketReadStream { return new GridFSBucketReadStream( this.s._chunksCollection, this.s._filesCollection, @@ -136,17 +140,17 @@ export class GridFSBucket extends TypedEventEmitter { * * @param id - The id of the file doc */ - delete(id: TFileId): Promise; - delete(id: TFileId, callback: Callback): void; - delete(id: TFileId, callback?: Callback): Promise | void { + delete(id: ObjectId): Promise; + delete(id: ObjectId, callback: Callback): void; + delete(id: ObjectId, callback?: Callback): Promise | void { return executeLegacyOperation(getTopology(this.s.db), _delete, [this, id, callback], { skipSessions: true }); } /** Convenience wrapper around find on the files collection */ - find(filter: Document, options?: FindOptions): FindCursor { - filter = filter || {}; + find(filter?: Filter, options?: FindOptions): FindCursor { + filter ??= {}; options = options ?? {}; return this.s._filesCollection.find(filter, options); } @@ -187,9 +191,9 @@ export class GridFSBucket extends TypedEventEmitter { * @param id - the id of the file to rename * @param filename - new name for the file */ - rename(id: TFileId, filename: string): Promise; - rename(id: TFileId, filename: string, callback: Callback): void; - rename(id: TFileId, filename: string, callback?: Callback): Promise | void { + rename(id: ObjectId, filename: string): Promise; + rename(id: ObjectId, filename: string, callback: Callback): void; + rename(id: ObjectId, filename: string, callback?: Callback): Promise | void { return executeLegacyOperation(getTopology(this.s.db), _rename, [this, id, filename, callback], { skipSessions: true }); @@ -210,7 +214,7 @@ export class GridFSBucket extends TypedEventEmitter { } } -function _delete(bucket: GridFSBucket, id: TFileId, callback: Callback): void { +function _delete(bucket: GridFSBucket, id: ObjectId, callback: Callback): void { return bucket.s._filesCollection.deleteOne({ _id: id }, (error, res) => { if (error) { return callback(error); @@ -234,7 +238,7 @@ function _delete(bucket: GridFSBucket, id: TFileId, callback: Callback): v function _rename( bucket: GridFSBucket, - id: TFileId, + id: ObjectId, filename: string, callback: Callback ): void { diff --git a/src/gridfs-stream/upload.ts b/src/gridfs-stream/upload.ts index cadca413ed2..daf46bc6e4e 100644 --- a/src/gridfs-stream/upload.ts +++ b/src/gridfs-stream/upload.ts @@ -5,20 +5,18 @@ import { WriteConcern } from './../write_concern'; import { PromiseProvider } from '../promise_provider'; import { ObjectId } from '../bson'; import type { Callback } from '../utils'; -import type { Collection } from '../collection'; import type { Document } from '../bson'; import type { GridFSBucket } from './index'; import type { GridFSFile } from './download'; import type { WriteConcernOptions } from '../write_concern'; +import type { Collection } from '../collection'; /** @public */ -export type TFileId = string | number | Document | ObjectId; - -export interface ChunkDoc { +export interface GridFSChunk { _id: ObjectId; - files_id: TFileId; + files_id: ObjectId; n: number; - data: Buffer; + data: Buffer | Uint8Array; } /** @public */ @@ -26,7 +24,7 @@ export interface GridFSBucketWriteStreamOptions extends WriteConcernOptions { /** Overwrite this bucket's chunkSizeBytes for this file */ chunkSizeBytes?: number; /** Custom file id for the GridFS file. */ - id?: TFileId; + id?: ObjectId; /** Object to store in the file document's `metadata` field */ metadata?: Document; /** String to store in the file document's `contentType` field */ @@ -45,12 +43,12 @@ export interface GridFSBucketWriteStreamOptions extends WriteConcernOptions { */ export class GridFSBucketWriteStream extends Writable { bucket: GridFSBucket; - chunks: Collection; + chunks: Collection; filename: string; - files: Collection; + files: Collection; options: GridFSBucketWriteStreamOptions; done: boolean; - id: TFileId; + id: ObjectId; chunkSizeBytes: number; bufToStore: Buffer; length: number; @@ -240,7 +238,7 @@ function __handleError( stream.emit(GridFSBucketWriteStream.ERROR, error); } -function createChunkDoc(filesId: TFileId, n: number, data: Buffer): ChunkDoc { +function createChunkDoc(filesId: ObjectId, n: number, data: Buffer): GridFSChunk { return { _id: new ObjectId(), files_id: filesId, @@ -309,7 +307,7 @@ function checkDone(stream: GridFSBucketWriteStream, callback?: Callback): boolea stream.id, stream.length, stream.chunkSizeBytes, - stream.md5 && stream.md5.digest('hex'), + stream.md5 ? stream.md5.digest('hex') : undefined, stream.filename, stream.options.contentType, stream.options.aliases, @@ -472,7 +470,7 @@ function doWrite( inputBuf.copy(stream.bufToStore, stream.pos, inputBufPos, inputBufPos + numToCopy); stream.pos += numToCopy; spaceRemaining -= numToCopy; - let doc: ChunkDoc; + let doc: GridFSChunk; if (spaceRemaining === 0) { if (stream.md5) { stream.md5.update(stream.bufToStore); diff --git a/src/index.ts b/src/index.ts index 5a33fd89764..614914b12c2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -168,7 +168,7 @@ export type { } from './cmap/message_stream'; export type { StreamDescription, StreamDescriptionOptions } from './cmap/stream_description'; export type { CompressorName } from './cmap/wire_protocol/compression'; -export type { CollectionPrivate, CollectionOptions } from './collection'; +export type { CollectionPrivate, CollectionOptions, ModifyResult } from './collection'; export type { AggregationCursorOptions } from './cursor/aggregation_cursor'; export type { CursorCloseOptions, @@ -195,8 +195,8 @@ export type { } from './gridfs-stream/index'; export type { GridFSBucketWriteStreamOptions, - TFileId, - GridFSBucketWriteStream + GridFSBucketWriteStream, + GridFSChunk } from './gridfs-stream/upload'; export type { LoggerOptions, LoggerFunction, LoggerLevelId } from './logger'; export type { @@ -353,3 +353,16 @@ export type { export type { OrderedBulkOperation } from './bulk/ordered'; export type { UnorderedBulkOperation } from './bulk/unordered'; export type { Encrypter, EncrypterOptions } from './encrypter'; +export type { + EnhancedOmit, + WithId, + OptionalId, + WithoutId, + UpdateQuery, + Filter, + Projection, + InferIdType, + ProjectionOperators, + MetaProjectionOperators, + MetaSortOperators +} from './mongo_types'; diff --git a/src/mongo_client.ts b/src/mongo_client.ts index 18df0ee370d..8621308091b 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -586,10 +586,13 @@ export class MongoClient extends TypedEventEmitter { * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. * @param options - Optional settings for the command */ - watch(): ChangeStream; - watch(pipeline?: Document[]): ChangeStream; - watch(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream { - pipeline = pipeline || []; + watch(): ChangeStream; + watch(pipeline?: Document[]): ChangeStream; + watch( + pipeline: Document[] = [], + options: ChangeStreamOptions = {} + ): ChangeStream { + pipeline = pipeline ?? []; options = options ?? {}; // Allow optionally not specifying a pipeline @@ -598,7 +601,7 @@ export class MongoClient extends TypedEventEmitter { pipeline = []; } - return new ChangeStream(this, pipeline, resolveOptions(this, options)); + return new ChangeStream(this, pipeline, resolveOptions(this, options)); } /** Return the mongo client logger */ diff --git a/src/mongo_types.ts b/src/mongo_types.ts index 6d4a171607e..8cf5dea9da9 100644 --- a/src/mongo_types.ts +++ b/src/mongo_types.ts @@ -1,5 +1,79 @@ +import type { Document, ObjectId } from './bson'; import { EventEmitter } from 'events'; +/** @internal */ +export type TODO_NODE_3286 = any; + +/** Given an object shaped type, return the type of the _id field or default to ObjectId @public */ +export type InferIdType = TSchema extends { _id: infer IdType } // user has defined a type for _id + ? // eslint-disable-next-line @typescript-eslint/ban-types + {} extends IdType // TODO(NODE-3285): Improve type readability + ? // eslint-disable-next-line @typescript-eslint/ban-types + Exclude + : unknown extends IdType + ? ObjectId + : IdType + : ObjectId; // user has not defined _id on schema + +/** Add an _id field to an object shaped type @public */ +export type WithId = EnhancedOmit & { _id: InferIdType }; + +/** + * Add an optional _id field to an object shaped type + * @public + * + * @privateRemarks + * `ObjectId extends TSchema['_id']` is a confusing ordering at first glance. Rather than ask + * `TSchema['_id'] extends ObjectId` which translated to "Is the _id property ObjectId?" + * we instead ask "Does ObjectId look like (have the same shape) as the _id?" + */ +export type OptionalId = ObjectId extends TSchema['_id'] // a Schema with ObjectId _id type or "any" or "indexed type" provided + ? EnhancedOmit & { _id?: InferIdType } // a Schema provided but _id type is not ObjectId + : WithId; // TODO(NODE-3285): Improve type readability + +/** TypeScript Omit (Exclude to be specific) does not work for objects with an "any" indexed type, and breaks discriminated unions @public */ +export type EnhancedOmit = string extends keyof TRecordOrUnion + ? TRecordOrUnion // TRecordOrUnion has indexed type e.g. { _id: string; [k: string]: any; } or it is "any" + : TRecordOrUnion extends any + ? Pick> // discriminated unions + : never; + +/** Remove the _id field from an object shaped type @public */ +export type WithoutId = Omit; + +/** A MongoDB filter can be some portion of the schema or a set of operators @public */ +export type Filter = Partial & Document; + +/** A MongoDB UpdateQuery is set of operators @public */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export type UpdateQuery = Document; // TODO(NODE-3274) + +/** @see https://docs.mongodb.com/manual/reference/operator/aggregation/meta/#proj._S_meta @public */ +export type MetaSortOperators = 'textScore' | 'indexKey'; + +/** @public */ +export type MetaProjectionOperators = + | MetaSortOperators + /** Only for Atlas Search https://docs.atlas.mongodb.com/reference/atlas-search/scoring/ */ + | 'searchScore' + /** Only for Atlas Search https://docs.atlas.mongodb.com/reference/atlas-search/highlighting/ */ + | 'searchHighlights'; + +/** @public */ +export interface ProjectionOperators { + $elemMatch?: Document; + $slice?: number | [number, number]; + $meta?: MetaProjectionOperators; +} + +/** @public */ +export type Projection = { + [Key in keyof TSchema]?: ProjectionOperators | 0 | 1 | boolean; +}; + +/** @public */ +export type Nullable = AnyType | null | undefined; + /** @public */ export type GenericListener = (...args: any[]) => void; diff --git a/src/operations/collections.ts b/src/operations/collections.ts index ea67bd97061..fbdf4175126 100644 --- a/src/operations/collections.ts +++ b/src/operations/collections.ts @@ -1,10 +1,7 @@ import { AbstractOperation, OperationOptions } from './operation'; -import { loadCollection } from '../dynamic_loaders'; +import { Collection } from '../collection'; import type { Callback } from '../utils'; import type { Db } from '../db'; - -// eslint-disable-next-line -import type { Collection } from '../collection'; import type { Server } from '../sdam/server'; import type { ClientSession } from '../sessions'; @@ -25,7 +22,6 @@ export class CollectionsOperation extends AbstractOperation { execute(server: Server, session: ClientSession, callback: Callback): void { const db = this.db; - const Collection = loadCollection(); // Let's get the collection names db.listCollections( diff --git a/src/operations/create_collection.ts b/src/operations/create_collection.ts index 1d7cf6d06a4..064dd3fe43e 100644 --- a/src/operations/create_collection.ts +++ b/src/operations/create_collection.ts @@ -1,14 +1,11 @@ import { CommandOperation, CommandOperationOptions } from './command'; import { Aspect, defineAspects } from './operation'; -import { loadCollection } from '../dynamic_loaders'; +import { Collection } from '../collection'; import type { Callback } from '../utils'; import type { Document } from '../bson'; import type { Server } from '../sdam/server'; import type { Db } from '../db'; import type { PkFactory } from '../mongo_client'; - -// eslint-disable-next-line -import type { Collection } from '../collection'; import type { ClientSession } from '../sessions'; const ILLEGAL_COMMAND_FIELDS = new Set([ @@ -82,7 +79,6 @@ export class CreateCollectionOperation extends CommandOperation { const db = this.db; const name = this.name; const options = this.options; - const Collection = loadCollection(); const done: Callback = err => { if (err) { diff --git a/src/operations/find.ts b/src/operations/find.ts index 93864c89488..20f6277ca75 100644 --- a/src/operations/find.ts +++ b/src/operations/find.ts @@ -15,15 +15,16 @@ import { Sort, formatSort } from '../sort'; import { isSharded } from '../cmap/wire_protocol/shared'; import { ReadConcern } from '../read_concern'; import type { ClientSession } from '../sessions'; +import type { Projection } from '../mongo_types'; /** @public */ -export interface FindOptions extends CommandOperationOptions { +export interface FindOptions extends CommandOperationOptions { /** Sets the limit of documents returned in the query. */ limit?: number; /** Set to sort the documents coming back from the query. Array of indexes, `[['a', 1]]` etc. */ sort?: Sort; /** The fields to return in the query. Object of fields to either include or exclude (one of, not both), `{'a':1, 'b': 1}` **or** `{'a': 0, 'b': 0}` */ - projection?: Document; + projection?: Projection; /** Set to skip N documents ahead in your query (useful for pagination). */ skip?: number; /** Tell the query to use specific indexes in the query. Object of indexes to use, `{'_id':1}` */ diff --git a/src/operations/insert.ts b/src/operations/insert.ts index 6a786240980..e1bd1e00b0d 100644 --- a/src/operations/insert.ts +++ b/src/operations/insert.ts @@ -5,11 +5,12 @@ import { prepareDocs } from './common_functions'; import type { Callback, MongoDBNamespace } from '../utils'; import type { Server } from '../sdam/server'; import type { Collection } from '../collection'; -import type { ObjectId, Document, BSONSerializeOptions } from '../bson'; +import type { Document, BSONSerializeOptions } from '../bson'; import type { BulkWriteOptions } from '../bulk/common'; import { WriteConcern, WriteConcernOptions } from '../write_concern'; import type { ClientSession } from '../sessions'; import { BulkWriteOperation } from './bulk_write'; +import type { InferIdType } from '../mongo_types'; /** @internal */ export class InsertOperation extends CommandOperation { @@ -53,11 +54,11 @@ export interface InsertOneOptions extends BSONSerializeOptions, WriteConcernOpti } /** @public */ -export interface InsertOneResult { +export interface InsertOneResult { /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ acknowledged: boolean; /** The identifier that was inserted. If the server generated the identifier, this value will be null as the driver does not have access to that data */ - insertedId: ObjectId; + insertedId: InferIdType; } export class InsertOneOperation extends InsertOperation { @@ -80,13 +81,13 @@ export class InsertOneOperation extends InsertOperation { } /** @public */ -export interface InsertManyResult { +export interface InsertManyResult { /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ acknowledged: boolean; /** The number of inserted documents for this operations */ insertedCount: number; /** Map of the index of the inserted document to the id of the inserted document */ - insertedIds: { [key: number]: ObjectId }; + insertedIds: { [key: number]: InferIdType }; } /** @internal */ diff --git a/src/operations/map_reduce.ts b/src/operations/map_reduce.ts index 5ad1c6c7d1d..5f91f9a7c0f 100644 --- a/src/operations/map_reduce.ts +++ b/src/operations/map_reduce.ts @@ -1,5 +1,4 @@ import { Code, Document } from '../bson'; -import { loadDb } from '../dynamic_loaders'; import { applyWriteConcern, decorateWithCollation, @@ -17,6 +16,7 @@ import { MongoError } from '../error'; import type { ObjectId } from '../bson'; import { Aspect, defineAspects } from './operation'; import type { ClientSession } from '../sessions'; +import { Db } from '../db'; const exclusionList = [ 'explain', @@ -36,14 +36,21 @@ const exclusionList = [ ]; /** @public */ -export type MapFunction = () => void; +export type MapFunction = (this: TSchema) => void; /** @public */ -export type ReduceFunction = (key: string, values: Document[]) => Document; +export type ReduceFunction = ( + key: TKey, + values: TValue[] +) => TValue; /** @public */ -export type FinalizeFunction = (key: string, reducedValue: Document) => Document; +export type FinalizeFunction = ( + key: TKey, + reducedValue: TValue +) => TValue; /** @public */ -export interface MapReduceOptions extends CommandOperationOptions { +export interface MapReduceOptions + extends CommandOperationOptions { /** Sets the output target for the map reduce job. */ out?: 'inline' | { inline: 1 } | { replace: string } | { merge: string } | { reduce: string }; /** Query filter object. */ @@ -55,7 +62,7 @@ export interface MapReduceOptions extends CommandOperationOptions { /** Keep temporary data. */ keeptemp?: boolean; /** Finalize function. */ - finalize?: FinalizeFunction | string; + finalize?: FinalizeFunction | string; /** Can pass in variables that can be access from map/reduce/finalize. */ scope?: Document; /** It is possible to make the execution stay in JS. Provided in MongoDB \> 2.0.X. */ @@ -198,7 +205,6 @@ export class MapReduceOperation extends CommandOperation if (result.result != null && typeof result.result === 'object') { const doc = result.result; // Return a collection from another db - const Db = loadDb(); collection = new Db(coll.s.db.s.client, doc.db, coll.s.db.s.options).collection( doc.collection ); diff --git a/src/operations/rename.ts b/src/operations/rename.ts index 390813aeb5a..a8ff93fbb9f 100644 --- a/src/operations/rename.ts +++ b/src/operations/rename.ts @@ -1,9 +1,8 @@ import { checkCollectionName, Callback } from '../utils'; -import { loadCollection } from '../dynamic_loaders'; import { RunAdminCommandOperation } from './run_command'; import { defineAspects, Aspect } from './operation'; import type { Server } from '../sdam/server'; -import type { Collection } from '../collection'; +import { Collection } from '../collection'; import type { CommandOperationOptions } from './command'; import { MongoError } from '../error'; import type { ClientSession } from '../sessions'; @@ -39,7 +38,6 @@ export class RenameOperation extends RunAdminCommandOperation { } execute(server: Server, session: ClientSession, callback: Callback): void { - const Collection = loadCollection(); const coll = this.collection; super.execute(server, session, (err, doc) => { diff --git a/src/sessions.ts b/src/sessions.ts index 730b59d78bd..c13ca34b3bd 100644 --- a/src/sessions.ts +++ b/src/sessions.ts @@ -67,7 +67,7 @@ export interface ClientSessionOptions { } /** @public */ -export type WithTransactionCallback = (session: ClientSession) => Promise | void; +export type WithTransactionCallback = (session: ClientSession) => Promise | void; /** @public */ export type ClientSessionEvents = { @@ -333,7 +333,7 @@ class ClientSession extends TypedEventEmitter { * @param fn - A lambda to run within a transaction * @param options - Optional settings for the transaction */ - withTransaction(fn: WithTransactionCallback, options?: TransactionOptions): Promise { + withTransaction(fn: WithTransactionCallback, options?: TransactionOptions): Promise { const startTime = now(); return attemptTransaction(this, startTime, fn, options); } @@ -373,12 +373,12 @@ function isMaxTimeMSExpiredError(err: MongoError) { ); } -function attemptTransactionCommit( +function attemptTransactionCommit( session: ClientSession, startTime: number, - fn: WithTransactionCallback, + fn: WithTransactionCallback, options?: TransactionOptions -): Promise { +): Promise { return session.commitTransaction().catch((err: MongoError) => { if ( err instanceof MongoError && @@ -408,10 +408,10 @@ function userExplicitlyEndedTransaction(session: ClientSession) { return USER_EXPLICIT_TXN_END_STATES.has(session.transaction.state); } -function attemptTransaction( +function attemptTransaction( session: ClientSession, startTime: number, - fn: WithTransactionCallback, + fn: WithTransactionCallback, options?: TransactionOptions ): Promise { const Promise = PromiseProvider.get(); diff --git a/src/utils.ts b/src/utils.ts index 87ca27944ae..4dfc2d2a45e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -460,7 +460,7 @@ export function decorateWithExplain(command: Document, explain: Explain): Docume * if the topology cannot be found. * @internal */ -export function getTopology(provider: MongoClient | Db | Collection): Topology { +export function getTopology(provider: MongoClient | Db | Collection): Topology { if (`topology` in provider && provider.topology) { return provider.topology; } else if ('client' in provider.s && provider.s.client.topology) { diff --git a/test/types/.eslintrc.json b/test/types/.eslintrc.json new file mode 100644 index 00000000000..15cec797940 --- /dev/null +++ b/test/types/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2018 + }, + "plugins": [ + "@typescript-eslint", + "prettier", + "eslint-plugin-tsdoc" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "prettier/@typescript-eslint", + "plugin:prettier/recommended" + ], + "env": { + "node": true, + "mocha": false, + "es6": true + }, + "rules": { + "prettier/prettier": "error", + "tsdoc/syntax": "warn", + "typescript-eslint/no-explicit-any": "off" + } +} diff --git a/test/types/basic_schema.test-d.ts b/test/types/basic_schema.test-d.ts new file mode 100644 index 00000000000..04bc7c5da9e --- /dev/null +++ b/test/types/basic_schema.test-d.ts @@ -0,0 +1,67 @@ +import { expectAssignable, expectNotType, expectType } from 'tsd'; + +import { Collection } from '../../src/collection'; +import { ObjectId } from '../../src/bson'; +import { Db } from '../../src/db'; +import { MongoClient } from '../../src/mongo_client'; +import type { InferIdType } from '../../src/mongo_types'; + +const db = new Db(new MongoClient(''), ''); + +type ACounter = { a: number }; +type ACounterWithId = { a: number; _id: ObjectId }; + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Can define Schema without _id +expectType>(new Collection(db, '')); +// Or with one +expectType>(new Collection(db, '')); + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Simple Schema that does not define an _id +// With _id +type InsertOneArgOf = Parameters['insertOne']>[0]; +expectAssignable>({ _id: new ObjectId(), a: 3 }); +// Without _id +expectAssignable>({ a: 3 }); +// Does not permit extra keys +expectNotType>({ a: 2, b: 34 }); +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Simple Schema that does define an _id +// With _id +expectAssignable>({ _id: new ObjectId(), a: 3 }); +// Without _id +expectAssignable>({ a: 3 }); +// Does not permit extra keys +expectNotType>({ a: 2, b: 34 }); + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// CustomType _id Schema (behavior change) +// _id that is a custom type must be generated client side, so it is required +class MyId { + uuid!: number; +} +interface CustomIdType { + a: number; + _id: MyId; +} +type customIdCollection = Collection; +type insertOneArg = Parameters[0]; + +// inferring the _id type is straight forward for a schema like this +type IdType = InferIdType; +expectType(new MyId()); + +// _id is a required field since it isn't an ObjectId +expectAssignable({ a: 2, _id: new MyId() }); +expectNotType({ a: 2 }); + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// InferIdType - +// eslint-disable-next-line @typescript-eslint/ban-types +type Empty = {}; +const a: never = 0 as never; +const oid = new ObjectId(); +expectType>(oid); // Empty schema gets the implicit _id +expectType>(a); // Empty object as an oid resolves to never, while this is a valid _id, it is likely undesirable +expectType>({ a: 3 }); // embedded documents are permitted as _id fields diff --git a/test/types/distinct.test-d.ts b/test/types/distinct.test-d.ts new file mode 100644 index 00000000000..aeb7d4d5ad9 --- /dev/null +++ b/test/types/distinct.test-d.ts @@ -0,0 +1,8 @@ +import { expectType } from 'tsd'; + +import type { Collection } from '../../src/collection'; +import type { Movie } from './example_schemas'; + +// Ensure distinct takes all keys of the schema plus '_id' +const x = (null as unknown) as Parameters['distinct']>[0]; +expectType<'_id' | keyof Movie>(x); diff --git a/test/types/example_schemas.ts b/test/types/example_schemas.ts new file mode 100644 index 00000000000..123bdf07597 --- /dev/null +++ b/test/types/example_schemas.ts @@ -0,0 +1,31 @@ +import type { Double, Int32 } from '../../src/bson'; + +export type MediaType = 'movie' | 'tv' | 'web series'; + +export interface Movie { + title: string; + year: Int32; + runtime: number; + released: Date; + poster: string; + plot: string; + fullPlot: string; + lastUpdated: Date; + type: MediaType; + directors: string[]; + imdb: { + rating: Double; + votes: number; + id: number; + }; + countries: string[]; + genres: string[]; + tomatoes: { + viewer: { + rating: number; + numReviews: number; + }; + lastUpdated: Date; + }; + num_mflix_comments: number; +} diff --git a/test/types/indexed_schema.test-d.ts b/test/types/indexed_schema.test-d.ts new file mode 100644 index 00000000000..be0e7ba154d --- /dev/null +++ b/test/types/indexed_schema.test-d.ts @@ -0,0 +1,36 @@ +import { expectType, expectNotType, expectError, expectAssignable } from 'tsd'; + +import { Collection } from '../../src/collection'; +import { ObjectId } from '../../src/bson'; +import { Db } from '../../src/db'; +import { MongoClient } from '../../src/mongo_client'; + +const db = new Db(new MongoClient(''), ''); + +type InsertRes = Promise<{ acknowledged: boolean; insertedId: TId }>; + +interface RandomKeysToNumberIncludingId { + _id: number; + a: number; + [extraKeys: string]: number; +} +const randomKeysIncludeIdC = new Collection(db, ''); +expectType>(randomKeysIncludeIdC.insertOne({ a: 2, randomKey: 23, _id: 23 })); +expectError(randomKeysIncludeIdC.insertOne({ a: 2, randomKey: 23 })); +expectError(randomKeysIncludeIdC.insertOne({ _id: 2, randomKey: 'string' })); + +const arg1 = (null as unknown) as Parameters[0]; +expectAssignable>(arg1); + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +interface RandomKeysToNumber { + a: number; + [extraKeys: string]: number | ObjectId; // if you omit _id, it still needs to be accounted for +} +const randomKeysC = new Collection(db, ''); +expectType(randomKeysC.insertOne({ a: 2, randomKey: 23, _id: new ObjectId() })); +expectType(randomKeysC.insertOne({ a: 2, randomKey: 23 })); +expectNotType>( + randomKeysC.insertOne({ a: 2, randomKey: 23, _id: new ObjectId() }) +); // You cannot implicitly have an _id of an unusual type diff --git a/test/types/mongodb.test-d.ts b/test/types/mongodb.test-d.ts new file mode 100644 index 00000000000..8dee493535d --- /dev/null +++ b/test/types/mongodb.test-d.ts @@ -0,0 +1,13 @@ +import { expectDeprecated } from 'tsd'; + +import { Collection } from '../../src/collection'; +import { AggregationCursor } from '../../src/cursor/aggregation_cursor'; +import { MongoError } from '../../src/error'; + +// We wish to keep these APIs but continue to ensure they are marked as deprecated. +expectDeprecated(Collection.prototype.insert); +expectDeprecated(Collection.prototype.update); +expectDeprecated(Collection.prototype.remove); +expectDeprecated(Collection.prototype.count); +expectDeprecated(MongoError.create); +expectDeprecated(AggregationCursor.prototype.geoNear); diff --git a/test/types/schema_helpers.test-d.ts b/test/types/schema_helpers.test-d.ts new file mode 100644 index 00000000000..9d177306ee5 --- /dev/null +++ b/test/types/schema_helpers.test-d.ts @@ -0,0 +1,52 @@ +import type { + InferIdType, + WithId, + WithoutId, + OptionalId, + EnhancedOmit +} from '../../src/mongo_types'; + +import { expectType, expectNotType, expectAssignable } from 'tsd'; +import { Document, ObjectId } from 'bson'; + +// InferIdType +expectType>(new ObjectId()); +expectType>(1 + 1); +expectType>(new ObjectId()); +expectAssignable>(new ObjectId()); +expectAssignable>(1 + 1); + +// WithId +expectAssignable>({ _id: new ObjectId() }); +expectAssignable>({ _id: new ObjectId(), a: 3 }); +expectNotType>({ _id: 3 }); + +// Changing _id to a type other than ObjectId makes it required: +expectNotType>({ a: 3 }); +expectNotType>({ a: 3 }); + +// If you just have an indexed type there is no enforcement +// expectType>({ a: 3 }); + +// But you can still bring back enforcement yourself +expectNotType>({ a: 3 }); + +// Custom _id type +class MyId {} +expectNotType>({ a: 3 }); +expectNotType>({ _id: new ObjectId(), a: 3 }); + +// WithoutId removes _id whether defined in the schema or not +expectType>({ a: 2 }); +expectNotType>({ _id: 3, a: 2 }); +expectNotType>({ _id: 3, a: 2 }); + +// EnhancedOmit fixes a problem with Typescript's built in Omit that breaks discriminated unions +// NODE-3287 +// expectNotAssignable>({ +// a: 'one' as const +// }); +expectAssignable>({ type: 'one' }); // This shouldn't work, but does, hence needing EnhancedOmit + +// Indexed type is unaffected, because you can't omit from {[x: string]: any} +expectAssignable>({ omitted: 2 }); diff --git a/test/types/union_schema.test-d.ts b/test/types/union_schema.test-d.ts new file mode 100644 index 00000000000..069e947f27d --- /dev/null +++ b/test/types/union_schema.test-d.ts @@ -0,0 +1,66 @@ +import { expectType, expectError, expectNotType, expectNotAssignable, expectAssignable } from 'tsd'; + +import type { Collection } from '../../src/collection'; +import { ObjectId } from '../../src/bson'; +import type { Filter } from '../../src/mongo_types'; + +type InsertOneFirstParam = Parameters['insertOne']>[0]; + +interface Circle { + _id: ObjectId; + radius: number; +} +interface Rectangle { + _id: ObjectId; + height: number; + width: number; +} +type Shape = Circle | Rectangle; + +type ShapeInsert = InsertOneFirstParam; +expectAssignable({ height: 2, width: 2, radius: 2 }); // This is permitted... +// error cases, should not insert a portion of a type +expectNotAssignable({ height: 2 }); +expectError({ + radius: 4, + extraKey: 'I should not be allowed', + _id: new ObjectId() +}); +// valid cases +expectAssignable({ height: 4, width: 4 }); +expectAssignable({ radius: 4 }); + +const c: Collection = null as never; +expectType>(c.findOne({ height: 4, width: 4 })); +// collection API can only respect TSchema given, cannot pick a type inside a union +expectNotType>(c.findOne({ height: 4, width: 4 })); + +interface A { + _id: number; +} +interface B { + _id: string; +} +type Data = A | B; +expectAssignable>({ _id: 2 }); +expectAssignable>({ _id: 'hi' }); + +// Ensure Exclusive Union Type doesn't break inside our collection methods +type Without = { [P in Exclude]?: never }; +// eslint-disable-next-line @typescript-eslint/ban-types +type XOR = T | U extends object ? (Without & U) | (Without & T) : T | U; + +interface Dog { + bark: string; +} +interface Cat { + meow: string; +} +type Pet = XOR; +expectNotAssignable>({ meow: '', bark: '' }); +expectAssignable>({ meow: '' }); +expectAssignable>({ bark: '' }); +expectAssignable>({ bark: '', _id: new ObjectId() }); +expectNotAssignable>({ meow: '', bark: '' }); // find +expectAssignable>({ bark: '' }); +expectAssignable>({ meow: '' }); diff --git a/test/unit/type_check.test.js b/test/unit/type_check.test.js new file mode 100644 index 00000000000..877b6d8b8e7 --- /dev/null +++ b/test/unit/type_check.test.js @@ -0,0 +1,16 @@ +'use strict'; + +const tsd = require('tsd').default; +const { expect } = require('chai'); + +describe('Typescript definitions', () => { + it('should pass assertions defined in test/types', async () => { + const diagnostics = await tsd(); + if (diagnostics.length !== 0) { + const messages = diagnostics + .map(d => `${d.fileName}:${d.line}:${d.column} - [${d.severity}]: ${d.message}`) + .join('\n'); + expect.fail('\n' + messages); + } + }); +});