From d8af08febfd4507a28bcda38d475b8010ef20f92 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 13 Dec 2022 14:00:21 -0800 Subject: [PATCH 1/7] Fixed issue where we call connectDatabaseToEmulator twice (#6883) --- .changeset/nervous-ads-pretend.md | 5 +++++ packages/database/src/api/Database.ts | 8 +++++--- packages/database/test/exp/integration.test.ts | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .changeset/nervous-ads-pretend.md diff --git a/.changeset/nervous-ads-pretend.md b/.changeset/nervous-ads-pretend.md new file mode 100644 index 00000000000..b375717da3e --- /dev/null +++ b/.changeset/nervous-ads-pretend.md @@ -0,0 +1,5 @@ +--- +"@firebase/database": patch +--- + +Fixed issue where connectDatabaseToEmulator can be called twice during a hot reload diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 6c367a87c44..f1a27492442 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -320,9 +320,11 @@ export function getDatabase( const db = _getProvider(app, 'database').getImmediate({ identifier: url }) as Database; - const emulator = getDefaultEmulatorHostnameAndPort('database'); - if (emulator) { - connectDatabaseEmulator(db, ...emulator); + if (!db._instanceStarted) { + const emulator = getDefaultEmulatorHostnameAndPort('database'); + if (emulator) { + connectDatabaseEmulator(db, ...emulator); + } } return db; } diff --git a/packages/database/test/exp/integration.test.ts b/packages/database/test/exp/integration.test.ts index 3be79d5c447..adf5094f222 100644 --- a/packages/database/test/exp/integration.test.ts +++ b/packages/database/test/exp/integration.test.ts @@ -77,6 +77,24 @@ describe('Database@exp Tests', () => { const db = getDatabase(defaultApp); expect(db).to.be.ok; }); + it("doesn't try to connect to emulator after database has already started", async () => { + const db = getDatabase(defaultApp); + const r = ref(db, '.info/connected'); + const deferred = new Deferred(); + onValue(r, snapshot => { + if (snapshot.val()) { + deferred.resolve(); + } + }); + await deferred.promise; + process.env.__FIREBASE_DEFAULTS__ = JSON.stringify({ + emulatorHosts: { + database: 'localhost:9000' + } + }); + expect(() => getDatabase(defaultApp)).to.not.throw(); + delete process.env.__FIREBASE_DEFAULTS__; + }); it('Can get database with custom URL', () => { const db = getDatabase(defaultApp, 'http://foo.bar.com'); From 9d2757a6b8e67c6f38a6bdfcdd0a792c511c0667 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 20 Dec 2022 11:46:01 -0800 Subject: [PATCH 2/7] Update dependency simple-git to v3.15.0 [SECURITY] (#6863) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0dbe56eea56..6799c635e07 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "protractor": "5.4.2", "request": "2.88.2", "semver": "7.3.8", - "simple-git": "3.7.1", + "simple-git": "3.15.0", "sinon": "9.2.4", "sinon-chai": "3.7.0", "source-map-loader": "1.1.3", diff --git a/yarn.lock b/yarn.lock index 61095a54399..669ab2be880 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15611,14 +15611,14 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz#366a4684d175b9cab2081e3681fda3747b6c51d7" integrity sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q== -simple-git@3.7.1: - version "3.7.1" - resolved "https://registry.npmjs.org/simple-git/-/simple-git-3.7.1.tgz#cb85c59da4da3d69792d206dd28cfbd803941fac" - integrity sha512-+Osjtsumbtew2y9to0pOYjNzSIr4NkKGBg7Po5SUtjQhaJf2QBmiTX/9E9cv9rmc7oUiSGFIB9e7ys5ibnT9+A== +simple-git@3.15.0: + version "3.15.0" + resolved "https://registry.npmjs.org/simple-git/-/simple-git-3.15.0.tgz#301a95a943c4f9b0a21d051eb6e6d0ffe4c9754f" + integrity sha512-FiWoMPlcYHQ+ApRihUsGjC/ZmIlWj62S6MBCwOunczvXcLQt+9ZdrysDrR6QVepkRQfEAaBXrN2QtJKrN6zbtg== dependencies: "@kwsites/file-exists" "^1.1.1" "@kwsites/promise-deferred" "^1.1.1" - debug "^4.3.3" + debug "^4.3.4" simple-swizzle@^0.2.2: version "0.2.2" From d4114a4f7da3f469c0c900416ac8beee58885ec3 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 21 Dec 2022 10:32:58 -0800 Subject: [PATCH 3/7] Format comment containing process.env (#6874) --- .changeset/wild-geckos-fetch.md | 5 +++++ packages/util/src/defaults.ts | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/wild-geckos-fetch.md diff --git a/.changeset/wild-geckos-fetch.md b/.changeset/wild-geckos-fetch.md new file mode 100644 index 00000000000..80787c38b5b --- /dev/null +++ b/.changeset/wild-geckos-fetch.md @@ -0,0 +1,5 @@ +--- +'@firebase/util': patch +--- + +Reformat a comment that causes compile errors in some build toolchains. diff --git a/packages/util/src/defaults.ts b/packages/util/src/defaults.ts index 0bf32b1968a..ceb73c683a8 100644 --- a/packages/util/src/defaults.ts +++ b/packages/util/src/defaults.ts @@ -53,8 +53,11 @@ const getDefaultsFromGlobal = (): FirebaseDefaults | undefined => /** * Attempt to read defaults from a JSON string provided to - * process.env.__FIREBASE_DEFAULTS__ or a JSON file whose path is in - * process.env.__FIREBASE_DEFAULTS_PATH__ + * process(.)env(.)__FIREBASE_DEFAULTS__ or a JSON file whose path is in + * process(.)env(.)__FIREBASE_DEFAULTS_PATH__ + * The dots are in parens because certain compilers (Vite?) cannot + * handle seeing that variable in comments. + * See https://github.com/firebase/firebase-js-sdk/issues/6838 */ const getDefaultsFromEnvVariable = (): FirebaseDefaults | undefined => { if (typeof process === 'undefined' || typeof process.env === 'undefined') { From 20e5ef7fbda307985d547543e8f473a49410e573 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 21 Dec 2022 13:10:28 -0800 Subject: [PATCH 4/7] Bump firebase-tools version (#6902) --- package.json | 2 +- .../rules-unit-testing/functions/yarn.lock | 805 +++++++++++++----- .../test/impl/discovery.test.ts | 8 +- yarn.lock | 93 +- 4 files changed, 635 insertions(+), 273 deletions(-) diff --git a/package.json b/package.json index 6799c635e07..d49d9b60a73 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "eslint-plugin-unused-imports": "2.0.0", "express": "4.18.2", "find-free-port": "2.0.0", - "firebase-tools": "11.2.2", + "firebase-tools": "11.19.0", "glob": "7.2.3", "http-server": "14.1.1", "indexeddbshim": "8.0.0", diff --git a/packages/rules-unit-testing/functions/yarn.lock b/packages/rules-unit-testing/functions/yarn.lock index 6821c815d20..9c24de71c0c 100644 --- a/packages/rules-unit-testing/functions/yarn.lock +++ b/packages/rules-unit-testing/functions/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@babel/parser@^7.9.4": + version "7.20.5" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz#7f3c7335fe417665d929f34ae5dceae4c04015e8" + integrity sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA== + "@fastify/busboy@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@fastify/busboy/-/busboy-1.1.0.tgz#4472f856e2bb5a9ee34ad64b93891b73b73537ca" @@ -9,99 +14,79 @@ dependencies: text-decoding "^1.0.0" -"@firebase/app-types@0.7.0": - version "0.7.0" - resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.7.0.tgz#c9e16d1b8bed1a991840b8d2a725fb58d0b5899f" - integrity sha512-6fbHQwDv2jp/v6bXhBw2eSRbNBpxHcd1NBF864UksSMVIqIyri9qpJB1Mn6sGZE+bnDsSQBC5j2TbMxYsJQkQg== - -"@firebase/app-types@0.8.0": - version "0.8.0" - resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.8.0.tgz#50a539a0a20bef8c50494d0615592fe2a384851f" - integrity sha512-Lec3VVquUwXPn2UReGSsfTxuMBVRmzGIwA/CJnF0LQuPgv9kOmXk9mVqsDMfHxHtqjai0n6wWHR2TqjdVV/bYA== +"@firebase/app-types@0.8.1": + version "0.8.1" + resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.8.1.tgz#4c7f916281aed570581fc667e3eb6cc730119a95" + integrity sha512-p75Ow3QhB82kpMzmOntv866wH9eZ3b4+QbUY+8/DA5Zzdf1c8Nsk8B7kbFpzJt4wwHMdy5LTF5YUnoTc1JiWkw== -"@firebase/auth-interop-types@0.1.6": - version "0.1.6" - resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.6.tgz#5ce13fc1c527ad36f1bb1322c4492680a6cf4964" - integrity sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g== +"@firebase/auth-interop-types@0.1.7": + version "0.1.7" + resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.7.tgz#82c8d431779916224d2af5cef6cec2042d830f28" + integrity sha512-yA/dTveGGPcc85JP8ZE/KZqfGQyQTBCV10THdI8HTlP1GDvNrhr//J5jAt58MlsCOaO3XmC4DqScPBbtIsR/EA== -"@firebase/component@0.5.20": - version "0.5.20" - resolved "https://registry.npmjs.org/@firebase/component/-/component-0.5.20.tgz#52165b5f7d25c4ac9c679e4e48d6f7fa7bf722cf" - integrity sha512-wP51tQBlPFprfAWxWjzC/56hG4APhl43jFsgwuqCl3bhVbiKcr278QbrbGNmIXDeGKo4sGZLAnH9whl2apeCmA== +"@firebase/component@0.5.21": + version "0.5.21" + resolved "https://registry.npmjs.org/@firebase/component/-/component-0.5.21.tgz#bb10add24fe2ee59a61163a469d4711d8da4002d" + integrity sha512-12MMQ/ulfygKpEJpseYMR0HunJdlsLrwx2XcEs40M18jocy2+spyzHHEwegN3x/2/BLFBjR5247Etmz0G97Qpg== dependencies: - "@firebase/util" "1.7.2" + "@firebase/util" "1.7.3" tslib "^2.1.0" -"@firebase/database-compat@^0.2.0": - version "0.2.9" - resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-0.2.9.tgz#a1b4ecf94e11eadfc21aa48121b3ba7ea18a57ae" - integrity sha512-zzyFM3+jW/qYtHojiQirHXGXYyElbqVngEEn/i2gXoSzcK0Y2AL5oHAqGYXLaaW0+t4Zwnssh3HnQJM8C1D0fw== +"@firebase/database-compat@^0.2.6": + version "0.2.10" + resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-0.2.10.tgz#fa4440db9f41a9a05112642504c1e6557a75b8be" + integrity sha512-fK+IgUUqVKcWK/gltzDU+B1xauCOfY6vulO8lxoNTkcCGlSxuTtwsdqjGkFmgFRMYjXFWWJ6iFcJ/vXahzwCtA== dependencies: - "@firebase/component" "0.5.20" - "@firebase/database" "0.13.9" - "@firebase/database-types" "0.9.16" - "@firebase/logger" "0.3.3" - "@firebase/util" "1.7.2" + "@firebase/component" "0.5.21" + "@firebase/database" "0.13.10" + "@firebase/database-types" "0.9.17" + "@firebase/logger" "0.3.4" + "@firebase/util" "1.7.3" tslib "^2.1.0" -"@firebase/database-types@0.9.16": - version "0.9.16" - resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.9.16.tgz#4f7f612c00346641a641ac689005857190e91ebc" - integrity sha512-dK/uFgHisrVijSoHf9RLJ7NwvlOul2rO/z9ufOSbGd8/TqFVASXz+19mynhDIoSEnyQtJC/NTyBzSPfjz0w61w== +"@firebase/database-types@0.9.17", "@firebase/database-types@^0.9.13": + version "0.9.17" + resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.9.17.tgz#4c248052b0a9ae052ba940e4996a0bfab25dc257" + integrity sha512-YQm2tCZyxNtEnlS5qo5gd2PAYgKCy69tUKwioGhApCFThW+mIgZs7IeYeJo2M51i4LCixYUl+CvnOyAnb/c3XA== dependencies: - "@firebase/app-types" "0.8.0" - "@firebase/util" "1.7.2" + "@firebase/app-types" "0.8.1" + "@firebase/util" "1.7.3" -"@firebase/database-types@^0.9.7": - version "0.9.8" - resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.9.8.tgz#5a9bb1d2c492ad635eff5f3cfbe6a0ea6a2463e7" - integrity sha512-bI7bwF5xc0nPi6Oa3JVt6JJdfhVAnEpCwgfTNILR4lYDPtxdxlRXhZzQ5lfqlCj7PR+drKh9RvMu6C24N1q04w== +"@firebase/database@0.13.10": + version "0.13.10" + resolved "https://registry.npmjs.org/@firebase/database/-/database-0.13.10.tgz#c24e0219490b9c1fabfb7b42cb45850e145fe56d" + integrity sha512-KRucuzZ7ZHQsRdGEmhxId5jyM2yKsjsQWF9yv0dIhlxYg0D8rCVDZc/waoPKA5oV3/SEIoptF8F7R1Vfe7BCQA== dependencies: - "@firebase/app-types" "0.7.0" - "@firebase/util" "1.6.0" - -"@firebase/database@0.13.9": - version "0.13.9" - resolved "https://registry.npmjs.org/@firebase/database/-/database-0.13.9.tgz#8cf8c77fb837ed1a6fa85565ac8c28864b0957fb" - integrity sha512-raQEBgQQybaEoMloJL8wWHQywGQ9mF2VbitvHydsbSNn+KL/xRDjXeQZPuuSbRjkYV6mR8jvQB7gpnzQQNE8Qg== - dependencies: - "@firebase/auth-interop-types" "0.1.6" - "@firebase/component" "0.5.20" - "@firebase/logger" "0.3.3" - "@firebase/util" "1.7.2" + "@firebase/auth-interop-types" "0.1.7" + "@firebase/component" "0.5.21" + "@firebase/logger" "0.3.4" + "@firebase/util" "1.7.3" faye-websocket "0.11.4" tslib "^2.1.0" -"@firebase/logger@0.3.3": - version "0.3.3" - resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.3.3.tgz#0f724b1e0b166d17ac285aac5c8ec14d136beed4" - integrity sha512-POTJl07jOKTOevLXrTvJD/VZ0M6PnJXflbAh5J9VGkmtXPXNG6MdZ9fmRgqYhXKTaDId6AQenQ262uwgpdtO0Q== +"@firebase/logger@0.3.4": + version "0.3.4" + resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.3.4.tgz#8822dd3e9168be93c1bce0b4ac235e3b165a6a68" + integrity sha512-hlFglGRgZEwoyClZcGLx/Wd+zoLfGmbDkFx56mQt/jJ0XMbfPqwId1kiPl0zgdWZX+D8iH+gT6GuLPFsJWgiGw== dependencies: tslib "^2.1.0" -"@firebase/util@1.6.0": - version "1.6.0" - resolved "https://registry.npmjs.org/@firebase/util/-/util-1.6.0.tgz#31aea6bba3ee98fc83a60eb189cb187243f4ef4b" - integrity sha512-6+hhqb4Zzjoo12xofTDHPkgW3FnN4ydBsjd5X2KuQI268DR3W3Ld64W/gkKPZrKRgUxeNeb+pykfP3qRe7q+vA== - dependencies: - tslib "^2.1.0" - -"@firebase/util@1.7.2": - version "1.7.2" - resolved "https://registry.npmjs.org/@firebase/util/-/util-1.7.2.tgz#dbdb259f141b5025a7faaaa38e2ea5df0be36ff5" - integrity sha512-P3aTihYEMoz2QQlcn0T7av7HLEK9gsTc1ZiN9VA8wnUtEJscUNemCmTmP3RRysqEb3Z+tVVoycztY8f6R36rRw== +"@firebase/util@1.7.3": + version "1.7.3" + resolved "https://registry.npmjs.org/@firebase/util/-/util-1.7.3.tgz#e71640b6b2970b754f947235ceb10cba3f70e62c" + integrity sha512-wxNqWbqokF551WrJ9BIFouU/V5SL1oYCGx1oudcirdhadnQRFH5v1sjgGL7cUV/UsekSycygphdrF2lxBxOYKg== dependencies: tslib "^2.1.0" -"@google-cloud/firestore@^5.0.2": - version "5.0.2" - resolved "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-5.0.2.tgz#36923fde45987f928a220d347f341c5602f9e340" - integrity sha512-xlGcNYaW0nvUMzNn2+pLfbEBVt6oysVqtM89faMgZWkWfEtvIQGS0h5PRdLlcqufNzRCX3yIGv29Pb+03ys+VA== +"@google-cloud/firestore@^6.4.0": + version "6.4.1" + resolved "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-6.4.1.tgz#3cd32ffb10a563a9c3c91236b51e49e4cd088393" + integrity sha512-5q4sl1XCL8NH2y82KZ4WQGHDOPnrSMYq3JpIeKD5C0OCSb4MfckOTB9LeAQ3p5tlL+7UsVRHj0SyzKz27XZJjw== dependencies: fast-deep-equal "^3.1.1" functional-red-black-tree "^1.0.1" - google-gax "^2.24.1" - protobufjs "^6.8.6" + google-gax "^3.5.1" + protobufjs "^7.0.0" "@google-cloud/paginator@^3.0.7": version "3.0.7" @@ -121,16 +106,15 @@ resolved "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-3.0.1.tgz#8d724fb280f47d1ff99953aee0c1669b25238c2e" integrity sha512-z1CjRjtQyBOYL+5Qr9DdYIfrdLBe746jRTYfaYU6MeXkqp7UfYs/jX16lFFVzZ7PGEJvqZNqYUEtb1mvDww4pA== -"@google-cloud/storage@^6.1.0": - version "6.5.2" - resolved "https://registry.npmjs.org/@google-cloud/storage/-/storage-6.5.2.tgz#0db4eebb947256925db06365cfdab412062b504b" - integrity sha512-n4HVE5bGGFdXlPUN2tP+wEnVH2XbYnv9PVrHirbAJPHk8EM7bm1G86+IhLha8KH4PpHLhjCPML173Sr6PWCXIQ== +"@google-cloud/storage@^6.5.2": + version "6.8.0" + resolved "https://registry.npmjs.org/@google-cloud/storage/-/storage-6.8.0.tgz#98bf58f18d422386b245d98d0bda9054852ccd9a" + integrity sha512-eRGsHrhVA7NORehYW9jLUWHRzYqFxbYiG3LQL50ZhjMekDwzhPKUQ7wbjAji9OFcO3Mk8jeNHeWdpAc/QZANCg== dependencies: "@google-cloud/paginator" "^3.0.7" "@google-cloud/projectify" "^3.0.0" "@google-cloud/promisify" "^3.0.0" abort-controller "^3.0.0" - arrify "^2.0.0" async-retry "^1.3.3" compressible "^2.0.12" duplexify "^4.0.0" @@ -145,23 +129,24 @@ teeny-request "^8.0.0" uuid "^8.0.0" -"@grpc/grpc-js@~1.3.0": - version "1.3.7" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.3.7.tgz#58b687aff93b743aafde237fd2ee9a3259d7f2d8" - integrity sha512-CKQVuwuSPh40tgOkR7c0ZisxYRiN05PcKPW72mQL5y++qd7CwBRoaJZvU5xfXnCJDFBmS3qZGQ71Frx6Ofo2XA== +"@grpc/grpc-js@~1.7.0": + version "1.7.3" + resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz#f2ea79f65e31622d7f86d4b4c9ae38f13ccab99a" + integrity sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog== dependencies: + "@grpc/proto-loader" "^0.7.0" "@types/node" ">=12.12.47" -"@grpc/proto-loader@^0.6.1": - version "0.6.5" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.5.tgz#f23c7cb3e7076a8702f40c2b6678f06fb9950a55" - integrity sha512-GZdzyVQI1Bln/kCzIYgTKu+rQJ5dno0gVrfmLe4jqQu7T2e7svSwJzpCBqVU5hhBSJP3peuPjOMWsj5GR61YmQ== +"@grpc/proto-loader@^0.7.0": + version "0.7.4" + resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.4.tgz#4946a84fbf47c3ddd4e6a97acb79d69a9f47ebf2" + integrity sha512-MnWjkGwqQ3W8fx94/c1CwqLsNmHHv2t0CFn+9++6+cDphC1lolpg9M2OU0iebIjK//pBNX9e94ho+gjx6vz39w== dependencies: "@types/long" "^4.0.1" lodash.camelcase "^4.3.0" long "^4.0.0" - protobufjs "^6.10.0" - yargs "^16.1.1" + protobufjs "^7.0.0" + yargs "^16.2.0" "@panva/asn1.js@^1.0.0": version "1.0.0" @@ -246,15 +231,7 @@ resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== -"@types/express-jwt@0.0.42": - version "0.0.42" - resolved "https://registry.npmjs.org/@types/express-jwt/-/express-jwt-0.0.42.tgz#4f04e1fadf9d18725950dc041808a4a4adf7f5ae" - integrity sha512-WszgUddvM1t5dPpJ3LhWNH8kfNN8GPIBrAGxgIYXVCEGx6Bx4A036aAuf/r5WH9DIEdlmp7gHOYvSM6U87B0ag== - dependencies: - "@types/express" "*" - "@types/express-unless" "*" - -"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": +"@types/express-serve-static-core@*": version "4.17.24" resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz#ea41f93bf7e0d59cd5a76665068ed6aab6815c07" integrity sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA== @@ -263,22 +240,14 @@ "@types/qs" "*" "@types/range-parser" "*" -"@types/express-unless@*": - version "0.5.2" - resolved "https://registry.npmjs.org/@types/express-unless/-/express-unless-0.5.2.tgz#07e29883d280778588644b03563d8796f870f20e" - integrity sha512-Q74UyYRX/zIgl1HSp9tUX2PlG8glkVm+59r7aK4KGKzC5jqKIOX6rrVLRQrzpZUQ84VukHtRoeAuon2nIssHPQ== - dependencies: - "@types/express" "*" - -"@types/express@*": - version "4.17.13" - resolved "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" - integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== +"@types/express-serve-static-core@^4.17.31": + version "4.17.31" + resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz#a1139efeab4e7323834bb0226e62ac019f474b2f" + integrity sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q== dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.18" + "@types/node" "*" "@types/qs" "*" - "@types/serve-static" "*" + "@types/range-parser" "*" "@types/express@4.17.3": version "4.17.3" @@ -289,11 +258,46 @@ "@types/express-serve-static-core" "*" "@types/serve-static" "*" +"@types/express@^4.17.14": + version "4.17.15" + resolved "https://registry.npmjs.org/@types/express/-/express-4.17.15.tgz#9290e983ec8b054b65a5abccb610411953d417ff" + integrity sha512-Yv0k4bXGOH+8a+7bELd2PqHQsuiANB+A8a4gnQrkRWzrkKlb6KHaVvyXhqs04sVW/OWlbPyYxRgYlIXLfrufMQ== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.31" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/jsonwebtoken@^8.5.9": + version "8.5.9" + resolved "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz#2c064ecb0b3128d837d2764aa0b117b0ff6e4586" + integrity sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg== + dependencies: + "@types/node" "*" + +"@types/linkify-it@*": + version "3.0.2" + resolved "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" + integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== + "@types/long@^4.0.0", "@types/long@^4.0.1": version "4.0.1" resolved "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== +"@types/markdown-it@^12.2.3": + version "12.2.3" + resolved "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51" + integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ== + dependencies: + "@types/linkify-it" "*" + "@types/mdurl" "*" + +"@types/mdurl@*": + version "1.0.2" + resolved "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" + integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== + "@types/mime@^1": version "1.3.2" resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" @@ -337,6 +341,16 @@ accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.8.0: + version "8.8.1" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" + integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== + agent-base@6: version "6.0.2" resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -349,13 +363,18 @@ ansi-regex@^5.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^4.0.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -373,6 +392,11 @@ async-retry@^1.3.3: dependencies: retry "0.13.1" +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + base64-js@^1.3.0: version "1.5.1" resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" @@ -383,6 +407,11 @@ bignumber.js@^9.0.0: resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== +bluebird@^3.7.2: + version "3.7.2" + resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + body-parser@1.19.0: version "1.19.0" resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -399,6 +428,21 @@ body-parser@1.19.0: raw-body "2.4.0" type-is "~1.6.17" +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + buffer-equal-constant-time@1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" @@ -409,6 +453,21 @@ bytes@3.1.0: resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +catharsis@^0.9.0: + version "0.9.0" + resolved "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121" + integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A== + dependencies: + lodash "^4.17.15" + +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + cliui@^7.0.2: version "7.0.4" resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -437,6 +496,11 @@ compressible@^2.0.12: dependencies: mime-db ">= 1.43.0 < 2" +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + content-disposition@0.5.3: version "0.5.3" resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" @@ -474,13 +538,25 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@4, debug@^4.1.1, debug@^4.3.2: +debug@4, debug@^4.1.1: version "4.3.2" resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== dependencies: ms "2.1.2" +debug@^4.3.4: + version "4.3.4" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +deep-is@~0.1.3: + version "0.1.4" + resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + depd@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -535,6 +611,11 @@ ent@^2.2.0: resolved "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= +entities@~2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" + integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== + escalade@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -545,6 +626,57 @@ escape-html@~1.0.3: resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^1.13.0: + version "1.14.3" + resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +espree@^9.0.0: + version "9.4.1" + resolved "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" + integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== + dependencies: + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" + +esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estraverse@^4.2.0: + version "4.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0: + version "5.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + etag@~1.8.1: version "1.8.1" resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" @@ -601,6 +733,11 @@ fast-deep-equal@^3.1.1: resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + fast-text-encoding@^1.0.0, fast-text-encoding@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz#ec02ac8e01ab8a319af182dae2681213cfe9ce53" @@ -626,22 +763,22 @@ finalhandler@~1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -firebase-admin@11.0.0: - version "11.0.0" - resolved "https://registry.npmjs.org/firebase-admin/-/firebase-admin-11.0.0.tgz#b10355cd9b142cf305fcb7842b51f918d3745a11" - integrity sha512-x56u+Q1P8QDvQKaYRe29ZUM/3f829cP8tsKCDXOhaIX/GbGfgcdjRhPmCafzlwgCWP5wW9NkOgIhnrw94zucvw== +firebase-admin@11.3.0: + version "11.3.0" + resolved "https://registry.npmjs.org/firebase-admin/-/firebase-admin-11.3.0.tgz#0c80a47d85471f6b988ecef7439a706aca052b88" + integrity sha512-8ENXUu9Lm6YTc5zzOqlF222M/KwsV/EDZ5UwwPPEU5XfCa1Ebj7K/SgLFdinjGu1NxkSnqu07UDpPhmAtW3b5w== dependencies: "@fastify/busboy" "^1.1.0" - "@firebase/database-compat" "^0.2.0" - "@firebase/database-types" "^0.9.7" + "@firebase/database-compat" "^0.2.6" + "@firebase/database-types" "^0.9.13" "@types/node" ">=12.12.47" jsonwebtoken "^8.5.1" - jwks-rsa "^2.0.2" + jwks-rsa "^2.1.4" node-forge "^1.3.1" - uuid "^8.3.2" + uuid "^9.0.0" optionalDependencies: - "@google-cloud/firestore" "^5.0.2" - "@google-cloud/storage" "^6.1.0" + "@google-cloud/firestore" "^6.4.0" + "@google-cloud/storage" "^6.5.2" firebase-functions@3.24.1: version "3.24.1" @@ -665,22 +802,16 @@ fresh@0.5.2: resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -gaxios@^4.0.0: - version "4.3.2" - resolved "https://registry.npmjs.org/gaxios/-/gaxios-4.3.2.tgz#845827c2dc25a0213c8ab4155c7a28910f5be83f" - integrity sha512-T+ap6GM6UZ0c4E6yb1y/hy2UB6hTrqhglp3XfmU9qbLCGRYhLVV5aRPpC4EmoG8N8zOnkYCgoBz+ScvGAARY6Q== - dependencies: - abort-controller "^3.0.0" - extend "^3.0.2" - https-proxy-agent "^5.0.0" - is-stream "^2.0.0" - node-fetch "^2.6.1" - gaxios@^5.0.0, gaxios@^5.0.1: version "5.0.2" resolved "https://registry.npmjs.org/gaxios/-/gaxios-5.0.2.tgz#ca3a40e851c728d31d7001c2357062d46bf966d1" @@ -691,14 +822,6 @@ gaxios@^5.0.0, gaxios@^5.0.1: is-stream "^2.0.0" node-fetch "^2.6.7" -gcp-metadata@^4.2.0: - version "4.3.1" - resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.3.1.tgz#fb205fe6a90fef2fd9c85e6ba06e5559ee1eefa9" - integrity sha512-x850LS5N7V1F3UcV7PoupzGsyD6iVwTVvsh3tbXfkctZnBnjW5yu5z1/3k3SehF7TyoTIe78rJs02GMMy+LF+A== - dependencies: - gaxios "^4.0.0" - json-bigint "^1.0.0" - gcp-metadata@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.1.tgz#8d1e785ee7fad554bc2a80c1f930c9a9518d2b00" @@ -712,25 +835,48 @@ get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -google-auth-library@^7.6.1: - version "7.9.2" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.9.2.tgz#c11c1b4d4cc50e85ea7c8a01f6d4ec2fbed1aed1" - integrity sha512-HjxbJt660a+YUTYAgYor87JCuBZvjUSNBExk4bXTEaMuCn8IHSDeHmFxKqThuDPrLCiKJp8blk/Ze8f7SI4N6g== +glob@^7.1.3: + version "7.2.3" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^8.0.0: + version "8.0.3" + resolved "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" + integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + +google-auth-library@^8.0.1: + version "8.5.2" + resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.5.2.tgz#bcdced8f7b475b80bf0e9c109c7c7e930866947b" + integrity sha512-FPfOSaI8n2TVXFHTP8/vAVFCXhyALj7w9/Rgefux3oeKZ/nQDNmfNTJ+lIKcoYT1cKkvMllp1Eood7Y5L+TP+A== dependencies: arrify "^2.0.0" base64-js "^1.3.0" ecdsa-sig-formatter "^1.0.11" fast-text-encoding "^1.0.0" - gaxios "^4.0.0" - gcp-metadata "^4.2.0" - gtoken "^5.0.4" + gaxios "^5.0.0" + gcp-metadata "^5.0.0" + gtoken "^6.1.0" jws "^4.0.0" lru-cache "^6.0.0" -google-auth-library@^8.0.1: - version "8.5.2" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.5.2.tgz#bcdced8f7b475b80bf0e9c109c7c7e930866947b" - integrity sha512-FPfOSaI8n2TVXFHTP8/vAVFCXhyALj7w9/Rgefux3oeKZ/nQDNmfNTJ+lIKcoYT1cKkvMllp1Eood7Y5L+TP+A== +google-auth-library@^8.0.2: + version "8.7.0" + resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.7.0.tgz#e36e255baba4755ce38dded4c50f896cf8515e51" + integrity sha512-1M0NG5VDIvJZEnstHbRdckLZESoJwguinwN8Dhae0j2ZKIQFIV63zxm6Fo6nM4xkgqUr2bbMtV5Dgo+Hy6oo0Q== dependencies: arrify "^2.0.0" base64-js "^1.3.0" @@ -742,31 +888,25 @@ google-auth-library@^8.0.1: jws "^4.0.0" lru-cache "^6.0.0" -google-gax@^2.24.1: - version "2.25.4" - resolved "https://registry.npmjs.org/google-gax/-/google-gax-2.25.4.tgz#9fe30cf7ccbcf41eb57f74d72b75c5c4d08b5003" - integrity sha512-+Jd0FFOWyb8ieX53e6Sl5OYvHXoA1sWKfQ24ykR502NKgBTvPAh/RFcITihGePBJZ1E8pfh4MKWU0Sf+f1CK+A== +google-gax@^3.5.1: + version "3.5.2" + resolved "https://registry.npmjs.org/google-gax/-/google-gax-3.5.2.tgz#7c3ad61dbf366a55527b803caead276668b160d8" + integrity sha512-AyP53w0gHcWlzxm+jSgqCR3Xu4Ld7EpSjhtNBnNhzwwWaIUyphH9kBGNIEH+i4UGkTUXOY29K/Re8EiAvkBRGw== dependencies: - "@grpc/grpc-js" "~1.3.0" - "@grpc/proto-loader" "^0.6.1" + "@grpc/grpc-js" "~1.7.0" + "@grpc/proto-loader" "^0.7.0" "@types/long" "^4.0.0" abort-controller "^3.0.0" duplexify "^4.0.0" fast-text-encoding "^1.0.3" - google-auth-library "^7.6.1" + google-auth-library "^8.0.2" is-stream-ended "^0.1.4" node-fetch "^2.6.1" - object-hash "^2.1.1" - proto3-json-serializer "^0.1.1" - protobufjs "6.11.2" - retry-request "^4.0.0" - -google-p12-pem@^3.0.3: - version "3.1.2" - resolved "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.1.2.tgz#c3d61c2da8e10843ff830fdb0d2059046238c1d4" - integrity sha512-tjf3IQIt7tWCDsa0ofDQ1qqSCNzahXDxdAGJDbruWqu3eCg5CKLYKN+hi0s6lfvzYZ1GDVr+oDF9OOWlDSdf0A== - dependencies: - node-forge "^0.10.0" + object-hash "^3.0.0" + proto3-json-serializer "^1.0.0" + protobufjs "7.1.2" + protobufjs-cli "1.0.2" + retry-request "^5.0.0" google-p12-pem@^4.0.0: version "4.0.1" @@ -775,14 +915,10 @@ google-p12-pem@^4.0.0: dependencies: node-forge "^1.3.1" -gtoken@^5.0.4: - version "5.3.1" - resolved "https://registry.npmjs.org/gtoken/-/gtoken-5.3.1.tgz#c1c2598a826f2b5df7c6bb53d7be6cf6d50c3c78" - integrity sha512-yqOREjzLHcbzz1UrQoxhBtpk8KjrVhuqPE7od1K2uhyxG2BHjKZetlbLw/SPZak/QqTIQW+addS+EcjqQsZbwQ== - dependencies: - gaxios "^4.0.0" - google-p12-pem "^3.0.3" - jws "^4.0.0" +graceful-fs@^4.1.9: + version "4.2.10" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== gtoken@^6.1.0: version "6.1.2" @@ -793,6 +929,11 @@ gtoken@^6.1.0: google-p12-pem "^4.0.0" jws "^4.0.0" +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + http-errors@1.7.2: version "1.7.2" resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" @@ -844,16 +985,24 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" -inherits@2.0.4, inherits@^2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" @@ -874,13 +1023,41 @@ is-stream@^2.0.0: resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -jose@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/jose/-/jose-2.0.5.tgz#29746a18d9fff7dcf9d5d2a6f62cb0c7cd27abd3" - integrity sha512-BAiDNeDKTMgk4tvD0BbxJ8xHEHBZgpeRZ1zGPPsitSyMgjoMWiLGYAE7H7NpP5h0lPppQajQs871E8NHUrzVPA== +jose@^2.0.6: + version "2.0.6" + resolved "https://registry.npmjs.org/jose/-/jose-2.0.6.tgz#894ba19169af339d3911be933f913dd02fc57c7c" + integrity sha512-FVoPY7SflDodE4lknJmbAHSUjLCzE2H1F6MS0RYKMQ8SR+lNccpMf8R4eqkNYyyUjR5qZReOzZo5C5YiHOCjjg== dependencies: "@panva/asn1.js" "^1.0.0" +js2xmlparser@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a" + integrity sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA== + dependencies: + xmlcreate "^2.0.4" + +jsdoc@^3.6.3: + version "3.6.11" + resolved "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.11.tgz#8bbb5747e6f579f141a5238cbad4e95e004458ce" + integrity sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg== + dependencies: + "@babel/parser" "^7.9.4" + "@types/markdown-it" "^12.2.3" + bluebird "^3.7.2" + catharsis "^0.9.0" + escape-string-regexp "^2.0.0" + js2xmlparser "^4.0.2" + klaw "^3.0.0" + markdown-it "^12.3.2" + markdown-it-anchor "^8.4.1" + marked "^4.0.10" + mkdirp "^1.0.4" + requizzle "^0.2.3" + strip-json-comments "^3.1.0" + taffydb "2.6.2" + underscore "~1.13.2" + json-bigint@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" @@ -922,14 +1099,15 @@ jwa@^2.0.0: ecdsa-sig-formatter "1.0.11" safe-buffer "^5.0.1" -jwks-rsa@^2.0.2: - version "2.0.4" - resolved "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-2.0.4.tgz#59d95e39f300783a8582ef8aa37d5ebbc6a8aa6f" - integrity sha512-iJqVCECYZZ+3oPmY1qXv3Fq+3ywDtuNEVBvG41pPlaR0zyGxa12nC0beAOBBUhETJmc05puS50mRQN4NkCGhmg== +jwks-rsa@^2.1.4: + version "2.1.5" + resolved "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-2.1.5.tgz#bb7bf8c5767836bc273bf5b27870066aca39c1bb" + integrity sha512-IODtn1SwEm7n6GQZnQLY0oxKDrMh7n/jRH1MzE8mlxWMrh2NnMyOsXTebu8vJ1qCpmuTJcL4DdiE0E4h8jnwsA== dependencies: - "@types/express-jwt" "0.0.42" - debug "^4.3.2" - jose "^2.0.5" + "@types/express" "^4.17.14" + "@types/jsonwebtoken" "^8.5.9" + debug "^4.3.4" + jose "^2.0.6" limiter "^1.1.5" lru-memoizer "^2.1.4" @@ -949,11 +1127,33 @@ jws@^4.0.0: jwa "^2.0.0" safe-buffer "^5.0.1" +klaw@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz#b11bec9cf2492f06756d6e809ab73a2910259146" + integrity sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g== + dependencies: + graceful-fs "^4.1.9" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + limiter@^1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz#8f92a25b3b16c6131293a0cc834b4a838a2aa7c2" integrity sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA== +linkify-it@^3.0.1: + version "3.0.3" + resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" + integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== + dependencies: + uc.micro "^1.0.1" + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -999,7 +1199,7 @@ lodash.once@^4.0.0: resolved "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash@^4.17.14: +lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -1009,6 +1209,11 @@ long@^4.0.0: resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== +long@^5.0.0: + version "5.2.1" + resolved "https://registry.npmjs.org/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" + integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -1032,6 +1237,32 @@ lru-memoizer@^2.1.4: lodash.clonedeep "^4.5.0" lru-cache "~4.0.0" +markdown-it-anchor@^8.4.1: + version "8.6.6" + resolved "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz#4a12e358c9c2167ee28cb7a5f10e29d6f1ffd7ca" + integrity sha512-jRW30YGywD2ESXDc+l17AiritL0uVaSnWsb26f+68qaW9zgbIIr1f4v2Nsvc0+s0Z2N3uX6t/yAw7BwCQ1wMsA== + +markdown-it@^12.3.2: + version "12.3.2" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" + integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== + dependencies: + argparse "^2.0.1" + entities "~2.1.0" + linkify-it "^3.0.1" + mdurl "^1.0.1" + uc.micro "^1.0.5" + +marked@^4.0.10: + version "4.2.4" + resolved "https://registry.npmjs.org/marked/-/marked-4.2.4.tgz#5a4ce6c7a1ae0c952601fce46376ee4cf1797e1c" + integrity sha512-Wcc9ikX7Q5E4BYDPvh1C6QNSxrjC9tBgz+A/vAhp59KXUgachw++uMvMKiSW8oA85nopmPZcEvBoex/YLMsiyA== + +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -1074,6 +1305,30 @@ mime@^3.0.0: resolved "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== +minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^5.0.1: + version "5.1.2" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz#0939d7d6f0898acbd1508abe534d1929368a8fff" + integrity sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg== + dependencies: + brace-expansion "^2.0.1" + +minimist@^1.2.0: + version "1.2.7" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== + +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -1113,11 +1368,6 @@ node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-forge@^0.10.0: - version "0.10.0" - resolved "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" - integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA== - node-forge@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -1128,10 +1378,10 @@ object-assign@^4: resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-hash@^2.1.1: - version "2.2.0" - resolved "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" - integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== +object-hash@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" + integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== on-finished@~2.3.0: version "2.3.0" @@ -1140,13 +1390,25 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.4.0: +once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + p-limit@^3.0.1: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -1159,20 +1421,48 @@ parseurl@~1.3.3: resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= -proto3-json-serializer@^0.1.1: - version "0.1.4" - resolved "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-0.1.4.tgz#aa2dc4c9c9b7ea05631354b2c2e52c227539a7f0" - integrity sha512-bFzdsKU/zaTobWrRxRniMZIzzcgKYlmBWL1gAcTXZ2M7TQTGPI0JoYYs6bN7tpWj59ZCfwg7Ii/A2e8BbQGYnQ== +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + +proto3-json-serializer@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-1.1.0.tgz#52d9c73b24d25ff925639e1e5a01ac883460149f" + integrity sha512-SjXwUWe/vANGs/mJJTbw5++7U67nwsymg7qsoPtw6GiXqw3kUy8ByojrlEdVE2efxAdKreX8WkDafxvYW95ZQg== + dependencies: + protobufjs "^7.0.0" -protobufjs@6.11.2, protobufjs@^6.10.0, protobufjs@^6.8.6: - version "6.11.2" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" - integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== +protobufjs-cli@1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.0.2.tgz#905fc49007cf4aaf3c45d5f250eb294eedeea062" + integrity sha512-cz9Pq9p/Zs7okc6avH20W7QuyjTclwJPgqXG11jNaulfS3nbVisID8rC+prfgq0gbZE0w9LBFd1OKFF03kgFzg== + dependencies: + chalk "^4.0.0" + escodegen "^1.13.0" + espree "^9.0.0" + estraverse "^5.1.0" + glob "^8.0.0" + jsdoc "^3.6.3" + minimist "^1.2.0" + semver "^7.1.2" + tmp "^0.2.1" + uglify-js "^3.7.7" + +protobufjs@7.1.2, protobufjs@^7.0.0: + version "7.1.2" + resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz#a0cf6aeaf82f5625bffcf5a38b7cd2a7de05890c" + integrity sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -1184,9 +1474,8 @@ protobufjs@6.11.2, protobufjs@^6.10.0, protobufjs@^6.8.6: "@protobufjs/path" "^1.1.2" "@protobufjs/pool" "^1.1.0" "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" "@types/node" ">=13.7.0" - long "^4.0.0" + long "^5.0.0" proxy-addr@~2.0.5: version "2.0.7" @@ -1235,13 +1524,12 @@ require-directory@^2.1.1: resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -retry-request@^4.0.0: - version "4.2.2" - resolved "https://registry.npmjs.org/retry-request/-/retry-request-4.2.2.tgz#b7d82210b6d2651ed249ba3497f07ea602f1a903" - integrity sha512-xA93uxUD/rogV7BV59agW/JHPGXeREMWiZc9jhcwY4YdZ7QOtC7qbomYg0n4wyk2lJhggjvKvhNX8wln/Aldhg== +requizzle@^0.2.3: + version "0.2.4" + resolved "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz#319eb658b28c370f0c20f968fa8ceab98c13d27c" + integrity sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw== dependencies: - debug "^4.1.1" - extend "^3.0.2" + lodash "^4.17.21" retry-request@^5.0.0: version "5.0.2" @@ -1256,6 +1544,13 @@ retry@0.13.1: resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== +rimraf@^3.0.0: + version "3.0.2" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + safe-buffer@5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -1276,6 +1571,13 @@ semver@^5.6.0: resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@^7.1.2: + version "7.3.8" + resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + send@0.17.1: version "0.17.1" resolved "https://registry.npmjs.org/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -1310,6 +1612,11 @@ setprototypeof@1.1.1: resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -1350,11 +1657,28 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-json-comments@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + stubs@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" integrity sha1-6NK6H6nJBXAwPAMLaQD31fiavls= +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +taffydb@2.6.2: + version "2.6.2" + resolved "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" + integrity sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA== + teeny-request@^8.0.0: version "8.0.2" resolved "https://registry.npmjs.org/teeny-request/-/teeny-request-8.0.2.tgz#c06a75101cf782788ba8f9a2ed5f2ac84c1c4e15" @@ -1371,6 +1695,13 @@ text-decoding@^1.0.0: resolved "https://registry.npmjs.org/text-decoding/-/text-decoding-1.0.0.tgz#38a5692d23b5c2b12942d6e245599cb58b1bc52f" integrity sha512-/0TJD42KDnVwKmDK6jj3xP7E2MG7SHAOG4tyTgyUCRPdHwvkquYNLEQltmdMa3owq3TkddCVcTsoctJI8VQNKA== +tmp@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" + integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== + dependencies: + rimraf "^3.0.0" + toidentifier@1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" @@ -1386,6 +1717,13 @@ tslib@^2.1.0: resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -1394,6 +1732,21 @@ type-is@~1.6.17, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +uc.micro@^1.0.1, uc.micro@^1.0.5: + version "1.0.6" + resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" + integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== + +uglify-js@^3.7.7: + version "3.17.4" + resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" + integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== + +underscore@~1.13.2: + version "1.13.6" + resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" + integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A== + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -1409,7 +1762,7 @@ utils-merge@1.0.1: resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^8.0.0, uuid@^8.3.2: +uuid@^8.0.0: version "8.3.2" resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== @@ -1451,6 +1804,11 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -1465,6 +1823,11 @@ wrappy@1: resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +xmlcreate@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be" + integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -1485,7 +1848,7 @@ yargs-parser@^20.2.2: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs@^16.1.1: +yargs@^16.2.0: version "16.2.0" resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== diff --git a/packages/rules-unit-testing/test/impl/discovery.test.ts b/packages/rules-unit-testing/test/impl/discovery.test.ts index b3f3db86307..a2ac2be767b 100644 --- a/packages/rules-unit-testing/test/impl/discovery.test.ts +++ b/packages/rules-unit-testing/test/impl/discovery.test.ts @@ -31,19 +31,19 @@ describe('discoverEmulators()', () => { expect(emulators).to.deep.equal({ database: { - host: 'localhost', + host: '127.0.0.1', port: 9002 }, firestore: { - host: 'localhost', + host: '127.0.0.1', port: 9003 }, storage: { - host: 'localhost', + host: '127.0.0.1', port: 9199 }, hub: { - host: 'localhost', + host: '127.0.0.1', port: 4400 } }); diff --git a/yarn.lock b/yarn.lock index 669ab2be880..772ba8e27cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4782,6 +4782,11 @@ async-each@^1.0.1: resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== +async-lock@1.3.2: + version "1.3.2" + resolved "https://registry.npmjs.org/async-lock/-/async-lock-1.3.2.tgz#56668613f91c1c55432b4db73e65c9ced664e789" + integrity sha512-phnXdS3RP7PPcmP6NWWzWMU0sLTeyvtZCxBPpZdkYE3seGLKSQZs9FrmVO/qwypq98FUtWWUEYxziLkdGk5nnA== + async-settle@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" @@ -4796,6 +4801,13 @@ async@^2.1.2, async@^2.6.2: dependencies: lodash "^4.17.14" +async@^2.6.4: + version "2.6.4" + resolved "https://registry.npmjs.org/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" + integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== + dependencies: + lodash "^4.17.14" + async@^3.0.1, async@^3.1.0, async@^3.2.0: version "3.2.1" resolved "https://registry.npmjs.org/async/-/async-3.2.1.tgz#d3274ec66d107a47476a4c49136aacdb00665fc8" @@ -5864,17 +5876,6 @@ cli-boxes@^2.2.0, cli-boxes@^2.2.1: resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== -cli-color@^2.0.2: - version "2.0.3" - resolved "https://registry.npmjs.org/cli-color/-/cli-color-2.0.3.tgz#73769ba969080629670f3f2ef69a4bf4e7cc1879" - integrity sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ== - dependencies: - d "^1.0.1" - es5-ext "^0.10.61" - es6-iterator "^2.0.3" - memoizee "^0.4.15" - timers-ext "^0.1.7" - cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -6093,6 +6094,11 @@ colorette@^1.1.0: resolved "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== +colorette@^2.0.19: + version "2.0.19" + resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" + integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== + colors@1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" @@ -6588,7 +6594,7 @@ cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -7443,15 +7449,6 @@ es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@ es6-symbol "~3.1.3" next-tick "~1.0.0" -es5-ext@^0.10.61: - version "0.10.61" - resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz#311de37949ef86b6b0dcea894d1ffedb909d3269" - integrity sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA== - dependencies: - es6-iterator "^2.0.3" - es6-symbol "^3.1.3" - next-tick "^1.1.0" - es6-error@^4.0.1: version "4.1.1" resolved "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" @@ -7483,7 +7480,7 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -es6-symbol@^3.1.1, es6-symbol@^3.1.3, es6-symbol@~3.1.3: +es6-symbol@^3.1.1, es6-symbol@~3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== @@ -8337,41 +8334,31 @@ fined@^1.0.1: object.pick "^1.2.0" parse-filepath "^1.0.1" -firebase-frameworks@^0.4.2: - version "0.4.2" - resolved "https://registry.npmjs.org/firebase-frameworks/-/firebase-frameworks-0.4.2.tgz#f112f8afeec35b5532d8b9bbb2886f9cff68f61b" - integrity sha512-a3xNE3wPh8JWq2WOgWlSypVS9O/y/3/3Im9EV7bNBF44wFV2oOAyFdVgDk6it81+lBRv7ci8PttgQZohtsFeVA== - dependencies: - fs-extra "^10.1.0" - jsonc-parser "^3.0.0" - semver "^7.3.7" - tslib "^2.3.1" - -firebase-tools@11.2.2: - version "11.2.2" - resolved "https://registry.npmjs.org/firebase-tools/-/firebase-tools-11.2.2.tgz#21984429cb255d80fa8035e8b0c14701763579ee" - integrity sha512-s2jot8WDmw4BpReFUx5IUYtdNCykjkK/GtFGWhYoeV6Hc9Xtas53L4ixHfZRPhM68y/492oAsN3jNIDpXAjfTw== +firebase-tools@11.19.0: + version "11.19.0" + resolved "https://registry.npmjs.org/firebase-tools/-/firebase-tools-11.19.0.tgz#a12ddbad34f64567a4002c812d5d23b7545ed22a" + integrity sha512-J1gM10/KwWUIfR59PgkPnsDWAqyqQP9BDb6/3lOPMaYF9IMgV59lDpLaHRBt8V8NOvfbxhyFt66erRH6KsDPuw== dependencies: "@google-cloud/pubsub" "^3.0.1" abort-controller "^3.0.0" ajv "^6.12.6" archiver "^5.0.0" + async-lock "1.3.2" body-parser "^1.19.0" chokidar "^3.0.2" cjson "^0.3.1" - cli-color "^2.0.2" cli-table "0.3.11" + colorette "^2.0.19" commander "^4.0.1" configstore "^5.0.1" cors "^2.8.5" cross-env "^5.1.3" - cross-spawn "^7.0.1" + cross-spawn "^7.0.3" csv-parse "^5.0.4" exegesis "^4.1.0" exegesis-express "^4.0.0" express "^4.16.4" filesize "^6.1.0" - firebase-frameworks "^0.4.2" form-data "^4.0.0" fs-extra "^10.1.0" glob "^7.1.2" @@ -8390,7 +8377,7 @@ firebase-tools@11.2.2: node-fetch "^2.6.7" open "^6.3.0" ora "^5.4.1" - portfinder "^1.0.23" + portfinder "^1.0.32" progress "^2.0.3" proxy-agent "^5.0.0" request "^2.87.0" @@ -8399,6 +8386,7 @@ firebase-tools@11.2.2: semver "^5.7.1" stream-chain "^2.2.4" stream-json "^1.7.3" + strip-ansi "^6.0.1" superstatic "^8.0.0" tar "^6.1.11" tcp-port-used "^1.0.2" @@ -11069,11 +11057,6 @@ json5@^2.2.1: resolved "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== -jsonc-parser@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz#73b8f0e5c940b83d03476bc2e51a20ef0932615d" - integrity sha512-DRf0QjnNeCUds3xTjKlQQ3DpJD51GvDjJfnxUVWg6PZTo2otSm+slzNAxU/35hF8/oJIKoG9slq30JYOsF2azg== - jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -12181,7 +12164,7 @@ memfs@3.4.7: dependencies: fs-monkey "^1.0.3" -memoizee@0.4.X, memoizee@^0.4.15: +memoizee@0.4.X: version "0.4.15" resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz#e6f3d2da863f318d02225391829a6c5956555b72" integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== @@ -12556,6 +12539,13 @@ mkdirp@1.0.4, mkdirp@^1.0.3, mkdirp@^1.0.4, mkdirp@~1.0.4: dependencies: minimist "^1.2.5" +mkdirp@^0.5.6: + version "0.5.6" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + mocha-chai-jest-snapshot@1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/mocha-chai-jest-snapshot/-/mocha-chai-jest-snapshot-1.1.3.tgz#ac7b280961a9da08b529d0f8488e90a4cbe9ece8" @@ -14045,7 +14035,7 @@ plugin-error@^1.0.1: arr-union "^3.1.0" extend-shallow "^3.0.2" -portfinder@^1.0.23, portfinder@^1.0.28: +portfinder@^1.0.28: version "1.0.28" resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778" integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA== @@ -14054,6 +14044,15 @@ portfinder@^1.0.23, portfinder@^1.0.28: debug "^3.1.1" mkdirp "^0.5.5" +portfinder@^1.0.32: + version "1.0.32" + resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz#2fe1b9e58389712429dc2bea5beb2146146c7f81" + integrity sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg== + dependencies: + async "^2.6.4" + debug "^3.2.7" + mkdirp "^0.5.6" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" From a7622d49f8a69bcdfb95b89dd1609a5c495fd529 Mon Sep 17 00:00:00 2001 From: Mark Duckworth <1124037+MarkDuckworth@users.noreply.github.com> Date: Wed, 21 Dec 2022 15:29:29 -0700 Subject: [PATCH 5/7] Markduckworth/or queries 4274 (#6896) * Updated the canonical ID of flat conjunctions to match the canonical ID of old style implicit flat conjunctions. * Updated documentation of or() and and() to match the latest API docs in the Android implementation. --- .changeset/quick-radios-obey.md | 5 ++++ packages/firestore/src/core/filter.ts | 8 ++++++ packages/firestore/src/lite-api/query.ts | 26 ++++++++++--------- .../firestore/test/unit/core/filter.test.ts | 14 +++++++++- 4 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 .changeset/quick-radios-obey.md diff --git a/.changeset/quick-radios-obey.md b/.changeset/quick-radios-obey.md new file mode 100644 index 00000000000..83e452264a5 --- /dev/null +++ b/.changeset/quick-radios-obey.md @@ -0,0 +1,5 @@ +--- +"@firebase/firestore": patch +--- + +Update canonifyFilter to compute the canonization for flat conjunctions the same as implicit AND queries. diff --git a/packages/firestore/src/core/filter.ts b/packages/firestore/src/core/filter.ts index 4322c926658..16bb627f2dc 100644 --- a/packages/firestore/src/core/filter.ts +++ b/packages/firestore/src/core/filter.ts @@ -325,6 +325,14 @@ export function canonifyFilter(filter: Filter): string { filter.op.toString() + canonicalId(filter.value) ); + } else if (compositeFilterIsFlatConjunction(filter)) { + // Older SDK versions use an implicit AND operation between their filters. + // In the new SDK versions, the developer may use an explicit AND filter. + // To stay consistent with the old usages, we add a special case to ensure + // the canonical ID for these two are the same. For example: + // `col.whereEquals("a", 1).whereEquals("b", 2)` should have the same + // canonical ID as `col.where(and(equals("a",1), equals("b",2)))`. + return filter.filters.map(filter => canonifyFilter(filter)).join(','); } else { // filter instanceof CompositeFilter const canonicalIdsString = filter.filters diff --git a/packages/firestore/src/lite-api/query.ts b/packages/firestore/src/lite-api/query.ts index 2f1d7ecbf8f..0b3de2268d0 100644 --- a/packages/firestore/src/lite-api/query.ts +++ b/packages/firestore/src/lite-api/query.ts @@ -364,13 +364,14 @@ export type QueryFilterConstraint = | QueryCompositeFilterConstraint; /** - * Creates a {@link QueryCompositeFilterConstraint} that performs a logical OR - * of all the provided {@link QueryFilterConstraint}s. + * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of + * the given filter constraints. A disjunction filter includes a document if it + * satisfies any of the given filters. * - * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s - * for OR operation. These must be created with calls to {@link where}, - * {@link or}, or {@link and}. - * @returns The created {@link QueryCompositeFilterConstraint}. + * @param queryConstraints - Optional. The list of + * {@link QueryFilterConstraint}s to perform a disjunction for. These must be + * created with calls to {@link where}, {@link or}, or {@link and}. + * @returns The newly created {@link QueryCompositeFilterConstraint}. * @internal TODO remove this internal tag with OR Query support in the server */ export function or( @@ -388,13 +389,14 @@ export function or( } /** - * Creates a {@link QueryCompositeFilterConstraint} that performs a logical AND - * of all the provided {@link QueryFilterConstraint}s. + * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of + * the given filter constraints. A conjunction filter includes a document if it + * satisfies all of the given filters. * - * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s - * for AND operation. These must be created with calls to {@link where}, - * {@link or}, or {@link and}. - * @returns The created {@link QueryCompositeFilterConstraint}. + * @param queryConstraints - Optional. The list of + * {@link QueryFilterConstraint}s to perform a conjunction for. These must be + * created with calls to {@link where}, {@link or}, or {@link and}. + * @returns The newly created {@link QueryCompositeFilterConstraint}. * @internal TODO remove this internal tag with OR Query support in the server */ export function and( diff --git a/packages/firestore/test/unit/core/filter.test.ts b/packages/firestore/test/unit/core/filter.test.ts index 3011e3f1647..a8ea6277c9a 100644 --- a/packages/firestore/test/unit/core/filter.test.ts +++ b/packages/firestore/test/unit/core/filter.test.ts @@ -25,7 +25,9 @@ import { FieldFilter, Operator } from '../../../src/core/filter'; -import { andFilter, filter, orFilter } from '../../util/helpers'; +import { queryToTarget } from '../../../src/core/query'; +import { canonifyTarget } from '../../../src/core/target'; +import { andFilter, filter, orFilter, query } from '../../util/helpers'; describe('FieldFilter', () => { it('exposes field filter members', () => { @@ -93,4 +95,14 @@ describe('CompositeFilter', () => { expect(compositeFilterIsFlat(orFilter2)).false; expect(compositeFilterIsFlatConjunction(orFilter2)).false; }); + + it('computes canonical id of flat conjunctions', () => { + const target1 = query('col', a, b, c); + + const target2 = query('col', andFilter(a, b, c)); + + expect(canonifyTarget(queryToTarget(target1))).to.equal( + canonifyTarget(queryToTarget(target2)) + ); + }); }); From 06dc1364d7560f4c563e1ccc89af9cad4cd91df8 Mon Sep 17 00:00:00 2001 From: dwyfrequency Date: Thu, 22 Dec 2022 16:27:18 -0500 Subject: [PATCH 6/7] Add Env Override Global Variable `forceEnvironment` (#6901) * Add forceEnvironment and check value in isNode * Update API reports * Add tests for environment package * Update tests and remove console.log * Add changeset * Remove old changeset and update it with a new one * Update jsdoc * Move getGlobal into separate file to remove circular dep --- .changeset/young-hornets-rescue.md | 6 +++ common/api-review/util.api.md | 6 ++- packages/util/index.node.ts | 1 + packages/util/index.ts | 1 + packages/util/src/defaults.ts | 10 ++++- packages/util/src/environment.ts | 27 +++++-------- packages/util/src/global.ts | 34 ++++++++++++++++ packages/util/test/defaults.test.ts | 20 ++++----- packages/util/test/environments.test.ts | 54 +++++++++++++++++++++++++ 9 files changed, 127 insertions(+), 32 deletions(-) create mode 100644 .changeset/young-hornets-rescue.md create mode 100644 packages/util/src/global.ts create mode 100644 packages/util/test/environments.test.ts diff --git a/.changeset/young-hornets-rescue.md b/.changeset/young-hornets-rescue.md new file mode 100644 index 00000000000..b6aba80702c --- /dev/null +++ b/.changeset/young-hornets-rescue.md @@ -0,0 +1,6 @@ +--- +'@firebase/util': minor +'firebase': minor +--- + +Allow users to specify their environment as `node` or `browser` to override Firebase's runtime environment detection and force the SDK to act as if it were in the respective environment. diff --git a/common/api-review/util.api.md b/common/api-review/util.api.md index eacd4ef3aa8..be8703adf3f 100644 --- a/common/api-review/util.api.md +++ b/common/api-review/util.api.md @@ -193,6 +193,7 @@ export interface FirebaseDefaults { config?: Record; // (undocumented) emulatorHosts?: Record; + forceEnvironment?: 'browser' | 'node'; } // Warning: (ae-missing-release-tag) "FirebaseError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -221,11 +222,12 @@ export const getDefaultEmulatorHost: (productName: string) => string | undefined // @public export const getDefaultEmulatorHostnameAndPort: (productName: string) => [hostname: string, port: number] | undefined; +// @public +export const getDefaults: () => FirebaseDefaults | undefined; + // @public export const getExperimentalSetting: (name: T) => FirebaseDefaults[`_${T}`]; -// Warning: (ae-missing-release-tag) "getGlobal" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export function getGlobal(): typeof globalThis; diff --git a/packages/util/index.node.ts b/packages/util/index.node.ts index d63584284ac..9c3b54b1c86 100644 --- a/packages/util/index.node.ts +++ b/packages/util/index.node.ts @@ -42,3 +42,4 @@ export * from './src/uuid'; export * from './src/exponential_backoff'; export * from './src/formatters'; export * from './src/compat'; +export * from './src/global'; diff --git a/packages/util/index.ts b/packages/util/index.ts index c529580b24e..38b944cd9b5 100644 --- a/packages/util/index.ts +++ b/packages/util/index.ts @@ -37,3 +37,4 @@ export * from './src/uuid'; export * from './src/exponential_backoff'; export * from './src/formatters'; export * from './src/compat'; +export * from './src/global'; diff --git a/packages/util/src/defaults.ts b/packages/util/src/defaults.ts index ceb73c683a8..2c972604663 100644 --- a/packages/util/src/defaults.ts +++ b/packages/util/src/defaults.ts @@ -16,7 +16,7 @@ */ import { base64Decode } from './crypt'; -import { getGlobal } from './environment'; +import { getGlobal } from './global'; /** * Keys for experimental properties on the `FirebaseDefaults` object. @@ -39,6 +39,11 @@ export interface FirebaseDefaults { emulatorHosts?: Record; _authTokenSyncURL?: string; _authIdTokenMaxAge?: number; + /** + * Override Firebase's runtime environment detection and + * force the SDK to act as if it were in the specified environment. + */ + forceEnvironment?: 'browser' | 'node'; [key: string]: unknown; } @@ -90,8 +95,9 @@ const getDefaultsFromCookie = (): FirebaseDefaults | undefined => { * (1) if such an object exists as a property of `globalThis` * (2) if such an object was provided on a shell environment variable * (3) if such an object exists in a cookie + * @public */ -const getDefaults = (): FirebaseDefaults | undefined => { +export const getDefaults = (): FirebaseDefaults | undefined => { try { return ( getDefaultsFromGlobal() || diff --git a/packages/util/src/environment.ts b/packages/util/src/environment.ts index 5c9be0d26c0..04bbd92165d 100644 --- a/packages/util/src/environment.ts +++ b/packages/util/src/environment.ts @@ -16,6 +16,7 @@ */ import { CONSTANTS } from './constants'; +import { getDefaults } from './defaults'; /** * Returns navigator.userAgent string or '' if it's not defined. @@ -52,10 +53,17 @@ export function isMobileCordova(): boolean { /** * Detect Node.js. * - * @return true if Node.js environment is detected. + * @return true if Node.js environment is detected or specified. */ // Node detection logic from: https://github.com/iliakan/detect-node/ export function isNode(): boolean { + const forceEnvironment = getDefaults()?.forceEnvironment; + if (forceEnvironment === 'node') { + return true; + } else if (forceEnvironment === 'browser') { + return false; + } + try { return ( Object.prototype.toString.call(global.process) === '[object process]' @@ -193,20 +201,3 @@ export function areCookiesEnabled(): boolean { } return true; } - -/** - * Polyfill for `globalThis` object. - * @returns the `globalThis` object for the given environment. - */ -export function getGlobal(): typeof globalThis { - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('Unable to locate global object.'); -} diff --git a/packages/util/src/global.ts b/packages/util/src/global.ts new file mode 100644 index 00000000000..88a31efbd19 --- /dev/null +++ b/packages/util/src/global.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyfill for `globalThis` object. + * @returns the `globalThis` object for the given environment. + * @public + */ +export function getGlobal(): typeof globalThis { + if (typeof self !== 'undefined') { + return self; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof global !== 'undefined') { + return global; + } + throw new Error('Unable to locate global object.'); +} diff --git a/packages/util/test/defaults.test.ts b/packages/util/test/defaults.test.ts index 05fcf883482..a5780096b30 100644 --- a/packages/util/test/defaults.test.ts +++ b/packages/util/test/defaults.test.ts @@ -21,13 +21,13 @@ import { getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort } from '../src/defaults'; -import * as environment from '../src/environment'; +import * as global from '../src/global'; use(sinonChai); describe('getDefaultEmulatorHost', () => { after(() => { - delete environment.getGlobal().__FIREBASE_DEFAULTS__; + delete global.getGlobal().__FIREBASE_DEFAULTS__; }); context('with no config', () => { @@ -68,7 +68,7 @@ describe('getDefaultEmulatorHost', () => { context('with no config and something unexpected throws', () => { let consoleInfoStub: SinonStub; before(() => { - stub(environment, 'getGlobal').throws(new Error('getGlobal threw!')); + stub(global, 'getGlobal').throws(new Error('getGlobal threw!')); consoleInfoStub = stub(console, 'info'); }); after(() => { @@ -83,7 +83,7 @@ describe('getDefaultEmulatorHost', () => { context('with global config not listing the emulator', () => { before(() => { - environment.getGlobal().__FIREBASE_DEFAULTS__ = { + global.getGlobal().__FIREBASE_DEFAULTS__ = { emulatorHosts: { /* no firestore */ database: '127.0.0.1:8080' @@ -98,7 +98,7 @@ describe('getDefaultEmulatorHost', () => { context('with IPv4 hostname in global config', () => { before(() => { - environment.getGlobal().__FIREBASE_DEFAULTS__ = { + global.getGlobal().__FIREBASE_DEFAULTS__ = { emulatorHosts: { firestore: '127.0.0.1:8080' } @@ -112,7 +112,7 @@ describe('getDefaultEmulatorHost', () => { context('with quoted IPv6 hostname in global config', () => { before(() => { - environment.getGlobal().__FIREBASE_DEFAULTS__ = { + global.getGlobal().__FIREBASE_DEFAULTS__ = { emulatorHosts: { firestore: '[::1]:8080' } @@ -127,7 +127,7 @@ describe('getDefaultEmulatorHost', () => { describe('getDefaultEmulatorHostnameAndPort', () => { after(() => { - delete environment.getGlobal().__FIREBASE_DEFAULTS__; + delete global.getGlobal().__FIREBASE_DEFAULTS__; }); context('with no config', () => { @@ -138,7 +138,7 @@ describe('getDefaultEmulatorHostnameAndPort', () => { context('with global config not listing the emulator', () => { before(() => { - environment.getGlobal().__FIREBASE_DEFAULTS__ = { + global.getGlobal().__FIREBASE_DEFAULTS__ = { emulatorHosts: { /* no firestore */ database: '127.0.0.1:8080' @@ -153,7 +153,7 @@ describe('getDefaultEmulatorHostnameAndPort', () => { context('with IPv4 hostname in global config', () => { before(() => { - environment.getGlobal().__FIREBASE_DEFAULTS__ = { + global.getGlobal().__FIREBASE_DEFAULTS__ = { emulatorHosts: { firestore: '127.0.0.1:8080' } @@ -170,7 +170,7 @@ describe('getDefaultEmulatorHostnameAndPort', () => { context('with quoted IPv6 hostname in global config', () => { before(() => { - environment.getGlobal().__FIREBASE_DEFAULTS__ = { + global.getGlobal().__FIREBASE_DEFAULTS__ = { emulatorHosts: { firestore: '[::1]:8080' } diff --git a/packages/util/test/environments.test.ts b/packages/util/test/environments.test.ts new file mode 100644 index 00000000000..0abc12ea633 --- /dev/null +++ b/packages/util/test/environments.test.ts @@ -0,0 +1,54 @@ +/** + * @license + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { expect } from 'chai'; +import { isNode } from '../src/environment'; +import { SinonStub, stub, restore } from 'sinon'; +import * as defaults from '../src/defaults'; + +const firebaseDefaults: defaults.FirebaseDefaults = { + _authTokenSyncURL: 'string', + _authIdTokenMaxAge: 200, + forceEnvironment: 'node' +}; + +describe('isNode()', () => { + let getDefaultsFromGlobalStub: SinonStub; + + beforeEach(async () => { + getDefaultsFromGlobalStub = stub(defaults, 'getDefaults'); + }); + + afterEach(async () => { + restore(); + }); + + it('returns true if forceEnvironment lists `node`', () => { + getDefaultsFromGlobalStub.returns(firebaseDefaults); + + expect(isNode()).to.be.true; + }); + + it('returns false if forceEnvironment lists `browser`', () => { + getDefaultsFromGlobalStub.returns({ + ...firebaseDefaults, + forceEnvironment: 'browser' + }); + + expect(isNode()).to.be.false; + }); +}); From 1455bfa4393383ab461de35ccbc2b171f92169df Mon Sep 17 00:00:00 2001 From: wu-hui <53845758+wu-hui@users.noreply.github.com> Date: Tue, 3 Jan 2023 16:28:37 -0500 Subject: [PATCH 7/7] Fix overlay patch mutation bug (#6893) * Fix overlay patch mutation bug * linting * More fixes * Create stupid-swans-fix.md * Feedback --- .changeset/stupid-swans-fix.md | 5 + .../src/local/local_documents_view.ts | 4 + .../firestore/src/local/overlayed_document.ts | 6 +- .../firestore/src/model/mutation_batch.ts | 1 + .../test/unit/local/counting_query_engine.ts | 155 ++++++------------ .../test/unit/local/local_store.test.ts | 110 ++++++++----- .../unit/local/local_store_indexeddb.test.ts | 27 ++- 7 files changed, 156 insertions(+), 152 deletions(-) create mode 100644 .changeset/stupid-swans-fix.md diff --git a/.changeset/stupid-swans-fix.md b/.changeset/stupid-swans-fix.md new file mode 100644 index 00000000000..312d8af3119 --- /dev/null +++ b/.changeset/stupid-swans-fix.md @@ -0,0 +1,5 @@ +--- +"@firebase/firestore": patch +--- + +Fix an issue that stops some performance optimization being applied. diff --git a/packages/firestore/src/local/local_documents_view.ts b/packages/firestore/src/local/local_documents_view.ts index e5d50c18e25..2572646655f 100644 --- a/packages/firestore/src/local/local_documents_view.ts +++ b/packages/firestore/src/local/local_documents_view.ts @@ -242,6 +242,10 @@ export class LocalDocumentsView { overlay.mutation.getFieldMask(), Timestamp.now() ); + } else { + // no overlay exists + // Using EMPTY to indicate there is no overlay for the document. + mutatedFields.set(doc.key, FieldMask.empty()); } }); diff --git a/packages/firestore/src/local/overlayed_document.ts b/packages/firestore/src/local/overlayed_document.ts index e50e6a9132d..bc7ab3b5f3a 100644 --- a/packages/firestore/src/local/overlayed_document.ts +++ b/packages/firestore/src/local/overlayed_document.ts @@ -27,8 +27,10 @@ export class OverlayedDocument { readonly overlayedDocument: Document, /** - * The fields that are locally mutated by patch mutations. If the overlayed - * document is from set or delete mutations, this returns null. + * The fields that are locally mutated by patch mutations. + * + * If the overlayed document is from set or delete mutations, this is `null`. + * If there is no overlay (mutation) for the document, this is an empty `FieldMask`. */ readonly mutatedFields: FieldMask | null ) {} diff --git a/packages/firestore/src/model/mutation_batch.ts b/packages/firestore/src/model/mutation_batch.ts index 2e7f367639e..56d5f4d2cd3 100644 --- a/packages/firestore/src/model/mutation_batch.ts +++ b/packages/firestore/src/model/mutation_batch.ts @@ -166,6 +166,7 @@ export class MutationBatch { if (overlay !== null) { overlays.set(m.key, overlay); } + if (!mutableDocument.isValidDocument()) { mutableDocument.convertToNoDocument(SnapshotVersion.min()); } diff --git a/packages/firestore/test/unit/local/counting_query_engine.ts b/packages/firestore/test/unit/local/counting_query_engine.ts index a6aaf7493aa..a8a89a590b6 100644 --- a/packages/firestore/test/unit/local/counting_query_engine.ts +++ b/packages/firestore/test/unit/local/counting_query_engine.ts @@ -20,19 +20,12 @@ import { SnapshotVersion } from '../../../src/core/snapshot_version'; import { DocumentOverlayCache } from '../../../src/local/document_overlay_cache'; import { IndexManager } from '../../../src/local/index_manager'; import { LocalDocumentsView } from '../../../src/local/local_documents_view'; -import { MutationQueue } from '../../../src/local/mutation_queue'; import { PersistencePromise } from '../../../src/local/persistence_promise'; import { PersistenceTransaction } from '../../../src/local/persistence_transaction'; import { QueryEngine } from '../../../src/local/query_engine'; import { RemoteDocumentCache } from '../../../src/local/remote_document_cache'; -import { - DocumentKeySet, - DocumentMap, - OverlayMap -} from '../../../src/model/collections'; -import { DocumentKey } from '../../../src/model/document_key'; -import { Overlay } from '../../../src/model/overlay'; -import { ResourcePath } from '../../../src/model/path'; +import { DocumentKeySet, DocumentMap } from '../../../src/model/collections'; +import { MutationType } from '../../../src/model/mutation'; /** * A test-only query engine that forwards all API calls and exposes the number @@ -40,23 +33,23 @@ import { ResourcePath } from '../../../src/model/path'; */ export class CountingQueryEngine extends QueryEngine { /** - * The number of mutations returned by the MutationQueue's - * `getAllMutationBatchesAffectingQuery()` API (since the last call to + * The number of overlays returned by the DocumentOverlayCache's + * `getOverlaysByCollection(Group)` API (since the last call to * `resetCounts()`) */ - mutationsReadByCollection = 0; + overlaysReadByCollection = 0; /** - * The number of mutations returned by the MutationQueue's - * `getAllMutationBatchesAffectingDocumentKey()` and - * `getAllMutationBatchesAffectingDocumentKeys()` APIs (since the last call - * to `resetCounts()`) + * The number of overlays returned by the DocumentOverlayCache's + * `getOverlay(s)` APIs (since the last call to `resetCounts()`) */ - mutationsReadByKey = 0; + overlaysReadByKey = 0; + + overlayTypes: { [k: string]: MutationType } = {}; /** * The number of documents returned by the RemoteDocumentCache's - * `getAll()` API (since the last call to `resetCounts()`) + * `getAll()` API (since the last call to `resetCounts()`). */ documentsReadByCollection = 0; @@ -66,25 +59,12 @@ export class CountingQueryEngine extends QueryEngine { */ documentsReadByKey = 0; - /** - * The number of documents returned by the OverlayCache's `getOverlays()` - * API (since the last call to `resetCounts()`) - */ - overlaysReadByCollection = 0; - - /** - * The number of documents returned by the OverlayCache's `getOverlay()` - * APIs (since the last call to `resetCounts()`) - */ - overlaysReadByKey = 0; - resetCounts(): void { - this.mutationsReadByCollection = 0; - this.mutationsReadByKey = 0; - this.documentsReadByCollection = 0; - this.documentsReadByKey = 0; this.overlaysReadByCollection = 0; this.overlaysReadByKey = 0; + this.overlayTypes = {}; + this.documentsReadByCollection = 0; + this.documentsReadByKey = 0; } getDocumentsMatchingQuery( @@ -107,8 +87,8 @@ export class CountingQueryEngine extends QueryEngine { ): void { const view = new LocalDocumentsView( this.wrapRemoteDocumentCache(localDocuments.remoteDocumentCache), - this.wrapMutationQueue(localDocuments.mutationQueue), - this.wrapDocumentOverlayCache(localDocuments.documentOverlayCache), + localDocuments.mutationQueue, + this.wrapOverlayCache(localDocuments.documentOverlayCache), localDocuments.indexManager ); return super.initialize(view, indexManager); @@ -168,88 +148,48 @@ export class CountingQueryEngine extends QueryEngine { }; } - private wrapMutationQueue(subject: MutationQueue): MutationQueue { + private wrapOverlayCache( + subject: DocumentOverlayCache + ): DocumentOverlayCache { return { - addMutationBatch: subject.addMutationBatch, - checkEmpty: subject.checkEmpty, - getAllMutationBatches: transaction => { - return subject.getAllMutationBatches(transaction).next(result => { - this.mutationsReadByKey += result.length; + getOverlay: (transaction, key) => { + return subject.getOverlay(transaction, key).next(result => { + this.overlaysReadByKey += 1; + if (!!result) { + this.overlayTypes[key.toString()] = result.mutation.type; + } return result; }); }, - getAllMutationBatchesAffectingDocumentKey: (transaction, documentKey) => { - return subject - .getAllMutationBatchesAffectingDocumentKey(transaction, documentKey) - .next(result => { - this.mutationsReadByKey += result.length; - return result; - }); - }, - getAllMutationBatchesAffectingDocumentKeys: ( - transaction, - documentKeys - ) => { - return subject - .getAllMutationBatchesAffectingDocumentKeys(transaction, documentKeys) - .next(result => { - this.mutationsReadByKey += result.length; - return result; - }); - }, - getAllMutationBatchesAffectingQuery: (transaction, query) => { - return subject - .getAllMutationBatchesAffectingQuery(transaction, query) - .next(result => { - this.mutationsReadByCollection += result.length; - return result; + + getOverlays: (transaction, keys) => { + return subject.getOverlays(transaction, keys).next(result => { + this.overlaysReadByKey += keys.length; + result.forEach((key, overlay) => { + this.overlayTypes[key.toString()] = overlay.mutation.type; }); + return result; + }); }, - getHighestUnacknowledgedBatchId: subject.getHighestUnacknowledgedBatchId, - getNextMutationBatchAfterBatchId: - subject.getNextMutationBatchAfterBatchId, - lookupMutationBatch: subject.lookupMutationBatch, - performConsistencyCheck: subject.performConsistencyCheck, - removeMutationBatch: subject.removeMutationBatch - }; - } - private wrapDocumentOverlayCache( - subject: DocumentOverlayCache - ): DocumentOverlayCache { - return { - getOverlay: ( - transaction: PersistenceTransaction, - key: DocumentKey - ): PersistencePromise => { - this.overlaysReadByKey++; - return subject.getOverlay(transaction, key); - }, - getOverlays: ( - transaction: PersistenceTransaction, - keys: DocumentKey[] - ): PersistencePromise => { - this.overlaysReadByKey += keys.length; - return subject.getOverlays(transaction, keys); - }, - getOverlaysForCollection: ( - transaction: PersistenceTransaction, - collection: ResourcePath, - sinceBatchId: number - ): PersistencePromise => { + getOverlaysForCollection: (transaction, collection, sinceBatchId) => { return subject .getOverlaysForCollection(transaction, collection, sinceBatchId) .next(result => { this.overlaysReadByCollection += result.size(); + result.forEach((key, overlay) => { + this.overlayTypes[key.toString()] = overlay.mutation.type; + }); return result; }); }, + getOverlaysForCollectionGroup: ( transaction: PersistenceTransaction, collectionGroup: string, sinceBatchId: number, count: number - ): PersistencePromise => { + ) => { return subject .getOverlaysForCollectionGroup( transaction, @@ -259,11 +199,24 @@ export class CountingQueryEngine extends QueryEngine { ) .next(result => { this.overlaysReadByCollection += result.size(); + result.forEach((key, overlay) => { + this.overlayTypes[key.toString()] = overlay.mutation.type; + }); return result; }); }, - removeOverlaysForBatchId: subject.removeOverlaysForBatchId, - saveOverlays: subject.saveOverlays + + saveOverlays: (transaction, largestBatchId, overlays) => { + return subject.saveOverlays(transaction, largestBatchId, overlays); + }, + + removeOverlaysForBatchId: (transaction, documentKeys, batchId) => { + return subject.removeOverlaysForBatchId( + transaction, + documentKeys, + batchId + ); + } }; } } diff --git a/packages/firestore/test/unit/local/local_store.test.ts b/packages/firestore/test/unit/local/local_store.test.ts index a7b4e519fd7..c25d337dc13 100644 --- a/packages/firestore/test/unit/local/local_store.test.ts +++ b/packages/firestore/test/unit/local/local_store.test.ts @@ -64,6 +64,7 @@ import { Document } from '../../../src/model/document'; import { Mutation, MutationResult, + MutationType, Precondition } from '../../../src/model/mutation'; import { @@ -333,22 +334,29 @@ class LocalStoreTester { * document key lookups. */ toHaveRead(expectedCount: { - mutationsByCollection?: number; - mutationsByKey?: number; + overlaysByCollection?: number; + overlaysByKey?: number; documentsByCollection?: number; documentsByKey?: number; + overlayTypes?: { [k: string]: MutationType }; }): LocalStoreTester { this.promiseChain = this.promiseChain.then(() => { - if (expectedCount.mutationsByCollection !== undefined) { - expect(this.queryEngine.mutationsReadByCollection).to.be.eq( - expectedCount.mutationsByCollection, - 'Mutations read (by collection)' + if (expectedCount.overlaysByCollection !== undefined) { + expect(this.queryEngine.overlaysReadByCollection).to.be.eq( + expectedCount.overlaysByCollection, + 'Overlays read (by collection)' ); } - if (expectedCount.mutationsByKey !== undefined) { - expect(this.queryEngine.mutationsReadByKey).to.be.eq( - expectedCount.mutationsByKey, - 'Mutations read (by key)' + if (expectedCount.overlaysByKey !== undefined) { + expect(this.queryEngine.overlaysReadByKey).to.be.eq( + expectedCount.overlaysByKey, + 'Overlays read (by key)' + ); + } + if (expectedCount.overlayTypes !== undefined) { + expect(this.queryEngine.overlayTypes).to.deep.equal( + expectedCount.overlayTypes, + 'Overlay types read' ); } if (expectedCount.documentsByCollection !== undefined) { @@ -1213,40 +1221,40 @@ function genericLocalStoreTests( const firstQuery = query('foo'); const secondQuery = query('foo', filter('matches', '==', true)); - return ( - expectLocalStore() - .afterAllocatingQuery(firstQuery) - .toReturnTargetId(2) - .after( - docAddedRemoteEvent( - [ - doc('foo/bar', 10, { matches: true }), - doc('foo/baz', 20, { matches: true }) - ], - [2] - ) - ) - .toReturnChanged( - doc('foo/bar', 10, { matches: true }), - doc('foo/baz', 20, { matches: true }) - ) - .after(setMutation('foo/bonk', { matches: true })) - .toReturnChanged( - doc('foo/bonk', 0, { matches: true }).setHasLocalMutations() - ) - .afterAllocatingQuery(secondQuery) - .toReturnTargetId(4) - .afterExecutingQuery(secondQuery) - .toReturnChanged( - doc('foo/bar', 10, { matches: true }), - doc('foo/baz', 20, { matches: true }), - doc('foo/bonk', 0, { matches: true }).setHasLocalMutations() + return expectLocalStore() + .afterAllocatingQuery(firstQuery) + .toReturnTargetId(2) + .after( + docAddedRemoteEvent( + [ + doc('foo/bar', 10, { matches: true }), + doc('foo/baz', 20, { matches: true }) + ], + [2] ) - // TODO(overlays): implement overlaysReadByKey and overlaysReadByCollection - // No mutations are read because only overlay is needed. - .toHaveRead({ documentsByCollection: 2, mutationsByCollection: 0 }) - .finish() - ); + ) + .toReturnChanged( + doc('foo/bar', 10, { matches: true }), + doc('foo/baz', 20, { matches: true }) + ) + .after(setMutation('foo/bonk', { matches: true })) + .toReturnChanged( + doc('foo/bonk', 0, { matches: true }).setHasLocalMutations() + ) + .afterAllocatingQuery(secondQuery) + .toReturnTargetId(4) + .afterExecutingQuery(secondQuery) + .toReturnChanged( + doc('foo/bar', 10, { matches: true }), + doc('foo/baz', 20, { matches: true }), + doc('foo/bonk', 0, { matches: true }).setHasLocalMutations() + ) + .toHaveRead({ + documentsByCollection: 2, + overlaysByCollection: 1, + overlayTypes: { [key('foo/bonk').toString()]: MutationType.Set } + }) + .finish(); }); // eslint-disable-next-line no-restricted-properties @@ -1997,6 +2005,22 @@ function genericLocalStoreTests( .finish(); }); + it('update on remote doc leads to update overlay', () => { + expect(new Map([['a', 1]])).to.deep.equal(new Map([['a', 0]])); + return expectLocalStore() + .afterAllocatingQuery(query('foo')) + .afterRemoteEvent(docUpdateRemoteEvent(doc('foo/baz', 10, { a: 1 }), [2])) + .afterRemoteEvent(docUpdateRemoteEvent(doc('foo/bar', 20, {}), [2])) + .afterMutations([patchMutation('foo/baz', { b: 2 })]) + .afterExecutingQuery(query('foo')) + .toHaveRead({ + documentsByCollection: 2, + overlaysByCollection: 1, + overlayTypes: { [key('foo/baz').toString()]: MutationType.Patch } + }) + .finish(); + }); + it('handles document creation time', () => { return ( expectLocalStore() diff --git a/packages/firestore/test/unit/local/local_store_indexeddb.test.ts b/packages/firestore/test/unit/local/local_store_indexeddb.test.ts index e84128a52cc..f10fa13c1d7 100644 --- a/packages/firestore/test/unit/local/local_store_indexeddb.test.ts +++ b/packages/firestore/test/unit/local/local_store_indexeddb.test.ts @@ -46,7 +46,7 @@ import { IndexKind, IndexOffset } from '../../../src/model/field_index'; -import { Mutation } from '../../../src/model/mutation'; +import { Mutation, MutationType } from '../../../src/model/mutation'; import { MutationBatch } from '../../../src/model/mutation_batch'; import { RemoteEvent } from '../../../src/remote/remote_event'; import { @@ -156,7 +156,11 @@ class AsyncLocalStoreTester { ); } - assertOverlaysRead(byKey: number, byCollection: number): void { + assertOverlaysRead( + byKey: number, + byCollection: number, + overlayTypes: { [k: string]: MutationType } + ): void { expect(this.queryEngine.overlaysReadByCollection).to.equal( byCollection, 'Overlays read (by collection)' @@ -165,6 +169,10 @@ class AsyncLocalStoreTester { byKey, 'Overlays read (by key)' ); + expect(this.queryEngine.overlayTypes).to.deep.equal( + overlayTypes, + 'Overlay types read' + ); } assertQueryReturned(...keys: string[]): void { @@ -354,7 +362,10 @@ describe('LocalStore w/ IndexedDB Persistence (Non generic)', () => { const queryMatches = query('coll', filter('matches', '==', true)); await test.executeQuery(queryMatches); - test.assertOverlaysRead(1, 1); + test.assertOverlaysRead(1, 1, { + [key('coll/a').toString()]: MutationType.Set, + [key('coll/b').toString()]: MutationType.Set + }); test.assertQueryReturned('coll/a', 'coll/b'); }); @@ -390,7 +401,9 @@ describe('LocalStore w/ IndexedDB Persistence (Non generic)', () => { // The query engine first reads the documents by key and then re-runs the query without limit. await test.executeQuery(queryCount); test.assertRemoteDocumentsRead(5, 0); - test.assertOverlaysRead(5, 1); + test.assertOverlaysRead(5, 1, { + [key('coll/b').toString()]: MutationType.Delete + }); test.assertQueryReturned('coll/a', 'coll/c'); }); @@ -423,7 +436,7 @@ describe('LocalStore w/ IndexedDB Persistence (Non generic)', () => { await test.executeQuery(queryCount); test.assertRemoteDocumentsRead(2, 0); - test.assertOverlaysRead(2, 0); + test.assertOverlaysRead(2, 0, {}); test.assertQueryReturned('coll/a', 'coll/c'); }); @@ -441,7 +454,9 @@ describe('LocalStore w/ IndexedDB Persistence (Non generic)', () => { const queryTime = query('coll', orderBy('time', 'asc')); await test.executeQuery(queryTime); - test.assertOverlaysRead(1, 0); + test.assertOverlaysRead(1, 0, { + [key('coll/a').toString()]: MutationType.Set + }); test.assertQueryReturned('coll/a'); }); });