diff --git a/.changeset/cold-chairs-fold.md b/.changeset/cold-chairs-fold.md deleted file mode 100644 index 0fb82429a87..00000000000 --- a/.changeset/cold-chairs-fold.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"firebase": minor -"@firebase/app": patch -"@firebase/data-connect": minor ---- - -Included Data Connect product. diff --git a/.changeset/nervous-timers-call.md b/.changeset/nervous-timers-call.md new file mode 100644 index 00000000000..49c504144d1 --- /dev/null +++ b/.changeset/nervous-timers-call.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Update to new base URL in documentation diff --git a/.changeset/sharp-dingos-admire.md b/.changeset/sharp-dingos-admire.md deleted file mode 100644 index aeb1b082ad5..00000000000 --- a/.changeset/sharp-dingos-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@firebase/firestore": patch ---- - -Re-enable useFetchStreams with the latest WebChannel implementation. This reduces the memory usage of WebChannel. diff --git a/.changeset/six-toys-chew.md b/.changeset/six-toys-chew.md new file mode 100644 index 00000000000..b15e6046724 --- /dev/null +++ b/.changeset/six-toys-chew.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Remove indentation in VertexAI API Not Enabled error diff --git a/.changeset/small-geckos-mix.md b/.changeset/small-geckos-mix.md deleted file mode 100644 index 33ddb4a7116..00000000000 --- a/.changeset/small-geckos-mix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@firebase/firestore': patch ---- - -Refactor Firestore client instantiation. This prepares for future features that require client to restart. diff --git a/.changeset/tall-peas-tell.md b/.changeset/tall-peas-tell.md new file mode 100644 index 00000000000..59af1cb8ab8 --- /dev/null +++ b/.changeset/tall-peas-tell.md @@ -0,0 +1,5 @@ +--- +'@firebase/vertexai': patch +--- + +Send App Check dummy token in header if there is an App Check getToken error. diff --git a/.changeset/tame-paws-nail.md b/.changeset/tame-paws-nail.md new file mode 100644 index 00000000000..0a2ad08c756 --- /dev/null +++ b/.changeset/tame-paws-nail.md @@ -0,0 +1,53 @@ +--- +'@firebase/analytics': patch +'@firebase/analytics-compat': patch +'@firebase/analytics-interop-types': patch +'@firebase/analytics-types': patch +'@firebase/app': patch +'@firebase/app-check': patch +'@firebase/app-check-compat': patch +'@firebase/app-check-interop-types': patch +'@firebase/app-check-types': patch +'@firebase/app-compat': patch +'@firebase/app-types': patch +'@firebase/auth': patch +'@firebase/auth-compat': patch +'@firebase/auth-interop-types': patch +'@firebase/auth-types': patch +'@firebase/component': patch +'@firebase/data-connect': patch +'@firebase/database': patch +'@firebase/database-compat': patch +'@firebase/database-types': patch +'firebase': patch +'@firebase/firestore': patch +'@firebase/firestore-compat': patch +'@firebase/firestore-types': patch +'@firebase/functions': patch +'@firebase/functions-compat': patch +'@firebase/functions-types': patch +'@firebase/installations': patch +'@firebase/installations-compat': patch +'@firebase/installations-types': patch +'@firebase/logger': patch +'@firebase/messaging': patch +'@firebase/messaging-compat': patch +'@firebase/messaging-interop-types': patch +'@firebase/performance': patch +'@firebase/performance-compat': patch +'@firebase/performance-types': patch +'@firebase/remote-config': patch +'@firebase/remote-config-compat': patch +'@firebase/remote-config-types': patch +'@firebase/rules-unit-testing': patch +'@firebase/storage': patch +'@firebase/storage-compat': patch +'@firebase/storage-types': patch +'@firebase/template': patch +'@firebase/template-types': patch +'@firebase/util': patch +'@firebase/vertexai': patch +'@firebase/webchannel-wrapper': patch +--- + +Upgrade to TypeScript 5.5.4 diff --git a/.changeset/tasty-boxes-brake.md b/.changeset/tasty-boxes-brake.md new file mode 100644 index 00000000000..beb8b626f36 --- /dev/null +++ b/.changeset/tasty-boxes-brake.md @@ -0,0 +1,5 @@ +--- +"@firebase/firestore": patch +--- + +Prevent a possible condition of slow snapshots, caused by a rapid series of document update(s) followed by a delete. diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 01949c5e354..a90241dea57 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -15,6 +15,9 @@ packages/database @maneesht @aashishpatil-g @firebase/jssdk-global-approvers packages/database-compat @maneesht @aashishpatil-g @firebase/jssdk-global-approvers packages/database-types @maneesht @aashishpatil-g @firebase/jssdk-global-approvers +# Data Connect Code +packages/data-connect @maneesht @aashishpatil-g @firebase/jssdk-global-approvers + # Firestore Code packages/firestore @firebase/firestore-js-team @firebase/jssdk-global-approvers packages/firestore-compat @firebase/firestore-js-team @firebase/jssdk-global-approvers diff --git a/.github/ISSUE_TEMPLATE/bug_report_v2.yaml b/.github/ISSUE_TEMPLATE/bug_report_v2.yaml index 0d68981c80b..24cc0efb53e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_v2.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report_v2.yaml @@ -63,6 +63,7 @@ body: - Auth - Component - Database + - DataConnect - Firestore - Functions - Installations diff --git a/.github/workflows/canary-deploy.yml b/.github/workflows/canary-deploy.yml index cd720955640..b2139d4df0c 100644 --- a/.github/workflows/canary-deploy.yml +++ b/.github/workflows/canary-deploy.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Yarn install run: yarn - name: Deploy canary @@ -71,7 +71,7 @@ jobs: NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}} NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} - NPM_TOKEN_VERTEXAI_PREVIEW: ${{secrets.NPM_TOKEN_VERTEXAI_PREVIEW}} + NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/check-changeset.yml b/.github/workflows/check-changeset.yml index dfed38487c3..fa93c2c6cc9 100644 --- a/.github/workflows/check-changeset.yml +++ b/.github/workflows/check-changeset.yml @@ -37,7 +37,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Yarn install run: yarn - name: Run changeset script diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index ef4c38ce951..34ad997fbc4 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -30,7 +30,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Yarn install run: yarn - name: Run doc generation diff --git a/.github/workflows/check-pkg-paths.yml b/.github/workflows/check-pkg-paths.yml index 16cb2b8fc3f..3d6fb1099e3 100644 --- a/.github/workflows/check-pkg-paths.yml +++ b/.github/workflows/check-pkg-paths.yml @@ -30,7 +30,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Yarn install run: yarn - name: Yarn build diff --git a/.github/workflows/deploy-config.yml b/.github/workflows/deploy-config.yml index e3c536aaca0..f01d8dcc9b3 100644 --- a/.github/workflows/deploy-config.yml +++ b/.github/workflows/deploy-config.yml @@ -38,7 +38,7 @@ jobs: - name: Set up node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Yarn install run: yarn - name: Deploy project config if needed diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 36cdcb277fc..f22f77e0fe5 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -39,7 +39,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@master with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 9f298b81495..8dc971a1a8c 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -34,7 +34,7 @@ jobs: - name: Set up node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Yarn install run: yarn - name: Run formatting script diff --git a/.github/workflows/health-metrics-pull-request.yml b/.github/workflows/health-metrics-pull-request.yml index 3063c1abdb7..8c7aba8fb50 100644 --- a/.github/workflows/health-metrics-pull-request.yml +++ b/.github/workflows/health-metrics-pull-request.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - uses: 'google-github-actions/auth@v0' with: credentials_json: '${{ secrets.GCP_SA_KEY }}' @@ -58,7 +58,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - uses: 'google-github-actions/auth@v0' with: credentials_json: '${{ secrets.GCP_SA_KEY }}' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 80851d9834a..82bb1410226 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: - name: Set up node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: yarn install run: yarn - name: yarn lint diff --git a/.github/workflows/prerelease-manual-deploy.yml b/.github/workflows/prerelease-manual-deploy.yml index 57f31bf9c54..7821734e85a 100644 --- a/.github/workflows/prerelease-manual-deploy.yml +++ b/.github/workflows/prerelease-manual-deploy.yml @@ -37,7 +37,7 @@ jobs: - name: Set up node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Yarn install run: yarn - name: Deploy prerelease @@ -74,7 +74,7 @@ jobs: NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}} NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} - NPM_TOKEN_VERTEXAI_PREVIEW: ${{secrets.NPM_TOKEN_VERTEXAI_PREVIEW}} + NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-log.yml b/.github/workflows/release-log.yml index 570a1f70842..eaee66ce962 100644 --- a/.github/workflows/release-log.yml +++ b/.github/workflows/release-log.yml @@ -31,7 +31,7 @@ jobs: - name: Setup Node.js 20.x uses: actions/setup-node@master with: - node-version: 20.x + node-version: 22.10.0 - name: Get PR number and send to tracker. run: node scripts/ci/log-changesets.js diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index b88b80b6d87..ddfff2ed8eb 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -35,7 +35,7 @@ jobs: - name: Setup Node.js 20.x uses: actions/setup-node@master with: - node-version: 20.x + node-version: 22.10.0 - name: Install Dependencies run: yarn diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index 7d6b4017406..1ac9d1f3ee7 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -35,7 +35,7 @@ jobs: - name: Set up node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Checkout release branch (with history) uses: actions/checkout@v4 with: @@ -84,7 +84,7 @@ jobs: NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}} NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} - NPM_TOKEN_VERTEXAI_PREVIEW: ${{secrets.NPM_TOKEN_VERTEXAI_PREVIEW}} + NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-staging.yml b/.github/workflows/release-staging.yml index 4efd3065180..94b66c6c7a5 100644 --- a/.github/workflows/release-staging.yml +++ b/.github/workflows/release-staging.yml @@ -49,7 +49,7 @@ jobs: - name: Set up node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Merge main into release uses: actions/github-script@v6 with: @@ -110,7 +110,7 @@ jobs: NPM_TOKEN_STORAGE: ${{secrets.NPM_TOKEN_STORAGE}} NPM_TOKEN_STORAGE_TYPES: ${{secrets.NPM_TOKEN_STORAGE_TYPES}} NPM_TOKEN_UTIL: ${{secrets.NPM_TOKEN_UTIL}} - NPM_TOKEN_VERTEXAI_PREVIEW: ${{secrets.NPM_TOKEN_VERTEXAI_PREVIEW}} + NPM_TOKEN_VERTEXAI: ${{secrets.NPM_TOKEN_VERTEXAI}} NPM_TOKEN_WEBCHANNEL_WRAPPER: ${{secrets.NPM_TOKEN_WEBCHANNEL_WRAPPER}} NPM_TOKEN_FIREBASE: ${{secrets.NPM_TOKEN_FIREBASE}} NPM_TOKEN_APP_COMPAT: ${{ secrets.NPM_TOKEN_APP_COMPAT }} diff --git a/.github/workflows/release-tweet.yml b/.github/workflows/release-tweet.yml index dffcbaeb0f3..ac446bed7ff 100644 --- a/.github/workflows/release-tweet.yml +++ b/.github/workflows/release-tweet.yml @@ -37,7 +37,7 @@ jobs: - name: Setup Node.js 20.x uses: actions/setup-node@master with: - node-version: 20.x + node-version: 22.10.0 - name: Poll release notes page on devsite run: node scripts/ci/poll_release_notes.js env: diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index eda081d1df7..68983f50a38 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -43,7 +43,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Test setup and yarn install run: | cp config/ci.config.json config/project.json @@ -82,7 +82,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Test setup and yarn install run: | cp config/ci.config.json config/project.json @@ -133,7 +133,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Test setup and yarn install run: | cp config/ci.config.json config/project.json @@ -173,7 +173,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Test setup and yarn install run: | cp config/ci.config.json config/project.json @@ -217,7 +217,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - run: cp config/ci.config.json config/project.json - run: yarn - run: yarn build:${{ matrix.persistence }} diff --git a/.github/workflows/test-changed-auth.yml b/.github/workflows/test-changed-auth.yml index 67d16551b3e..f94d058fb04 100644 --- a/.github/workflows/test-changed-auth.yml +++ b/.github/workflows/test-changed-auth.yml @@ -59,7 +59,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Test setup and yarn install run: | cp config/ci.config.json config/project.json @@ -91,7 +91,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Test setup and yarn install run: | cp config/ci.config.json config/project.json @@ -102,3 +102,28 @@ jobs: run: xvfb-run yarn test:changed auth env: BROWSERS: 'Firefox' + + test-webkit: + name: Test Auth on Webkit if Changed + runs-on: macos-latest + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node (20) + uses: actions/setup-node@v3 + with: + node-version: 22.10.0 + - name: Test setup and yarn install + run: | + cp config/ci.config.json config/project.json + yarn + npx playwright install webkit + - name: build + run: yarn build:changed auth + - name: Run tests on changed packages + run: yarn test:changed auth + env: + BROWSERS: 'WebkitHeadless' \ No newline at end of file diff --git a/.github/workflows/test-changed-fcm-integration.yml b/.github/workflows/test-changed-fcm-integration.yml index 464e3208ccc..ee7b680f70d 100644 --- a/.github/workflows/test-changed-fcm-integration.yml +++ b/.github/workflows/test-changed-fcm-integration.yml @@ -41,7 +41,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Test setup and yarn install run: | cp config/ci.config.json config/project.json diff --git a/.github/workflows/test-changed-firestore-integration.yml b/.github/workflows/test-changed-firestore-integration.yml index 94240156c78..b288ea49ed0 100644 --- a/.github/workflows/test-changed-firestore-integration.yml +++ b/.github/workflows/test-changed-firestore-integration.yml @@ -71,7 +71,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update diff --git a/.github/workflows/test-changed-firestore.yml b/.github/workflows/test-changed-firestore.yml index e148d164909..7a181702d35 100644 --- a/.github/workflows/test-changed-firestore.yml +++ b/.github/workflows/test-changed-firestore.yml @@ -40,7 +40,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update @@ -87,7 +87,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update @@ -115,7 +115,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update @@ -145,7 +145,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update @@ -183,7 +183,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Download build archive uses: actions/download-artifact@v3 with: @@ -222,7 +222,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Test setup and yarn install run: cp config/ci.config.json config/project.json - name: Run tests @@ -231,6 +231,62 @@ jobs: BROWSERS: 'Firefox' EXPERIMENTAL_MODE: true + compat-test-webkit: + name: Test Firestore Compatible on Webkit + runs-on: macos-latest + needs: build + if: ${{ needs.build.outputs.changed == 'true'}} + steps: + - name: Set up Node (20) + uses: actions/setup-node@v3 + with: + node-version: 22.10.0 + - name: Download build archive + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + - name: Unzip build artifact + run: tar xf build.tar.gz + - name: Test setup + run: | + cp config/ci.config.json config/project.json + npx playwright install webkit + - name: Run compat tests + run: cd packages/firestore-compat && yarn run test:ci + env: + BROWSERS: 'WebkitHeadless' + + test-webkit: + name: Test Firestore on Webkit + strategy: + matrix: + # TODO (dlarocque): Add test:travis once the browser tests are isolated + # Exclude test:travis for now, since it includes node tests, which are failing for + # some reason. + test-name: ["test:browser", "test:lite:browser", "test:browser:prod:nameddb", "test:lite:browser:nameddb"] + runs-on: macos-latest + needs: build + if: ${{ needs.build.outputs.changed == 'true'}} + steps: + - name: Download build archive + uses: actions/download-artifact@v3 + with: + name: build.tar.gz + - name: Unzip build artifact + run: tar xf build.tar.gz + - name: Set up Node (20) + uses: actions/setup-node@v3 + with: + node-version: 22.10.0 + - name: Test setup + run: | + cp config/ci.config.json config/project.json + npx playwright install webkit + - name: Run tests + run: cd packages/firestore && yarn run ${{ matrix.test-name }} + env: + BROWSERS: 'WebkitHeadless' + EXPERIMENTAL_MODE: true # A job that fails if any required job in the test matrix fails, # to be used as a required check for merging. check-required-tests: @@ -241,4 +297,4 @@ jobs: steps: - name: Check test matrix if: needs.build.result == 'failure' || needs.test-chrome.result == 'failure' || needs.compat-test-chrome.result == 'failure' - run: exit 1 + run: exit 1 \ No newline at end of file diff --git a/.github/workflows/test-changed-misc.yml b/.github/workflows/test-changed-misc.yml index 8e59dbea835..3cabe64f2b3 100644 --- a/.github/workflows/test-changed-misc.yml +++ b/.github/workflows/test-changed-misc.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update diff --git a/.github/workflows/test-changed.yml b/.github/workflows/test-changed.yml index 7da82df4a26..6499a825725 100644 --- a/.github/workflows/test-changed.yml +++ b/.github/workflows/test-changed.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update @@ -63,7 +63,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Firefox stable run: | sudo apt-get update @@ -78,3 +78,29 @@ jobs: run: xvfb-run yarn test:changed core env: BROWSERS: 'Firefox' + + + test-webkit: + name: Test Packages With Changed Files in Webkit + runs-on: macos-latest + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Node (20) + uses: actions/setup-node@v3 + with: + node-version: 22.10.0 + - name: Test setup and yarn install + run: | + cp config/ci.config.json config/project.json + yarn + npx playwright install webkit + - name: build + run: yarn build:changed core + - name: Run tests on changed packages + run: yarn test:changed core + env: + BROWSERS: 'WebkitHeadless' \ No newline at end of file diff --git a/.github/workflows/test-firebase-integration.yml b/.github/workflows/test-firebase-integration.yml index c545bc2e86e..9a99e6f82a3 100644 --- a/.github/workflows/test-firebase-integration.yml +++ b/.github/workflows/test-firebase-integration.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: install Chrome stable run: | sudo apt-get update diff --git a/.github/workflows/update-api-reports.yml b/.github/workflows/update-api-reports.yml index c808000b5dc..761d7020c7a 100644 --- a/.github/workflows/update-api-reports.yml +++ b/.github/workflows/update-api-reports.yml @@ -33,7 +33,7 @@ jobs: - name: Set up node (20) uses: actions/setup-node@v3 with: - node-version: 20.x + node-version: 22.10.0 - name: Yarn install run: yarn - name: Update API reports diff --git a/.vscode/launch.json b/.vscode/launch.json index 37e64370169..e0a16340123 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,24 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Prune .d.ts", + "program": "${workspaceRoot}/repo-scripts/prune-dts/node_modules/.bin/_mocha", + "cwd": "${workspaceRoot}/repo-scripts/prune-dts", + "args": [ + "--require", + "ts-node/register", + "--timeout", + "5000", + "${workspaceFolder}/repo-scripts/prune-dts/*.test.ts" + ], + "env": { + "TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}" + }, + "sourceMaps": true, + }, { "type": "node", "request": "launch", diff --git a/common/api-review/auth.api.md b/common/api-review/auth.api.md index 8e915daf731..b011b803774 100644 --- a/common/api-review/auth.api.md +++ b/common/api-review/auth.api.md @@ -445,7 +445,7 @@ export function isSignInWithEmailLink(auth: Auth, emailLink: string): boolean; export function linkWithCredential(user: User, credential: AuthCredential): Promise; // @public -export function linkWithPhoneNumber(user: User, phoneNumber: string, appVerifier: ApplicationVerifier): Promise; +export function linkWithPhoneNumber(user: User, phoneNumber: string, appVerifier?: ApplicationVerifier): Promise; // @public export function linkWithPopup(user: User, provider: AuthProvider, resolver?: PopupRedirectResolver): Promise; @@ -625,7 +625,7 @@ export class PhoneAuthProvider { static readonly PHONE_SIGN_IN_METHOD: 'phone'; static readonly PROVIDER_ID: 'phone'; readonly providerId: "phone"; - verifyPhoneNumber(phoneOptions: PhoneInfoOptions | string, applicationVerifier: ApplicationVerifier): Promise; + verifyPhoneNumber(phoneOptions: PhoneInfoOptions | string, applicationVerifier?: ApplicationVerifier): Promise; } // @public @@ -692,7 +692,7 @@ export interface ReactNativeAsyncStorage { export function reauthenticateWithCredential(user: User, credential: AuthCredential): Promise; // @public -export function reauthenticateWithPhoneNumber(user: User, phoneNumber: string, appVerifier: ApplicationVerifier): Promise; +export function reauthenticateWithPhoneNumber(user: User, phoneNumber: string, appVerifier?: ApplicationVerifier): Promise; // @public export function reauthenticateWithPopup(user: User, provider: AuthProvider, resolver?: PopupRedirectResolver): Promise; @@ -778,7 +778,7 @@ export function signInWithEmailAndPassword(auth: Auth, email: string, password: export function signInWithEmailLink(auth: Auth, email: string, emailLink?: string): Promise; // @public -export function signInWithPhoneNumber(auth: Auth, phoneNumber: string, appVerifier: ApplicationVerifier): Promise; +export function signInWithPhoneNumber(auth: Auth, phoneNumber: string, appVerifier?: ApplicationVerifier): Promise; // @public export function signInWithPopup(auth: Auth, provider: AuthProvider, resolver?: PopupRedirectResolver): Promise; diff --git a/common/api-review/functions.api.md b/common/api-review/functions.api.md index 0602656f88e..6133e017f67 100644 --- a/common/api-review/functions.api.md +++ b/common/api-review/functions.api.md @@ -18,8 +18,10 @@ export interface Functions { } // @public -export interface FunctionsError extends FirebaseError { - readonly code: FunctionsErrorCode; +export class FunctionsError extends FirebaseError { + constructor( + code: FunctionsErrorCodeCore, message?: string, + details?: unknown); readonly details?: unknown; } diff --git a/common/api-review/vertexai-preview.api.md b/common/api-review/vertexai.api.md similarity index 80% rename from common/api-review/vertexai-preview.api.md rename to common/api-review/vertexai.api.md index c965bdde432..041bc62451f 100644 --- a/common/api-review/vertexai-preview.api.md +++ b/common/api-review/vertexai.api.md @@ -1,4 +1,4 @@ -## API Report File for "@firebase/vertexai-preview" +## API Report File for "@firebase/vertexai" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). @@ -9,6 +9,15 @@ import { FirebaseApp } from '@firebase/app'; import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; import { FirebaseError } from '@firebase/util'; +// @public +export class ArraySchema extends Schema { + constructor(schemaParams: SchemaParams, items: TypedSchema); + // (undocumented) + items: TypedSchema; + // @internal (undocumented) + toJSON(): SchemaRequest; +} + // @public export interface BaseParams { // (undocumented) @@ -19,14 +28,17 @@ export interface BaseParams { // @public export enum BlockReason { - // (undocumented) - BLOCKED_REASON_UNSPECIFIED = "BLOCKED_REASON_UNSPECIFIED", // (undocumented) OTHER = "OTHER", // (undocumented) SAFETY = "SAFETY" } +// @public +export class BooleanSchema extends Schema { + constructor(schemaParams?: SchemaParams); +} + // @public export class ChatSession { // Warning: (ae-forgotten-export) The symbol "ApiSettings" needs to be exported by the entry point index.d.ts @@ -145,8 +157,6 @@ export interface FileDataPart { // @public export enum FinishReason { - // (undocumented) - FINISH_REASON_UNSPECIFIED = "FINISH_REASON_UNSPECIFIED", // (undocumented) MAX_TOKENS = "MAX_TOKENS", // (undocumented) @@ -182,8 +192,6 @@ export enum FunctionCallingMode { // (undocumented) AUTO = "AUTO", // (undocumented) - MODE_UNSPECIFIED = "MODE_UNSPECIFIED", - // (undocumented) NONE = "NONE" } @@ -201,44 +209,9 @@ export interface FunctionCallPart { // @public export interface FunctionDeclaration { - description?: string; + description: string; name: string; - parameters?: FunctionDeclarationSchema; -} - -// @public -export interface FunctionDeclarationSchema { - description?: string; - properties: { - [k: string]: FunctionDeclarationSchemaProperty; - }; - required?: string[]; - type: FunctionDeclarationSchemaType; -} - -// @public -export interface FunctionDeclarationSchemaProperty { - description?: string; - enum?: string[]; - example?: unknown; - format?: string; - items?: FunctionDeclarationSchema; - nullable?: boolean; - properties?: { - [k: string]: FunctionDeclarationSchema; - }; - required?: string[]; - type?: FunctionDeclarationSchemaType; -} - -// @public -export enum FunctionDeclarationSchemaType { - ARRAY = "ARRAY", - BOOLEAN = "BOOLEAN", - INTEGER = "INTEGER", - NUMBER = "NUMBER", - OBJECT = "OBJECT", - STRING = "STRING" + parameters?: ObjectSchemaInterface; } // @public @@ -331,6 +304,7 @@ export interface GenerationConfig { // (undocumented) presencePenalty?: number; responseMimeType?: string; + responseSchema?: TypedSchema | SchemaRequest; // (undocumented) stopSequences?: string[]; // (undocumented) @@ -401,8 +375,6 @@ export interface GroundingMetadata { // @public (undocumented) export enum HarmBlockMethod { - // (undocumented) - HARM_BLOCK_METHOD_UNSPECIFIED = "HARM_BLOCK_METHOD_UNSPECIFIED", // (undocumented) PROBABILITY = "PROBABILITY", // (undocumented) @@ -418,9 +390,7 @@ export enum HarmBlockThreshold { // (undocumented) BLOCK_NONE = "BLOCK_NONE", // (undocumented) - BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH", - // (undocumented) - HARM_BLOCK_THRESHOLD_UNSPECIFIED = "HARM_BLOCK_THRESHOLD_UNSPECIFIED" + BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH" } // @public @@ -432,15 +402,11 @@ export enum HarmCategory { // (undocumented) HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH", // (undocumented) - HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT", - // (undocumented) - HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED" + HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT" } // @public export enum HarmProbability { - // (undocumented) - HARM_PROBABILITY_UNSPECIFIED = "HARM_PROBABILITY_UNSPECIFIED", // (undocumented) HIGH = "HIGH", // (undocumented) @@ -460,9 +426,7 @@ export enum HarmSeverity { // (undocumented) HARM_SEVERITY_MEDIUM = "HARM_SEVERITY_MEDIUM", // (undocumented) - HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE", - // (undocumented) - HARM_SEVERITY_UNSPECIFIED = "HARM_SEVERITY_UNSPECIFIED" + HARM_SEVERITY_NEGLIGIBLE = "HARM_SEVERITY_NEGLIGIBLE" } // @public @@ -478,6 +442,11 @@ export interface InlineDataPart { videoMetadata?: VideoMetadata; } +// @public +export class IntegerSchema extends Schema { + constructor(schemaParams?: SchemaParams); +} + // @public export interface ModelParams extends BaseParams { // (undocumented) @@ -490,6 +459,34 @@ export interface ModelParams extends BaseParams { tools?: Tool[]; } +// @public +export class NumberSchema extends Schema { + constructor(schemaParams?: SchemaParams); +} + +// @public +export class ObjectSchema extends Schema { + constructor(schemaParams: SchemaParams, properties: { + [k: string]: TypedSchema; + }, optionalProperties?: string[]); + // (undocumented) + optionalProperties: string[]; + // (undocumented) + properties: { + [k: string]: TypedSchema; + }; + // @internal (undocumented) + toJSON(): SchemaRequest; +} + +// @public +export interface ObjectSchemaInterface extends SchemaInterface { + // (undocumented) + optionalProperties?: string[]; + // (undocumented) + type: SchemaType.OBJECT; +} + // @public export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; @@ -499,7 +496,7 @@ export const POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]; // @public export interface PromptFeedback { // (undocumented) - blockReason: BlockReason; + blockReason?: BlockReason; // (undocumented) blockReasonMessage?: string; // (undocumented) @@ -544,11 +541,87 @@ export interface SafetySetting { // (undocumented) category: HarmCategory; // (undocumented) - method: HarmBlockMethod; + method?: HarmBlockMethod; // (undocumented) threshold: HarmBlockThreshold; } +// @public +export abstract class Schema implements SchemaInterface { + constructor(schemaParams: SchemaInterface); + [key: string]: unknown; + // (undocumented) + static array(arrayParams: SchemaParams & { + items: Schema; + }): ArraySchema; + // (undocumented) + static boolean(booleanParams?: SchemaParams): BooleanSchema; + description?: string; + // (undocumented) + static enumString(stringParams: SchemaParams & { + enum: string[]; + }): StringSchema; + example?: unknown; + format?: string; + // (undocumented) + static integer(integerParams?: SchemaParams): IntegerSchema; + nullable: boolean; + // (undocumented) + static number(numberParams?: SchemaParams): NumberSchema; + // (undocumented) + static object(objectParams: SchemaParams & { + properties: { + [k: string]: Schema; + }; + optionalProperties?: string[]; + }): ObjectSchema; + // (undocumented) + static string(stringParams?: SchemaParams): StringSchema; + // @internal + toJSON(): SchemaRequest; + type: SchemaType; +} + +// @public +export interface SchemaInterface extends SchemaShared { + type: SchemaType; +} + +// @public +export interface SchemaParams extends SchemaShared { +} + +// @public +export interface SchemaRequest extends SchemaShared { + required?: string[]; + type: SchemaType; +} + +// @public +export interface SchemaShared { + // (undocumented) + [key: string]: unknown; + description?: string; + enum?: string[]; + example?: unknown; + format?: string; + items?: T; + nullable?: boolean; + properties?: { + [k: string]: T; + }; +} + +// @public +export enum SchemaType { + ARRAY = "array", + BOOLEAN = "boolean", + INTEGER = "integer", + NUMBER = "number", + OBJECT = "object", + STRING = "string" +} + // @public (undocumented) export interface Segment { // (undocumented) @@ -571,6 +644,15 @@ export interface StartChatParams extends BaseParams { tools?: Tool[]; } +// @public +export class StringSchema extends Schema { + constructor(schemaParams?: SchemaParams, enumValues?: string[]); + // (undocumented) + enum?: string[]; + // @internal (undocumented) + toJSON(): SchemaRequest; +} + // @public export interface TextPart { // (undocumented) @@ -589,9 +671,12 @@ export type Tool = FunctionDeclarationsTool; // @public export interface ToolConfig { // (undocumented) - functionCallingConfig: FunctionCallingConfig; + functionCallingConfig?: FunctionCallingConfig; } +// @public +export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; + // @public export interface UsageMetadata { // (undocumented) @@ -616,15 +701,15 @@ export class VertexAIError extends FirebaseError { readonly code: VertexAIErrorCode; // (undocumented) readonly customErrorData?: CustomErrorData | undefined; - // (undocumented) - readonly message: string; } // @public export const enum VertexAIErrorCode { + API_NOT_ENABLED = "api-not-enabled", ERROR = "error", FETCH_ERROR = "fetch-error", INVALID_CONTENT = "invalid-content", + INVALID_SCHEMA = "invalid-schema", NO_API_KEY = "no-api-key", NO_MODEL = "no-model", NO_PROJECT_ID = "no-project-id", diff --git a/config/.eslintrc.js b/config/.eslintrc.js index 04de0f9d10c..57243a3e2a4 100644 --- a/config/.eslintrc.js +++ b/config/.eslintrc.js @@ -31,7 +31,7 @@ module.exports = { 'unused-imports' ], 'parserOptions': { - 'ecmaVersion': 2015, + 'ecmaVersion': 2017, 'sourceType': 'module' }, 'overrides': [ diff --git a/config/functions/package.json b/config/functions/package.json index 08a79673e85..9a032e8bb95 100644 --- a/config/functions/package.json +++ b/config/functions/package.json @@ -8,6 +8,6 @@ }, "private": true, "engines": { - "node": "16" + "node": ">=18.0.0" } } diff --git a/config/karma.base.js b/config/karma.base.js index e074987f29b..49824296740 100644 --- a/config/karma.base.js +++ b/config/karma.base.js @@ -20,6 +20,33 @@ const path = require('path'); const webpackTestConfig = require('./webpack.test'); const { argv } = require('yargs'); +function determineBrowsers() { + const supportedBrowsers = ['ChromeHeadless', 'WebkitHeadless', 'Firefox']; + + if (process.env.BROWSERS) { + const browsers = process.env.BROWSERS.split(','); + + const validBrowsers = browsers.filter(browser => + supportedBrowsers.includes(browser) + ); + if (validBrowsers.length === 0) { + console.error( + `The \'BROWSER\' environment variable was set, but no supported browsers were listed. The supported browsers are ${JSON.stringify( + supportedBrowsers + )}.` + ); + return []; + } else { + return validBrowsers; + } + } else { + console.log( + "The 'BROWSER' environment variable is undefined. Defaulting to 'ChromeHeadless'." + ); + return ['ChromeHeadless']; + } +} + const config = { // disable watcher autoWatch: false, @@ -57,10 +84,11 @@ const config = { // changes autoWatch: false, - // start these browsers - // available browser launchers: - // https://npmjs.org/browse/keyword/karma-launcher - browsers: process.env?.BROWSERS?.split(',') ?? ['ChromeHeadless'], + // Browsers to launch for testing + // To use a custom set of browsers, define the BROWSERS environment variable as a comma-seperated list. + // Supported browsers are 'ChromeHeadless', 'WebkitHeadless', and 'Firefox'. + // See: https://karma-runner.github.io/6.4/config/browsers.html + browsers: determineBrowsers(), webpack: webpackTestConfig, diff --git a/config/tsconfig.base.json b/config/tsconfig.base.json index 0bfe24208a8..adbd2e44072 100644 --- a/config/tsconfig.base.json +++ b/config/tsconfig.base.json @@ -5,24 +5,16 @@ "importHelpers": true, "strict": true, "lib": [ - "es5", "dom", - "es2015.promise", - "es2015.symbol", - "es2015.iterable", - "es2015.collection", - "es2015.symbol.wellknown", - "es2015.core", - "es2017.object", - "es2017.string", - "ESNext.WeakRef", + "es2017", + "esnext.WeakRef", ], "module": "ES2015", "moduleResolution": "node", "resolveJsonModule": true, "esModuleInterop": true, "sourceMap": true, - "target": "es5", + "target": "es2017", "typeRoots": [ "../node_modules/@types" ], diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 3a04923f8de..a27f2832eb7 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -455,105 +455,124 @@ toc: path: /docs/reference/js/storage.uploadtask.md - title: UploadTaskSnapshot path: /docs/reference/js/storage.uploadtasksnapshot.md - - title: vertexai-preview - path: /docs/reference/js/vertexai-preview.md + - title: vertexai + path: /docs/reference/js/vertexai.md section: + - title: ArraySchema + path: /docs/reference/js/vertexai.arrayschema.md - title: BaseParams - path: /docs/reference/js/vertexai-preview.baseparams.md + path: /docs/reference/js/vertexai.baseparams.md + - title: BooleanSchema + path: /docs/reference/js/vertexai.booleanschema.md - title: ChatSession - path: /docs/reference/js/vertexai-preview.chatsession.md + path: /docs/reference/js/vertexai.chatsession.md - title: Citation - path: /docs/reference/js/vertexai-preview.citation.md + path: /docs/reference/js/vertexai.citation.md - title: CitationMetadata - path: /docs/reference/js/vertexai-preview.citationmetadata.md + path: /docs/reference/js/vertexai.citationmetadata.md - title: Content - path: /docs/reference/js/vertexai-preview.content.md + path: /docs/reference/js/vertexai.content.md - title: CountTokensRequest - path: /docs/reference/js/vertexai-preview.counttokensrequest.md + path: /docs/reference/js/vertexai.counttokensrequest.md - title: CountTokensResponse - path: /docs/reference/js/vertexai-preview.counttokensresponse.md + path: /docs/reference/js/vertexai.counttokensresponse.md - title: CustomErrorData - path: /docs/reference/js/vertexai-preview.customerrordata.md + path: /docs/reference/js/vertexai.customerrordata.md - title: Date_2 - path: /docs/reference/js/vertexai-preview.date_2.md + path: /docs/reference/js/vertexai.date_2.md - title: EnhancedGenerateContentResponse - path: /docs/reference/js/vertexai-preview.enhancedgeneratecontentresponse.md + path: /docs/reference/js/vertexai.enhancedgeneratecontentresponse.md - title: ErrorDetails - path: /docs/reference/js/vertexai-preview.errordetails.md + path: /docs/reference/js/vertexai.errordetails.md - title: FileData - path: /docs/reference/js/vertexai-preview.filedata.md + path: /docs/reference/js/vertexai.filedata.md - title: FileDataPart - path: /docs/reference/js/vertexai-preview.filedatapart.md + path: /docs/reference/js/vertexai.filedatapart.md - title: FunctionCall - path: /docs/reference/js/vertexai-preview.functioncall.md + path: /docs/reference/js/vertexai.functioncall.md - title: FunctionCallingConfig - path: /docs/reference/js/vertexai-preview.functioncallingconfig.md + path: /docs/reference/js/vertexai.functioncallingconfig.md - title: FunctionCallPart - path: /docs/reference/js/vertexai-preview.functioncallpart.md + path: /docs/reference/js/vertexai.functioncallpart.md - title: FunctionDeclaration - path: /docs/reference/js/vertexai-preview.functiondeclaration.md - - title: FunctionDeclarationSchema - path: /docs/reference/js/vertexai-preview.functiondeclarationschema.md - - title: FunctionDeclarationSchemaProperty - path: >- - /docs/reference/js/vertexai-preview.functiondeclarationschemaproperty.md + path: /docs/reference/js/vertexai.functiondeclaration.md - title: FunctionDeclarationsTool - path: /docs/reference/js/vertexai-preview.functiondeclarationstool.md + path: /docs/reference/js/vertexai.functiondeclarationstool.md - title: FunctionResponse - path: /docs/reference/js/vertexai-preview.functionresponse.md + path: /docs/reference/js/vertexai.functionresponse.md - title: FunctionResponsePart - path: /docs/reference/js/vertexai-preview.functionresponsepart.md + path: /docs/reference/js/vertexai.functionresponsepart.md - title: GenerateContentCandidate - path: /docs/reference/js/vertexai-preview.generatecontentcandidate.md + path: /docs/reference/js/vertexai.generatecontentcandidate.md - title: GenerateContentRequest - path: /docs/reference/js/vertexai-preview.generatecontentrequest.md + path: /docs/reference/js/vertexai.generatecontentrequest.md - title: GenerateContentResponse - path: /docs/reference/js/vertexai-preview.generatecontentresponse.md + path: /docs/reference/js/vertexai.generatecontentresponse.md - title: GenerateContentResult - path: /docs/reference/js/vertexai-preview.generatecontentresult.md + path: /docs/reference/js/vertexai.generatecontentresult.md - title: GenerateContentStreamResult - path: /docs/reference/js/vertexai-preview.generatecontentstreamresult.md + path: /docs/reference/js/vertexai.generatecontentstreamresult.md - title: GenerationConfig - path: /docs/reference/js/vertexai-preview.generationconfig.md + path: /docs/reference/js/vertexai.generationconfig.md - title: GenerativeContentBlob - path: /docs/reference/js/vertexai-preview.generativecontentblob.md + path: /docs/reference/js/vertexai.generativecontentblob.md - title: GenerativeModel - path: /docs/reference/js/vertexai-preview.generativemodel.md + path: /docs/reference/js/vertexai.generativemodel.md - title: GroundingAttribution - path: /docs/reference/js/vertexai-preview.groundingattribution.md + path: /docs/reference/js/vertexai.groundingattribution.md - title: GroundingMetadata - path: /docs/reference/js/vertexai-preview.groundingmetadata.md + path: /docs/reference/js/vertexai.groundingmetadata.md - title: InlineDataPart - path: /docs/reference/js/vertexai-preview.inlinedatapart.md + path: /docs/reference/js/vertexai.inlinedatapart.md + - title: IntegerSchema + path: /docs/reference/js/vertexai.integerschema.md - title: ModelParams - path: /docs/reference/js/vertexai-preview.modelparams.md + path: /docs/reference/js/vertexai.modelparams.md + - title: NumberSchema + path: /docs/reference/js/vertexai.numberschema.md + - title: ObjectSchema + path: /docs/reference/js/vertexai.objectschema.md + - title: ObjectSchemaInterface + path: /docs/reference/js/vertexai.objectschemainterface.md - title: PromptFeedback - path: /docs/reference/js/vertexai-preview.promptfeedback.md + path: /docs/reference/js/vertexai.promptfeedback.md - title: RequestOptions - path: /docs/reference/js/vertexai-preview.requestoptions.md + path: /docs/reference/js/vertexai.requestoptions.md - title: RetrievedContextAttribution - path: /docs/reference/js/vertexai-preview.retrievedcontextattribution.md + path: /docs/reference/js/vertexai.retrievedcontextattribution.md - title: SafetyRating - path: /docs/reference/js/vertexai-preview.safetyrating.md + path: /docs/reference/js/vertexai.safetyrating.md - title: SafetySetting - path: /docs/reference/js/vertexai-preview.safetysetting.md + path: /docs/reference/js/vertexai.safetysetting.md + - title: Schema + path: /docs/reference/js/vertexai.schema.md + - title: SchemaInterface + path: /docs/reference/js/vertexai.schemainterface.md + - title: SchemaParams + path: /docs/reference/js/vertexai.schemaparams.md + - title: SchemaRequest + path: /docs/reference/js/vertexai.schemarequest.md + - title: SchemaShared + path: /docs/reference/js/vertexai.schemashared.md - title: Segment - path: /docs/reference/js/vertexai-preview.segment.md + path: /docs/reference/js/vertexai.segment.md - title: StartChatParams - path: /docs/reference/js/vertexai-preview.startchatparams.md + path: /docs/reference/js/vertexai.startchatparams.md + - title: StringSchema + path: /docs/reference/js/vertexai.stringschema.md - title: TextPart - path: /docs/reference/js/vertexai-preview.textpart.md + path: /docs/reference/js/vertexai.textpart.md - title: ToolConfig - path: /docs/reference/js/vertexai-preview.toolconfig.md + path: /docs/reference/js/vertexai.toolconfig.md - title: UsageMetadata - path: /docs/reference/js/vertexai-preview.usagemetadata.md + path: /docs/reference/js/vertexai.usagemetadata.md - title: VertexAI - path: /docs/reference/js/vertexai-preview.vertexai.md + path: /docs/reference/js/vertexai.vertexai.md - title: VertexAIError - path: /docs/reference/js/vertexai-preview.vertexaierror.md + path: /docs/reference/js/vertexai.vertexaierror.md - title: VertexAIOptions - path: /docs/reference/js/vertexai-preview.vertexaioptions.md + path: /docs/reference/js/vertexai.vertexaioptions.md - title: VideoMetadata - path: /docs/reference/js/vertexai-preview.videometadata.md + path: /docs/reference/js/vertexai.videometadata.md - title: WebAttribution - path: /docs/reference/js/vertexai-preview.webattribution.md + path: /docs/reference/js/vertexai.webattribution.md diff --git a/docs-devsite/analytics.md b/docs-devsite/analytics.md index fe4fa13a68d..e8568b1e792 100644 --- a/docs-devsite/analytics.md +++ b/docs-devsite/analytics.md @@ -990,7 +990,7 @@ Whether a particular consent type has been granted or denied. Signature: ```typescript -export declare type ConsentStatusString = 'granted' | 'denied'; +export type ConsentStatusString = 'granted' | 'denied'; ``` ## Currency @@ -1000,7 +1000,7 @@ Standard Google Analytics currency type. Signature: ```typescript -export declare type Currency = string | number; +export type Currency = string | number; ``` ## CustomEventName @@ -1010,7 +1010,7 @@ Any custom event name string not in the standard list of recommended event names Signature: ```typescript -export declare type CustomEventName = T extends EventNameString ? never : T; +export type CustomEventName = T extends EventNameString ? never : T; ``` ## EventNameString @@ -1020,5 +1020,5 @@ Type for standard Google Analytics event names. `logEvent` also accepts any cust Signature: ```typescript -export declare type EventNameString = 'add_payment_info' | 'add_shipping_info' | 'add_to_cart' | 'add_to_wishlist' | 'begin_checkout' | 'checkout_progress' | 'exception' | 'generate_lead' | 'login' | 'page_view' | 'purchase' | 'refund' | 'remove_from_cart' | 'screen_view' | 'search' | 'select_content' | 'select_item' | 'select_promotion' | 'set_checkout_option' | 'share' | 'sign_up' | 'timing_complete' | 'view_cart' | 'view_item' | 'view_item_list' | 'view_promotion' | 'view_search_results'; +export type EventNameString = 'add_payment_info' | 'add_shipping_info' | 'add_to_cart' | 'add_to_wishlist' | 'begin_checkout' | 'checkout_progress' | 'exception' | 'generate_lead' | 'login' | 'page_view' | 'purchase' | 'refund' | 'remove_from_cart' | 'screen_view' | 'search' | 'select_content' | 'select_item' | 'select_promotion' | 'set_checkout_option' | 'share' | 'sign_up' | 'timing_complete' | 'view_cart' | 'view_item' | 'view_item_list' | 'view_promotion' | 'view_search_results'; ``` diff --git a/docs-devsite/app-check.md b/docs-devsite/app-check.md index ea60678e688..f0d401a530f 100644 --- a/docs-devsite/app-check.md +++ b/docs-devsite/app-check.md @@ -197,5 +197,5 @@ A listener that is called whenever the App Check token changes. Signature: ```typescript -export declare type AppCheckTokenListener = (token: AppCheckTokenResult) => void; +export type AppCheckTokenListener = (token: AppCheckTokenResult) => void; ``` diff --git a/docs-devsite/auth.md b/docs-devsite/auth.md index 43d23dc8931..83c91db1de2 100644 --- a/docs-devsite/auth.md +++ b/docs-devsite/auth.md @@ -923,14 +923,16 @@ Asynchronously signs in using a phone number. This method sends a code via SMS to the given phone number, and returns a [ConfirmationResult](./auth.confirmationresult.md#confirmationresult_interface). After the user provides the code sent to their phone, call [ConfirmationResult.confirm()](./auth.confirmationresult.md#confirmationresultconfirm) with the code to sign the user in. -For abuse prevention, this method also requires a [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface). This SDK includes a reCAPTCHA-based implementation, [RecaptchaVerifier](./auth.recaptchaverifier.md#recaptchaverifier_class). This function can work on other platforms that do not support the [RecaptchaVerifier](./auth.recaptchaverifier.md#recaptchaverifier_class) (like React Native), but you need to use a third-party [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface) implementation. +For abuse prevention, this method requires a [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface). This SDK includes an implementation based on reCAPTCHA v2, [RecaptchaVerifier](./auth.recaptchaverifier.md#recaptchaverifier_class). This function can work on other platforms that do not support the [RecaptchaVerifier](./auth.recaptchaverifier.md#recaptchaverifier_class) (like React Native), but you need to use a third-party [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface) implementation. + +If you've enabled project-level reCAPTCHA Enterprise bot protection in Enforce mode, you can omit the [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface). This method does not work in a Node.js environment or with [Auth](./auth.auth.md#auth_interface) instances created with a [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface). Signature: ```typescript -export declare function signInWithPhoneNumber(auth: Auth, phoneNumber: string, appVerifier: ApplicationVerifier): Promise; +export declare function signInWithPhoneNumber(auth: Auth, phoneNumber: string, appVerifier?: ApplicationVerifier): Promise; ``` #### Parameters @@ -1304,7 +1306,7 @@ This method does not work in a Node.js environment. Signature: ```typescript -export declare function linkWithPhoneNumber(user: User, phoneNumber: string, appVerifier: ApplicationVerifier): Promise; +export declare function linkWithPhoneNumber(user: User, phoneNumber: string, appVerifier?: ApplicationVerifier): Promise; ``` #### Parameters @@ -1457,7 +1459,7 @@ This method does not work in a Node.js environment or on any [User](./auth.user. Signature: ```typescript -export declare function reauthenticateWithPhoneNumber(user: User, phoneNumber: string, appVerifier: ApplicationVerifier): Promise; +export declare function reauthenticateWithPhoneNumber(user: User, phoneNumber: string, appVerifier?: ApplicationVerifier): Promise; ``` #### Parameters @@ -2112,7 +2114,7 @@ Map of OAuth Custom Parameters. Signature: ```typescript -export declare type CustomParameters = Record; +export type CustomParameters = Record; ``` ## NextOrObserver @@ -2122,7 +2124,7 @@ Type definition for an event callback. Signature: ```typescript -export declare type NextOrObserver = NextFn | Observer; +export type NextOrObserver = NextFn | Observer; ``` ## PhoneInfoOptions @@ -2134,7 +2136,7 @@ The information that's required depends on whether you are doing single-factor s Signature: ```typescript -export declare type PhoneInfoOptions = PhoneSingleFactorInfoOptions | PhoneMultiFactorEnrollInfoOptions | PhoneMultiFactorSignInInfoOptions; +export type PhoneInfoOptions = PhoneSingleFactorInfoOptions | PhoneMultiFactorEnrollInfoOptions | PhoneMultiFactorSignInInfoOptions; ``` ## UserProfile @@ -2144,5 +2146,5 @@ User profile used in [AdditionalUserInfo](./auth.additionaluserinfo.md#additiona Signature: ```typescript -export declare type UserProfile = Record; +export type UserProfile = Record; ``` diff --git a/docs-devsite/auth.phoneauthprovider.md b/docs-devsite/auth.phoneauthprovider.md index 44bd44b53ba..e09e0b51caa 100644 --- a/docs-devsite/auth.phoneauthprovider.md +++ b/docs-devsite/auth.phoneauthprovider.md @@ -203,7 +203,7 @@ Starts a phone number authentication flow by sending a verification code to the Signature: ```typescript -verifyPhoneNumber(phoneOptions: PhoneInfoOptions | string, applicationVerifier: ApplicationVerifier): Promise; +verifyPhoneNumber(phoneOptions: PhoneInfoOptions | string, applicationVerifier?: ApplicationVerifier): Promise; ``` #### Parameters @@ -211,13 +211,13 @@ verifyPhoneNumber(phoneOptions: PhoneInfoOptions | string, applicationVerifier: | Parameter | Type | Description | | --- | --- | --- | | phoneOptions | [PhoneInfoOptions](./auth.md#phoneinfooptions) \| string | | -| applicationVerifier | [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface) | For abuse prevention, this method also requires a [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface). This SDK includes a reCAPTCHA-based implementation, [RecaptchaVerifier](./auth.recaptchaverifier.md#recaptchaverifier_class). | +| applicationVerifier | [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface) | An [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface), which prevents requests from unauthorized clients. This SDK includes an implementation based on reCAPTCHA v2, [RecaptchaVerifier](./auth.recaptchaverifier.md#recaptchaverifier_class). If you've enabled reCAPTCHA Enterprise bot protection in Enforce mode, this parameter is optional; in all other configurations, the parameter is required. | Returns: Promise<string> -A Promise for a verification ID that can be passed to [PhoneAuthProvider.credential()](./auth.phoneauthprovider.md#phoneauthprovidercredential) to identify this flow.. +A Promise for a verification ID that can be passed to [PhoneAuthProvider.credential()](./auth.phoneauthprovider.md#phoneauthprovidercredential) to identify this flow. ### Example 1 diff --git a/docs-devsite/functions.functionserror.md b/docs-devsite/functions.functionserror.md index 3be96745b4c..8c2067c4f41 100644 --- a/docs-devsite/functions.functionserror.md +++ b/docs-devsite/functions.functionserror.md @@ -9,36 +9,53 @@ overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %} -# FunctionsError interface +# FunctionsError class An error returned by the Firebase Functions client SDK. +See [FunctionsErrorCode](./functions.md#functionserrorcode) for full documentation of codes. + Signature: ```typescript -export interface FunctionsError extends FirebaseError +export declare class FunctionsError extends FirebaseError ``` Extends: [FirebaseError](./util.firebaseerror.md#firebaseerror_class) -## Properties +## Constructors -| Property | Type | Description | +| Constructor | Modifiers | Description | | --- | --- | --- | -| [code](./functions.functionserror.md#functionserrorcode) | [FunctionsErrorCode](./functions.md#functionserrorcode) | A standard error code that will be returned to the client. This also determines the HTTP status code of the response, as defined in code.proto. | -| [details](./functions.functionserror.md#functionserrordetails) | unknown | Extra data to be converted to JSON and included in the error response. | +| [(constructor)(code, message, details)](./functions.functionserror.md#functionserrorconstructor) | | Constructs a new instance of the FunctionsError class. | + +## Properties -## FunctionsError.code +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [details](./functions.functionserror.md#functionserrordetails) | | unknown | Additional details to be converted to JSON and included in the error response. | -A standard error code that will be returned to the client. This also determines the HTTP status code of the response, as defined in code.proto. +## FunctionsError.(constructor) + +Constructs a new instance of the `FunctionsError` class. Signature: ```typescript -readonly code: FunctionsErrorCode; +constructor( + code: FunctionsErrorCode, message?: string, + details?: unknown); ``` +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| code | [FunctionsErrorCode](./functions.md#functionserrorcodecore) | | +| message | string | | +| details | unknown | | + ## FunctionsError.details -Extra data to be converted to JSON and included in the error response. +Additional details to be converted to JSON and included in the error response. Signature: diff --git a/docs-devsite/functions.md b/docs-devsite/functions.md index 8e73e1178bc..4887fcd4911 100644 --- a/docs-devsite/functions.md +++ b/docs-devsite/functions.md @@ -23,12 +23,17 @@ Cloud Functions for Firebase | [httpsCallable(functionsInstance, name, options)](./functions.md#httpscallable_1dd297c) | Returns a reference to the callable HTTPS trigger with the given name. | | [httpsCallableFromURL(functionsInstance, url, options)](./functions.md#httpscallablefromurl_7af6987) | Returns a reference to the callable HTTPS trigger with the specified url. | +## Classes + +| Class | Description | +| --- | --- | +| [FunctionsError](./functions.functionserror.md#functionserror_class) | An error returned by the Firebase Functions client SDK.See [FunctionsErrorCode](./functions.md#functionserrorcode) for full documentation of codes. | + ## Interfaces | Interface | Description | | --- | --- | | [Functions](./functions.functions.md#functions_interface) | A Functions instance. | -| [FunctionsError](./functions.functionserror.md#functionserror_interface) | An error returned by the Firebase Functions client SDK. | | [HttpsCallableOptions](./functions.httpscallableoptions.md#httpscallableoptions_interface) | An interface for metadata about how calls should be executed. | | [HttpsCallableResult](./functions.httpscallableresult.md#httpscallableresult_interface) | An HttpsCallableResult wraps a single result from a function call. | @@ -142,7 +147,7 @@ Possible values: - 'cancelled': The operation was cancelled (typically by the ca Signature: ```typescript -export declare type FunctionsErrorCode = `functions/${FunctionsErrorCodeCore}`; +export type FunctionsErrorCode = `functions/${FunctionsErrorCodeCore}`; ``` ## FunctionsErrorCodeCore @@ -152,7 +157,7 @@ Functions error code string appended after "functions/" product prefix. See [Fun Signature: ```typescript -export declare type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; +export type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated'; ``` ## HttpsCallable @@ -162,5 +167,5 @@ A reference to a "callable" HTTP trigger in Google Cloud Functions. Signature: ```typescript -export declare type HttpsCallable = (data?: RequestData | null) => Promise>; +export type HttpsCallable = (data?: RequestData | null) => Promise>; ``` diff --git a/docs-devsite/index.md b/docs-devsite/index.md index 0064652e792..82fdb36f076 100644 --- a/docs-devsite/index.md +++ b/docs-devsite/index.md @@ -27,5 +27,5 @@ https://github.com/firebase/firebase-js-sdk | [@firebase/performance](./performance.md#performance_package) | The Firebase Performance Monitoring Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/remote-config](./remote-config.md#remote-config_package) | The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/storage](./storage.md#storage_package) | Cloud Storage for Firebase | -| [@firebase/vertexai-preview](./vertexai-preview.md#vertexai-preview_package) | The Vertex AI in Firebase Web SDK. | +| [@firebase/vertexai](./vertexai.md#vertexai_package) | The Vertex AI in Firebase Web SDK. | diff --git a/docs-devsite/installations.md b/docs-devsite/installations.md index 3e20ae4935f..89565124f01 100644 --- a/docs-devsite/installations.md +++ b/docs-devsite/installations.md @@ -152,7 +152,7 @@ An user defined callback function that gets called when Installations ID changes Signature: ```typescript -export declare type IdChangeCallbackFn = (installationId: string) => void; +export type IdChangeCallbackFn = (installationId: string) => void; ``` ## IdChangeUnsubscribeFn @@ -162,5 +162,5 @@ Unsubscribe a callback function previously added via [IdChangeCallbackFn](./inst Signature: ```typescript -export declare type IdChangeUnsubscribeFn = () => void; +export type IdChangeUnsubscribeFn = () => void; ``` diff --git a/docs-devsite/remote-config.md b/docs-devsite/remote-config.md index 41663da6751..371ab7ff157 100644 --- a/docs-devsite/remote-config.md +++ b/docs-devsite/remote-config.md @@ -325,7 +325,7 @@ Summarizes the outcome of the last attempt to fetch config from the Firebase Rem Signature: ```typescript -export declare type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle'; +export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle'; ``` ## LogLevel @@ -335,7 +335,7 @@ Defines levels of Remote Config logging. Signature: ```typescript -export declare type LogLevel = 'debug' | 'error' | 'silent'; +export type LogLevel = 'debug' | 'error' | 'silent'; ``` ## ValueSource @@ -347,5 +347,5 @@ Indicates the source of a value. Signature: ```typescript -export declare type ValueSource = 'static' | 'default' | 'remote'; +export type ValueSource = 'static' | 'default' | 'remote'; ``` diff --git a/docs-devsite/storage.md b/docs-devsite/storage.md index 76d6f6887d3..da72929ebc9 100644 --- a/docs-devsite/storage.md +++ b/docs-devsite/storage.md @@ -493,7 +493,7 @@ An enumeration of the possible string formats for upload. Signature: ```typescript -export declare type StringFormat = (typeof StringFormat)[keyof typeof StringFormat]; +export type StringFormat = (typeof StringFormat)[keyof typeof StringFormat]; ``` ## TaskEvent @@ -503,7 +503,7 @@ An event that is triggered on a task. Signature: ```typescript -export declare type TaskEvent = 'state_changed'; +export type TaskEvent = 'state_changed'; ``` ## TaskState @@ -513,7 +513,7 @@ Represents the current state of a running upload. Signature: ```typescript -export declare type TaskState = 'running' | 'paused' | 'success' | 'canceled' | 'error'; +export type TaskState = 'running' | 'paused' | 'success' | 'canceled' | 'error'; ``` ## StorageErrorCode diff --git a/docs-devsite/vertexai-preview.chatsession.md b/docs-devsite/vertexai-preview.chatsession.md deleted file mode 100644 index d8dc691d186..00000000000 --- a/docs-devsite/vertexai-preview.chatsession.md +++ /dev/null @@ -1,138 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ChatSession class -ChatSession class that enables sending chat messages and stores history of sent and received messages so far. - -Signature: - -```typescript -export declare class ChatSession -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai-preview.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [model](./vertexai-preview.chatsession.md#chatsessionmodel) | | string | | -| [params](./vertexai-preview.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) \| undefined | | -| [requestOptions](./vertexai-preview.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) \| undefined | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [getHistory()](./vertexai-preview.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | -| [sendMessage(request)](./vertexai-preview.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) | -| [sendMessageStream(request)](./vertexai-preview.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | - -## ChatSession.(constructor) - -Constructs a new instance of the `ChatSession` class - -Signature: - -```typescript -constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| apiSettings | ApiSettings | | -| model | string | | -| params | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) \| undefined | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) \| undefined | | - -## ChatSession.model - -Signature: - -```typescript -model: string; -``` - -## ChatSession.params - -Signature: - -```typescript -params?: StartChatParams | undefined; -``` - -## ChatSession.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions | undefined; -``` - -## ChatSession.getHistory() - -Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. - -Signature: - -```typescript -getHistory(): Promise; -``` -Returns: - -Promise<[Content](./vertexai-preview.content.md#content_interface)\[\]> - -## ChatSession.sendMessage() - -Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) - -Signature: - -```typescript -sendMessage(request: string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)> - -## ChatSession.sendMessageStream() - -Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. - -Signature: - -```typescript -sendMessageStream(request: string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - diff --git a/docs-devsite/vertexai-preview.functiondeclarationschema.md b/docs-devsite/vertexai-preview.functiondeclarationschema.md deleted file mode 100644 index 7d0e5809d41..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationschema.md +++ /dev/null @@ -1,70 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationSchema interface -Schema for parameters passed to [FunctionDeclaration.parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters). - -Signature: - -```typescript -export interface FunctionDeclarationSchema -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [description](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemadescription) | string | Optional. Description of the parameter. | -| [properties](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemaproperties) | { \[k: string\]: [FunctionDeclarationSchemaProperty](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemaproperty_interface); } | The format of the parameter. | -| [required](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemarequired) | string\[\] | Optional. Array of required parameters. | -| [type](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschematype) | [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | The type of the parameter. | - -## FunctionDeclarationSchema.description - -Optional. Description of the parameter. - -Signature: - -```typescript -description?: string; -``` - -## FunctionDeclarationSchema.properties - -The format of the parameter. - -Signature: - -```typescript -properties: { - [k: string]: FunctionDeclarationSchemaProperty; - }; -``` - -## FunctionDeclarationSchema.required - -Optional. Array of required parameters. - -Signature: - -```typescript -required?: string[]; -``` - -## FunctionDeclarationSchema.type - -The type of the parameter. - -Signature: - -```typescript -type: FunctionDeclarationSchemaType; -``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md b/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md deleted file mode 100644 index ac2e1262dd0..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md +++ /dev/null @@ -1,125 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationSchemaProperty interface -Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. - -Signature: - -```typescript -export interface FunctionDeclarationSchemaProperty -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [description](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertydescription) | string | Optional. The description of the property. | -| [enum](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyenum) | string\[\] | Optional. The enum of the property. | -| [example](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyexample) | unknown | Optional. The example of the property. | -| [format](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyformat) | string | Optional. The format of the property. | -| [items](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyitems) | [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Optional. The items of the property. [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | -| [nullable](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertynullable) | boolean | Optional. Whether the property is nullable. | -| [properties](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyproperties) | { \[k: string\]: [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface); } | Optional. Map of [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface). | -| [required](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyrequired) | string\[\] | Optional. Array of required property. | -| [type](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertytype) | [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | Optional. The type of the property. [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype). | - -## FunctionDeclarationSchemaProperty.description - -Optional. The description of the property. - -Signature: - -```typescript -description?: string; -``` - -## FunctionDeclarationSchemaProperty.enum - -Optional. The enum of the property. - -Signature: - -```typescript -enum?: string[]; -``` - -## FunctionDeclarationSchemaProperty.example - -Optional. The example of the property. - -Signature: - -```typescript -example?: unknown; -``` - -## FunctionDeclarationSchemaProperty.format - -Optional. The format of the property. - -Signature: - -```typescript -format?: string; -``` - -## FunctionDeclarationSchemaProperty.items - -Optional. The items of the property. [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) - -Signature: - -```typescript -items?: FunctionDeclarationSchema; -``` - -## FunctionDeclarationSchemaProperty.nullable - -Optional. Whether the property is nullable. - -Signature: - -```typescript -nullable?: boolean; -``` - -## FunctionDeclarationSchemaProperty.properties - -Optional. Map of [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface). - -Signature: - -```typescript -properties?: { - [k: string]: FunctionDeclarationSchema; - }; -``` - -## FunctionDeclarationSchemaProperty.required - -Optional. Array of required property. - -Signature: - -```typescript -required?: string[]; -``` - -## FunctionDeclarationSchemaProperty.type - -Optional. The type of the property. [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype). - -Signature: - -```typescript -type?: FunctionDeclarationSchemaType; -``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationstool.md b/docs-devsite/vertexai-preview.functiondeclarationstool.md deleted file mode 100644 index d1af4351a23..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationstool.md +++ /dev/null @@ -1,35 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationsTool interface -A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. - -Signature: - -```typescript -export declare interface FunctionDeclarationsTool -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [functionDeclarations](./vertexai-preview.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai-preview.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | - -## FunctionDeclarationsTool.functionDeclarations - -Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. - -Signature: - -```typescript -functionDeclarations?: FunctionDeclaration[]; -``` diff --git a/docs-devsite/vertexai-preview.generatecontentcandidate.md b/docs-devsite/vertexai-preview.generatecontentcandidate.md deleted file mode 100644 index 9f36fab1e87..00000000000 --- a/docs-devsite/vertexai-preview.generatecontentcandidate.md +++ /dev/null @@ -1,87 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerateContentCandidate interface -A candidate returned as part of a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -export interface GenerateContentCandidate -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [citationMetadata](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai-preview.citationmetadata.md#citationmetadata_interface) | | -| [content](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai-preview.content.md#content_interface) | | -| [finishMessage](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | -| [finishReason](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai-preview.md#finishreason) | | -| [groundingMetadata](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai-preview.groundingmetadata.md#groundingmetadata_interface) | | -| [index](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidateindex) | number | | -| [safetyRatings](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface)\[\] | | - -## GenerateContentCandidate.citationMetadata - -Signature: - -```typescript -citationMetadata?: CitationMetadata; -``` - -## GenerateContentCandidate.content - -Signature: - -```typescript -content: Content; -``` - -## GenerateContentCandidate.finishMessage - -Signature: - -```typescript -finishMessage?: string; -``` - -## GenerateContentCandidate.finishReason - -Signature: - -```typescript -finishReason?: FinishReason; -``` - -## GenerateContentCandidate.groundingMetadata - -Signature: - -```typescript -groundingMetadata?: GroundingMetadata; -``` - -## GenerateContentCandidate.index - -Signature: - -```typescript -index: number; -``` - -## GenerateContentCandidate.safetyRatings - -Signature: - -```typescript -safetyRatings?: SafetyRating[]; -``` diff --git a/docs-devsite/vertexai-preview.generationconfig.md b/docs-devsite/vertexai-preview.generationconfig.md deleted file mode 100644 index b14dfea053b..00000000000 --- a/docs-devsite/vertexai-preview.generationconfig.md +++ /dev/null @@ -1,107 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerationConfig interface -Config options for content-related requests - -Signature: - -```typescript -export interface GenerationConfig -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [candidateCount](./vertexai-preview.generationconfig.md#generationconfigcandidatecount) | number | | -| [frequencyPenalty](./vertexai-preview.generationconfig.md#generationconfigfrequencypenalty) | number | | -| [maxOutputTokens](./vertexai-preview.generationconfig.md#generationconfigmaxoutputtokens) | number | | -| [presencePenalty](./vertexai-preview.generationconfig.md#generationconfigpresencepenalty) | number | | -| [responseMimeType](./vertexai-preview.generationconfig.md#generationconfigresponsemimetype) | string | Output response mimetype of the generated candidate text. Supported mimetypes are text/plain (default, text output) and application/json (JSON response in the candidates). The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. | -| [stopSequences](./vertexai-preview.generationconfig.md#generationconfigstopsequences) | string\[\] | | -| [temperature](./vertexai-preview.generationconfig.md#generationconfigtemperature) | number | | -| [topK](./vertexai-preview.generationconfig.md#generationconfigtopk) | number | | -| [topP](./vertexai-preview.generationconfig.md#generationconfigtopp) | number | | - -## GenerationConfig.candidateCount - -Signature: - -```typescript -candidateCount?: number; -``` - -## GenerationConfig.frequencyPenalty - -Signature: - -```typescript -frequencyPenalty?: number; -``` - -## GenerationConfig.maxOutputTokens - -Signature: - -```typescript -maxOutputTokens?: number; -``` - -## GenerationConfig.presencePenalty - -Signature: - -```typescript -presencePenalty?: number; -``` - -## GenerationConfig.responseMimeType - -Output response mimetype of the generated candidate text. Supported mimetypes are `text/plain` (default, text output) and `application/json` (JSON response in the candidates). The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. - -Signature: - -```typescript -responseMimeType?: string; -``` - -## GenerationConfig.stopSequences - -Signature: - -```typescript -stopSequences?: string[]; -``` - -## GenerationConfig.temperature - -Signature: - -```typescript -temperature?: number; -``` - -## GenerationConfig.topK - -Signature: - -```typescript -topK?: number; -``` - -## GenerationConfig.topP - -Signature: - -```typescript -topP?: number; -``` diff --git a/docs-devsite/vertexai-preview.generativemodel.md b/docs-devsite/vertexai-preview.generativemodel.md deleted file mode 100644 index a50fac631cc..00000000000 --- a/docs-devsite/vertexai-preview.generativemodel.md +++ /dev/null @@ -1,201 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerativeModel class -Class for generative model APIs. - -Signature: - -```typescript -export declare class GenerativeModel -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai-preview.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [generationConfig](./vertexai-preview.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | | -| [model](./vertexai-preview.generativemodel.md#generativemodelmodel) | | string | | -| [requestOptions](./vertexai-preview.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | -| [safetySettings](./vertexai-preview.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface)\[\] | | -| [systemInstruction](./vertexai-preview.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.generativemodel.md#generativemodeltools) | | [Tool](./vertexai-preview.md#tool)\[\] | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [countTokens(request)](./vertexai-preview.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | -| [generateContent(request)](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [generateContentStream(request)](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | -| [startChat(startChatParams)](./vertexai-preview.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | - -## GenerativeModel.(constructor) - -Constructs a new instance of the `GenerativeModel` class - -Signature: - -```typescript -constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vertexAI | [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | | -| modelParams | [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | - -## GenerativeModel.generationConfig - -Signature: - -```typescript -generationConfig: GenerationConfig; -``` - -## GenerativeModel.model - -Signature: - -```typescript -model: string; -``` - -## GenerativeModel.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions; -``` - -## GenerativeModel.safetySettings - -Signature: - -```typescript -safetySettings: SafetySetting[]; -``` - -## GenerativeModel.systemInstruction - -Signature: - -```typescript -systemInstruction?: Content; -``` - -## GenerativeModel.toolConfig - -Signature: - -```typescript -toolConfig?: ToolConfig; -``` - -## GenerativeModel.tools - -Signature: - -```typescript -tools?: Tool[]; -``` - -## GenerativeModel.countTokens() - -Counts the tokens in the provided request. - -Signature: - -```typescript -countTokens(request: CountTokensRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [CountTokensRequest](./vertexai-preview.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[CountTokensResponse](./vertexai-preview.counttokensresponse.md#counttokensresponse_interface)> - -## GenerativeModel.generateContent() - -Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -generateContent(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)> - -## GenerativeModel.generateContentStream() - -Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. - -Signature: - -```typescript -generateContentStream(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - -## GenerativeModel.startChat() - -Gets a new [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. - -Signature: - -```typescript -startChat(startChatParams?: StartChatParams): ChatSession; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| startChatParams | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) | | - -Returns: - -[ChatSession](./vertexai-preview.chatsession.md#chatsession_class) - diff --git a/docs-devsite/vertexai-preview.md b/docs-devsite/vertexai-preview.md deleted file mode 100644 index 27829c8ad2e..00000000000 --- a/docs-devsite/vertexai-preview.md +++ /dev/null @@ -1,397 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# vertexai-preview package -The Vertex AI in Firebase Web SDK. - -## Functions - -| Function | Description | -| --- | --- | -| function(app, ...) | -| [getVertexAI(app, options)](./vertexai-preview.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance for the given app. | -| function(vertexAI, ...) | -| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai-preview.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | - -## Classes - -| Class | Description | -| --- | --- | -| [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | -| [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) | Class for generative model APIs. | -| [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI in Firebase SDK. | - -## Enumerations - -| Enumeration | Description | -| --- | --- | -| [BlockReason](./vertexai-preview.md#blockreason) | Reason that a prompt was blocked. | -| [FinishReason](./vertexai-preview.md#finishreason) | Reason that a candidate finished. | -| [FunctionCallingMode](./vertexai-preview.md#functioncallingmode) | | -| [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ | -| [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | | -| [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | -| [HarmCategory](./vertexai-preview.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | -| [HarmProbability](./vertexai-preview.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | -| [HarmSeverity](./vertexai-preview.md#harmseverity) | Harm severity levels. | -| [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) can have. | - -## Interfaces - -| Interface | Description | -| --- | --- | -| [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | -| [Citation](./vertexai-preview.citation.md#citation_interface) | A single citation. | -| [CitationMetadata](./vertexai-preview.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface). | -| [Content](./vertexai-preview.content.md#content_interface) | Content type for both prompts and response candidates. | -| [CountTokensRequest](./vertexai-preview.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens) | -| [CountTokensResponse](./vertexai-preview.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens). | -| [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | -| [Date\_2](./vertexai-preview.date_2.md#date_2_interface) | Protobuf google.type.Date | -| [EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | -| [ErrorDetails](./vertexai-preview.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | -| [FileData](./vertexai-preview.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | -| [FileDataPart](./vertexai-preview.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai-preview.filedata.md#filedata_interface) | -| [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | -| [FunctionCallingConfig](./vertexai-preview.functioncallingconfig.md#functioncallingconfig_interface) | | -| [FunctionCallPart](./vertexai-preview.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface). | -| [FunctionDeclaration](./vertexai-preview.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | -| [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Schema for parameters passed to [FunctionDeclaration.parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters). | -| [FunctionDeclarationSchemaProperty](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemaproperty_interface) | Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. | -| [FunctionDeclarationsTool](./vertexai-preview.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | -| [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) made based on model prediction. | -| [FunctionResponsePart](./vertexai-preview.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface). | -| [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) | -| [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | -| [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) call. | -| [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | -| [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | Config options for content-related requests | -| [GenerativeContentBlob](./vertexai-preview.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | -| [GroundingAttribution](./vertexai-preview.groundingattribution.md#groundingattribution_interface) | | -| [GroundingMetadata](./vertexai-preview.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | -| [InlineDataPart](./vertexai-preview.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | -| [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). | -| [PromptFeedback](./vertexai-preview.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | -| [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). | -| [RetrievedContextAttribution](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) | -| [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | -| [Segment](./vertexai-preview.segment.md#segment_interface) | | -| [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai-preview.generativemodel.md#generativemodelstartchat). | -| [TextPart](./vertexai-preview.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | -| [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | -| [UsageMetadata](./vertexai-preview.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | -| [VertexAIOptions](./vertexai-preview.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI in Firebase SDK. | -| [VideoMetadata](./vertexai-preview.videometadata.md#videometadata_interface) | Describes the input video content. | -| [WebAttribution](./vertexai-preview.webattribution.md#webattribution_interface) | | - -## Variables - -| Variable | Description | -| --- | --- | -| [POSSIBLE\_ROLES](./vertexai-preview.md#possible_roles) | Possible roles. | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [Part](./vertexai-preview.md#part) | Content part - includes text, image/video, or function call/response part types. | -| [Role](./vertexai-preview.md#role) | Role is the producer of the content. | -| [Tool](./vertexai-preview.md#tool) | Defines a tool that model can call to access external knowledge. | - -## function(app, ...) - -### getVertexAI(app, options) {:#getvertexai_04094cf} - -Returns a [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance for the given app. - -Signature: - -```typescript -export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | -| options | [VertexAIOptions](./vertexai-preview.vertexaioptions.md#vertexaioptions_interface) | | - -Returns: - -[VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) - -## function(vertexAI, ...) - -### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} - -Returns a [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. - -Signature: - -```typescript -export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vertexAI | [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | | -| modelParams | [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | - -Returns: - -[GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) - -## POSSIBLE\_ROLES - -Possible roles. - -Signature: - -```typescript -POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] -``` - -## Part - -Content part - includes text, image/video, or function call/response part types. - -Signature: - -```typescript -export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; -``` - -## Role - -Role is the producer of the content. - -Signature: - -```typescript -export declare type Role = (typeof POSSIBLE_ROLES)[number]; -``` - -## Tool - -Defines a tool that model can call to access external knowledge. - -Signature: - -```typescript -export declare type Tool = FunctionDeclarationsTool; -``` - -## BlockReason - -Reason that a prompt was blocked. - -Signature: - -```typescript -export declare enum BlockReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCKED\_REASON\_UNSPECIFIED | "BLOCKED_REASON_UNSPECIFIED" | | -| OTHER | "OTHER" | | -| SAFETY | "SAFETY" | | - -## FinishReason - -Reason that a candidate finished. - -Signature: - -```typescript -export declare enum FinishReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| FINISH\_REASON\_UNSPECIFIED | "FINISH_REASON_UNSPECIFIED" | | -| MAX\_TOKENS | "MAX_TOKENS" | | -| OTHER | "OTHER" | | -| RECITATION | "RECITATION" | | -| SAFETY | "SAFETY" | | -| STOP | "STOP" | | - -## FunctionCallingMode - - -Signature: - -```typescript -export declare enum FunctionCallingMode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ANY | "ANY" | | -| AUTO | "AUTO" | | -| MODE\_UNSPECIFIED | "MODE_UNSPECIFIED" | | -| NONE | "NONE" | | - -## FunctionDeclarationSchemaType - -Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ - -Signature: - -```typescript -export declare enum FunctionDeclarationSchemaType -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ARRAY | "ARRAY" | Array type. | -| BOOLEAN | "BOOLEAN" | Boolean type. | -| INTEGER | "INTEGER" | Integer type. | -| NUMBER | "NUMBER" | Number type. | -| OBJECT | "OBJECT" | Object type. | -| STRING | "STRING" | String type. | - -## HarmBlockMethod - - -Signature: - -```typescript -export declare enum HarmBlockMethod -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_BLOCK\_METHOD\_UNSPECIFIED | "HARM_BLOCK_METHOD_UNSPECIFIED" | | -| PROBABILITY | "PROBABILITY" | | -| SEVERITY | "SEVERITY" | | - -## HarmBlockThreshold - -Threshold above which a prompt or candidate will be blocked. - -Signature: - -```typescript -export declare enum HarmBlockThreshold -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | -| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | -| BLOCK\_NONE | "BLOCK_NONE" | | -| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | -| HARM\_BLOCK\_THRESHOLD\_UNSPECIFIED | "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | | - -## HarmCategory - -Harm categories that would cause prompts or candidates to be blocked. - -Signature: - -```typescript -export declare enum HarmCategory -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | -| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | -| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | -| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | -| HARM\_CATEGORY\_UNSPECIFIED | "HARM_CATEGORY_UNSPECIFIED" | | - -## HarmProbability - -Probability that a prompt or candidate matches a harm category. - -Signature: - -```typescript -export declare enum HarmProbability -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_PROBABILITY\_UNSPECIFIED | "HARM_PROBABILITY_UNSPECIFIED" | | -| HIGH | "HIGH" | | -| LOW | "LOW" | | -| MEDIUM | "MEDIUM" | | -| NEGLIGIBLE | "NEGLIGIBLE" | | - -## HarmSeverity - -Harm severity levels. - -Signature: - -```typescript -export declare enum HarmSeverity -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | -| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | -| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | -| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | -| HARM\_SEVERITY\_UNSPECIFIED | "HARM_SEVERITY_UNSPECIFIED" | | - -## VertexAIErrorCode - -Standardized error codes that [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) can have. - -Signature: - -```typescript -export declare const enum VertexAIErrorCode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ERROR | "error" | A generic error occurred. | -| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | -| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | -| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | -| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | -| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | -| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | -| REQUEST\_ERROR | "request-error" | An error occurred in a request. | -| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | - diff --git a/docs-devsite/vertexai.arrayschema.md b/docs-devsite/vertexai.arrayschema.md new file mode 100644 index 00000000000..8f228baf9e8 --- /dev/null +++ b/docs-devsite/vertexai.arrayschema.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArraySchema class +Schema class for "array" types. The `items` param should refer to the type of item that can be a member of the array. + +Signature: + +```typescript +export declare class ArraySchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, items)](./vertexai.arrayschema.md#arrayschemaconstructor) | | Constructs a new instance of the ArraySchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [items](./vertexai.arrayschema.md#arrayschemaitems) | | [TypedSchema](./vertexai.md#typedschema) | | + +## ArraySchema.(constructor) + +Constructs a new instance of the `ArraySchema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaParams, items: TypedSchema); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| items | [TypedSchema](./vertexai.md#typedschema) | | + +## ArraySchema.items + +Signature: + +```typescript +items: TypedSchema; +``` diff --git a/docs-devsite/vertexai-preview.baseparams.md b/docs-devsite/vertexai.baseparams.md similarity index 67% rename from docs-devsite/vertexai-preview.baseparams.md rename to docs-devsite/vertexai.baseparams.md index 6756c919ccc..382ec825210 100644 --- a/docs-devsite/vertexai-preview.baseparams.md +++ b/docs-devsite/vertexai.baseparams.md @@ -22,8 +22,8 @@ export interface BaseParams | Property | Type | Description | | --- | --- | --- | -| [generationConfig](./vertexai-preview.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | | -| [safetySettings](./vertexai-preview.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface)\[\] | | +| [generationConfig](./vertexai.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | +| [safetySettings](./vertexai.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | ## BaseParams.generationConfig diff --git a/docs-devsite/vertexai.booleanschema.md b/docs-devsite/vertexai.booleanschema.md new file mode 100644 index 00000000000..89449f26142 --- /dev/null +++ b/docs-devsite/vertexai.booleanschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# BooleanSchema class +Schema class for "boolean" types. + +Signature: + +```typescript +export declare class BooleanSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.booleanschema.md#booleanschemaconstructor) | | Constructs a new instance of the BooleanSchema class | + +## BooleanSchema.(constructor) + +Constructs a new instance of the `BooleanSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.chatsession.md b/docs-devsite/vertexai.chatsession.md new file mode 100644 index 00000000000..cc5a75ace16 --- /dev/null +++ b/docs-devsite/vertexai.chatsession.md @@ -0,0 +1,138 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ChatSession class +ChatSession class that enables sending chat messages and stores history of sent and received messages so far. + +Signature: + +```typescript +export declare class ChatSession +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [model](./vertexai.chatsession.md#chatsessionmodel) | | string | | +| [params](./vertexai.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | +| [requestOptions](./vertexai.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [getHistory()](./vertexai.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | +| [sendMessage(request)](./vertexai.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | +| [sendMessageStream(request)](./vertexai.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | + +## ChatSession.(constructor) + +Constructs a new instance of the `ChatSession` class + +Signature: + +```typescript +constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| apiSettings | ApiSettings | | +| model | string | | +| params | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | + +## ChatSession.model + +Signature: + +```typescript +model: string; +``` + +## ChatSession.params + +Signature: + +```typescript +params?: StartChatParams | undefined; +``` + +## ChatSession.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions | undefined; +``` + +## ChatSession.getHistory() + +Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. + +Signature: + +```typescript +getHistory(): Promise; +``` +Returns: + +Promise<[Content](./vertexai.content.md#content_interface)\[\]> + +## ChatSession.sendMessage() + +Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) + +Signature: + +```typescript +sendMessage(request: string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> + +## ChatSession.sendMessageStream() + +Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. + +Signature: + +```typescript +sendMessageStream(request: string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + diff --git a/docs-devsite/vertexai-preview.citation.md b/docs-devsite/vertexai.citation.md similarity index 68% rename from docs-devsite/vertexai-preview.citation.md rename to docs-devsite/vertexai.citation.md index 10a615ee247..b5f5a19f231 100644 --- a/docs-devsite/vertexai-preview.citation.md +++ b/docs-devsite/vertexai.citation.md @@ -22,12 +22,12 @@ export interface Citation | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai-preview.citation.md#citationendindex) | number | | -| [license](./vertexai-preview.citation.md#citationlicense) | string | | -| [publicationDate](./vertexai-preview.citation.md#citationpublicationdate) | Date | | -| [startIndex](./vertexai-preview.citation.md#citationstartindex) | number | | -| [title](./vertexai-preview.citation.md#citationtitle) | string | | -| [uri](./vertexai-preview.citation.md#citationuri) | string | | +| [endIndex](./vertexai.citation.md#citationendindex) | number | | +| [license](./vertexai.citation.md#citationlicense) | string | | +| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | | +| [startIndex](./vertexai.citation.md#citationstartindex) | number | | +| [title](./vertexai.citation.md#citationtitle) | string | | +| [uri](./vertexai.citation.md#citationuri) | string | | ## Citation.endIndex diff --git a/docs-devsite/vertexai-preview.citationmetadata.md b/docs-devsite/vertexai.citationmetadata.md similarity index 64% rename from docs-devsite/vertexai-preview.citationmetadata.md rename to docs-devsite/vertexai.citationmetadata.md index fa740ca1af7..e3d41a37d98 100644 --- a/docs-devsite/vertexai-preview.citationmetadata.md +++ b/docs-devsite/vertexai.citationmetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CitationMetadata interface -Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface). +Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). Signature: @@ -22,7 +22,7 @@ export interface CitationMetadata | Property | Type | Description | | --- | --- | --- | -| [citations](./vertexai-preview.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai-preview.citation.md#citation_interface)\[\] | | +| [citations](./vertexai.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai.citation.md#citation_interface)\[\] | | ## CitationMetadata.citations diff --git a/docs-devsite/vertexai-preview.content.md b/docs-devsite/vertexai.content.md similarity index 76% rename from docs-devsite/vertexai-preview.content.md rename to docs-devsite/vertexai.content.md index 26198a3951f..7a4634a62bc 100644 --- a/docs-devsite/vertexai-preview.content.md +++ b/docs-devsite/vertexai.content.md @@ -22,8 +22,8 @@ export interface Content | Property | Type | Description | | --- | --- | --- | -| [parts](./vertexai-preview.content.md#contentparts) | [Part](./vertexai-preview.md#part)\[\] | | -| [role](./vertexai-preview.content.md#contentrole) | [Role](./vertexai-preview.md#role) | | +| [parts](./vertexai.content.md#contentparts) | [Part](./vertexai.md#part)\[\] | | +| [role](./vertexai.content.md#contentrole) | [Role](./vertexai.md#role) | | ## Content.parts diff --git a/docs-devsite/vertexai-preview.counttokensrequest.md b/docs-devsite/vertexai.counttokensrequest.md similarity index 68% rename from docs-devsite/vertexai-preview.counttokensrequest.md rename to docs-devsite/vertexai.counttokensrequest.md index 07e5f0d85f3..db519b7eb11 100644 --- a/docs-devsite/vertexai-preview.counttokensrequest.md +++ b/docs-devsite/vertexai.counttokensrequest.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensRequest interface -Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens) +Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) Signature: @@ -22,7 +22,7 @@ export interface CountTokensRequest | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai-preview.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | +| [contents](./vertexai.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | ## CountTokensRequest.contents diff --git a/docs-devsite/vertexai-preview.counttokensresponse.md b/docs-devsite/vertexai.counttokensresponse.md similarity index 67% rename from docs-devsite/vertexai-preview.counttokensresponse.md rename to docs-devsite/vertexai.counttokensresponse.md index d097d5aacff..2978f9a45bb 100644 --- a/docs-devsite/vertexai-preview.counttokensresponse.md +++ b/docs-devsite/vertexai.counttokensresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensResponse interface -Response from calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens). +Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). Signature: @@ -22,8 +22,8 @@ export interface CountTokensResponse | Property | Type | Description | | --- | --- | --- | -| [totalBillableCharacters](./vertexai-preview.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | -| [totalTokens](./vertexai-preview.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | +| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | +| [totalTokens](./vertexai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | ## CountTokensResponse.totalBillableCharacters diff --git a/docs-devsite/vertexai-preview.customerrordata.md b/docs-devsite/vertexai.customerrordata.md similarity index 54% rename from docs-devsite/vertexai-preview.customerrordata.md rename to docs-devsite/vertexai.customerrordata.md index f0af0574161..701b1b84c49 100644 --- a/docs-devsite/vertexai-preview.customerrordata.md +++ b/docs-devsite/vertexai.customerrordata.md @@ -22,10 +22,10 @@ export interface CustomErrorData | Property | Type | Description | | --- | --- | --- | -| [errorDetails](./vertexai-preview.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai-preview.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | -| [response](./vertexai-preview.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) | -| [status](./vertexai-preview.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | -| [statusText](./vertexai-preview.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | +| [errorDetails](./vertexai.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | +| [response](./vertexai.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | +| [status](./vertexai.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | +| [statusText](./vertexai.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | ## CustomErrorData.errorDetails @@ -39,7 +39,7 @@ errorDetails?: ErrorDetails[]; ## CustomErrorData.response -Response from a [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) +Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) Signature: diff --git a/docs-devsite/vertexai-preview.date_2.md b/docs-devsite/vertexai.date_2.md similarity index 78% rename from docs-devsite/vertexai-preview.date_2.md rename to docs-devsite/vertexai.date_2.md index 5af031447c4..cf073bb86fe 100644 --- a/docs-devsite/vertexai-preview.date_2.md +++ b/docs-devsite/vertexai.date_2.md @@ -22,9 +22,9 @@ export interface Date | Property | Type | Description | | --- | --- | --- | -| [day](./vertexai-preview.date_2.md#date_2day) | number | | -| [month](./vertexai-preview.date_2.md#date_2month) | number | | -| [year](./vertexai-preview.date_2.md#date_2year) | number | | +| [day](./vertexai.date_2.md#date_2day) | number | | +| [month](./vertexai.date_2.md#date_2month) | number | | +| [year](./vertexai.date_2.md#date_2year) | number | | ## Date\_2.day diff --git a/docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md similarity index 61% rename from docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md rename to docs-devsite/vertexai.enhancedgeneratecontentresponse.md index 132c5ed0be2..535fb9def8f 100644 --- a/docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md +++ b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md @@ -17,14 +17,14 @@ Response object wrapped with helper methods. ```typescript export interface EnhancedGenerateContentResponse extends GenerateContentResponse ``` -Extends: [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) +Extends: [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [functionCalls](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface)\[\] \| undefined | | -| [text](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | +| [functionCalls](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai.functioncall.md#functioncall_interface)\[\] \| undefined | | +| [text](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | ## EnhancedGenerateContentResponse.functionCalls diff --git a/docs-devsite/vertexai-preview.errordetails.md b/docs-devsite/vertexai.errordetails.md similarity index 68% rename from docs-devsite/vertexai-preview.errordetails.md rename to docs-devsite/vertexai.errordetails.md index 45e84a618ab..68959343439 100644 --- a/docs-devsite/vertexai-preview.errordetails.md +++ b/docs-devsite/vertexai.errordetails.md @@ -22,10 +22,10 @@ export interface ErrorDetails | Property | Type | Description | | --- | --- | --- | -| ["@type"](./vertexai-preview.errordetails.md#errordetails"@type") | string | | -| [domain](./vertexai-preview.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | -| [metadata](./vertexai-preview.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | -| [reason](./vertexai-preview.errordetails.md#errordetailsreason) | string | The reason for the error. | +| ["@type"](./vertexai.errordetails.md#errordetails"@type") | string | | +| [domain](./vertexai.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | +| [metadata](./vertexai.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | +| [reason](./vertexai.errordetails.md#errordetailsreason) | string | The reason for the error. | ## ErrorDetails."@type" diff --git a/docs-devsite/vertexai-preview.filedata.md b/docs-devsite/vertexai.filedata.md similarity index 81% rename from docs-devsite/vertexai-preview.filedata.md rename to docs-devsite/vertexai.filedata.md index 577b4b1910d..7e000174692 100644 --- a/docs-devsite/vertexai-preview.filedata.md +++ b/docs-devsite/vertexai.filedata.md @@ -22,8 +22,8 @@ export interface FileData | Property | Type | Description | | --- | --- | --- | -| [fileUri](./vertexai-preview.filedata.md#filedatafileuri) | string | | -| [mimeType](./vertexai-preview.filedata.md#filedatamimetype) | string | | +| [fileUri](./vertexai.filedata.md#filedatafileuri) | string | | +| [mimeType](./vertexai.filedata.md#filedatamimetype) | string | | ## FileData.fileUri diff --git a/docs-devsite/vertexai-preview.filedatapart.md b/docs-devsite/vertexai.filedatapart.md similarity index 60% rename from docs-devsite/vertexai-preview.filedatapart.md rename to docs-devsite/vertexai.filedatapart.md index e03c056f588..74512fa6d29 100644 --- a/docs-devsite/vertexai-preview.filedatapart.md +++ b/docs-devsite/vertexai.filedatapart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FileDataPart interface -Content part interface if the part represents [FileData](./vertexai-preview.filedata.md#filedata_interface) +Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) Signature: @@ -22,11 +22,11 @@ export interface FileDataPart | Property | Type | Description | | --- | --- | --- | -| [fileData](./vertexai-preview.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai-preview.filedata.md#filedata_interface) | | -| [functionCall](./vertexai-preview.filedatapart.md#filedatapartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.filedatapart.md#filedatapartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.filedatapart.md#filedatapartinlinedata) | never | | -| [text](./vertexai-preview.filedatapart.md#filedataparttext) | never | | +| [fileData](./vertexai.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai.filedata.md#filedata_interface) | | +| [functionCall](./vertexai.filedatapart.md#filedatapartfunctioncall) | never | | +| [functionResponse](./vertexai.filedatapart.md#filedatapartfunctionresponse) | never | | +| [inlineData](./vertexai.filedatapart.md#filedatapartinlinedata) | never | | +| [text](./vertexai.filedatapart.md#filedataparttext) | never | | ## FileDataPart.fileData diff --git a/docs-devsite/vertexai-preview.functioncall.md b/docs-devsite/vertexai.functioncall.md similarity index 57% rename from docs-devsite/vertexai-preview.functioncall.md rename to docs-devsite/vertexai.functioncall.md index 60e0ea50dc4..ca7bc015438 100644 --- a/docs-devsite/vertexai-preview.functioncall.md +++ b/docs-devsite/vertexai.functioncall.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCall interface -A predicted [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. +A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. Signature: @@ -22,8 +22,8 @@ export interface FunctionCall | Property | Type | Description | | --- | --- | --- | -| [args](./vertexai-preview.functioncall.md#functioncallargs) | object | | -| [name](./vertexai-preview.functioncall.md#functioncallname) | string | | +| [args](./vertexai.functioncall.md#functioncallargs) | object | | +| [name](./vertexai.functioncall.md#functioncallname) | string | | ## FunctionCall.args diff --git a/docs-devsite/vertexai-preview.functioncallingconfig.md b/docs-devsite/vertexai.functioncallingconfig.md similarity index 71% rename from docs-devsite/vertexai-preview.functioncallingconfig.md rename to docs-devsite/vertexai.functioncallingconfig.md index 1965fb76e95..3724fec5bf7 100644 --- a/docs-devsite/vertexai-preview.functioncallingconfig.md +++ b/docs-devsite/vertexai.functioncallingconfig.md @@ -21,8 +21,8 @@ export interface FunctionCallingConfig | Property | Type | Description | | --- | --- | --- | -| [allowedFunctionNames](./vertexai-preview.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | -| [mode](./vertexai-preview.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai-preview.md#functioncallingmode) | | +| [allowedFunctionNames](./vertexai.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | +| [mode](./vertexai.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai.md#functioncallingmode) | | ## FunctionCallingConfig.allowedFunctionNames diff --git a/docs-devsite/vertexai-preview.functioncallpart.md b/docs-devsite/vertexai.functioncallpart.md similarity index 59% rename from docs-devsite/vertexai-preview.functioncallpart.md rename to docs-devsite/vertexai.functioncallpart.md index 5da204692f9..af8ccf1109a 100644 --- a/docs-devsite/vertexai-preview.functioncallpart.md +++ b/docs-devsite/vertexai.functioncallpart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCallPart interface -Content part interface if the part represents a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface). +Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionCallPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) | | -| [functionResponse](./vertexai-preview.functioncallpart.md#functioncallpartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.functioncallpart.md#functioncallpartinlinedata) | never | | -| [text](./vertexai-preview.functioncallpart.md#functioncallparttext) | never | | +| [functionCall](./vertexai.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | | +| [functionResponse](./vertexai.functioncallpart.md#functioncallpartfunctionresponse) | never | | +| [inlineData](./vertexai.functioncallpart.md#functioncallpartinlinedata) | never | | +| [text](./vertexai.functioncallpart.md#functioncallparttext) | never | | ## FunctionCallPart.functionCall diff --git a/docs-devsite/vertexai-preview.functiondeclaration.md b/docs-devsite/vertexai.functiondeclaration.md similarity index 57% rename from docs-devsite/vertexai-preview.functiondeclaration.md rename to docs-devsite/vertexai.functiondeclaration.md index e178c7e8bc3..211c1dd868d 100644 --- a/docs-devsite/vertexai-preview.functiondeclaration.md +++ b/docs-devsite/vertexai.functiondeclaration.md @@ -22,18 +22,18 @@ export declare interface FunctionDeclaration | Property | Type | Description | | --- | --- | --- | -| [description](./vertexai-preview.functiondeclaration.md#functiondeclarationdescription) | string | Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. | -| [name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | -| [parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters) | [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | +| [description](./vertexai.functiondeclaration.md#functiondeclarationdescription) | string | Description and purpose of the function. Model uses it to decide how and whether to call the function. | +| [name](./vertexai.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | +| [parameters](./vertexai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | ## FunctionDeclaration.description -Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. +Description and purpose of the function. Model uses it to decide how and whether to call the function. Signature: ```typescript -description?: string; +description: string; ``` ## FunctionDeclaration.name @@ -53,5 +53,5 @@ Optional. Describes the parameters to this function in JSON Schema Object format Signature: ```typescript -parameters?: FunctionDeclarationSchema; +parameters?: ObjectSchemaInterface; ``` diff --git a/docs-devsite/vertexai.functiondeclarationstool.md b/docs-devsite/vertexai.functiondeclarationstool.md new file mode 100644 index 00000000000..5e728046639 --- /dev/null +++ b/docs-devsite/vertexai.functiondeclarationstool.md @@ -0,0 +1,35 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FunctionDeclarationsTool interface +A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. + +Signature: + +```typescript +export declare interface FunctionDeclarationsTool +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionDeclarations](./vertexai.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | + +## FunctionDeclarationsTool.functionDeclarations + +Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. + +Signature: + +```typescript +functionDeclarations?: FunctionDeclaration[]; +``` diff --git a/docs-devsite/vertexai-preview.functionresponse.md b/docs-devsite/vertexai.functionresponse.md similarity index 50% rename from docs-devsite/vertexai-preview.functionresponse.md rename to docs-devsite/vertexai.functionresponse.md index d89ace08df1..0ca553e0e6b 100644 --- a/docs-devsite/vertexai-preview.functionresponse.md +++ b/docs-devsite/vertexai.functionresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponse interface -The result output from a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) made based on model prediction. +The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. Signature: @@ -22,8 +22,8 @@ export interface FunctionResponse | Property | Type | Description | | --- | --- | --- | -| [name](./vertexai-preview.functionresponse.md#functionresponsename) | string | | -| [response](./vertexai-preview.functionresponse.md#functionresponseresponse) | object | | +| [name](./vertexai.functionresponse.md#functionresponsename) | string | | +| [response](./vertexai.functionresponse.md#functionresponseresponse) | object | | ## FunctionResponse.name diff --git a/docs-devsite/vertexai-preview.functionresponsepart.md b/docs-devsite/vertexai.functionresponsepart.md similarity index 58% rename from docs-devsite/vertexai-preview.functionresponsepart.md rename to docs-devsite/vertexai.functionresponsepart.md index 4e246d625f6..1905c98cdc7 100644 --- a/docs-devsite/vertexai-preview.functionresponsepart.md +++ b/docs-devsite/vertexai.functionresponsepart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponsePart interface -Content part interface if the part represents [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface). +Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionResponsePart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.functionresponsepart.md#functionresponsepartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) | | -| [inlineData](./vertexai-preview.functionresponsepart.md#functionresponsepartinlinedata) | never | | -| [text](./vertexai-preview.functionresponsepart.md#functionresponseparttext) | never | | +| [functionCall](./vertexai.functionresponsepart.md#functionresponsepartfunctioncall) | never | | +| [functionResponse](./vertexai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | | +| [inlineData](./vertexai.functionresponsepart.md#functionresponsepartinlinedata) | never | | +| [text](./vertexai.functionresponsepart.md#functionresponseparttext) | never | | ## FunctionResponsePart.functionCall diff --git a/docs-devsite/vertexai.generatecontentcandidate.md b/docs-devsite/vertexai.generatecontentcandidate.md new file mode 100644 index 00000000000..a30eef55485 --- /dev/null +++ b/docs-devsite/vertexai.generatecontentcandidate.md @@ -0,0 +1,87 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerateContentCandidate interface +A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +export interface GenerateContentCandidate +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [citationMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | | +| [content](./vertexai.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai.content.md#content_interface) | | +| [finishMessage](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | +| [finishReason](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai.md#finishreason) | | +| [groundingMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | | +| [index](./vertexai.generatecontentcandidate.md#generatecontentcandidateindex) | number | | +| [safetyRatings](./vertexai.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | + +## GenerateContentCandidate.citationMetadata + +Signature: + +```typescript +citationMetadata?: CitationMetadata; +``` + +## GenerateContentCandidate.content + +Signature: + +```typescript +content: Content; +``` + +## GenerateContentCandidate.finishMessage + +Signature: + +```typescript +finishMessage?: string; +``` + +## GenerateContentCandidate.finishReason + +Signature: + +```typescript +finishReason?: FinishReason; +``` + +## GenerateContentCandidate.groundingMetadata + +Signature: + +```typescript +groundingMetadata?: GroundingMetadata; +``` + +## GenerateContentCandidate.index + +Signature: + +```typescript +index: number; +``` + +## GenerateContentCandidate.safetyRatings + +Signature: + +```typescript +safetyRatings?: SafetyRating[]; +``` diff --git a/docs-devsite/vertexai-preview.generatecontentrequest.md b/docs-devsite/vertexai.generatecontentrequest.md similarity index 54% rename from docs-devsite/vertexai-preview.generatecontentrequest.md rename to docs-devsite/vertexai.generatecontentrequest.md index 68ce52340e8..31f1103a2e2 100644 --- a/docs-devsite/vertexai-preview.generatecontentrequest.md +++ b/docs-devsite/vertexai.generatecontentrequest.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentRequest interface -Request sent through [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) +Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) Signature: ```typescript export interface GenerateContentRequest extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai-preview.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai-preview.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [contents](./vertexai.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | +| [systemInstruction](./vertexai.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai.md#tool)\[\] | | ## GenerateContentRequest.contents diff --git a/docs-devsite/vertexai-preview.generatecontentresponse.md b/docs-devsite/vertexai.generatecontentresponse.md similarity index 50% rename from docs-devsite/vertexai-preview.generatecontentresponse.md rename to docs-devsite/vertexai.generatecontentresponse.md index cb0fb0e3209..304674c9b6f 100644 --- a/docs-devsite/vertexai-preview.generatecontentresponse.md +++ b/docs-devsite/vertexai.generatecontentresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResponse interface -Individual response from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. +Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. Signature: @@ -22,9 +22,9 @@ export interface GenerateContentResponse | Property | Type | Description | | --- | --- | --- | -| [candidates](./vertexai-preview.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | -| [promptFeedback](./vertexai-preview.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai-preview.promptfeedback.md#promptfeedback_interface) | | -| [usageMetadata](./vertexai-preview.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai-preview.usagemetadata.md#usagemetadata_interface) | | +| [candidates](./vertexai.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | +| [promptFeedback](./vertexai.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | | +| [usageMetadata](./vertexai.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | | ## GenerateContentResponse.candidates diff --git a/docs-devsite/vertexai-preview.generatecontentresult.md b/docs-devsite/vertexai.generatecontentresult.md similarity index 69% rename from docs-devsite/vertexai-preview.generatecontentresult.md rename to docs-devsite/vertexai.generatecontentresult.md index 87249a5bc55..3e162f9ebb2 100644 --- a/docs-devsite/vertexai-preview.generatecontentresult.md +++ b/docs-devsite/vertexai.generatecontentresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResult interface -Result object returned from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) call. +Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. Signature: @@ -22,7 +22,7 @@ export interface GenerateContentResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai-preview.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | +| [response](./vertexai.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | ## GenerateContentResult.response diff --git a/docs-devsite/vertexai-preview.generatecontentstreamresult.md b/docs-devsite/vertexai.generatecontentstreamresult.md similarity index 52% rename from docs-devsite/vertexai-preview.generatecontentstreamresult.md rename to docs-devsite/vertexai.generatecontentstreamresult.md index 6fd46600079..340abb1d0bd 100644 --- a/docs-devsite/vertexai-preview.generatecontentstreamresult.md +++ b/docs-devsite/vertexai.generatecontentstreamresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentStreamResult interface -Result object returned from [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. +Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. Signature: @@ -22,8 +22,8 @@ export interface GenerateContentStreamResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | -| [stream](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [response](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [stream](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | ## GenerateContentStreamResult.response diff --git a/docs-devsite/vertexai.generationconfig.md b/docs-devsite/vertexai.generationconfig.md new file mode 100644 index 00000000000..3c3d0a14ffa --- /dev/null +++ b/docs-devsite/vertexai.generationconfig.md @@ -0,0 +1,118 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerationConfig interface +Config options for content-related requests + +Signature: + +```typescript +export interface GenerationConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [candidateCount](./vertexai.generationconfig.md#generationconfigcandidatecount) | number | | +| [frequencyPenalty](./vertexai.generationconfig.md#generationconfigfrequencypenalty) | number | | +| [maxOutputTokens](./vertexai.generationconfig.md#generationconfigmaxoutputtokens) | number | | +| [presencePenalty](./vertexai.generationconfig.md#generationconfigpresencepenalty) | number | | +| [responseMimeType](./vertexai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | +| [responseSchema](./vertexai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./vertexai.md#typedschema) \| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | +| [stopSequences](./vertexai.generationconfig.md#generationconfigstopsequences) | string\[\] | | +| [temperature](./vertexai.generationconfig.md#generationconfigtemperature) | number | | +| [topK](./vertexai.generationconfig.md#generationconfigtopk) | number | | +| [topP](./vertexai.generationconfig.md#generationconfigtopp) | number | | + +## GenerationConfig.candidateCount + +Signature: + +```typescript +candidateCount?: number; +``` + +## GenerationConfig.frequencyPenalty + +Signature: + +```typescript +frequencyPenalty?: number; +``` + +## GenerationConfig.maxOutputTokens + +Signature: + +```typescript +maxOutputTokens?: number; +``` + +## GenerationConfig.presencePenalty + +Signature: + +```typescript +presencePenalty?: number; +``` + +## GenerationConfig.responseMimeType + +Output response MIME type of the generated candidate text. Supported MIME types are `text/plain` (default, text output), `application/json` (JSON response in the candidates), and `text/x.enum`. + +Signature: + +```typescript +responseMimeType?: string; +``` + +## GenerationConfig.responseSchema + +Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. + +Signature: + +```typescript +responseSchema?: TypedSchema | SchemaRequest; +``` + +## GenerationConfig.stopSequences + +Signature: + +```typescript +stopSequences?: string[]; +``` + +## GenerationConfig.temperature + +Signature: + +```typescript +temperature?: number; +``` + +## GenerationConfig.topK + +Signature: + +```typescript +topK?: number; +``` + +## GenerationConfig.topP + +Signature: + +```typescript +topP?: number; +``` diff --git a/docs-devsite/vertexai-preview.generativecontentblob.md b/docs-devsite/vertexai.generativecontentblob.md similarity index 76% rename from docs-devsite/vertexai-preview.generativecontentblob.md rename to docs-devsite/vertexai.generativecontentblob.md index b5dcb272027..dfcd098291f 100644 --- a/docs-devsite/vertexai-preview.generativecontentblob.md +++ b/docs-devsite/vertexai.generativecontentblob.md @@ -22,8 +22,8 @@ export interface GenerativeContentBlob | Property | Type | Description | | --- | --- | --- | -| [data](./vertexai-preview.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | -| [mimeType](./vertexai-preview.generativecontentblob.md#generativecontentblobmimetype) | string | | +| [data](./vertexai.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | +| [mimeType](./vertexai.generativecontentblob.md#generativecontentblobmimetype) | string | | ## GenerativeContentBlob.data diff --git a/docs-devsite/vertexai.generativemodel.md b/docs-devsite/vertexai.generativemodel.md new file mode 100644 index 00000000000..7105f9c100b --- /dev/null +++ b/docs-devsite/vertexai.generativemodel.md @@ -0,0 +1,201 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerativeModel class +Class for generative model APIs. + +Signature: + +```typescript +export declare class GenerativeModel +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [generationConfig](./vertexai.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | +| [model](./vertexai.generativemodel.md#generativemodelmodel) | | string | | +| [requestOptions](./vertexai.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | +| [safetySettings](./vertexai.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | +| [systemInstruction](./vertexai.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.generativemodel.md#generativemodeltools) | | [Tool](./vertexai.md#tool)\[\] | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [countTokens(request)](./vertexai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | +| [generateContent(request)](./vertexai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [generateContentStream(request)](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | +| [startChat(startChatParams)](./vertexai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | + +## GenerativeModel.(constructor) + +Constructs a new instance of the `GenerativeModel` class + +Signature: + +```typescript +constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | +| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | + +## GenerativeModel.generationConfig + +Signature: + +```typescript +generationConfig: GenerationConfig; +``` + +## GenerativeModel.model + +Signature: + +```typescript +model: string; +``` + +## GenerativeModel.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions; +``` + +## GenerativeModel.safetySettings + +Signature: + +```typescript +safetySettings: SafetySetting[]; +``` + +## GenerativeModel.systemInstruction + +Signature: + +```typescript +systemInstruction?: Content; +``` + +## GenerativeModel.toolConfig + +Signature: + +```typescript +toolConfig?: ToolConfig; +``` + +## GenerativeModel.tools + +Signature: + +```typescript +tools?: Tool[]; +``` + +## GenerativeModel.countTokens() + +Counts the tokens in the provided request. + +Signature: + +```typescript +countTokens(request: CountTokensRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface)> + +## GenerativeModel.generateContent() + +Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +generateContent(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> + +## GenerativeModel.generateContentStream() + +Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. + +Signature: + +```typescript +generateContentStream(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + +## GenerativeModel.startChat() + +Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. + +Signature: + +```typescript +startChat(startChatParams?: StartChatParams): ChatSession; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| startChatParams | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | | + +Returns: + +[ChatSession](./vertexai.chatsession.md#chatsession_class) + diff --git a/docs-devsite/vertexai-preview.groundingattribution.md b/docs-devsite/vertexai.groundingattribution.md similarity index 58% rename from docs-devsite/vertexai-preview.groundingattribution.md rename to docs-devsite/vertexai.groundingattribution.md index 2c7d2f09e0b..b72d8150635 100644 --- a/docs-devsite/vertexai-preview.groundingattribution.md +++ b/docs-devsite/vertexai.groundingattribution.md @@ -21,10 +21,10 @@ export interface GroundingAttribution | Property | Type | Description | | --- | --- | --- | -| [confidenceScore](./vertexai-preview.groundingattribution.md#groundingattributionconfidencescore) | number | | -| [retrievedContext](./vertexai-preview.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [segment](./vertexai-preview.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai-preview.segment.md#segment_interface) | | -| [web](./vertexai-preview.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai-preview.webattribution.md#webattribution_interface) | | +| [confidenceScore](./vertexai.groundingattribution.md#groundingattributionconfidencescore) | number | | +| [retrievedContext](./vertexai.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [segment](./vertexai.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai.segment.md#segment_interface) | | +| [web](./vertexai.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | ## GroundingAttribution.confidenceScore diff --git a/docs-devsite/vertexai-preview.groundingmetadata.md b/docs-devsite/vertexai.groundingmetadata.md similarity index 66% rename from docs-devsite/vertexai-preview.groundingmetadata.md rename to docs-devsite/vertexai.groundingmetadata.md index 5f40a00457d..186f00d29a7 100644 --- a/docs-devsite/vertexai-preview.groundingmetadata.md +++ b/docs-devsite/vertexai.groundingmetadata.md @@ -22,9 +22,9 @@ export interface GroundingMetadata | Property | Type | Description | | --- | --- | --- | -| [groundingAttributions](./vertexai-preview.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai-preview.groundingattribution.md#groundingattribution_interface)\[\] | | -| [retrievalQueries](./vertexai-preview.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | -| [webSearchQueries](./vertexai-preview.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | +| [groundingAttributions](./vertexai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface)\[\] | | +| [retrievalQueries](./vertexai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | +| [webSearchQueries](./vertexai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | ## GroundingMetadata.groundingAttributions diff --git a/docs-devsite/vertexai-preview.inlinedatapart.md b/docs-devsite/vertexai.inlinedatapart.md similarity index 60% rename from docs-devsite/vertexai-preview.inlinedatapart.md rename to docs-devsite/vertexai.inlinedatapart.md index ae05f80ddb7..0cb064fc357 100644 --- a/docs-devsite/vertexai-preview.inlinedatapart.md +++ b/docs-devsite/vertexai.inlinedatapart.md @@ -22,11 +22,11 @@ export interface InlineDataPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.inlinedatapart.md#inlinedatapartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai-preview.generativecontentblob.md#generativecontentblob_interface) | | -| [text](./vertexai-preview.inlinedatapart.md#inlinedataparttext) | never | | -| [videoMetadata](./vertexai-preview.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai-preview.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | +| [functionCall](./vertexai.inlinedatapart.md#inlinedatapartfunctioncall) | never | | +| [functionResponse](./vertexai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | +| [inlineData](./vertexai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | | +| [text](./vertexai.inlinedatapart.md#inlinedataparttext) | never | | +| [videoMetadata](./vertexai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | ## InlineDataPart.functionCall diff --git a/docs-devsite/vertexai.integerschema.md b/docs-devsite/vertexai.integerschema.md new file mode 100644 index 00000000000..4822bdd618b --- /dev/null +++ b/docs-devsite/vertexai.integerschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# IntegerSchema class +Schema class for "integer" types. + +Signature: + +```typescript +export declare class IntegerSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.integerschema.md#integerschemaconstructor) | | Constructs a new instance of the IntegerSchema class | + +## IntegerSchema.(constructor) + +Constructs a new instance of the `IntegerSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md new file mode 100644 index 00000000000..d9e26eabc5d --- /dev/null +++ b/docs-devsite/vertexai.md @@ -0,0 +1,412 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# vertexai package +The Vertex AI in Firebase Web SDK. + +## Functions + +| Function | Description | +| --- | --- | +| function(app, ...) | +| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. | +| function(vertexAI, ...) | +| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | + +## Classes + +| Class | Description | +| --- | --- | +| [ArraySchema](./vertexai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items param should refer to the type of item that can be a member of the array. | +| [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | +| [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | +| [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | +| [IntegerSchema](./vertexai.integerschema.md#integerschema_class) | Schema class for "integer" types. | +| [NumberSchema](./vertexai.numberschema.md#numberschema_class) | Schema class for "number" types. | +| [ObjectSchema](./vertexai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | +| [Schema](./vertexai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | +| [StringSchema](./vertexai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | +| [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI in Firebase SDK. | + +## Enumerations + +| Enumeration | Description | +| --- | --- | +| [BlockReason](./vertexai.md#blockreason) | Reason that a prompt was blocked. | +| [FinishReason](./vertexai.md#finishreason) | Reason that a candidate finished. | +| [FunctionCallingMode](./vertexai.md#functioncallingmode) | | +| [HarmBlockMethod](./vertexai.md#harmblockmethod) | | +| [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | +| [HarmCategory](./vertexai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | +| [HarmProbability](./vertexai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | +| [HarmSeverity](./vertexai.md#harmseverity) | Harm severity levels. | +| [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | +| [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [BaseParams](./vertexai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | +| [Citation](./vertexai.citation.md#citation_interface) | A single citation. | +| [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). | +| [Content](./vertexai.content.md#content_interface) | Content type for both prompts and response candidates. | +| [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) | +| [CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). | +| [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | +| [Date\_2](./vertexai.date_2.md#date_2_interface) | Protobuf google.type.Date | +| [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | +| [ErrorDetails](./vertexai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | +| [FileData](./vertexai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | +| [FileDataPart](./vertexai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) | +| [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | +| [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | +| [FunctionCallPart](./vertexai.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). | +| [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | +| [FunctionDeclarationsTool](./vertexai.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | +| [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. | +| [FunctionResponsePart](./vertexai.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). | +| [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) | +| [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | +| [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. | +| [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | +| [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Config options for content-related requests | +| [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | +| [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface) | | +| [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | +| [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | +| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | +| [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | +| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | +| [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | +| [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | Interface for [Schema](./vertexai.schema.md#schema_class) class. | +| [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. | +| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. | +| [SchemaShared](./vertexai.schemashared.md#schemashared_interface) | Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. | +| [Segment](./vertexai.segment.md#segment_interface) | | +| [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). | +| [TextPart](./vertexai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | +| [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | +| [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | +| [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI in Firebase SDK. | +| [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Describes the input video content. | +| [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [POSSIBLE\_ROLES](./vertexai.md#possible_roles) | Possible roles. | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [Part](./vertexai.md#part) | Content part - includes text, image/video, or function call/response part types. | +| [Role](./vertexai.md#role) | Role is the producer of the content. | +| [Tool](./vertexai.md#tool) | Defines a tool that model can call to access external knowledge. | +| [TypedSchema](./vertexai.md#typedschema) | A type that includes all specific Schema types. | + +## function(app, ...) + +### getVertexAI(app, options) {:#getvertexai_04094cf} + +Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. + +Signature: + +```typescript +export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | +| options | [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | | + +Returns: + +[VertexAI](./vertexai.vertexai.md#vertexai_interface) + +## function(vertexAI, ...) + +### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} + +Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. + +Signature: + +```typescript +export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | +| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | + +Returns: + +[GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) + +## POSSIBLE\_ROLES + +Possible roles. + +Signature: + +```typescript +POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] +``` + +## Part + +Content part - includes text, image/video, or function call/response part types. + +Signature: + +```typescript +export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +``` + +## Role + +Role is the producer of the content. + +Signature: + +```typescript +export type Role = (typeof POSSIBLE_ROLES)[number]; +``` + +## Tool + +Defines a tool that model can call to access external knowledge. + +Signature: + +```typescript +export declare type Tool = FunctionDeclarationsTool; +``` + +## TypedSchema + +A type that includes all specific Schema types. + +Signature: + +```typescript +export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; +``` + +## BlockReason + +Reason that a prompt was blocked. + +Signature: + +```typescript +export declare enum BlockReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| OTHER | "OTHER" | | +| SAFETY | "SAFETY" | | + +## FinishReason + +Reason that a candidate finished. + +Signature: + +```typescript +export declare enum FinishReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| MAX\_TOKENS | "MAX_TOKENS" | | +| OTHER | "OTHER" | | +| RECITATION | "RECITATION" | | +| SAFETY | "SAFETY" | | +| STOP | "STOP" | | + +## FunctionCallingMode + + +Signature: + +```typescript +export declare enum FunctionCallingMode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ANY | "ANY" | | +| AUTO | "AUTO" | | +| NONE | "NONE" | | + +## HarmBlockMethod + + +Signature: + +```typescript +export declare enum HarmBlockMethod +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| PROBABILITY | "PROBABILITY" | | +| SEVERITY | "SEVERITY" | | + +## HarmBlockThreshold + +Threshold above which a prompt or candidate will be blocked. + +Signature: + +```typescript +export declare enum HarmBlockThreshold +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | +| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | +| BLOCK\_NONE | "BLOCK_NONE" | | +| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | + +## HarmCategory + +Harm categories that would cause prompts or candidates to be blocked. + +Signature: + +```typescript +export declare enum HarmCategory +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | +| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | +| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | +| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | + +## HarmProbability + +Probability that a prompt or candidate matches a harm category. + +Signature: + +```typescript +export declare enum HarmProbability +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HIGH | "HIGH" | | +| LOW | "LOW" | | +| MEDIUM | "MEDIUM" | | +| NEGLIGIBLE | "NEGLIGIBLE" | | + +## HarmSeverity + +Harm severity levels. + +Signature: + +```typescript +export declare enum HarmSeverity +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | +| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | +| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | +| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | + +## SchemaType + +Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) + +Signature: + +```typescript +export declare enum SchemaType +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ARRAY | "array" | Array type. | +| BOOLEAN | "boolean" | Boolean type. | +| INTEGER | "integer" | Integer type. | +| NUMBER | "number" | Number type. | +| OBJECT | "object" | Object type. | +| STRING | "string" | String type. | + +## VertexAIErrorCode + +Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. + +Signature: + +```typescript +export declare const enum VertexAIErrorCode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | +| ERROR | "error" | A generic error occurred. | +| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | +| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | +| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | +| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | +| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | +| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | +| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | +| REQUEST\_ERROR | "request-error" | An error occurred in a request. | +| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | + diff --git a/docs-devsite/vertexai-preview.modelparams.md b/docs-devsite/vertexai.modelparams.md similarity index 54% rename from docs-devsite/vertexai-preview.modelparams.md rename to docs-devsite/vertexai.modelparams.md index 34d68f86714..590bc14e435 100644 --- a/docs-devsite/vertexai-preview.modelparams.md +++ b/docs-devsite/vertexai.modelparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ModelParams interface -Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). Signature: ```typescript export interface ModelParams extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [model](./vertexai-preview.modelparams.md#modelparamsmodel) | string | | -| [systemInstruction](./vertexai-preview.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.modelparams.md#modelparamstools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [model](./vertexai.modelparams.md#modelparamsmodel) | string | | +| [systemInstruction](./vertexai.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.modelparams.md#modelparamstools) | [Tool](./vertexai.md#tool)\[\] | | ## ModelParams.model diff --git a/docs-devsite/vertexai.numberschema.md b/docs-devsite/vertexai.numberschema.md new file mode 100644 index 00000000000..8fdd9374652 --- /dev/null +++ b/docs-devsite/vertexai.numberschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# NumberSchema class +Schema class for "number" types. + +Signature: + +```typescript +export declare class NumberSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.numberschema.md#numberschemaconstructor) | | Constructs a new instance of the NumberSchema class | + +## NumberSchema.(constructor) + +Constructs a new instance of the `NumberSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.objectschema.md b/docs-devsite/vertexai.objectschema.md new file mode 100644 index 00000000000..8731960b220 --- /dev/null +++ b/docs-devsite/vertexai.objectschema.md @@ -0,0 +1,71 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ObjectSchema class +Schema class for "object" types. The `properties` param must be a map of `Schema` objects. + +Signature: + +```typescript +export declare class ObjectSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, properties, optionalProperties)](./vertexai.objectschema.md#objectschemaconstructor) | | Constructs a new instance of the ObjectSchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [optionalProperties](./vertexai.objectschema.md#objectschemaoptionalproperties) | | string\[\] | | +| [properties](./vertexai.objectschema.md#objectschemaproperties) | | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | + +## ObjectSchema.(constructor) + +Constructs a new instance of the `ObjectSchema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaParams, properties: { + [k: string]: TypedSchema; + }, optionalProperties?: string[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| properties | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | +| optionalProperties | string\[\] | | + +## ObjectSchema.optionalProperties + +Signature: + +```typescript +optionalProperties: string[]; +``` + +## ObjectSchema.properties + +Signature: + +```typescript +properties: { + [k: string]: TypedSchema; + }; +``` diff --git a/docs-devsite/vertexai.objectschemainterface.md b/docs-devsite/vertexai.objectschemainterface.md new file mode 100644 index 00000000000..6a4e052d183 --- /dev/null +++ b/docs-devsite/vertexai.objectschemainterface.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ObjectSchemaInterface interface +Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. + +Signature: + +```typescript +export interface ObjectSchemaInterface extends SchemaInterface +``` +Extends: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [optionalProperties](./vertexai.objectschemainterface.md#objectschemainterfaceoptionalproperties) | string\[\] | | +| [type](./vertexai.objectschemainterface.md#objectschemainterfacetype) | [SchemaType.OBJECT](./vertexai.md#schematypeobject_enummember) | | + +## ObjectSchemaInterface.optionalProperties + +Signature: + +```typescript +optionalProperties?: string[]; +``` + +## ObjectSchemaInterface.type + +Signature: + +```typescript +type: SchemaType.OBJECT; +``` diff --git a/docs-devsite/vertexai-preview.promptfeedback.md b/docs-devsite/vertexai.promptfeedback.md similarity index 66% rename from docs-devsite/vertexai-preview.promptfeedback.md rename to docs-devsite/vertexai.promptfeedback.md index cb27f10c8c3..369ef02051d 100644 --- a/docs-devsite/vertexai-preview.promptfeedback.md +++ b/docs-devsite/vertexai.promptfeedback.md @@ -22,16 +22,16 @@ export interface PromptFeedback | Property | Type | Description | | --- | --- | --- | -| [blockReason](./vertexai-preview.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai-preview.md#blockreason) | | -| [blockReasonMessage](./vertexai-preview.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | -| [safetyRatings](./vertexai-preview.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface)\[\] | | +| [blockReason](./vertexai.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai.md#blockreason) | | +| [blockReasonMessage](./vertexai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | +| [safetyRatings](./vertexai.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | ## PromptFeedback.blockReason Signature: ```typescript -blockReason: BlockReason; +blockReason?: BlockReason; ``` ## PromptFeedback.blockReasonMessage diff --git a/docs-devsite/vertexai-preview.requestoptions.md b/docs-devsite/vertexai.requestoptions.md similarity index 55% rename from docs-devsite/vertexai-preview.requestoptions.md rename to docs-devsite/vertexai.requestoptions.md index 550ec44ce96..6d074775520 100644 --- a/docs-devsite/vertexai-preview.requestoptions.md +++ b/docs-devsite/vertexai.requestoptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # RequestOptions interface -Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). Signature: @@ -22,12 +22,12 @@ export interface RequestOptions | Property | Type | Description | | --- | --- | --- | -| [baseUrl](./vertexai-preview.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebaseml.googleapis.com | -| [timeout](./vertexai-preview.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. | +| [baseUrl](./vertexai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com | +| [timeout](./vertexai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). | ## RequestOptions.baseUrl -Base url for endpoint. Defaults to https://firebaseml.googleapis.com +Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com Signature: @@ -37,7 +37,7 @@ baseUrl?: string; ## RequestOptions.timeout -Request timeout in milliseconds. +Request timeout in milliseconds. Defaults to 180 seconds (180000ms). Signature: diff --git a/docs-devsite/vertexai-preview.retrievedcontextattribution.md b/docs-devsite/vertexai.retrievedcontextattribution.md similarity index 76% rename from docs-devsite/vertexai-preview.retrievedcontextattribution.md rename to docs-devsite/vertexai.retrievedcontextattribution.md index 0a121cdc004..e36bfacb3ec 100644 --- a/docs-devsite/vertexai-preview.retrievedcontextattribution.md +++ b/docs-devsite/vertexai.retrievedcontextattribution.md @@ -21,8 +21,8 @@ export interface RetrievedContextAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | -| [uri](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | +| [title](./vertexai.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | +| [uri](./vertexai.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | ## RetrievedContextAttribution.title diff --git a/docs-devsite/vertexai-preview.safetyrating.md b/docs-devsite/vertexai.safetyrating.md similarity index 55% rename from docs-devsite/vertexai-preview.safetyrating.md rename to docs-devsite/vertexai.safetyrating.md index 65b1bc8fb42..b5f204bef2c 100644 --- a/docs-devsite/vertexai-preview.safetyrating.md +++ b/docs-devsite/vertexai.safetyrating.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SafetyRating interface -A safety rating associated with a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) +A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) Signature: @@ -22,12 +22,12 @@ export interface SafetyRating | Property | Type | Description | | --- | --- | --- | -| [blocked](./vertexai-preview.safetyrating.md#safetyratingblocked) | boolean | | -| [category](./vertexai-preview.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai-preview.md#harmcategory) | | -| [probability](./vertexai-preview.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai-preview.md#harmprobability) | | -| [probabilityScore](./vertexai-preview.safetyrating.md#safetyratingprobabilityscore) | number | | -| [severity](./vertexai-preview.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai-preview.md#harmseverity) | | -| [severityScore](./vertexai-preview.safetyrating.md#safetyratingseverityscore) | number | | +| [blocked](./vertexai.safetyrating.md#safetyratingblocked) | boolean | | +| [category](./vertexai.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | +| [probability](./vertexai.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai.md#harmprobability) | | +| [probabilityScore](./vertexai.safetyrating.md#safetyratingprobabilityscore) | number | | +| [severity](./vertexai.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai.md#harmseverity) | | +| [severityScore](./vertexai.safetyrating.md#safetyratingseverityscore) | number | | ## SafetyRating.blocked diff --git a/docs-devsite/vertexai-preview.safetysetting.md b/docs-devsite/vertexai.safetysetting.md similarity index 64% rename from docs-devsite/vertexai-preview.safetysetting.md rename to docs-devsite/vertexai.safetysetting.md index 78678315805..17fa1cff839 100644 --- a/docs-devsite/vertexai-preview.safetysetting.md +++ b/docs-devsite/vertexai.safetysetting.md @@ -22,9 +22,9 @@ export interface SafetySetting | Property | Type | Description | | --- | --- | --- | -| [category](./vertexai-preview.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai-preview.md#harmcategory) | | -| [method](./vertexai-preview.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | | -| [threshold](./vertexai-preview.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | | +| [category](./vertexai.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | +| [method](./vertexai.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai.md#harmblockmethod) | | +| [threshold](./vertexai.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | | ## SafetySetting.category @@ -39,7 +39,7 @@ category: HarmCategory; Signature: ```typescript -method: HarmBlockMethod; +method?: HarmBlockMethod; ``` ## SafetySetting.threshold diff --git a/docs-devsite/vertexai.schema.md b/docs-devsite/vertexai.schema.md new file mode 100644 index 00000000000..f4a36c3c506 --- /dev/null +++ b/docs-devsite/vertexai.schema.md @@ -0,0 +1,250 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Schema class +Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with `JSON.stringify()` into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) + +Signature: + +```typescript +export declare abstract class Schema implements SchemaInterface +``` +Implements: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.schema.md#schemaconstructor) | | Constructs a new instance of the Schema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [description](./vertexai.schema.md#schemadescription) | | string | Optional. The description of the property. | +| [example](./vertexai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | +| [format](./vertexai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
| +| [nullable](./vertexai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | +| [type](./vertexai.schema.md#schematype) | | [SchemaType](./vertexai.md#schematype) | Optional. The type of the property. [SchemaType](./vertexai.md#schematype). | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [array(arrayParams)](./vertexai.schema.md#schemaarray) | static | | +| [boolean(booleanParams)](./vertexai.schema.md#schemaboolean) | static | | +| [enumString(stringParams)](./vertexai.schema.md#schemaenumstring) | static | | +| [integer(integerParams)](./vertexai.schema.md#schemainteger) | static | | +| [number(numberParams)](./vertexai.schema.md#schemanumber) | static | | +| [object(objectParams)](./vertexai.schema.md#schemaobject) | static | | +| [string(stringParams)](./vertexai.schema.md#schemastring) | static | | + +## Schema.(constructor) + +Constructs a new instance of the `Schema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaInterface); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | | + +## Schema.description + +Optional. The description of the property. + +Signature: + +```typescript +description?: string; +``` + +## Schema.example + +Optional. The example of the property. + +Signature: + +```typescript +example?: unknown; +``` + +## Schema.format + +Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
+ +Signature: + +```typescript +format?: string; +``` + +## Schema.nullable + +Optional. Whether the property is nullable. Defaults to false. + +Signature: + +```typescript +nullable: boolean; +``` + +## Schema.type + +Optional. The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` + +## Schema.array() + +Signature: + +```typescript +static array(arrayParams: SchemaParams & { + items: Schema; + }): ArraySchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrayParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { items: [Schema](./vertexai.schema.md#schema_class); } | | + +Returns: + +[ArraySchema](./vertexai.arrayschema.md#arrayschema_class) + +## Schema.boolean() + +Signature: + +```typescript +static boolean(booleanParams?: SchemaParams): BooleanSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| booleanParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) + +## Schema.enumString() + +Signature: + +```typescript +static enumString(stringParams: SchemaParams & { + enum: string[]; + }): StringSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { enum: string\[\]; } | | + +Returns: + +[StringSchema](./vertexai.stringschema.md#stringschema_class) + +## Schema.integer() + +Signature: + +```typescript +static integer(integerParams?: SchemaParams): IntegerSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| integerParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[IntegerSchema](./vertexai.integerschema.md#integerschema_class) + +## Schema.number() + +Signature: + +```typescript +static number(numberParams?: SchemaParams): NumberSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| numberParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[NumberSchema](./vertexai.numberschema.md#numberschema_class) + +## Schema.object() + +Signature: + +```typescript +static object(objectParams: SchemaParams & { + properties: { + [k: string]: Schema; + }; + optionalProperties?: string[]; + }): ObjectSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| objectParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { properties: { \[k: string\]: [Schema](./vertexai.schema.md#schema_class); }; optionalProperties?: string\[\]; } | | + +Returns: + +[ObjectSchema](./vertexai.objectschema.md#objectschema_class) + +## Schema.string() + +Signature: + +```typescript +static string(stringParams?: SchemaParams): StringSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[StringSchema](./vertexai.stringschema.md#stringschema_class) + diff --git a/docs-devsite/vertexai.schemainterface.md b/docs-devsite/vertexai.schemainterface.md new file mode 100644 index 00000000000..3992c9e5116 --- /dev/null +++ b/docs-devsite/vertexai.schemainterface.md @@ -0,0 +1,36 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaInterface interface +Interface for [Schema](./vertexai.schema.md#schema_class) class. + +Signature: + +```typescript +export interface SchemaInterface extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./vertexai.schemainterface.md#schemainterfacetype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | + +## SchemaInterface.type + +The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` diff --git a/docs-devsite/vertexai.schemaparams.md b/docs-devsite/vertexai.schemaparams.md new file mode 100644 index 00000000000..3c6d9f385fd --- /dev/null +++ b/docs-devsite/vertexai.schemaparams.md @@ -0,0 +1,21 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaParams interface +Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. + +Signature: + +```typescript +export interface SchemaParams extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> + diff --git a/docs-devsite/vertexai.schemarequest.md b/docs-devsite/vertexai.schemarequest.md new file mode 100644 index 00000000000..f12259b1608 --- /dev/null +++ b/docs-devsite/vertexai.schemarequest.md @@ -0,0 +1,47 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaRequest interface +Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. + +Signature: + +```typescript +export interface SchemaRequest extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface)> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [required](./vertexai.schemarequest.md#schemarequestrequired) | string\[\] | Optional. Array of required property. | +| [type](./vertexai.schemarequest.md#schemarequesttype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | + +## SchemaRequest.required + +Optional. Array of required property. + +Signature: + +```typescript +required?: string[]; +``` + +## SchemaRequest.type + +The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` diff --git a/docs-devsite/vertexai.schemashared.md b/docs-devsite/vertexai.schemashared.md new file mode 100644 index 00000000000..50cc6464ecf --- /dev/null +++ b/docs-devsite/vertexai.schemashared.md @@ -0,0 +1,103 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaShared interface +Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. + +Signature: + +```typescript +export interface SchemaShared +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [description](./vertexai.schemashared.md#schemashareddescription) | string | Optional. The description of the property. | +| [enum](./vertexai.schemashared.md#schemasharedenum) | string\[\] | Optional. The enum of the property. | +| [example](./vertexai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | +| [format](./vertexai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. | +| [items](./vertexai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | +| [nullable](./vertexai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | +| [properties](./vertexai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | + +## SchemaShared.description + +Optional. The description of the property. + +Signature: + +```typescript +description?: string; +``` + +## SchemaShared.enum + +Optional. The enum of the property. + +Signature: + +```typescript +enum?: string[]; +``` + +## SchemaShared.example + +Optional. The example of the property. + +Signature: + +```typescript +example?: unknown; +``` + +## SchemaShared.format + +Optional. The format of the property. + +Signature: + +```typescript +format?: string; +``` + +## SchemaShared.items + +Optional. The items of the property. + +Signature: + +```typescript +items?: T; +``` + +## SchemaShared.nullable + +Optional. Whether the property is nullable. + +Signature: + +```typescript +nullable?: boolean; +``` + +## SchemaShared.properties + +Optional. Map of `Schema` objects. + +Signature: + +```typescript +properties?: { + [k: string]: T; + }; +``` diff --git a/docs-devsite/vertexai-preview.segment.md b/docs-devsite/vertexai.segment.md similarity index 75% rename from docs-devsite/vertexai-preview.segment.md rename to docs-devsite/vertexai.segment.md index c64bc3ffcda..db61f00a149 100644 --- a/docs-devsite/vertexai-preview.segment.md +++ b/docs-devsite/vertexai.segment.md @@ -21,9 +21,9 @@ export interface Segment | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai-preview.segment.md#segmentendindex) | number | | -| [partIndex](./vertexai-preview.segment.md#segmentpartindex) | number | | -| [startIndex](./vertexai-preview.segment.md#segmentstartindex) | number | | +| [endIndex](./vertexai.segment.md#segmentendindex) | number | | +| [partIndex](./vertexai.segment.md#segmentpartindex) | number | | +| [startIndex](./vertexai.segment.md#segmentstartindex) | number | | ## Segment.endIndex diff --git a/docs-devsite/vertexai-preview.startchatparams.md b/docs-devsite/vertexai.startchatparams.md similarity index 51% rename from docs-devsite/vertexai-preview.startchatparams.md rename to docs-devsite/vertexai.startchatparams.md index f422f7a1ff0..e07bbd91d82 100644 --- a/docs-devsite/vertexai-preview.startchatparams.md +++ b/docs-devsite/vertexai.startchatparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # StartChatParams interface -Params for [GenerativeModel.startChat()](./vertexai-preview.generativemodel.md#generativemodelstartchat). +Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). Signature: ```typescript export interface StartChatParams extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [history](./vertexai-preview.startchatparams.md#startchatparamshistory) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai-preview.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.startchatparams.md#startchatparamstools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [history](./vertexai.startchatparams.md#startchatparamshistory) | [Content](./vertexai.content.md#content_interface)\[\] | | +| [systemInstruction](./vertexai.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.startchatparams.md#startchatparamstools) | [Tool](./vertexai.md#tool)\[\] | | ## StartChatParams.history diff --git a/docs-devsite/vertexai.stringschema.md b/docs-devsite/vertexai.stringschema.md new file mode 100644 index 00000000000..bfafe0fe9df --- /dev/null +++ b/docs-devsite/vertexai.stringschema.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StringSchema class +Schema class for "string" types. Can be used with or without enum values. + +Signature: + +```typescript +export declare class StringSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, enumValues)](./vertexai.stringschema.md#stringschemaconstructor) | | Constructs a new instance of the StringSchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [enum](./vertexai.stringschema.md#stringschemaenum) | | string\[\] | | + +## StringSchema.(constructor) + +Constructs a new instance of the `StringSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams, enumValues?: string[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| enumValues | string\[\] | | + +## StringSchema.enum + +Signature: + +```typescript +enum?: string[]; +``` diff --git a/docs-devsite/vertexai-preview.textpart.md b/docs-devsite/vertexai.textpart.md similarity index 72% rename from docs-devsite/vertexai-preview.textpart.md rename to docs-devsite/vertexai.textpart.md index 206168180b2..afee40a369d 100644 --- a/docs-devsite/vertexai-preview.textpart.md +++ b/docs-devsite/vertexai.textpart.md @@ -22,10 +22,10 @@ export interface TextPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.textpart.md#textpartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.textpart.md#textpartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.textpart.md#textpartinlinedata) | never | | -| [text](./vertexai-preview.textpart.md#textparttext) | string | | +| [functionCall](./vertexai.textpart.md#textpartfunctioncall) | never | | +| [functionResponse](./vertexai.textpart.md#textpartfunctionresponse) | never | | +| [inlineData](./vertexai.textpart.md#textpartinlinedata) | never | | +| [text](./vertexai.textpart.md#textparttext) | string | | ## TextPart.functionCall diff --git a/docs-devsite/vertexai-preview.toolconfig.md b/docs-devsite/vertexai.toolconfig.md similarity index 71% rename from docs-devsite/vertexai-preview.toolconfig.md rename to docs-devsite/vertexai.toolconfig.md index 4278eef509b..30c62c17c01 100644 --- a/docs-devsite/vertexai-preview.toolconfig.md +++ b/docs-devsite/vertexai.toolconfig.md @@ -22,12 +22,12 @@ export interface ToolConfig | Property | Type | Description | | --- | --- | --- | -| [functionCallingConfig](./vertexai-preview.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai-preview.functioncallingconfig.md#functioncallingconfig_interface) | | +| [functionCallingConfig](./vertexai.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | ## ToolConfig.functionCallingConfig Signature: ```typescript -functionCallingConfig: FunctionCallingConfig; +functionCallingConfig?: FunctionCallingConfig; ``` diff --git a/docs-devsite/vertexai-preview.usagemetadata.md b/docs-devsite/vertexai.usagemetadata.md similarity index 63% rename from docs-devsite/vertexai-preview.usagemetadata.md rename to docs-devsite/vertexai.usagemetadata.md index 2829c9dbd5d..d254f34335f 100644 --- a/docs-devsite/vertexai-preview.usagemetadata.md +++ b/docs-devsite/vertexai.usagemetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # UsageMetadata interface -Usage metadata about a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). +Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). Signature: @@ -22,9 +22,9 @@ export interface UsageMetadata | Property | Type | Description | | --- | --- | --- | -| [candidatesTokenCount](./vertexai-preview.usagemetadata.md#usagemetadatacandidatestokencount) | number | | -| [promptTokenCount](./vertexai-preview.usagemetadata.md#usagemetadataprompttokencount) | number | | -| [totalTokenCount](./vertexai-preview.usagemetadata.md#usagemetadatatotaltokencount) | number | | +| [candidatesTokenCount](./vertexai.usagemetadata.md#usagemetadatacandidatestokencount) | number | | +| [promptTokenCount](./vertexai.usagemetadata.md#usagemetadataprompttokencount) | number | | +| [totalTokenCount](./vertexai.usagemetadata.md#usagemetadatatotaltokencount) | number | | ## UsageMetadata.candidatesTokenCount diff --git a/docs-devsite/vertexai-preview.vertexai.md b/docs-devsite/vertexai.vertexai.md similarity index 62% rename from docs-devsite/vertexai-preview.vertexai.md rename to docs-devsite/vertexai.vertexai.md index 46c13416370..4797bf8bada 100644 --- a/docs-devsite/vertexai-preview.vertexai.md +++ b/docs-devsite/vertexai.vertexai.md @@ -22,12 +22,12 @@ export interface VertexAI | Property | Type | Description | | --- | --- | --- | -| [app](./vertexai-preview.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance is associated with. | -| [location](./vertexai-preview.vertexai.md#vertexailocation) | string | | +| [app](./vertexai.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. | +| [location](./vertexai.vertexai.md#vertexailocation) | string | | ## VertexAI.app -The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance is associated with. +The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. Signature: diff --git a/docs-devsite/vertexai-preview.vertexaierror.md b/docs-devsite/vertexai.vertexaierror.md similarity index 57% rename from docs-devsite/vertexai-preview.vertexaierror.md rename to docs-devsite/vertexai.vertexaierror.md index 8ad434d0988..86532ac6018 100644 --- a/docs-devsite/vertexai-preview.vertexaierror.md +++ b/docs-devsite/vertexai.vertexaierror.md @@ -23,15 +23,14 @@ export declare class VertexAIError extends FirebaseError | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(code, message, customErrorData)](./vertexai-preview.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | +| [(constructor)(code, message, customErrorData)](./vertexai.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [code](./vertexai-preview.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | | -| [customErrorData](./vertexai-preview.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) \| undefined | | -| [message](./vertexai-preview.vertexaierror.md#vertexaierrormessage) | | string | | +| [code](./vertexai.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | | +| [customErrorData](./vertexai.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | | ## VertexAIError.(constructor) @@ -47,9 +46,9 @@ constructor(code: VertexAIErrorCode, message: string, customErrorData?: CustomEr | Parameter | Type | Description | | --- | --- | --- | -| code | [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode). | +| code | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai.md#vertexaierrorcode). | | message | string | A human-readable message describing the error. | -| customErrorData | [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | +| customErrorData | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | ## VertexAIError.code @@ -66,11 +65,3 @@ readonly code: VertexAIErrorCode; ```typescript readonly customErrorData?: CustomErrorData | undefined; ``` - -## VertexAIError.message - -Signature: - -```typescript -readonly message: string; -``` diff --git a/docs-devsite/vertexai-preview.vertexaioptions.md b/docs-devsite/vertexai.vertexaioptions.md similarity index 87% rename from docs-devsite/vertexai-preview.vertexaioptions.md rename to docs-devsite/vertexai.vertexaioptions.md index 4b42406eb95..e15b525bfed 100644 --- a/docs-devsite/vertexai-preview.vertexaioptions.md +++ b/docs-devsite/vertexai.vertexaioptions.md @@ -22,7 +22,7 @@ export interface VertexAIOptions | Property | Type | Description | | --- | --- | --- | -| [location](./vertexai-preview.vertexaioptions.md#vertexaioptionslocation) | string | | +| [location](./vertexai.vertexaioptions.md#vertexaioptionslocation) | string | | ## VertexAIOptions.location diff --git a/docs-devsite/vertexai-preview.videometadata.md b/docs-devsite/vertexai.videometadata.md similarity index 66% rename from docs-devsite/vertexai-preview.videometadata.md rename to docs-devsite/vertexai.videometadata.md index 04d8883bae9..b4f872c4e3d 100644 --- a/docs-devsite/vertexai-preview.videometadata.md +++ b/docs-devsite/vertexai.videometadata.md @@ -22,8 +22,8 @@ export interface VideoMetadata | Property | Type | Description | | --- | --- | --- | -| [endOffset](./vertexai-preview.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | -| [startOffset](./vertexai-preview.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [endOffset](./vertexai.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [startOffset](./vertexai.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | ## VideoMetadata.endOffset diff --git a/docs-devsite/vertexai-preview.webattribution.md b/docs-devsite/vertexai.webattribution.md similarity index 79% rename from docs-devsite/vertexai-preview.webattribution.md rename to docs-devsite/vertexai.webattribution.md index 5db6f94b82e..bb4fecf874d 100644 --- a/docs-devsite/vertexai-preview.webattribution.md +++ b/docs-devsite/vertexai.webattribution.md @@ -21,8 +21,8 @@ export interface WebAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai-preview.webattribution.md#webattributiontitle) | string | | -| [uri](./vertexai-preview.webattribution.md#webattributionuri) | string | | +| [title](./vertexai.webattribution.md#webattributiontitle) | string | | +| [uri](./vertexai.webattribution.md#webattributionuri) | string | | ## WebAttribution.title diff --git a/e2e/karma.conf.js b/e2e/karma.conf.js index 80824d6d548..fb2474f3beb 100644 --- a/e2e/karma.conf.js +++ b/e2e/karma.conf.js @@ -82,7 +82,7 @@ module.exports = function (config) { 'resolveJsonModule': true, 'esModuleInterop': true, 'sourceMap': true, - 'target': 'es5', + 'target': 'es2017', 'importHelpers': true, 'noEmitOnError': true } diff --git a/e2e/package.json b/e2e/package.json index 54a4ca3f292..7c5c9e501c8 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -34,9 +34,12 @@ "karma-typescript": "5.5.4", "karma-typescript-es6-transform": "5.5.4", "mocha": "9.2.2", - "typescript": "4.7.4", + "typescript": "5.5.4", "webpack": "5.76.0", - "webpack-cli": "4.10.0", - "webpack-dev-server": "4.11.1" + "webpack-cli": "5.1.4", + "webpack-dev-server": "5.1.0" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/e2e/yarn.lock b/e2e/yarn.lock index c457b3cff79..b3ec91b4856 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -10,51 +10,32 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== - dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/code-frame@^7.23.5": - version "7.23.5" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" - integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== +"@babel/code-frame@^7.24.2", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz#9374b5cd068d128dac0b94ff482594273b1c2815" + integrity sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g== dependencies: - "@babel/highlight" "^7.23.4" - chalk "^2.4.2" - -"@babel/code-frame@^7.24.1", "@babel/code-frame@^7.24.2": - version "7.24.2" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae" - integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ== - dependencies: - "@babel/highlight" "^7.24.2" + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.14.5", "@babel/compat-data@^7.14.7": - version "7.14.7" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.7.tgz#7b047d7a3a89a67d2258dc61f604f098f1bc7e08" - integrity sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw== +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.24.4", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz#f02ba6d34e88fadd5e8861e8b38902f43cc1c819" + integrity sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA== -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9", "@babel/compat-data@^7.23.5": - version "7.23.5" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" - integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== - -"@babel/core@7.24.3": - version "7.24.3" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz#568864247ea10fbd4eff04dda1e05f9e2ea985c3" - integrity sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ== +"@babel/core@7.24.4": + version "7.24.4" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.24.4.tgz#1f758428e88e0d8c563874741bc4ffc4f71a4717" + integrity sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.24.2" - "@babel/generator" "^7.24.1" + "@babel/generator" "^7.24.4" "@babel/helper-compilation-targets" "^7.23.6" "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.24.1" - "@babel/parser" "^7.24.1" + "@babel/helpers" "^7.24.4" + "@babel/parser" "^7.24.4" "@babel/template" "^7.24.0" "@babel/traverse" "^7.24.1" "@babel/types" "^7.24.0" @@ -65,194 +46,89 @@ semver "^6.3.1" "@babel/core@^7.11.1", "@babel/core@^7.7.5": - version "7.14.6" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab" - integrity sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.14.5" - "@babel/helper-compilation-targets" "^7.14.5" - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helpers" "^7.14.6" - "@babel/parser" "^7.14.6" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" - convert-source-map "^1.7.0" + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" + integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.0" + "@babel/generator" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.0" + "@babel/parser" "^7.26.0" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.26.0" + convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" - -"@babel/generator@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz#848d7b9f031caca9d0cd0af01b063f226f52d785" - integrity sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA== - dependencies: - "@babel/types" "^7.14.5" - jsesc "^2.5.1" - source-map "^0.5.0" + json5 "^2.2.3" + semver "^6.3.1" -"@babel/generator@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz#e67e06f68568a4ebf194d1c6014235344f0476d0" - integrity sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A== +"@babel/generator@^7.24.4", "@babel/generator@^7.25.9", "@babel/generator@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz#505cc7c90d92513f458a477e5ef0703e7c91b8d7" + integrity sha512-/AIkAmInnWwgEAJGQr9vY0c66Mj6kjkE2ZPB1PurTRaRAh3U+J45sAQMjQDJdh4WbR3l0x5xkimXBKyBXXAu2w== dependencies: - "@babel/types" "^7.24.0" + "@babel/parser" "^7.26.0" + "@babel/types" "^7.26.0" "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^2.5.1" + jsesc "^3.0.2" -"@babel/helper-annotate-as-pure@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz#7bf478ec3b71726d56a8ca5775b046fc29879e61" - integrity sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA== +"@babel/helper-annotate-as-pure@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" + integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.25.9" -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.9.tgz#f41752fe772a578e67286e6779a68a5a92de1ee9" + integrity sha512-C47lC7LIDCnz0h4vai/tpNOI95tCd5ZT3iBt/DBH5lXKHZsyNQv18yf1wIIg2ntiQNgmAvA+DgZ82iW8Qdym8g== dependencies: - "@babel/types" "^7.18.6" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" -"@babel/helper-annotate-as-pure@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" - integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== +"@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6", "@babel/helper-compilation-targets@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" + integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.14.5.tgz#b939b43f8c37765443a19ae74ad8b15978e0a191" - integrity sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w== - dependencies: - "@babel/helper-explode-assignable-expression" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.15": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz#5426b109cf3ad47b91120f8328d8ab1be8b0b956" - integrity sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw== - dependencies: - "@babel/types" "^7.22.15" - -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz#7a99c5d0967911e972fe2c3411f7d5b498498ecf" - integrity sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw== - dependencies: - "@babel/compat-data" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.22.10", "@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6": - version "7.23.6" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" - integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== - dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-validator-option" "^7.23.5" - browserslist "^4.22.2" + "@babel/compat-data" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-create-class-features-plugin@^7.14.5": - version "7.14.6" - resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.6.tgz#f114469b6c06f8b5c59c6c4e74621f5085362542" - integrity sha512-Z6gsfGofTxH/+LQXqYEK45kxmcensbzmk/oi8DmaQytlQCgqNZt9XQF8iqlI/SeXWVjaMNxvYvzaYw+kh42mDg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-member-expression-to-functions" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" - -"@babel/helper-create-class-features-plugin@^7.22.15": - version "7.24.0" - resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.0.tgz#fc7554141bdbfa2d17f7b4b80153b9b090e5d158" - integrity sha512-QAH+vfvts51BCsNZ2PhY6HAggnlS6omLLFTsIpeqZk/MmJ6cW7tgz5yRv0fMJThcr6FmbMrENh1RgrWPTYA76g== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-member-expression-to-functions" "^7.23.0" - "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.20" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" +"@babel/helper-create-class-features-plugin@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" + integrity sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-member-expression-to-functions" "^7.25.9" + "@babel/helper-optimise-call-expression" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/traverse" "^7.25.9" semver "^6.3.1" -"@babel/helper-create-regexp-features-plugin@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz#c7d5ac5e9cf621c26057722fb7a8a4c5889358c4" - integrity sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - regexpu-core "^4.7.1" - -"@babel/helper-create-regexp-features-plugin@^7.18.6": - version "7.20.5" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz#5ea79b59962a09ec2acf20a963a01ab4d076ccca" - integrity sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w== +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.9.tgz#3e8999db94728ad2b2458d7a470e7770b7764e26" + integrity sha512-ORPNZ3h6ZRkOyAa/SaHU+XsLZr0UQzRwuDQ0cczIA17nAzZ+85G5cVkOJIj7QavLZGSe8QXUmNFxSZzjcZF9bw== dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.2.1" - -"@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1" - integrity sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - regexpu-core "^5.3.1" + "@babel/helper-annotate-as-pure" "^7.25.9" + regexpu-core "^6.1.1" semver "^6.3.1" -"@babel/helper-define-polyfill-provider@^0.2.2": - version "0.2.3" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz#0525edec5094653a282688d34d846e4c75e9c0b6" - integrity sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew== - dependencies: - "@babel/helper-compilation-targets" "^7.13.0" - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/traverse" "^7.13.0" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - semver "^6.1.2" - -"@babel/helper-define-polyfill-provider@^0.4.4": - version "0.4.4" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.4.tgz#64df615451cb30e94b59a9696022cffac9a10088" - integrity sha512-QcJMILQCu2jm5TFPGA3lCpJJTeEP+mqeXooG/NZbg/h5FTFi6V0+99ahlRsW8/kRLyb24LZVCCiclDedhLKcBA== - dependencies: - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-plugin-utils" "^7.22.5" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - -"@babel/helper-define-polyfill-provider@^0.5.0": - version "0.5.0" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.5.0.tgz#465805b7361f461e86c680f1de21eaf88c25901b" - integrity sha512-NovQquuQLAQ5HuyjCz7WQP9MjRj7dx++yspwiyUiGl9ZyadHRSql1HZh5ogRd8W8w6YM6EQ/NTB8rgjLt5W65Q== - dependencies: - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-plugin-utils" "^7.22.5" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - -"@babel/helper-define-polyfill-provider@^0.6.1": - version "0.6.1" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.1.tgz#fadc63f0c2ff3c8d02ed905dcea747c5b0fb74fd" - integrity sha512-o7SDgTJuvx5vLKD6SFvkydkSMBvahDKGiNJzG22IZYXhiqoe9efY7zocICBgzHV4IRg5wdgl2nEL/tulKIEIbA== +"@babel/helper-define-polyfill-provider@^0.6.2": + version "0.6.2" + resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz#18594f789c3594acb24cfdb4a7f7b7d2e8bd912d" + integrity sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ== dependencies: "@babel/helper-compilation-targets" "^7.22.6" "@babel/helper-plugin-utils" "^7.22.5" @@ -260,490 +136,160 @@ lodash.debounce "^4.0.8" resolve "^1.14.2" -"@babel/helper-environment-visitor@^7.22.20": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" - integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== - -"@babel/helper-explode-assignable-expression@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz#8aa72e708205c7bb643e45c73b4386cdf2a1f645" - integrity sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4" - integrity sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ== - dependencies: - "@babel/helper-get-function-arity" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": - version "7.23.0" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" - integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== - dependencies: - "@babel/template" "^7.22.15" - "@babel/types" "^7.23.0" - -"@babel/helper-get-function-arity@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" - integrity sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-hoist-variables@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d" - integrity sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-hoist-variables@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" - integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-member-expression-to-functions@^7.14.5": - version "7.14.7" - resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz#97e56244beb94211fe277bd818e3a329c66f7970" - integrity sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-member-expression-to-functions@^7.22.15", "@babel/helper-member-expression-to-functions@^7.23.0": - version "7.23.0" - resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" - integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== - dependencies: - "@babel/types" "^7.23.0" - -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3" - integrity sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-module-imports@^7.22.15": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" - integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== - dependencies: - "@babel/types" "^7.22.15" - -"@babel/helper-module-transforms@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz#7de42f10d789b423eb902ebd24031ca77cb1e10e" - integrity sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA== - dependencies: - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-simple-access" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helper-module-transforms@^7.23.3": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" - integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.20" - -"@babel/helper-optimise-call-expression@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz#f27395a8619e0665b3f0364cddb41c25d71b499c" - integrity sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-optimise-call-expression@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" - integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-plugin-utils@^7.18.6": - version "7.20.2" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" - integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== - -"@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.24.0": - version "7.24.0" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz#945681931a52f15ce879fd5b86ce2dae6d3d7f2a" - integrity sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w== - -"@babel/helper-remap-async-to-generator@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz#51439c913612958f54a987a4ffc9ee587a2045d6" - integrity sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-wrap-function" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helper-remap-async-to-generator@^7.22.20": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz#7b68e1cb4fa964d2996fd063723fb48eca8498e0" - integrity sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-wrap-function" "^7.22.20" - -"@babel/helper-replace-supers@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz#0ecc0b03c41cd567b4024ea016134c28414abb94" - integrity sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helper-replace-supers@^7.22.20": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" - integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-member-expression-to-functions" "^7.22.15" - "@babel/helper-optimise-call-expression" "^7.22.5" - -"@babel/helper-simple-access@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz#66ea85cf53ba0b4e588ba77fc813f53abcaa41c4" - integrity sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-simple-access@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" - integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-skip-transparent-expression-wrappers@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz#96f486ac050ca9f44b009fbe5b7d394cab3a0ee4" - integrity sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" - integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-split-export-declaration@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a" - integrity sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-split-export-declaration@^7.22.6": - version "7.22.6" - resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" - integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== - -"@babel/helper-string-parser@^7.23.4": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" - integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== - -"@babel/helper-validator-identifier@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8" - integrity sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg== - -"@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/helper-validator-identifier@^7.22.20": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" - integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== - -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - -"@babel/helper-validator-option@^7.22.5", "@babel/helper-validator-option@^7.23.5": - version "7.23.5" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" - integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== +"@babel/helper-member-expression-to-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" + integrity sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helper-module-imports@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" + integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helper-module-transforms@^7.23.3", "@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" + integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== + dependencies: + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/helper-wrap-function@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.14.5.tgz#5919d115bf0fe328b8a5d63bcb610f51601f2bff" - integrity sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ== +"@babel/helper-optimise-call-expression@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" + integrity sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== dependencies: - "@babel/helper-function-name" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/types" "^7.25.9" -"@babel/helper-wrap-function@^7.22.20": - version "7.22.20" - resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz#15352b0b9bfb10fc9c76f79f6342c00e3411a569" - integrity sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw== - dependencies: - "@babel/helper-function-name" "^7.22.5" - "@babel/template" "^7.22.15" - "@babel/types" "^7.22.19" +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.24.0", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" + integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== -"@babel/helpers@^7.14.6": - version "7.14.6" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.6.tgz#5b58306b95f1b47e2a0199434fa8658fa6c21635" - integrity sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA== +"@babel/helper-remap-async-to-generator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" + integrity sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw== dependencies: - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-wrap-function" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/helpers@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz#183e44714b9eba36c3038e442516587b1e0a1a94" - integrity sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg== +"@babel/helper-replace-supers@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz#ba447224798c3da3f8713fc272b145e33da6a5c5" + integrity sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ== dependencies: - "@babel/template" "^7.24.0" - "@babel/traverse" "^7.24.1" - "@babel/types" "^7.24.0" + "@babel/helper-member-expression-to-functions" "^7.25.9" + "@babel/helper-optimise-call-expression" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== +"@babel/helper-simple-access@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz#6d51783299884a2c74618d6ef0f86820ec2e7739" + integrity sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q== dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/highlight@^7.23.4": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" - integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== - dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" -"@babel/highlight@^7.24.2": - version "7.24.2" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz#3f539503efc83d3c59080a10e6634306e0370d26" - integrity sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA== +"@babel/helper-skip-transparent-expression-wrappers@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" + integrity sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" -"@babel/parser@^7.14.5", "@babel/parser@^7.14.6": - version "7.14.7" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" - integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== -"@babel/parser@^7.24.0": - version "7.24.0" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz#26a3d1ff49031c53a97d03b604375f028746a9ac" - integrity sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg== +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== -"@babel/parser@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz#1e416d3627393fab1cb5b0f2f1796a100ae9133a" - integrity sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg== +"@babel/helper-validator-option@^7.23.5", "@babel/helper-validator-option@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" + integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" - integrity sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ== +"@babel/helper-wrap-function@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz#d99dfd595312e6c894bd7d237470025c85eea9d0" + integrity sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/template" "^7.25.9" + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.14.5.tgz#4b467302e1548ed3b1be43beae2cc9cf45e0bb7e" - integrity sha512-ZoJS2XCKPBfTmL122iP6NM9dOg+d4lc9fFk3zxc8iDjvt8Pk4+TlsHSKhIPf6X+L5ORCdBzqMZDjL/WHj7WknQ== +"@babel/helpers@^7.24.4", "@babel/helpers@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" + integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" + "@babel/template" "^7.25.9" + "@babel/types" "^7.26.0" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.23.3.tgz#f6652bb16b94f8f9c20c50941e16e9756898dc5d" - integrity sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ== +"@babel/parser@^7.24.4", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.0.tgz#710a75a7d805a8f72753154e451474e9795b121c" + integrity sha512-aP8x5pIw3xvYr/sXT+SEUwyhrXT8rUJRZltK/qN3Db80dcKpTett8cJxHyjk+xYSVXvNnl2SfcJVjbwxpOSscA== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-transform-optional-chaining" "^7.23.3" - -"@babel/plugin-proposal-async-generator-functions@^7.14.7": - version "7.14.7" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.7.tgz#784a48c3d8ed073f65adcf30b57bcbf6c8119ace" - integrity sha512-RK8Wj7lXLY3bqei69/cc25gwS5puEc3dknoFPFbqfy3XxYQBQFvu4ioWpafMBAB+L9NyptQK4nMOa5Xz16og8Q== + "@babel/types" "^7.26.0" + +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.24.4", "@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" + integrity sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.14.5" - "@babel/plugin-syntax-async-generators" "^7.8.4" - -"@babel/plugin-proposal-class-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" - integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/plugin-bugfix-safari-class-field-initializer-scope@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz#af9e4fb63ccb8abcb92375b2fcfe36b60c774d30" + integrity sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-proposal-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.5.tgz#158e9e10d449c3849ef3ecde94a03d9f1841b681" - integrity sha512-KBAH5ksEnYHCegqseI5N9skTdxgJdmDoAOc0uXa+4QMYKeZD0w5IARh4FMlTNtaHhbB8v+KzMdTgxMMzsIy6Yg== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.24.1", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz#e8dc26fcd616e6c5bf2bd0d5a2c151d4f92a9137" + integrity sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-proposal-dynamic-import@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz#0c6617df461c0c1f8fff3b47cd59772360101d2c" - integrity sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.24.1", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz#807a667f9158acac6f6164b4beb85ad9ebc9e1d1" + integrity sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/plugin-transform-optional-chaining" "^7.25.9" -"@babel/plugin-proposal-export-namespace-from@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz#dbad244310ce6ccd083072167d8cea83a52faf76" - integrity sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA== +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.24.1", "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz#de7093f1e7deaf68eadd7cc6b07f2ab82543269e" + integrity sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - -"@babel/plugin-proposal-json-strings@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb" - integrity sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-json-strings" "^7.8.3" - -"@babel/plugin-proposal-logical-assignment-operators@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz#6e6229c2a99b02ab2915f82571e0cc646a40c738" - integrity sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - -"@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz#ee38589ce00e2cc59b299ec3ea406fcd3a0fdaf6" - integrity sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - -"@babel/plugin-proposal-numeric-separator@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz#83631bf33d9a51df184c2102a069ac0c58c05f18" - integrity sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - -"@babel/plugin-proposal-object-rest-spread@^7.14.7": - version "7.14.7" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz#5920a2b3df7f7901df0205974c0641b13fd9d363" - integrity sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g== - dependencies: - "@babel/compat-data" "^7.14.7" - "@babel/helper-compilation-targets" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.14.5" - -"@babel/plugin-proposal-optional-catch-binding@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz#939dd6eddeff3a67fdf7b3f044b5347262598c3c" - integrity sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - -"@babel/plugin-proposal-optional-chaining@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz#fa83651e60a360e3f13797eef00b8d519695b603" - integrity sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -"@babel/plugin-proposal-private-methods@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz#37446495996b2945f30f5be5b60d5e2aa4f5792d" - integrity sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" "@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": version "7.21.0-placeholder-for-preset-env.2" resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== -"@babel/plugin-proposal-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.5.tgz#9f65a4d0493a940b4c01f8aa9d3f1894a587f636" - integrity sha512-62EyfyA3WA0mZiF2e2IV9mc9Ghwxcg8YTu8BS4Wss4Y3PY725OmS9M0qLORbJwLqFtGh+jiE4wAmocK2CTUK2Q== - dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - -"@babel/plugin-proposal-unicode-property-regex@^7.14.5", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz#0f95ee0e757a5d647f378daa0eca7e93faa8bbe8" - integrity sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -779,19 +325,19 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-import-assertions@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz#9c05a7f592982aff1a2768260ad84bcd3f0c77fc" - integrity sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw== +"@babel/plugin-syntax-import-assertions@^7.24.1", "@babel/plugin-syntax-import-assertions@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" + integrity sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-syntax-import-attributes@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.23.3.tgz#992aee922cf04512461d7dae3ff6951b90a2dc06" - integrity sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA== +"@babel/plugin-syntax-import-attributes@^7.24.1", "@babel/plugin-syntax-import-attributes@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" + integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -871,661 +417,416 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-arrow-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" - integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== +"@babel/plugin-transform-arrow-functions@^7.24.1", "@babel/plugin-transform-arrow-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz#7821d4410bee5daaadbb4cdd9a6649704e176845" + integrity sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-arrow-functions@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz#94c6dcfd731af90f27a79509f9ab7fb2120fc38b" - integrity sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ== +"@babel/plugin-transform-async-generator-functions@^7.24.3", "@babel/plugin-transform-async-generator-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" + integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-remap-async-to-generator" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-async-generator-functions@^7.22.10": - version "7.23.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.9.tgz#9adaeb66fc9634a586c5df139c6240d41ed801ce" - integrity sha512-8Q3veQEDGe14dTYuwagbRtwxQDnytyg1JFu4/HwEMETeofocrB0U0ejBJIXoeG/t2oXZ8kzCyI0ZZfbT80VFNQ== +"@babel/plugin-transform-async-to-generator@^7.24.1", "@babel/plugin-transform-async-to-generator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz#c80008dacae51482793e5a9c08b39a5be7e12d71" + integrity sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-remap-async-to-generator" "^7.22.20" - "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-remap-async-to-generator" "^7.25.9" -"@babel/plugin-transform-async-to-generator@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz#72c789084d8f2094acb945633943ef8443d39e67" - integrity sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA== +"@babel/plugin-transform-block-scoped-functions@^7.24.1", "@babel/plugin-transform-block-scoped-functions@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz#5700691dbd7abb93de300ca7be94203764fce458" + integrity sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== dependencies: - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-async-to-generator@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz#d1f513c7a8a506d43f47df2bf25f9254b0b051fa" - integrity sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw== +"@babel/plugin-transform-block-scoping@^7.24.4", "@babel/plugin-transform-block-scoping@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz#c33665e46b06759c93687ca0f84395b80c0473a1" + integrity sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== dependencies: - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-remap-async-to-generator" "^7.22.20" - -"@babel/plugin-transform-block-scoped-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" - integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-block-scoped-functions@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.23.3.tgz#fe1177d715fb569663095e04f3598525d98e8c77" - integrity sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-block-scoping@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.5.tgz#8cc63e61e50f42e078e6f09be775a75f23ef9939" - integrity sha512-LBYm4ZocNgoCqyxMLoOnwpsmQ18HWTQvql64t3GvMUzLQrNoV1BDG0lNftC8QKYERkZgCCT/7J5xWGObGAyHDw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-block-scoping@^7.22.10": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz#b2d38589531c6c80fbe25e6b58e763622d2d3cf5" - integrity sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-class-properties@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz#35c377db11ca92a785a718b6aa4e3ed1eb65dc48" - integrity sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-class-static-block@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.4.tgz#2a202c8787a8964dd11dfcedf994d36bfc844ab5" - integrity sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - -"@babel/plugin-transform-classes@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.5.tgz#0e98e82097b38550b03b483f9b51a78de0acb2cf" - integrity sha512-J4VxKAMykM06K/64z9rwiL6xnBHgB1+FVspqvlgCdwD1KUbQNfszeKVVOMh59w3sztHYIZDgnhOC4WbdEfHFDA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" - globals "^11.1.0" - -"@babel/plugin-transform-classes@^7.22.6": - version "7.23.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.8.tgz#d08ae096c240347badd68cdf1b6d1624a6435d92" - integrity sha512-yAYslGsY1bX6Knmg46RjiCiNSwJKv2IUC8qOdYKqMMr0491SXFhcHqOdRDeCRohOOIzwN/90C6mQ9qAKgrP7dg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.20" - "@babel/helper-split-export-declaration" "^7.22.6" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" - integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-computed-properties@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz#652e69561fcc9d2b50ba4f7ac7f60dcf65e86474" - integrity sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/template" "^7.22.15" - -"@babel/plugin-transform-destructuring@^7.14.7": - version "7.14.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" - integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-destructuring@^7.22.10": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz#8c9ee68228b12ae3dff986e56ed1ba4f3c446311" - integrity sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-dotall-regex@^7.14.5", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz#2f6bf76e46bdf8043b4e7e16cf24532629ba0c7a" - integrity sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-dotall-regex@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.23.3.tgz#3f7af6054882ede89c378d0cf889b854a993da50" - integrity sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-duplicate-keys@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz#365a4844881bdf1501e3a9f0270e7f0f91177954" - integrity sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-duplicate-keys@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.23.3.tgz#664706ca0a5dfe8d066537f99032fc1dc8b720ce" - integrity sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-dynamic-import@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.4.tgz#c7629e7254011ac3630d47d7f34ddd40ca535143" - integrity sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - -"@babel/plugin-transform-exponentiation-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz#5154b8dd6a3dfe6d90923d61724bd3deeb90b493" - integrity sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-exponentiation-operator@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.23.3.tgz#ea0d978f6b9232ba4722f3dbecdd18f450babd18" - integrity sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-export-namespace-from@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.4.tgz#084c7b25e9a5c8271e987a08cf85807b80283191" - integrity sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - -"@babel/plugin-transform-for-of@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz#dae384613de8f77c196a8869cbf602a44f7fc0eb" - integrity sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-for-of@^7.22.5": - version "7.23.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.6.tgz#81c37e24171b37b370ba6aaffa7ac86bcb46f94e" - integrity sha512-aYH4ytZ0qSuBbpfhuofbg/e96oQ7U2w1Aw/UQmKT+1l39uEhUPoFS3fHevDc1G0OvewyDudfMKY1OulczHzWIw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - -"@babel/plugin-transform-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" - integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== - dependencies: - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-function-name@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz#8f424fcd862bf84cb9a1a6b42bc2f47ed630f8dc" - integrity sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw== - dependencies: - "@babel/helper-compilation-targets" "^7.22.15" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-json-strings@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.4.tgz#a871d9b6bd171976efad2e43e694c961ffa3714d" - integrity sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-json-strings" "^7.8.3" - -"@babel/plugin-transform-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" - integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-literals@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz#8214665f00506ead73de157eba233e7381f3beb4" - integrity sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-logical-assignment-operators@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.4.tgz#e599f82c51d55fac725f62ce55d3a0886279ecb5" - integrity sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - -"@babel/plugin-transform-member-expression-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" - integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-member-expression-literals@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.23.3.tgz#e37b3f0502289f477ac0e776b05a833d853cabcc" - integrity sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-modules-amd@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz#4fd9ce7e3411cb8b83848480b7041d83004858f7" - integrity sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g== +"@babel/plugin-transform-class-properties@^7.24.1", "@babel/plugin-transform-class-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz#a8ce84fedb9ad512549984101fa84080a9f5f51f" + integrity sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-amd@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.3.tgz#e19b55436a1416829df0a1afc495deedfae17f7d" - integrity sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw== +"@babel/plugin-transform-class-static-block@^7.24.4", "@babel/plugin-transform-class-static-block@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz#6c8da219f4eb15cae9834ec4348ff8e9e09664a0" + integrity sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-commonjs@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.5.tgz#7aaee0ea98283de94da98b28f8c35701429dad97" - integrity sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A== +"@babel/plugin-transform-classes@^7.24.1", "@babel/plugin-transform-classes@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz#7152457f7880b593a63ade8a861e6e26a4469f52" + integrity sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-simple-access" "^7.14.5" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" + "@babel/traverse" "^7.25.9" + globals "^11.1.0" -"@babel/plugin-transform-modules-commonjs@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz#661ae831b9577e52be57dd8356b734f9700b53b4" - integrity sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA== +"@babel/plugin-transform-computed-properties@^7.24.1", "@babel/plugin-transform-computed-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz#db36492c78460e534b8852b1d5befe3c923ef10b" + integrity sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/template" "^7.25.9" -"@babel/plugin-transform-modules-systemjs@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.14.5.tgz#c75342ef8b30dcde4295d3401aae24e65638ed29" - integrity sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA== +"@babel/plugin-transform-destructuring@^7.24.1", "@babel/plugin-transform-destructuring@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz#966ea2595c498224340883602d3cfd7a0c79cea1" + integrity sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== dependencies: - "@babel/helper-hoist-variables" "^7.14.5" - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.5" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-systemjs@^7.22.5": - version "7.23.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.9.tgz#105d3ed46e4a21d257f83a2f9e2ee4203ceda6be" - integrity sha512-KDlPRM6sLo4o1FkiSlXoAa8edLXFsKKIda779fbLrvmeuc3itnjCtaO6RrtoaANsIJANj+Vk1zqbZIMhkCAHVw== +"@babel/plugin-transform-dotall-regex@^7.24.1", "@babel/plugin-transform-dotall-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz#bad7945dd07734ca52fe3ad4e872b40ed09bb09a" + integrity sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== dependencies: - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.20" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-umd@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz#fb662dfee697cce274a7cda525190a79096aa6e0" - integrity sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA== +"@babel/plugin-transform-duplicate-keys@^7.24.1", "@babel/plugin-transform-duplicate-keys@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz#8850ddf57dce2aebb4394bb434a7598031059e6d" + integrity sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-modules-umd@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.23.3.tgz#5d4395fccd071dfefe6585a4411aa7d6b7d769e9" - integrity sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg== +"@babel/plugin-transform-duplicate-named-capturing-groups-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz#6f7259b4de127721a08f1e5165b852fcaa696d31" + integrity sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog== dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-named-capturing-groups-regex@^7.14.7": - version "7.14.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.7.tgz#60c06892acf9df231e256c24464bfecb0908fd4e" - integrity sha512-DTNOTaS7TkW97xsDMrp7nycUVh6sn/eq22VaxWfEdzuEbRsiaOU0pqU7DlyUGHVsbQbSghvjKRpEl+nUCKGQSg== +"@babel/plugin-transform-dynamic-import@^7.24.1", "@babel/plugin-transform-dynamic-import@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz#23e917de63ed23c6600c5dd06d94669dce79f7b8" + integrity sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" - integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== +"@babel/plugin-transform-exponentiation-operator@^7.24.1", "@babel/plugin-transform-exponentiation-operator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.9.tgz#ece47b70d236c1d99c263a1e22b62dc20a4c8b0f" + integrity sha512-KRhdhlVk2nObA5AYa7QMgTMTVJdfHprfpAk4DjZVtllqRg9qarilstTKEhpVjyt+Npi8ThRyiV8176Am3CodPA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.5" - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-new-target@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz#31bdae8b925dc84076ebfcd2a9940143aed7dbf8" - integrity sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ== +"@babel/plugin-transform-export-namespace-from@^7.24.1", "@babel/plugin-transform-export-namespace-from@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz#90745fe55053394f554e40584cda81f2c8a402a2" + integrity sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-new-target@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.23.3.tgz#5491bb78ed6ac87e990957cea367eab781c4d980" - integrity sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ== +"@babel/plugin-transform-for-of@^7.24.1", "@babel/plugin-transform-for-of@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz#4bdc7d42a213397905d89f02350c5267866d5755" + integrity sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-nullish-coalescing-operator@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz#45556aad123fc6e52189ea749e33ce090637346e" - integrity sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA== +"@babel/plugin-transform-function-name@^7.24.1", "@babel/plugin-transform-function-name@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz#939d956e68a606661005bfd550c4fc2ef95f7b97" + integrity sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-numeric-separator@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.4.tgz#03d08e3691e405804ecdd19dd278a40cca531f29" - integrity sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q== +"@babel/plugin-transform-json-strings@^7.24.1", "@babel/plugin-transform-json-strings@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz#c86db407cb827cded902a90c707d2781aaa89660" + integrity sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-object-rest-spread@^7.22.5": - version "7.24.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.0.tgz#7b836ad0088fdded2420ce96d4e1d3ed78b71df1" - integrity sha512-y/yKMm7buHpFFXfxVFS4Vk1ToRJDilIa6fKRioB9Vjichv58TDGXTvqV0dN7plobAmTW5eSEGXDngE+Mm+uO+w== +"@babel/plugin-transform-literals@^7.24.1", "@babel/plugin-transform-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz#1a1c6b4d4aa59bc4cad5b6b3a223a0abd685c9de" + integrity sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.23.3" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-object-super@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" - integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== +"@babel/plugin-transform-logical-assignment-operators@^7.24.1", "@babel/plugin-transform-logical-assignment-operators@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz#b19441a8c39a2fda0902900b306ea05ae1055db7" + integrity sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-object-super@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.23.3.tgz#81fdb636dcb306dd2e4e8fd80db5b2362ed2ebcd" - integrity sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA== +"@babel/plugin-transform-member-expression-literals@^7.24.1", "@babel/plugin-transform-member-expression-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz#63dff19763ea64a31f5e6c20957e6a25e41ed5de" + integrity sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.20" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-optional-catch-binding@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.4.tgz#318066de6dacce7d92fa244ae475aa8d91778017" - integrity sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A== +"@babel/plugin-transform-modules-amd@^7.24.1", "@babel/plugin-transform-modules-amd@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz#49ba478f2295101544abd794486cd3088dddb6c5" + integrity sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-optional-chaining@^7.22.10", "@babel/plugin-transform-optional-chaining@^7.23.3": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz#6acf61203bdfc4de9d4e52e64490aeb3e52bd017" - integrity sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA== +"@babel/plugin-transform-modules-commonjs@^7.24.1", "@babel/plugin-transform-modules-commonjs@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz#d165c8c569a080baf5467bda88df6425fc060686" + integrity sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-simple-access" "^7.25.9" -"@babel/plugin-transform-parameters@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz#49662e86a1f3ddccac6363a7dfb1ff0a158afeb3" - integrity sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA== +"@babel/plugin-transform-modules-systemjs@^7.24.1", "@babel/plugin-transform-modules-systemjs@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" + integrity sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" -"@babel/plugin-transform-parameters@^7.22.5", "@babel/plugin-transform-parameters@^7.23.3": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz#83ef5d1baf4b1072fa6e54b2b0999a7b2527e2af" - integrity sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw== +"@babel/plugin-transform-modules-umd@^7.24.1", "@babel/plugin-transform-modules-umd@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz#6710079cdd7c694db36529a1e8411e49fcbf14c9" + integrity sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-module-transforms" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-private-methods@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz#b2d7a3c97e278bfe59137a978d53b2c2e038c0e4" - integrity sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g== +"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5", "@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz#454990ae6cc22fd2a0fa60b3a2c6f63a38064e6a" + integrity sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-private-property-in-object@^7.22.5": - version "7.23.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.4.tgz#3ec711d05d6608fd173d9b8de39872d8dbf68bf5" - integrity sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A== +"@babel/plugin-transform-new-target@^7.24.1", "@babel/plugin-transform-new-target@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz#42e61711294b105c248336dcb04b77054ea8becd" + integrity sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-create-class-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-property-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" - integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== +"@babel/plugin-transform-nullish-coalescing-operator@^7.24.1", "@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz#bcb1b0d9e948168102d5f7104375ca21c3266949" + integrity sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-property-literals@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.23.3.tgz#54518f14ac4755d22b92162e4a852d308a560875" - integrity sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw== +"@babel/plugin-transform-numeric-separator@^7.24.1", "@babel/plugin-transform-numeric-separator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz#bfed75866261a8b643468b0ccfd275f2033214a1" + integrity sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-regenerator@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" - integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== +"@babel/plugin-transform-object-rest-spread@^7.24.1", "@babel/plugin-transform-object-rest-spread@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz#0203725025074164808bcf1a2cfa90c652c99f18" + integrity sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== dependencies: - regenerator-transform "^0.14.2" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/plugin-transform-parameters" "^7.25.9" -"@babel/plugin-transform-regenerator@^7.22.10": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz#141afd4a2057298602069fce7f2dc5173e6c561c" - integrity sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ== +"@babel/plugin-transform-object-super@^7.24.1", "@babel/plugin-transform-object-super@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz#385d5de135162933beb4a3d227a2b7e52bb4cf03" + integrity sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - regenerator-transform "^0.15.2" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-replace-supers" "^7.25.9" -"@babel/plugin-transform-reserved-words@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz#c44589b661cfdbef8d4300dcc7469dffa92f8304" - integrity sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg== +"@babel/plugin-transform-optional-catch-binding@^7.24.1", "@babel/plugin-transform-optional-catch-binding@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz#10e70d96d52bb1f10c5caaac59ac545ea2ba7ff3" + integrity sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-reserved-words@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.23.3.tgz#4130dcee12bd3dd5705c587947eb715da12efac8" - integrity sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg== +"@babel/plugin-transform-optional-chaining@^7.24.1", "@babel/plugin-transform-optional-chaining@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz#e142eb899d26ef715435f201ab6e139541eee7dd" + integrity sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-shorthand-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" - integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== +"@babel/plugin-transform-parameters@^7.24.1", "@babel/plugin-transform-parameters@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz#b856842205b3e77e18b7a7a1b94958069c7ba257" + integrity sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-shorthand-properties@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz#97d82a39b0e0c24f8a981568a8ed851745f59210" - integrity sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg== +"@babel/plugin-transform-private-methods@^7.24.1", "@babel/plugin-transform-private-methods@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz#847f4139263577526455d7d3223cd8bda51e3b57" + integrity sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-spread@^7.14.6": - version "7.14.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" - integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== +"@babel/plugin-transform-private-property-in-object@^7.24.1", "@babel/plugin-transform-private-property-in-object@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz#9c8b73e64e6cc3cbb2743633885a7dd2c385fe33" + integrity sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-spread@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz#41d17aacb12bde55168403c6f2d6bdca563d362c" - integrity sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg== +"@babel/plugin-transform-property-literals@^7.24.1", "@babel/plugin-transform-property-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz#d72d588bd88b0dec8b62e36f6fda91cedfe28e3f" + integrity sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-sticky-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz#5b617542675e8b7761294381f3c28c633f40aeb9" - integrity sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A== +"@babel/plugin-transform-regenerator@^7.24.1", "@babel/plugin-transform-regenerator@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz#03a8a4670d6cebae95305ac6defac81ece77740b" + integrity sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" + regenerator-transform "^0.15.2" -"@babel/plugin-transform-sticky-regex@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.23.3.tgz#dec45588ab4a723cb579c609b294a3d1bd22ff04" - integrity sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg== +"@babel/plugin-transform-regexp-modifiers@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz#2f5837a5b5cd3842a919d8147e9903cc7455b850" + integrity sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" - integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== +"@babel/plugin-transform-reserved-words@^7.24.1", "@babel/plugin-transform-reserved-words@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz#0398aed2f1f10ba3f78a93db219b27ef417fb9ce" + integrity sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-template-literals@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.23.3.tgz#5f0f028eb14e50b5d0f76be57f90045757539d07" - integrity sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg== +"@babel/plugin-transform-shorthand-properties@^7.24.1", "@babel/plugin-transform-shorthand-properties@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz#bb785e6091f99f826a95f9894fc16fde61c163f2" + integrity sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-typeof-symbol@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz#39af2739e989a2bd291bf6b53f16981423d457d4" - integrity sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw== +"@babel/plugin-transform-spread@^7.24.1", "@babel/plugin-transform-spread@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz#24a35153931b4ba3d13cec4a7748c21ab5514ef9" + integrity sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" -"@babel/plugin-transform-typeof-symbol@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.23.3.tgz#9dfab97acc87495c0c449014eb9c547d8966bca4" - integrity sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ== +"@babel/plugin-transform-sticky-regex@^7.24.1", "@babel/plugin-transform-sticky-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz#c7f02b944e986a417817b20ba2c504dfc1453d32" + integrity sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-escapes@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz#9d4bd2a681e3c5d7acf4f57fa9e51175d91d0c6b" - integrity sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA== +"@babel/plugin-transform-template-literals@^7.24.1", "@babel/plugin-transform-template-literals@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" + integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-escapes@^7.22.10": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz#1f66d16cab01fab98d784867d24f70c1ca65b925" - integrity sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q== +"@babel/plugin-transform-typeof-symbol@^7.24.1", "@babel/plugin-transform-typeof-symbol@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" + integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-property-regex@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.23.3.tgz#19e234129e5ffa7205010feec0d94c251083d7ad" - integrity sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA== +"@babel/plugin-transform-unicode-escapes@^7.24.1", "@babel/plugin-transform-unicode-escapes@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz#a75ef3947ce15363fccaa38e2dd9bc70b2788b82" + integrity sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz#4cd09b6c8425dd81255c7ceb3fb1836e7414382e" - integrity sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw== +"@babel/plugin-transform-unicode-property-regex@^7.24.1", "@babel/plugin-transform-unicode-property-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz#a901e96f2c1d071b0d1bb5dc0d3c880ce8f53dd3" + integrity sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-regex@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.23.3.tgz#26897708d8f42654ca4ce1b73e96140fbad879dc" - integrity sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw== +"@babel/plugin-transform-unicode-regex@^7.24.1", "@babel/plugin-transform-unicode-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz#5eae747fe39eacf13a8bd006a4fb0b5d1fa5e9b1" + integrity sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/plugin-transform-unicode-sets-regex@^7.22.5": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.23.3.tgz#4fb6f0a719c2c5859d11f6b55a050cc987f3799e" - integrity sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw== +"@babel/plugin-transform-unicode-sets-regex@^7.24.1", "@babel/plugin-transform-unicode-sets-regex@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz#65114c17b4ffc20fa5b163c63c70c0d25621fabe" + integrity sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-create-regexp-features-plugin" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" -"@babel/preset-env@7.22.10": - version "7.22.10" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.10.tgz#3263b9fe2c8823d191d28e61eac60a79f9ce8a0f" - integrity sha512-riHpLb1drNkpLlocmSyEg4oYJIQFeXAK/d7rI6mbD0XsvoTOOweXDmQPG/ErxsEhWk3rl3Q/3F6RFQlVFS8m0A== +"@babel/preset-env@7.24.4": + version "7.24.4" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.4.tgz#46dbbcd608771373b88f956ffb67d471dce0d23b" + integrity sha512-7Kl6cSmYkak0FK/FXjSEnLJ1N9T/WA2RkMhu17gZ/dsxKJUuTYNIylahPTzqpLyJN4WhDif8X0XK1R8Wsguo/A== dependencies: - "@babel/compat-data" "^7.22.9" - "@babel/helper-compilation-targets" "^7.22.10" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-validator-option" "^7.22.5" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.22.5" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.22.5" + "@babel/compat-data" "^7.24.4" + "@babel/helper-compilation-targets" "^7.23.6" + "@babel/helper-plugin-utils" "^7.24.0" + "@babel/helper-validator-option" "^7.23.5" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.24.4" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.24.1" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.24.1" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.24.1" "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.22.5" - "@babel/plugin-syntax-import-attributes" "^7.22.5" + "@babel/plugin-syntax-import-assertions" "^7.24.1" + "@babel/plugin-syntax-import-attributes" "^7.24.1" "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" @@ -1537,140 +838,135 @@ "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" - "@babel/plugin-transform-arrow-functions" "^7.22.5" - "@babel/plugin-transform-async-generator-functions" "^7.22.10" - "@babel/plugin-transform-async-to-generator" "^7.22.5" - "@babel/plugin-transform-block-scoped-functions" "^7.22.5" - "@babel/plugin-transform-block-scoping" "^7.22.10" - "@babel/plugin-transform-class-properties" "^7.22.5" - "@babel/plugin-transform-class-static-block" "^7.22.5" - "@babel/plugin-transform-classes" "^7.22.6" - "@babel/plugin-transform-computed-properties" "^7.22.5" - "@babel/plugin-transform-destructuring" "^7.22.10" - "@babel/plugin-transform-dotall-regex" "^7.22.5" - "@babel/plugin-transform-duplicate-keys" "^7.22.5" - "@babel/plugin-transform-dynamic-import" "^7.22.5" - "@babel/plugin-transform-exponentiation-operator" "^7.22.5" - "@babel/plugin-transform-export-namespace-from" "^7.22.5" - "@babel/plugin-transform-for-of" "^7.22.5" - "@babel/plugin-transform-function-name" "^7.22.5" - "@babel/plugin-transform-json-strings" "^7.22.5" - "@babel/plugin-transform-literals" "^7.22.5" - "@babel/plugin-transform-logical-assignment-operators" "^7.22.5" - "@babel/plugin-transform-member-expression-literals" "^7.22.5" - "@babel/plugin-transform-modules-amd" "^7.22.5" - "@babel/plugin-transform-modules-commonjs" "^7.22.5" - "@babel/plugin-transform-modules-systemjs" "^7.22.5" - "@babel/plugin-transform-modules-umd" "^7.22.5" + "@babel/plugin-transform-arrow-functions" "^7.24.1" + "@babel/plugin-transform-async-generator-functions" "^7.24.3" + "@babel/plugin-transform-async-to-generator" "^7.24.1" + "@babel/plugin-transform-block-scoped-functions" "^7.24.1" + "@babel/plugin-transform-block-scoping" "^7.24.4" + "@babel/plugin-transform-class-properties" "^7.24.1" + "@babel/plugin-transform-class-static-block" "^7.24.4" + "@babel/plugin-transform-classes" "^7.24.1" + "@babel/plugin-transform-computed-properties" "^7.24.1" + "@babel/plugin-transform-destructuring" "^7.24.1" + "@babel/plugin-transform-dotall-regex" "^7.24.1" + "@babel/plugin-transform-duplicate-keys" "^7.24.1" + "@babel/plugin-transform-dynamic-import" "^7.24.1" + "@babel/plugin-transform-exponentiation-operator" "^7.24.1" + "@babel/plugin-transform-export-namespace-from" "^7.24.1" + "@babel/plugin-transform-for-of" "^7.24.1" + "@babel/plugin-transform-function-name" "^7.24.1" + "@babel/plugin-transform-json-strings" "^7.24.1" + "@babel/plugin-transform-literals" "^7.24.1" + "@babel/plugin-transform-logical-assignment-operators" "^7.24.1" + "@babel/plugin-transform-member-expression-literals" "^7.24.1" + "@babel/plugin-transform-modules-amd" "^7.24.1" + "@babel/plugin-transform-modules-commonjs" "^7.24.1" + "@babel/plugin-transform-modules-systemjs" "^7.24.1" + "@babel/plugin-transform-modules-umd" "^7.24.1" "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" - "@babel/plugin-transform-new-target" "^7.22.5" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.5" - "@babel/plugin-transform-numeric-separator" "^7.22.5" - "@babel/plugin-transform-object-rest-spread" "^7.22.5" - "@babel/plugin-transform-object-super" "^7.22.5" - "@babel/plugin-transform-optional-catch-binding" "^7.22.5" - "@babel/plugin-transform-optional-chaining" "^7.22.10" - "@babel/plugin-transform-parameters" "^7.22.5" - "@babel/plugin-transform-private-methods" "^7.22.5" - "@babel/plugin-transform-private-property-in-object" "^7.22.5" - "@babel/plugin-transform-property-literals" "^7.22.5" - "@babel/plugin-transform-regenerator" "^7.22.10" - "@babel/plugin-transform-reserved-words" "^7.22.5" - "@babel/plugin-transform-shorthand-properties" "^7.22.5" - "@babel/plugin-transform-spread" "^7.22.5" - "@babel/plugin-transform-sticky-regex" "^7.22.5" - "@babel/plugin-transform-template-literals" "^7.22.5" - "@babel/plugin-transform-typeof-symbol" "^7.22.5" - "@babel/plugin-transform-unicode-escapes" "^7.22.10" - "@babel/plugin-transform-unicode-property-regex" "^7.22.5" - "@babel/plugin-transform-unicode-regex" "^7.22.5" - "@babel/plugin-transform-unicode-sets-regex" "^7.22.5" + "@babel/plugin-transform-new-target" "^7.24.1" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.24.1" + "@babel/plugin-transform-numeric-separator" "^7.24.1" + "@babel/plugin-transform-object-rest-spread" "^7.24.1" + "@babel/plugin-transform-object-super" "^7.24.1" + "@babel/plugin-transform-optional-catch-binding" "^7.24.1" + "@babel/plugin-transform-optional-chaining" "^7.24.1" + "@babel/plugin-transform-parameters" "^7.24.1" + "@babel/plugin-transform-private-methods" "^7.24.1" + "@babel/plugin-transform-private-property-in-object" "^7.24.1" + "@babel/plugin-transform-property-literals" "^7.24.1" + "@babel/plugin-transform-regenerator" "^7.24.1" + "@babel/plugin-transform-reserved-words" "^7.24.1" + "@babel/plugin-transform-shorthand-properties" "^7.24.1" + "@babel/plugin-transform-spread" "^7.24.1" + "@babel/plugin-transform-sticky-regex" "^7.24.1" + "@babel/plugin-transform-template-literals" "^7.24.1" + "@babel/plugin-transform-typeof-symbol" "^7.24.1" + "@babel/plugin-transform-unicode-escapes" "^7.24.1" + "@babel/plugin-transform-unicode-property-regex" "^7.24.1" + "@babel/plugin-transform-unicode-regex" "^7.24.1" + "@babel/plugin-transform-unicode-sets-regex" "^7.24.1" "@babel/preset-modules" "0.1.6-no-external-plugins" - "@babel/types" "^7.22.10" - babel-plugin-polyfill-corejs2 "^0.4.5" - babel-plugin-polyfill-corejs3 "^0.8.3" - babel-plugin-polyfill-regenerator "^0.5.2" + babel-plugin-polyfill-corejs2 "^0.4.10" + babel-plugin-polyfill-corejs3 "^0.10.4" + babel-plugin-polyfill-regenerator "^0.6.1" core-js-compat "^3.31.0" semver "^6.3.1" "@babel/preset-env@^7.11.0": - version "7.14.7" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.7.tgz#5c70b22d4c2d893b03d8c886a5c17422502b932a" - integrity sha512-itOGqCKLsSUl0Y+1nSfhbuuOlTs0MJk2Iv7iSH+XT/mR8U1zRLO7NjWlYXB47yhK4J/7j+HYty/EhFZDYKa/VA== - dependencies: - "@babel/compat-data" "^7.14.7" - "@babel/helper-compilation-targets" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-async-generator-functions" "^7.14.7" - "@babel/plugin-proposal-class-properties" "^7.14.5" - "@babel/plugin-proposal-class-static-block" "^7.14.5" - "@babel/plugin-proposal-dynamic-import" "^7.14.5" - "@babel/plugin-proposal-export-namespace-from" "^7.14.5" - "@babel/plugin-proposal-json-strings" "^7.14.5" - "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" - "@babel/plugin-proposal-numeric-separator" "^7.14.5" - "@babel/plugin-proposal-object-rest-spread" "^7.14.7" - "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-private-methods" "^7.14.5" - "@babel/plugin-proposal-private-property-in-object" "^7.14.5" - "@babel/plugin-proposal-unicode-property-regex" "^7.14.5" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.14.5" - "@babel/plugin-transform-async-to-generator" "^7.14.5" - "@babel/plugin-transform-block-scoped-functions" "^7.14.5" - "@babel/plugin-transform-block-scoping" "^7.14.5" - "@babel/plugin-transform-classes" "^7.14.5" - "@babel/plugin-transform-computed-properties" "^7.14.5" - "@babel/plugin-transform-destructuring" "^7.14.7" - "@babel/plugin-transform-dotall-regex" "^7.14.5" - "@babel/plugin-transform-duplicate-keys" "^7.14.5" - "@babel/plugin-transform-exponentiation-operator" "^7.14.5" - "@babel/plugin-transform-for-of" "^7.14.5" - "@babel/plugin-transform-function-name" "^7.14.5" - "@babel/plugin-transform-literals" "^7.14.5" - "@babel/plugin-transform-member-expression-literals" "^7.14.5" - "@babel/plugin-transform-modules-amd" "^7.14.5" - "@babel/plugin-transform-modules-commonjs" "^7.14.5" - "@babel/plugin-transform-modules-systemjs" "^7.14.5" - "@babel/plugin-transform-modules-umd" "^7.14.5" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.7" - "@babel/plugin-transform-new-target" "^7.14.5" - "@babel/plugin-transform-object-super" "^7.14.5" - "@babel/plugin-transform-parameters" "^7.14.5" - "@babel/plugin-transform-property-literals" "^7.14.5" - "@babel/plugin-transform-regenerator" "^7.14.5" - "@babel/plugin-transform-reserved-words" "^7.14.5" - "@babel/plugin-transform-shorthand-properties" "^7.14.5" - "@babel/plugin-transform-spread" "^7.14.6" - "@babel/plugin-transform-sticky-regex" "^7.14.5" - "@babel/plugin-transform-template-literals" "^7.14.5" - "@babel/plugin-transform-typeof-symbol" "^7.14.5" - "@babel/plugin-transform-unicode-escapes" "^7.14.5" - "@babel/plugin-transform-unicode-regex" "^7.14.5" - "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.14.5" - babel-plugin-polyfill-corejs2 "^0.2.2" - babel-plugin-polyfill-corejs3 "^0.2.2" - babel-plugin-polyfill-regenerator "^0.2.2" - core-js-compat "^3.15.0" - semver "^6.3.0" + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" + integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== + dependencies: + "@babel/compat-data" "^7.26.0" + "@babel/helper-compilation-targets" "^7.25.9" + "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-validator-option" "^7.25.9" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" + "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.25.9" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.25.9" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.25.9" + "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" + "@babel/plugin-syntax-import-assertions" "^7.26.0" + "@babel/plugin-syntax-import-attributes" "^7.26.0" + "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" + "@babel/plugin-transform-arrow-functions" "^7.25.9" + "@babel/plugin-transform-async-generator-functions" "^7.25.9" + "@babel/plugin-transform-async-to-generator" "^7.25.9" + "@babel/plugin-transform-block-scoped-functions" "^7.25.9" + "@babel/plugin-transform-block-scoping" "^7.25.9" + "@babel/plugin-transform-class-properties" "^7.25.9" + "@babel/plugin-transform-class-static-block" "^7.26.0" + "@babel/plugin-transform-classes" "^7.25.9" + "@babel/plugin-transform-computed-properties" "^7.25.9" + "@babel/plugin-transform-destructuring" "^7.25.9" + "@babel/plugin-transform-dotall-regex" "^7.25.9" + "@babel/plugin-transform-duplicate-keys" "^7.25.9" + "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" + "@babel/plugin-transform-dynamic-import" "^7.25.9" + "@babel/plugin-transform-exponentiation-operator" "^7.25.9" + "@babel/plugin-transform-export-namespace-from" "^7.25.9" + "@babel/plugin-transform-for-of" "^7.25.9" + "@babel/plugin-transform-function-name" "^7.25.9" + "@babel/plugin-transform-json-strings" "^7.25.9" + "@babel/plugin-transform-literals" "^7.25.9" + "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" + "@babel/plugin-transform-member-expression-literals" "^7.25.9" + "@babel/plugin-transform-modules-amd" "^7.25.9" + "@babel/plugin-transform-modules-commonjs" "^7.25.9" + "@babel/plugin-transform-modules-systemjs" "^7.25.9" + "@babel/plugin-transform-modules-umd" "^7.25.9" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" + "@babel/plugin-transform-new-target" "^7.25.9" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" + "@babel/plugin-transform-numeric-separator" "^7.25.9" + "@babel/plugin-transform-object-rest-spread" "^7.25.9" + "@babel/plugin-transform-object-super" "^7.25.9" + "@babel/plugin-transform-optional-catch-binding" "^7.25.9" + "@babel/plugin-transform-optional-chaining" "^7.25.9" + "@babel/plugin-transform-parameters" "^7.25.9" + "@babel/plugin-transform-private-methods" "^7.25.9" + "@babel/plugin-transform-private-property-in-object" "^7.25.9" + "@babel/plugin-transform-property-literals" "^7.25.9" + "@babel/plugin-transform-regenerator" "^7.25.9" + "@babel/plugin-transform-regexp-modifiers" "^7.26.0" + "@babel/plugin-transform-reserved-words" "^7.25.9" + "@babel/plugin-transform-shorthand-properties" "^7.25.9" + "@babel/plugin-transform-spread" "^7.25.9" + "@babel/plugin-transform-sticky-regex" "^7.25.9" + "@babel/plugin-transform-template-literals" "^7.25.9" + "@babel/plugin-transform-typeof-symbol" "^7.25.9" + "@babel/plugin-transform-unicode-escapes" "^7.25.9" + "@babel/plugin-transform-unicode-property-regex" "^7.25.9" + "@babel/plugin-transform-unicode-regex" "^7.25.9" + "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" + "@babel/preset-modules" "0.1.6-no-external-plugins" + babel-plugin-polyfill-corejs2 "^0.4.10" + babel-plugin-polyfill-corejs3 "^0.10.6" + babel-plugin-polyfill-regenerator "^0.6.1" + core-js-compat "^3.38.1" + semver "^6.3.1" "@babel/preset-modules@0.1.6-no-external-plugins": version "0.1.6-no-external-plugins" @@ -1681,88 +977,42 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-modules@^0.1.4": - version "0.1.4" - resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" - integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" - "@babel/types" "^7.4.4" - esutils "^2.0.2" - -"@babel/regjsgen@^0.8.0": - version "0.8.0" - resolved "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" - integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== - "@babel/runtime@^7.8.4": - version "7.14.6" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" - integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/template@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" - integrity sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/template@^7.22.15", "@babel/template@^7.24.0": - version "7.24.0" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50" - integrity sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA== - dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/parser" "^7.24.0" - "@babel/types" "^7.24.0" - -"@babel/traverse@^7.13.0", "@babel/traverse@^7.14.5", "@babel/traverse@^7.24.1": - version "7.24.1" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz#d65c36ac9dd17282175d1e4a3c49d5b7988f530c" - integrity sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ== - dependencies: - "@babel/code-frame" "^7.24.1" - "@babel/generator" "^7.24.1" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.24.1" - "@babel/types" "^7.24.0" + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" + integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== + dependencies: + regenerator-runtime "^0.14.0" + +"@babel/template@^7.24.0", "@babel/template@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" + integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/traverse@^7.24.1", "@babel/traverse@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz#a50f8fe49e7f69f53de5bea7e413cd35c5e13c84" + integrity sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw== + dependencies: + "@babel/code-frame" "^7.25.9" + "@babel/generator" "^7.25.9" + "@babel/parser" "^7.25.9" + "@babel/template" "^7.25.9" + "@babel/types" "^7.25.9" debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.14.5", "@babel/types@^7.4.4": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff" - integrity sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - to-fast-properties "^2.0.0" - -"@babel/types@^7.18.6": - version "7.20.7" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" - integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== - dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" - to-fast-properties "^2.0.0" - -"@babel/types@^7.22.10", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.24.0": - version "7.24.0" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz#3b951f435a92e7333eba05b7566fd297960ea1bf" - integrity sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w== +"@babel/types@^7.24.0", "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.4.4": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz#deabd08d6b753bc8e0f198f8709fb575e31774ff" + integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA== dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" "@colors/colors@1.5.0": version "1.5.0" @@ -1770,411 +1020,417 @@ integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== "@discoveryjs/json-ext@^0.5.0": - version "0.5.3" - resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz#90420f9f9c6d3987f176a19a7d8e764271a2f55d" - integrity sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g== - -"@firebase/analytics-compat@0.2.6": - version "0.2.6" - resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.6.tgz#50063978c42f13eb800e037e96ac4b17236841f4" - integrity sha512-4MqpVLFkGK7NJf/5wPEEP7ePBJatwYpyjgJ+wQHQGHfzaCDgntOnl9rL2vbVGGKCnRqWtZDIWhctB86UWXaX2Q== - dependencies: - "@firebase/analytics" "0.10.0" - "@firebase/analytics-types" "0.8.0" - "@firebase/component" "0.6.4" - "@firebase/util" "1.9.3" + version "0.5.7" + resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" + integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== + +"@firebase/analytics-compat@0.2.15-canary.e577a408c": + version "0.2.15-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.15-canary.e577a408c.tgz#fddbb8af72b2263a1b37908e569bc5e078094697" + integrity sha512-ejzH+aLgVK5UVEzImnns878oKL7IkOAhnQ2CeL/vTxQR21Gn8sFYQ5fnO8wKLh9C9xdxorWnXmTDR5PDjbQ1CQ== + dependencies: + "@firebase/analytics" "0.10.9-canary.e577a408c" + "@firebase/analytics-types" "0.8.2-canary.e577a408c" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/analytics-types@0.8.0": - version "0.8.0" - resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.0.tgz#551e744a29adbc07f557306530a2ec86add6d410" - integrity sha512-iRP+QKI2+oz3UAh4nPEq14CsEjrjD6a5+fuypjScisAh9kXKFvdJOZJDwk7kikLvWVLGEs9+kIUS4LPQV7VZVw== - -"@firebase/analytics@0.10.0": - version "0.10.0" - resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.0.tgz#9c6986acd573c6c6189ffb52d0fd63c775db26d7" - integrity sha512-Locv8gAqx0e+GX/0SI3dzmBY5e9kjVDtD+3zCFLJ0tH2hJwuCAiL+5WkHuxKj92rqQj/rvkBUCfA1ewlX2hehg== - dependencies: - "@firebase/component" "0.6.4" - "@firebase/installations" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" +"@firebase/analytics-types@0.8.2-canary.e577a408c": + version "0.8.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.2-canary.e577a408c.tgz#0eb6eb5ea62d0f2147e3b21163994c3b518d07d1" + integrity sha512-E0C/pI5GCKqWlZm7ZZEAwGOJLIunKlM/rfyElkxZdcdM2VVIhlNuRvi2R9r4TEtBwa+zS1E2Hp0rp1RJ5vtGhQ== + +"@firebase/analytics@0.10.9-canary.e577a408c": + version "0.10.9-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.9-canary.e577a408c.tgz#7b50262b9633e9dbfe2ea9ce4f4333da9391bbbc" + integrity sha512-KG2jF9HJTE3Axm1wcehmSHcGDfUy4gCDabbJjLr7TyNqmRz1+0w/PzYMZs8uPP6gWmwGMNKcmAGCEC9+mt/0aA== + dependencies: + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/installations" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/app-check-compat@0.3.7": - version "0.3.7" - resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.7.tgz#e150f61d653a0f2043a34dcb995616a717161839" - integrity sha512-cW682AxsyP1G+Z0/P7pO/WT2CzYlNxoNe5QejVarW2o5ZxeWSSPAiVEwpEpQR/bUlUmdeWThYTMvBWaopdBsqw== +"@firebase/app-check-compat@0.3.16-canary.e577a408c": + version "0.3.16-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.16-canary.e577a408c.tgz#c63299f699bf295512f538b3f40902a040f79b98" + integrity sha512-zvS/3ZA4iwgWFKPeTm6NybdiJCfvyBazAP2w731GAYdkcbnaqqki4rlDDPsJqY6WehhcwakBtpiBrK8DmGQ79A== dependencies: - "@firebase/app-check" "0.8.0" - "@firebase/app-check-types" "0.5.0" - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" + "@firebase/app-check" "0.8.9-canary.e577a408c" + "@firebase/app-check-types" "0.5.2-canary.e577a408c" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/app-check-interop-types@0.3.0": - version "0.3.0" - resolved "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.0.tgz#b27ea1397cb80427f729e4bbf3a562f2052955c4" - integrity sha512-xAxHPZPIgFXnI+vb4sbBjZcde7ZluzPPaSK7Lx3/nmuVk4TjZvnL8ONnkd4ERQKL8WePQySU+pRcWkh8rDf5Sg== +"@firebase/app-check-interop-types@0.3.2-canary.e577a408c": + version "0.3.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.2-canary.e577a408c.tgz#f9f22160782a294ee9eafe56c228b9a95710925e" + integrity sha512-fg6IFUVkc93xCiZ/qucO54zdq2mksks9HI4WJbBlLVCMoYJwXt3aBQt1m/0vHzMt2KPf3LlhQ9XLNnu1LGE0Dw== -"@firebase/app-check-types@0.5.0": - version "0.5.0" - resolved "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.0.tgz#1b02826213d7ce6a1cf773c329b46ea1c67064f4" - integrity sha512-uwSUj32Mlubybw7tedRzR24RP8M8JUVR3NPiMk3/Z4bCmgEKTlQBwMXrehDAZ2wF+TsBq0SN1c6ema71U/JPyQ== +"@firebase/app-check-types@0.5.2-canary.e577a408c": + version "0.5.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.2-canary.e577a408c.tgz#55d0ac631fba11363c253ca29e149a2227718cbf" + integrity sha512-9+v/EvezXPhCJhvEJeASr/2bbw8lv6sJVq3pFxQUY8cexyoqbkXjWuFu8HnbvIJqlHHfYNnfSiumsgs2J4Q0Lw== -"@firebase/app-check@0.8.0": - version "0.8.0" - resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.0.tgz#b531ec40900af9c3cf1ec63de9094a0ddd733d6a" - integrity sha512-dRDnhkcaC2FspMiRK/Vbp+PfsOAEP6ZElGm9iGFJ9fDqHoPs0HOPn7dwpJ51lCFi1+2/7n5pRPGhqF/F03I97g== +"@firebase/app-check@0.8.9-canary.e577a408c": + version "0.8.9-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.9-canary.e577a408c.tgz#c567baa9cd987bb05b8bcb535f21b35ae40d4b4b" + integrity sha512-oVQG6HGf2YelvngoacKbascxlt6EH9VWY3HCTs/iYmdH3RfKf0wMSDkVY9+NokwwHnUwZjRY/Kjp5VcLc8C51A== dependencies: - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/app-compat@0.2.13": - version "0.2.13" - resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.13.tgz#c42d392f45f2c9fef1631cb3ae36d53296aa6407" - integrity sha512-j6ANZaWjeVy5zg6X7uiqh6lM6o3n3LD1+/SJFNs9V781xyryyZWXe+tmnWNWPkP086QfJoNkWN9pMQRqSG4vMg== +"@firebase/app-compat@0.2.45-canary.e577a408c": + version "0.2.45-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.45-canary.e577a408c.tgz#8052e478c0f617208e06473972b2012c030d7cfc" + integrity sha512-mTrdwl94ID3RnBcNQe3LLut3RJedZs9DzZwIbczPamKACjoui5YSm3UP5TITi3jaRv/bZwO34YNIK4hxyWS+jg== dependencies: - "@firebase/app" "0.9.13" - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" + "@firebase/app" "0.10.15-canary.e577a408c" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/app-types@0.9.0": - version "0.9.0" - resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.0.tgz#35b5c568341e9e263b29b3d2ba0e9cfc9ec7f01e" - integrity sha512-AeweANOIo0Mb8GiYm3xhTEBVCmPwTYAu9Hcd2qSkLuga/6+j9b1Jskl5bpiSQWy9eJ/j5pavxj6eYogmnuzm+Q== +"@firebase/app-types@0.9.2-canary.e577a408c": + version "0.9.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.2-canary.e577a408c.tgz#8a307fe169e4a86f9e98b6abd6f06eea100afcfc" + integrity sha512-b1NRPwjgAvEf3yOFC7qW58Ks2iFu/k1aY+8eNYvYz7dXdvXRFhRyuW3Qn63yEl4epy1DFo6gZiQ7+8wVSS4Ldw== -"@firebase/app@0.9.13": - version "0.9.13" - resolved "https://registry.npmjs.org/@firebase/app/-/app-0.9.13.tgz#b1d3ad63d52f235a0d70a9b4261cabb3a24690d7" - integrity sha512-GfiI1JxJ7ecluEmDjPzseRXk/PX31hS7+tjgBopL7XjB2hLUdR+0FTMXy2Q3/hXezypDvU6or7gVFizDESrkXw== +"@firebase/app@0.10.15-canary.e577a408c": + version "0.10.15-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/app/-/app-0.10.15-canary.e577a408c.tgz#a71c7aea85082448423881cf40e1252bfe48629a" + integrity sha512-/2kjjOmtfg7nfuXF6p9XipZi8WZUKCt6eoPWFgFj+1yvp7r9mUpFlvbR+XGbz0no4FAblW/cOvUVhsa3W1I+Ag== dependencies: - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" idb "7.1.1" tslib "^2.1.0" -"@firebase/auth-compat@0.4.2": - version "0.4.2" - resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.4.2.tgz#cb65edc2fbd5f72fff32310409f2fd702b5145e7" - integrity sha512-Q30e77DWXFmXEt5dg5JbqEDpjw9y3/PcP9LslDPR7fARmAOTIY9MM6HXzm9KC+dlrKH/+p6l8g9ifJiam9mc4A== +"@firebase/auth-compat@0.5.15-canary.e577a408c": + version "0.5.15-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.15-canary.e577a408c.tgz#cae7035dda7bf2042e87443f12e659c2a1834bdf" + integrity sha512-L0p5tmT5swkHgbjwm723YqxAdJe4wDRBe5kSeRaVqK7p2WChUgjKIhoFsFcwf6591StHCiK5eZKJtau2Uz6HjA== dependencies: - "@firebase/auth" "0.23.2" - "@firebase/auth-types" "0.12.0" - "@firebase/component" "0.6.4" - "@firebase/util" "1.9.3" - node-fetch "2.6.7" + "@firebase/auth" "1.8.0-canary.e577a408c" + "@firebase/auth-types" "0.12.2-canary.e577a408c" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/auth-interop-types@0.2.1": - version "0.2.1" - resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.1.tgz#78884f24fa539e34a06c03612c75f222fcc33742" - integrity sha512-VOaGzKp65MY6P5FI84TfYKBXEPi6LmOCSMMzys6o2BN2LOsqy7pCuZCup7NYnfbk5OkkQKzvIfHOzTm0UDpkyg== - -"@firebase/auth-types@0.12.0": - version "0.12.0" - resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.0.tgz#f28e1b68ac3b208ad02a15854c585be6da3e8e79" - integrity sha512-pPwaZt+SPOshK8xNoiQlK5XIrS97kFYc3Rc7xmy373QsOJ9MmqXxLaYssP5Kcds4wd2qK//amx/c+A8O2fVeZA== - -"@firebase/auth@0.23.2": - version "0.23.2" - resolved "https://registry.npmjs.org/@firebase/auth/-/auth-0.23.2.tgz#9e6d8dd550a28053c1825fb98c7dc9b37119254d" - integrity sha512-dM9iJ0R6tI1JczuGSxXmQbXAgtYie0K4WvKcuyuSTCu9V8eEDiz4tfa1sO3txsfvwg7nOY3AjoCyMYEdqZ8hdg== - dependencies: - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" - node-fetch "2.6.7" +"@firebase/auth-interop-types@0.2.3-canary.e577a408c": + version "0.2.3-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.3-canary.e577a408c.tgz#2eccac1ba25b38386c26829d89cc18e272b6aa79" + integrity sha512-7kKiifjMceqygJlMJH6HQaLtScDHpNpHbYTBZ2r1hF/DTLJXgVhfzDk4S77AeEwl3HIvc1E9iFISVkmfl+rOsA== + +"@firebase/auth-types@0.12.2-canary.e577a408c": + version "0.12.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.2-canary.e577a408c.tgz#84efa14bcebfb2f1b901886f2e9b3d92ca6f1a91" + integrity sha512-rFhQTSsQBNtdUDbHZZ3+F81SZHVrNpkjUJ1aZ5pE6kkbpsn3Qvo1YecU0h28jLg4WbDcwS7iXaOT4GitckUQRw== + +"@firebase/auth@1.8.0-canary.e577a408c": + version "1.8.0-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/auth/-/auth-1.8.0-canary.e577a408c.tgz#2287c08335e9968768a40905cb9114dab8eb9b3c" + integrity sha512-gOip6KD67vtSiyJMxlDSGyDivR+FQPa+ZhdONZnmWLJSqx22m9MvqBKDZwWn5WV87DYE4i321px6FJudTw7igg== + dependencies: + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" + tslib "^2.1.0" + +"@firebase/component@0.6.10-canary.e577a408c": + version "0.6.10-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.10-canary.e577a408c.tgz#c79bf2009d4c130d273f0fc41fe6520da86896a8" + integrity sha512-oGPT9G2obvn0UDL4Sy3It3lHOEb4bx3/xSE5DYMhGt5p07WfKsEPcVerjhQKDRYRe3lVWrKo6wFuGeOwnosQuQ== + dependencies: + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/component@0.6.4": - version "0.6.4" - resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.4.tgz#8981a6818bd730a7554aa5e0516ffc9b1ae3f33d" - integrity sha512-rLMyrXuO9jcAUCaQXCMjCMUsWrba5fzHlNK24xz5j2W6A/SRmK8mZJ/hn7V0fViLbxC0lPMtrK1eYzk6Fg03jA== +"@firebase/data-connect@0.1.1-canary.e577a408c": + version "0.1.1-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.1.1-canary.e577a408c.tgz#d4804b9e5de637bb2792a7356191aafd4d4316cd" + integrity sha512-Fk033kJ6EHLFaDcPuX+G40VLUJPHYK5hrB3DpvtkXJRKDB98oVg111ZlGuX5aHVBNtHZe/hU9ODdUqSKflhl3Q== dependencies: - "@firebase/util" "1.9.3" + "@firebase/auth-interop-types" "0.2.3-canary.e577a408c" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/database-compat@0.3.4": - version "0.3.4" - resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-0.3.4.tgz#4e57932f7a5ba761cd5ac946ab6b6ab3f660522c" - integrity sha512-kuAW+l+sLMUKBThnvxvUZ+Q1ZrF/vFJ58iUY9kAcbX48U03nVzIF6Tmkf0p3WVQwMqiXguSgtOPIB6ZCeF+5Gg== +"@firebase/database-compat@2.0.0-canary.e577a408c": + version "2.0.0-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.0-canary.e577a408c.tgz#3474928eb0d95ddb841d743af549e0a731f6525e" + integrity sha512-cVATbY+ltzjKzARazHbT9chNKAW+NGEi3xFNtHpgSElNaiVVNQT/KKFosEQW3YsoYso0fG4Y4BJn0j0PsFTsgA== dependencies: - "@firebase/component" "0.6.4" - "@firebase/database" "0.14.4" - "@firebase/database-types" "0.10.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/database" "1.0.9-canary.e577a408c" + "@firebase/database-types" "1.0.6-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/database-types@0.10.4": - version "0.10.4" - resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.10.4.tgz#47ba81113512dab637abace61cfb65f63d645ca7" - integrity sha512-dPySn0vJ/89ZeBac70T+2tWWPiJXWbmRygYv0smT5TfE3hDrQ09eKMF3Y+vMlTdrMWq7mUdYW5REWPSGH4kAZQ== +"@firebase/database-types@1.0.6-canary.e577a408c": + version "1.0.6-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.6-canary.e577a408c.tgz#9734ffe92db16b91a9c63529f8d3e3991d871039" + integrity sha512-C+7uS/uM/DHMYtCMERdHVbkBkWEO7DL4WIDqHGP3SuCQzZ8EOwQA587r/ko8GjePAU1RYTarY2G8TmiS3zvPQw== dependencies: - "@firebase/app-types" "0.9.0" - "@firebase/util" "1.9.3" + "@firebase/app-types" "0.9.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" -"@firebase/database@0.14.4": - version "0.14.4" - resolved "https://registry.npmjs.org/@firebase/database/-/database-0.14.4.tgz#9e7435a16a540ddfdeb5d99d45618e6ede179aa6" - integrity sha512-+Ea/IKGwh42jwdjCyzTmeZeLM3oy1h0mFPsTy6OqCWzcu/KFqRAr5Tt1HRCOBlNOdbh84JPZC47WLU18n2VbxQ== +"@firebase/database@1.0.9-canary.e577a408c": + version "1.0.9-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/database/-/database-1.0.9-canary.e577a408c.tgz#99ee54b4b4e8f0112a91aa90aae412e93fbb92ec" + integrity sha512-HCUUYCFhBkZnf8rwK7Vd/StZk2phyul+qoSfD/dBokgiPm6wYBA1a6+bFqUwriy8iw9R85k8enfXy+Ywmc3Ovw== dependencies: - "@firebase/auth-interop-types" "0.2.1" - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" + "@firebase/app-check-interop-types" "0.3.2-canary.e577a408c" + "@firebase/auth-interop-types" "0.2.3-canary.e577a408c" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" faye-websocket "0.11.4" tslib "^2.1.0" -"@firebase/firestore-compat@0.3.12": - version "0.3.12" - resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.12.tgz#c08b24c76da7af75598f3c28432b6eb22f959b56" - integrity sha512-mazuNGAx5Kt9Nph0pm6ULJFp/+j7GSsx+Ncw1GrnKl+ft1CQ4q2LcUssXnjqkX2Ry0fNGqUzC1mfIUrk9bYtjQ== +"@firebase/firestore-compat@0.3.39-canary.e577a408c": + version "0.3.39-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.39-canary.e577a408c.tgz#08ad2d5d2ab175026dd506acac03f2fa78e9c823" + integrity sha512-W5ua0Vk9CIyPkWXA36uzTFR75vH2A1A2QQzbpx/h+qGIQUNvkNBhoCpfiW3pq3056jSYyUVPwlR4hXAVfWclpQ== dependencies: - "@firebase/component" "0.6.4" - "@firebase/firestore" "3.13.0" - "@firebase/firestore-types" "2.5.1" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/firestore" "4.7.4-canary.e577a408c" + "@firebase/firestore-types" "3.0.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/firestore-types@2.5.1": - version "2.5.1" - resolved "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-2.5.1.tgz#464b2ee057956599ca34de50eae957c30fdbabb7" - integrity sha512-xG0CA6EMfYo8YeUxC8FeDzf6W3FX1cLlcAGBYV6Cku12sZRI81oWcu61RSKM66K6kUENP+78Qm8mvroBcm1whw== - -"@firebase/firestore@3.13.0": - version "3.13.0" - resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-3.13.0.tgz#f924a3bb462bc3ac666dc5d375f3f8c4e1a72345" - integrity sha512-NwcnU+madJXQ4fbLkGx1bWvL612IJN/qO6bZ6dlPmyf7QRyu5azUosijdAN675r+bOOJxMtP1Bv981bHBXAbUg== - dependencies: - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" - "@firebase/webchannel-wrapper" "0.10.1" - "@grpc/grpc-js" "~1.7.0" - "@grpc/proto-loader" "^0.6.13" - node-fetch "2.6.7" +"@firebase/firestore-types@3.0.2-canary.e577a408c": + version "3.0.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.2-canary.e577a408c.tgz#79796f99480e0719823bb816c4845d2d20ac767a" + integrity sha512-P3wH4cR6c8s6QDXMj+SbV++FEOJ7v64+iYNIfkhPAgsIdkfZAFM8uGc5RMyNyd+o8HR98otPQAJOnMxKSFJk1g== + +"@firebase/firestore@4.7.4-canary.e577a408c": + version "4.7.4-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.4-canary.e577a408c.tgz#128eaca443b9e545c1f79722647ed491baf77184" + integrity sha512-+WSXt6T1Zo2gIAnt0eSvEIZvbBMT5cgaQMUjzGdGixdOayetdKQsF0rOIy1b43ciUJrpECBqdeNIzAWLUxCnDg== + dependencies: + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/webchannel-wrapper" "1.0.2-canary.e577a408c" + "@grpc/grpc-js" "~1.9.0" + "@grpc/proto-loader" "^0.7.8" tslib "^2.1.0" -"@firebase/functions-compat@0.3.5": - version "0.3.5" - resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.5.tgz#7a532d3a9764c6d5fbc1ec5541a989a704326647" - integrity sha512-uD4jwgwVqdWf6uc3NRKF8cSZ0JwGqSlyhPgackyUPe+GAtnERpS4+Vr66g0b3Gge0ezG4iyHo/EXW/Hjx7QhHw== +"@firebase/functions-compat@0.3.15-canary.e577a408c": + version "0.3.15-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.15-canary.e577a408c.tgz#603b63a0abb80576f60e920522f232ea73e35584" + integrity sha512-RJDI10YNUCWkLMXGFdqCOcrqkdquVRKhhHT5x0mJcaFwMgdYKBjh/u+vyNTkLM6M2KLTCMLalOJyGNtXIvL2xQ== dependencies: - "@firebase/component" "0.6.4" - "@firebase/functions" "0.10.0" - "@firebase/functions-types" "0.6.0" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/functions" "0.11.9-canary.e577a408c" + "@firebase/functions-types" "0.6.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/functions-types@0.6.0": - version "0.6.0" - resolved "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.0.tgz#ccd7000dc6fc668f5acb4e6a6a042a877a555ef2" - integrity sha512-hfEw5VJtgWXIRf92ImLkgENqpL6IWpYaXVYiRkFY1jJ9+6tIhWM7IzzwbevwIIud/jaxKVdRzD7QBWfPmkwCYw== - -"@firebase/functions@0.10.0": - version "0.10.0" - resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.10.0.tgz#c630ddf12cdf941c25bc8d554e30c3226cd560f6" - integrity sha512-2U+fMNxTYhtwSpkkR6WbBcuNMOVaI7MaH3cZ6UAeNfj7AgEwHwMIFLPpC13YNZhno219F0lfxzTAA0N62ndWzA== - dependencies: - "@firebase/app-check-interop-types" "0.3.0" - "@firebase/auth-interop-types" "0.2.1" - "@firebase/component" "0.6.4" - "@firebase/messaging-interop-types" "0.2.0" - "@firebase/util" "1.9.3" - node-fetch "2.6.7" +"@firebase/functions-types@0.6.2-canary.e577a408c": + version "0.6.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.2-canary.e577a408c.tgz#c1d1f73bf528d9f770ea5c125ca8dedadc560c03" + integrity sha512-SJIi3pvzVrdwtoWeQUZGQOHXG8FHm57eRMs6NgrZLm4lkEQSNvhyzoL1g+vrhMCp95y1N7LzMjsiGEVKI9iITw== + +"@firebase/functions@0.11.9-canary.e577a408c": + version "0.11.9-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.9-canary.e577a408c.tgz#253e4a0b212440ef6521998ae1e03ca4571ce6c5" + integrity sha512-1IXDmr88c4b8WpFBrZXlvHCwA4pblnjP0Kx+1zr+ZS8HA5zIzLBjj5u8085BvU5ajbm8H5PqLoIopUp0tMMKjA== + dependencies: + "@firebase/app-check-interop-types" "0.3.2-canary.e577a408c" + "@firebase/auth-interop-types" "0.2.3-canary.e577a408c" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/messaging-interop-types" "0.2.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/installations-compat@0.2.4": - version "0.2.4" - resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.4.tgz#b5557c897b4cd3635a59887a8bf69c3731aaa952" - integrity sha512-LI9dYjp0aT9Njkn9U4JRrDqQ6KXeAmFbRC0E7jI7+hxl5YmRWysq5qgQl22hcWpTk+cm3es66d/apoDU/A9n6Q== +"@firebase/installations-compat@0.2.10-canary.e577a408c": + version "0.2.10-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.10-canary.e577a408c.tgz#a786ba61d0e13407ac84a7513165d463abd2b2d4" + integrity sha512-3bOVauoRCUOCTG3QgjtMa4lGarERlK+6YGVjN53uDaBMMcxAJS/5Gv/SMcCVJhyHTdTb4JV5qLHH8hchHYgu5Q== dependencies: - "@firebase/component" "0.6.4" - "@firebase/installations" "0.6.4" - "@firebase/installations-types" "0.5.0" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/installations" "0.6.10-canary.e577a408c" + "@firebase/installations-types" "0.5.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/installations-types@0.5.0": - version "0.5.0" - resolved "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.0.tgz#2adad64755cd33648519b573ec7ec30f21fb5354" - integrity sha512-9DP+RGfzoI2jH7gY4SlzqvZ+hr7gYzPODrbzVD82Y12kScZ6ZpRg/i3j6rleto8vTFC8n6Len4560FnV1w2IRg== +"@firebase/installations-types@0.5.2-canary.e577a408c": + version "0.5.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.2-canary.e577a408c.tgz#caaafd066379c6340cd6ce74fa43a55cfaa8d4da" + integrity sha512-LhSt9fB89XK6DtI/r9wlCYpwO8jPaEjkLxWp5W4ZJ3XwqhaM3ndf2VVrS5z3xrInqSR83faKvvsoZTFvsGJbIA== -"@firebase/installations@0.6.4": - version "0.6.4" - resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.4.tgz#20382e33e6062ac5eff4bede8e468ed4c367609e" - integrity sha512-u5y88rtsp7NYkCHC3ElbFBrPtieUybZluXyzl7+4BsIz4sqb4vSAuwHEUgCgCeaQhvsnxDEU6icly8U9zsJigA== +"@firebase/installations@0.6.10-canary.e577a408c": + version "0.6.10-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.10-canary.e577a408c.tgz#20e281227afe34f8f506ce121bf4ea7eedd9f593" + integrity sha512-OqU2vWKBDulpcMmotmsRW/wFuXER6ilrgDee6xt+E4RWdURNvJ/DpDcfFm934/Hw16pcTQDSzseAXBqss1S06g== dependencies: - "@firebase/component" "0.6.4" - "@firebase/util" "1.9.3" - idb "7.0.1" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" + idb "7.1.1" tslib "^2.1.0" -"@firebase/logger@0.4.0": - version "0.4.0" - resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.0.tgz#15ecc03c452525f9d47318ad9491b81d1810f113" - integrity sha512-eRKSeykumZ5+cJPdxxJRgAC3G5NknY2GwEbKfymdnXtnT0Ucm4pspfR6GT4MUQEDuJwRVbVcSx85kgJulMoFFA== +"@firebase/logger@0.4.3-canary.e577a408c": + version "0.4.3-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.3-canary.e577a408c.tgz#a54f0b42e2bbcf474ef82983a14ad7efaec1c502" + integrity sha512-P62nyiW3TGU2cc2OnoCx7YOjpUj5AKIKuUvjn8W4wSuKB2eHF75w2sWCtAaOugXUYMp/QoSSLEpwMSJO7Xg6HA== dependencies: tslib "^2.1.0" -"@firebase/messaging-compat@0.2.4": - version "0.2.4" - resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.4.tgz#323ca48deef77065b4fcda3cfd662c4337dffcfd" - integrity sha512-lyFjeUhIsPRYDPNIkYX1LcZMpoVbBWXX4rPl7c/rqc7G+EUea7IEtSt4MxTvh6fDfPuzLn7+FZADfscC+tNMfg== +"@firebase/messaging-compat@0.2.13-canary.e577a408c": + version "0.2.13-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.13-canary.e577a408c.tgz#9bfc8700fec9f510195ceab6c4a7a006c853bc4a" + integrity sha512-HdoepMBydMjXvnWJaq/0N82DBmCcwojT8XHnx6UUjhC2gmZuy/dmHcwOi1OC53zm4dYt+u9sx3TdCPn3Zt6ysA== dependencies: - "@firebase/component" "0.6.4" - "@firebase/messaging" "0.12.4" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/messaging" "0.12.13-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/messaging-interop-types@0.2.0": - version "0.2.0" - resolved "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.0.tgz#6056f8904a696bf0f7fdcf5f2ca8f008e8f6b064" - integrity sha512-ujA8dcRuVeBixGR9CtegfpU4YmZf3Lt7QYkcj693FFannwNuZgfAYaTmbJ40dtjB81SAu6tbFPL9YLNT15KmOQ== - -"@firebase/messaging@0.12.4": - version "0.12.4" - resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.4.tgz#ccb49df5ab97d5650c9cf5b8c77ddc34daafcfe0" - integrity sha512-6JLZct6zUaex4g7HI3QbzeUrg9xcnmDAPTWpkoMpd/GoSVWH98zDoWXMGrcvHeCAIsLpFMe4MPoZkJbrPhaASw== - dependencies: - "@firebase/component" "0.6.4" - "@firebase/installations" "0.6.4" - "@firebase/messaging-interop-types" "0.2.0" - "@firebase/util" "1.9.3" - idb "7.0.1" +"@firebase/messaging-interop-types@0.2.2-canary.e577a408c": + version "0.2.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.2-canary.e577a408c.tgz#004aac98993a3b28e62b942d26e3688239e4c49c" + integrity sha512-lhSi6wwyUa2spoqDmxMNbMMtj/sqPSp2KIzT/VJs1PV1flc5g81Mo5DxMwcUFx0fjNCvMd74rmpXYXtwgJUWoA== + +"@firebase/messaging@0.12.13-canary.e577a408c": + version "0.12.13-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.13-canary.e577a408c.tgz#f48f88152ddfeeffddee2b0cbda7079f15f8975f" + integrity sha512-43nN/xaWFt6UKgBKN8EAmkoiH8+rQyGlT05H3HkScN+XyXDP9W288KGGImjYfQmlaTa9b3hCz1aEg1N14pQsYw== + dependencies: + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/installations" "0.6.10-canary.e577a408c" + "@firebase/messaging-interop-types" "0.2.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" + idb "7.1.1" tslib "^2.1.0" -"@firebase/performance-compat@0.2.4": - version "0.2.4" - resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.4.tgz#95cbf32057b5d9f0c75d804bc50e6ed3ba486274" - integrity sha512-nnHUb8uP9G8islzcld/k6Bg5RhX62VpbAb/Anj7IXs/hp32Eb2LqFPZK4sy3pKkBUO5wcrlRWQa6wKOxqlUqsg== +"@firebase/performance-compat@0.2.10-canary.e577a408c": + version "0.2.10-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.10-canary.e577a408c.tgz#d03f609b16e9f8c21f7375b1001811b63c595aa2" + integrity sha512-ms0HMNCj6J9HfxuqorWI+bbwDtyBW+Yoo6ORgNnxsWp/A9Upi3AdfL+cqfhbMbQlntp+o9AIqCi+cdy3BX8SBA== dependencies: - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/performance" "0.6.4" - "@firebase/performance-types" "0.2.0" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/performance" "0.6.10-canary.e577a408c" + "@firebase/performance-types" "0.2.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/performance-types@0.2.0": - version "0.2.0" - resolved "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.0.tgz#400685f7a3455970817136d9b48ce07a4b9562ff" - integrity sha512-kYrbr8e/CYr1KLrLYZZt2noNnf+pRwDq2KK9Au9jHrBMnb0/C9X9yWSXmZkFt4UIdsQknBq8uBB7fsybZdOBTA== - -"@firebase/performance@0.6.4": - version "0.6.4" - resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.4.tgz#0ad766bfcfab4f386f4fe0bef43bbcf505015069" - integrity sha512-HfTn/bd8mfy/61vEqaBelNiNnvAbUtME2S25A67Nb34zVuCSCRIX4SseXY6zBnOFj3oLisaEqhVcJmVPAej67g== - dependencies: - "@firebase/component" "0.6.4" - "@firebase/installations" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" +"@firebase/performance-types@0.2.2-canary.e577a408c": + version "0.2.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.2-canary.e577a408c.tgz#d450c685ea8ce41fa3bf8d0ce9c172993e65f367" + integrity sha512-7dITRmK66uVzYssTrpuKZ9D1zEUebNz3LGHsRrtqLe1uCAVWwlUt7H14p7vLWJVlCv27Wx3eiSGhyOqPPwmqgQ== + +"@firebase/performance@0.6.10-canary.e577a408c": + version "0.6.10-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.10-canary.e577a408c.tgz#7aa8e3d5fe2cd1f20a7ec9ff26dbff7e78d74a64" + integrity sha512-Ds2cavuif/fQA+n/P/IhhCDxtxtI9XB+0CUFaJhT39aUUoLMHH9lh4+/LNoYifs3NXVxRcF4+goKGon2DntbbQ== + dependencies: + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/installations" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/remote-config-compat@0.2.4": - version "0.2.4" - resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.4.tgz#1f494c81a6c9560b1f9ca1b4fbd4bbbe47cf4776" - integrity sha512-FKiki53jZirrDFkBHglB3C07j5wBpitAaj8kLME6g8Mx+aq7u9P7qfmuSRytiOItADhWUj7O1JIv7n9q87SuwA== +"@firebase/remote-config-compat@0.2.10-canary.e577a408c": + version "0.2.10-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.10-canary.e577a408c.tgz#9229a2412cc9549db54e4cad35e11bd8940409c8" + integrity sha512-Vdju2neGfb/eA0ifgv7L0TLkY3HHcISkPaLWDLN+D+7XUIPbisKIeQM6zstCPEnwrcRxWvb0ky63bXx+xVWcHg== dependencies: - "@firebase/component" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/remote-config" "0.4.4" - "@firebase/remote-config-types" "0.3.0" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/remote-config" "0.4.10-canary.e577a408c" + "@firebase/remote-config-types" "0.3.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/remote-config-types@0.3.0": - version "0.3.0" - resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.0.tgz#689900dcdb3e5c059e8499b29db393e4e51314b4" - integrity sha512-RtEH4vdcbXZuZWRZbIRmQVBNsE7VDQpet2qFvq6vwKLBIQRQR5Kh58M4ok3A3US8Sr3rubYnaGqZSurCwI8uMA== - -"@firebase/remote-config@0.4.4": - version "0.4.4" - resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.4.tgz#6a496117054de58744bc9f382d2a6d1e14060c65" - integrity sha512-x1ioTHGX8ZwDSTOVp8PBLv2/wfwKzb4pxi0gFezS5GCJwbLlloUH4YYZHHS83IPxnua8b6l0IXUaWd0RgbWwzQ== - dependencies: - "@firebase/component" "0.6.4" - "@firebase/installations" "0.6.4" - "@firebase/logger" "0.4.0" - "@firebase/util" "1.9.3" +"@firebase/remote-config-types@0.3.2-canary.e577a408c": + version "0.3.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.2-canary.e577a408c.tgz#896a72b491f774dd6824a53388b78f4b978e367b" + integrity sha512-u2MWoUqvWUorLrzVqRMZgAK0AgV5OblfR3wG9JUA8vGrbCLWOY4J9RKdKtUaHMstn+4XIbQWV6HLgCy7Yn/e1A== + +"@firebase/remote-config@0.4.10-canary.e577a408c": + version "0.4.10-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.10-canary.e577a408c.tgz#06e9a0c6f194e640e569650e4594ec423aa3061d" + integrity sha512-dJDsovw6kcV9RhHPWNlwjTd3BLGvW6BhwgV7gWJKhmeGuDkKdAPsZcvmZVLZ9TJ50vdeeILiwBKajw5jGHU6rA== + dependencies: + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/installations" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/storage-compat@0.3.2": - version "0.3.2" - resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.2.tgz#51a97170fd652a516f729f82b97af369e5a2f8d7" - integrity sha512-wvsXlLa9DVOMQJckbDNhXKKxRNNewyUhhbXev3t8kSgoCotd1v3MmqhKKz93ePhDnhHnDs7bYHy+Qa8dRY6BXw== +"@firebase/storage-compat@0.3.13-canary.e577a408c": + version "0.3.13-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.13-canary.e577a408c.tgz#f2b38f1816bfb1263269de44f5d5cd498bd20374" + integrity sha512-JYqYbUQfcMR6u7GPvYDBzxcxUPnj63zh8VaQLUYKMCxbFvkpF5J5xnJ+wlY0/rypfWOzW87MVvsnn/uruHfBrw== dependencies: - "@firebase/component" "0.6.4" - "@firebase/storage" "0.11.2" - "@firebase/storage-types" "0.8.0" - "@firebase/util" "1.9.3" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/storage" "0.13.3-canary.e577a408c" + "@firebase/storage-types" "0.8.2-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/storage-types@0.8.0": - version "0.8.0" - resolved "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.0.tgz#f1e40a5361d59240b6e84fac7fbbbb622bfaf707" - integrity sha512-isRHcGrTs9kITJC0AVehHfpraWFui39MPaU7Eo8QfWlqW7YPymBmRgjDrlOgFdURh6Cdeg07zmkLP5tzTKRSpg== +"@firebase/storage-types@0.8.2-canary.e577a408c": + version "0.8.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.2-canary.e577a408c.tgz#ec7ccc1265ef0a820d1c67f29dac78947cce84d0" + integrity sha512-9QMdcKWJBhAo9bCeWLhwQToMt1dYWGSMxU3gvKkR+b5us/IKaq+bAt5fwXXWXJNRKsTkkrWcJd4sCZxF20cz+A== -"@firebase/storage@0.11.2": - version "0.11.2" - resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.11.2.tgz#c5e0316543fe1c4026b8e3910f85ad73f5b77571" - integrity sha512-CtvoFaBI4hGXlXbaCHf8humajkbXhs39Nbh6MbNxtwJiCqxPy9iH3D3CCfXAvP0QvAAwmJUTK3+z9a++Kc4nkA== +"@firebase/storage@0.13.3-canary.e577a408c": + version "0.13.3-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.3-canary.e577a408c.tgz#dd46f4702deef731c1b94b17f05d4ed98d652511" + integrity sha512-ethukzObt6FEAm3+JCE7W3sCryKxU7nE9E0aiXWOabwAQduaCJK4dguzly60PvSJkwTTA68W1O6tYjRwnz8PDg== dependencies: - "@firebase/component" "0.6.4" - "@firebase/util" "1.9.3" - node-fetch "2.6.7" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" tslib "^2.1.0" -"@firebase/util@1.9.3": - version "1.9.3" - resolved "https://registry.npmjs.org/@firebase/util/-/util-1.9.3.tgz#45458dd5cd02d90e55c656e84adf6f3decf4b7ed" - integrity sha512-DY02CRhOZwpzO36fHpuVysz6JZrscPiBXD0fXp6qSrL9oNOx5KWICKdR95C0lSITzxp0TZosVyHqzatE8JbcjA== +"@firebase/util@1.10.1-canary.e577a408c": + version "1.10.1-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/util/-/util-1.10.1-canary.e577a408c.tgz#3d21ab72c9684e3156c949020595f5503e186e85" + integrity sha512-AKonAsktdHqtUDi+lXVdLq674q7WDicxB7evEgE9ffHFh5lsZIDgdyGZeYHb9xJ3aYEzNGiqHUbXyks7BA9YXA== dependencies: tslib "^2.1.0" -"@firebase/webchannel-wrapper@0.10.1": - version "0.10.1" - resolved "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.10.1.tgz#60bb2aaf129f9e00621f8d698722ddba6ee1f8ac" - integrity sha512-Dq5rYfEpdeel0bLVN+nfD1VWmzCkK+pJbSjIawGE+RY4+NIJqhbUDDQjvV0NUK84fMfwxvtFoCtEe70HfZjFcw== - -"@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== +"@firebase/vertexai@1.0.0-canary.e577a408c": + version "1.0.0-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/vertexai/-/vertexai-1.0.0-canary.e577a408c.tgz#fdb49a6489356a59dc3177235eb35810ab296761" + integrity sha512-z5hnHyBBnT0MDticDdV+UN0rbwb1nlVd+9yHedd+KlzzZ7n9fjlwbSlea8cv3Zk78z23lIoMAo90AXEL7QuiFw== dependencies: - "@grpc/proto-loader" "^0.7.0" - "@types/node" ">=12.12.47" + "@firebase/app-check-interop-types" "0.3.2-canary.e577a408c" + "@firebase/component" "0.6.10-canary.e577a408c" + "@firebase/logger" "0.4.3-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" + tslib "^2.1.0" + +"@firebase/webchannel-wrapper@1.0.2-canary.e577a408c": + version "1.0.2-canary.e577a408c" + resolved "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.2-canary.e577a408c.tgz#5b3c9e0e227c81c8a3f57bec5ed915815da27ef2" + integrity sha512-oMcvpf7jYk1oZXmSaiViphM0mZA7GLpH+MDtmmsMODxTQ8PdVMV0y+4g0Jz4hCnVOG4m1DyvtTOCKAB96E8a3g== -"@grpc/proto-loader@^0.6.13": - version "0.6.13" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.13.tgz#008f989b72a40c60c96cd4088522f09b05ac66bc" - integrity sha512-FjxPYDRTn6Ec3V0arm1FtSpmP6V50wuph2yILpyvTKzjc76oDdoihXqM1DzOW5ubvCC8GivfCnNtfaRE8myJ7g== +"@grpc/grpc-js@~1.9.0": + version "1.9.15" + resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz#433d7ac19b1754af690ea650ab72190bd700739b" + integrity sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ== dependencies: - "@types/long" "^4.0.1" - lodash.camelcase "^4.3.0" - long "^4.0.0" - protobufjs "^6.11.3" - yargs "^16.2.0" + "@grpc/proto-loader" "^0.7.8" + "@types/node" ">=12.12.47" -"@grpc/proto-loader@^0.7.0": - version "0.7.5" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.5.tgz#ee9e7488fa585dc6b0f7fe88cd39723a3e64c906" - integrity sha512-mfcTuMbFowq1wh/Rn5KQl6qb95M21Prej3bewD9dUQMurYGVckGO/Pbe2Ocwto6sD05b/mxZLspvqwx60xO2Rg== +"@grpc/proto-loader@^0.7.8": + version "0.7.13" + resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" + integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw== dependencies: - "@types/long" "^4.0.1" lodash.camelcase "^4.3.0" - long "^4.0.0" - protobufjs "^7.0.0" - yargs "^16.2.0" + long "^5.0.0" + protobufjs "^7.2.5" + yargs "^17.7.2" "@istanbuljs/schema@^0.1.2": version "0.1.3" @@ -2200,17 +1456,20 @@ resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.13" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" - integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== +"@jridgewell/source-map@^0.3.3": + version "0.3.6" + resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" + integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" -"@jridgewell/sourcemap-codec@^1.4.14": - version "1.4.15" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" - integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.5.0" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== -"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": +"@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== @@ -2218,15 +1477,35 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jsonjoy.com/base64@^1.1.1": + version "1.1.2" + resolved "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz#cf8ea9dcb849b81c95f14fc0aaa151c6b54d2578" + integrity sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA== + +"@jsonjoy.com/json-pack@^1.0.3": + version "1.1.0" + resolved "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.0.tgz#33ca57ee29d12feef540f2139225597469dec894" + integrity sha512-zlQONA+msXPPwHWZMKFVS78ewFczIll5lXiVPwFPCZUsrOKdxc2AvxU1HoNBmMRhqDZUR9HkC3UOm+6pME6Xsg== + dependencies: + "@jsonjoy.com/base64" "^1.1.1" + "@jsonjoy.com/util" "^1.1.2" + hyperdyperid "^1.2.0" + thingies "^1.20.0" + +"@jsonjoy.com/util@^1.1.2", "@jsonjoy.com/util@^1.3.0": + version "1.5.0" + resolved "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.5.0.tgz#6008e35b9d9d8ee27bc4bfaa70c8cbf33a537b4c" + integrity sha512-ojoNsrIuPI9g6o8UxhraZQSyF2ByJanAY4cTFbc8Mf2AXEF4aQRGY1dJxyJpuyav8r9FGflEt/Ff3u5Nt6YMPA== + "@leichtgewicht/ip-codec@^2.0.1": - version "2.0.4" - resolved "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" - integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== + version "2.0.5" + resolved "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1" + integrity sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" - integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== "@protobufjs/base64@^1.1.2": version "1.1.2" @@ -2241,12 +1520,12 @@ "@protobufjs/eventemitter@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" - integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== "@protobufjs/fetch@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" - integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== dependencies: "@protobufjs/aspromise" "^1.1.1" "@protobufjs/inquire" "^1.1.0" @@ -2254,45 +1533,50 @@ "@protobufjs/float@^1.0.2": version "1.0.2" resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" - integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== "@protobufjs/inquire@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" - integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== "@protobufjs/path@^1.1.2": version "1.1.2" resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" - integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== "@protobufjs/pool@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" - integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== "@protobufjs/utf8@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" - integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== -"@socket.io/base64-arraybuffer@~1.0.2": - version "1.0.2" - resolved "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#568d9beae00b0d835f4f8c53fd55714986492e61" - integrity sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ== +"@rollup/rollup-linux-x64-gnu@4.9.5": + version "4.9.5" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz#85946ee4d068bd12197aeeec2c6f679c94978a49" + integrity sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA== + +"@socket.io/component-emitter@~3.1.0": + version "3.1.2" + resolved "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz#821f8442f4175d8f0467b9daf26e3a18e2d02af2" + integrity sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA== "@types/body-parser@*": - version "1.19.2" - resolved "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" - integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + version "1.19.5" + resolved "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4" + integrity sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg== dependencies: "@types/connect" "*" "@types/node" "*" -"@types/bonjour@^3.5.9": - version "3.5.10" - resolved "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.10.tgz#0f6aadfe00ea414edc86f5d106357cda9701e275" - integrity sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw== +"@types/bonjour@^3.5.13": + version "3.5.13" + resolved "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.13.tgz#adf90ce1a105e81dd1f9c61fdc5afda1bfb92956" + integrity sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ== dependencies: "@types/node" "*" @@ -2301,23 +1585,18 @@ resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.14.tgz#ae3055ea2be43c91c9fd700a36d67820026d96e6" integrity sha512-Wj71sXE4Q4AkGdG9Tvq1u/fquNz9EdG4LIJMwVVII7ashjD/8cf8fyIfJAjRr6YcsXnSE8cOGQPq1gqeR8z+3w== -"@types/component-emitter@^1.2.10": - version "1.2.10" - resolved "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz#ef5b1589b9f16544642e473db5ea5639107ef3ea" - integrity sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg== - -"@types/connect-history-api-fallback@^1.3.5": - version "1.3.5" - resolved "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz#d1f7a8a09d0ed5a57aee5ae9c18ab9b803205dae" - integrity sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw== +"@types/connect-history-api-fallback@^1.5.4": + version "1.5.4" + resolved "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz#7de71645a103056b48ac3ce07b3520b819c1d5b3" + integrity sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw== dependencies: "@types/express-serve-static-core" "*" "@types/node" "*" "@types/connect@*": - version "3.4.35" - resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + version "3.4.38" + resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" + integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug== dependencies: "@types/node" "*" @@ -2327,151 +1606,169 @@ integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== "@types/cors@^2.8.12": - version "2.8.12" - resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" - integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== + version "2.8.17" + resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz#5d718a5e494a8166f569d986794e49c48b216b2b" + integrity sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA== + dependencies: + "@types/node" "*" "@types/eslint-scope@^3.7.3": - version "3.7.3" - resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz#125b88504b61e3c8bc6f870882003253005c3224" - integrity sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g== + version "3.7.7" + resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== dependencies: "@types/eslint" "*" "@types/estree" "*" "@types/eslint@*": - version "7.28.0" - resolved "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz#7e41f2481d301c68e14f483fe10b017753ce8d5a" - integrity sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A== + version "9.6.1" + resolved "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" + integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== dependencies: "@types/estree" "*" "@types/json-schema" "*" "@types/estree@*": - version "0.0.50" - resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" - integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== + version "1.0.6" + resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== "@types/estree@^0.0.51": version "0.0.51" resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== -"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": - version "4.17.27" - resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.27.tgz#7a776191e47295d2a05962ecbb3a4ce97e38b401" - integrity sha512-e/sVallzUTPdyOTiqi8O8pMdBBphscvI6E4JYaKlja4Lm+zh7UFSSdW5VMkRbhDtmrONqOUHOXRguPsDckzxNA== +"@types/express-serve-static-core@*", "@types/express-serve-static-core@^5.0.0": + version "5.0.1" + resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.1.tgz#3c9997ae9d00bc236e45c6374e84f2596458d9db" + integrity sha512-CRICJIl0N5cXDONAdlTv5ShATZ4HEwk6kDDIW2/w9qOWKg+NU/5F8wYRWCrONad0/UKkloNSmmyN/wX4rtpbVA== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + "@types/send" "*" + +"@types/express-serve-static-core@^4.17.33": + version "4.19.6" + resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz#e01324c2a024ff367d92c66f48553ced0ab50267" + integrity sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A== dependencies: "@types/node" "*" "@types/qs" "*" "@types/range-parser" "*" + "@types/send" "*" -"@types/express@*", "@types/express@^4.17.13": - 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@*": + version "5.0.0" + resolved "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz#13a7d1f75295e90d19ed6e74cab3678488eaa96c" + integrity sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ== dependencies: "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.18" + "@types/express-serve-static-core" "^5.0.0" "@types/qs" "*" "@types/serve-static" "*" -"@types/http-proxy@^1.17.8": - version "1.17.9" - resolved "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz#7f0e7931343761efde1e2bf48c40f02f3f75705a" - integrity sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw== +"@types/express@^4.17.21": + version "4.17.21" + resolved "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz#c26d4a151e60efe0084b23dc3369ebc631ed192d" + integrity sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ== dependencies: - "@types/node" "*" - -"@types/json-schema@*", "@types/json-schema@^7.0.7": - version "7.0.8" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818" - integrity sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg== - -"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8": - version "7.0.11" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.33" + "@types/qs" "*" + "@types/serve-static" "*" -"@types/json-schema@^7.0.9": - version "7.0.9" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== +"@types/http-errors@*": + version "2.0.4" + resolved "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f" + integrity sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA== -"@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/http-proxy@^1.17.8": + version "1.17.15" + resolved "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz#12118141ce9775a6499ecb4c01d02f90fc839d36" + integrity sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ== + dependencies: + "@types/node" "*" -"@types/mime@*": - version "3.0.1" - resolved "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" - integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== +"@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": + version "7.0.15" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/mime@^1": - version "1.3.2" - resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" - integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + version "1.3.5" + resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" + integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== "@types/mocha@9.1.1": version "9.1.1" resolved "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== +"@types/node-forge@^1.3.0": + version "1.3.11" + resolved "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz#0972ea538ddb0f4d9c2fa0ec5db5724773a604da" + integrity sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ== + dependencies: + "@types/node" "*" + "@types/node@*", "@types/node@>=10.0.0", "@types/node@>=12.12.47", "@types/node@>=13.7.0": - version "16.3.2" - resolved "https://registry.npmjs.org/@types/node/-/node-16.3.2.tgz#655432817f83b51ac869c2d51dd8305fb8342e16" - integrity sha512-jJs9ErFLP403I+hMLGnqDRWT0RYKSvArxuBVh2veudHV7ifEC1WAmjJADacZ7mRbA2nWgHtn8xyECMAot0SkAw== + version "22.8.0" + resolved "https://registry.npmjs.org/@types/node/-/node-22.8.0.tgz#193c6f82f9356ce0e6bba86b59f2ffe06e7e320b" + integrity sha512-84rafSBHC/z1i1E3p0cJwKA+CfYDNSXX9WSZBRopjIzLET8oNt6ht2tei4C7izwDeEiLLfdeSVBv1egOH916hg== + dependencies: + undici-types "~6.19.8" "@types/qs@*": - version "6.9.7" - resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + version "6.9.16" + resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.16.tgz#52bba125a07c0482d26747d5d4947a64daf8f794" + integrity sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A== "@types/range-parser@*": - version "1.2.4" - resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - -"@types/retry@^0.12.0": - version "0.12.1" - resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz#d8f1c0d0dc23afad6dc16a9e993a0865774b4065" - integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g== + version "1.2.7" + resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" + integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== -"@types/serve-index@^1.9.1": - version "1.9.1" - resolved "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz#1b5e85370a192c01ec6cec4735cf2917337a6278" - integrity sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg== - dependencies: - "@types/express" "*" +"@types/retry@0.12.2": + version "0.12.2" + resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz#ed279a64fa438bb69f2480eda44937912bb7480a" + integrity sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow== -"@types/serve-static@*": - version "1.13.10" - resolved "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" - integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== +"@types/send@*": + version "0.17.4" + resolved "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz#6619cd24e7270793702e4e6a4b958a9010cfc57a" + integrity sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA== dependencies: "@types/mime" "^1" "@types/node" "*" -"@types/serve-static@^1.13.10": - version "1.15.0" - resolved "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz#c7930ff61afb334e121a9da780aac0d9b8f34155" - integrity sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg== +"@types/serve-index@^1.9.4": + version "1.9.4" + resolved "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.4.tgz#e6ae13d5053cb06ed36392110b4f9a49ac4ec898" + integrity sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug== + dependencies: + "@types/express" "*" + +"@types/serve-static@*", "@types/serve-static@^1.15.5": + version "1.15.7" + resolved "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz#22174bbd74fb97fe303109738e9b5c2f3064f714" + integrity sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw== dependencies: - "@types/mime" "*" + "@types/http-errors" "*" "@types/node" "*" + "@types/send" "*" -"@types/sockjs@^0.3.33": - version "0.3.33" - resolved "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz#570d3a0b99ac995360e3136fd6045113b1bd236f" - integrity sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw== +"@types/sockjs@^0.3.36": + version "0.3.36" + resolved "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz#ce322cf07bcc119d4cbf7f88954f3a3bd0f67535" + integrity sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q== dependencies: "@types/node" "*" -"@types/ws@^8.5.1": - version "8.5.3" - resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" - integrity sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w== +"@types/ws@^8.5.10": + version "8.5.12" + resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz#619475fe98f35ccca2a2f6c137702d85ec247b7e" + integrity sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ== dependencies: "@types/node" "*" @@ -2601,22 +1898,20 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.2.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5" - integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== +"@webpack-cli/configtest@^2.1.1": + version "2.1.1" + resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz#3b2f852e91dac6e3b85fb2a314fb8bef46d94646" + integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== -"@webpack-cli/info@^1.5.0": - version "1.5.0" - resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1" - integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== - dependencies: - envinfo "^7.7.3" +"@webpack-cli/info@^2.0.2": + version "2.0.2" + resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz#cc3fbf22efeb88ff62310cf885c5b09f44ae0fdd" + integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== -"@webpack-cli/serve@^1.7.0": - version "1.7.0" - resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" - integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== +"@webpack-cli/serve@^2.0.5": + version "2.0.5" + resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" + integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -2628,15 +1923,7 @@ resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -accepts@~1.3.4, accepts@~1.3.5: - version "1.3.7" - resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -accepts@~1.3.8: +accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: version "1.3.8" resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== @@ -2645,24 +1932,21 @@ accepts@~1.3.8: negotiator "0.6.3" acorn-import-assertions@^1.7.6: - version "1.8.0" - resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" - integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== + version "1.9.0" + resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" + integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== acorn-walk@^8.0.2: - version "8.1.1" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz#3ddab7f84e4a7e2313f6c414c5b7dac85f4e3ebc" - integrity sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w== - -acorn@^8.1.0: - version "8.4.1" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c" - integrity sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA== + version "8.3.4" + resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" -acorn@^8.7.1: - version "8.8.2" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.7.1, acorn@^8.8.2: + version "8.13.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz#2a30d670818ad16ddd6a35d3842dacec9e5d7ca3" + integrity sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w== ajv-formats@^2.1.1: version "2.1.1" @@ -2676,7 +1960,7 @@ ajv-keywords@^3.5.2: resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv-keywords@^5.0.0: +ajv-keywords@^5.1.0: version "5.1.0" resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== @@ -2693,15 +1977,15 @@ ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.8.0: - version "8.8.2" - resolved "https://registry.npmjs.org/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" - integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== +ajv@^8.0.0, ajv@^8.9.0: + version "8.17.1" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== dependencies: - fast-deep-equal "^3.1.1" + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" json-schema-traverse "^1.0.0" require-from-string "^2.0.2" - uri-js "^4.2.2" ansi-colors@4.1.1: version "4.1.1" @@ -2713,18 +1997,11 @@ ansi-html-community@^0.0.8: resolved "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41" integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw== -ansi-regex@^5.0.0: +ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.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" @@ -2733,9 +2010,9 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: color-convert "^2.0.1" anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + version "3.1.3" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" @@ -2748,12 +2025,7 @@ argparse@^2.0.1: array-flatten@1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-flatten@^2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" - integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== asn1.js@^4.10.1: version "4.10.1" @@ -2764,25 +2036,16 @@ asn1.js@^4.10.1: inherits "^2.0.1" minimalistic-assert "^1.0.0" -asn1.js@^5.2.0: - version "5.4.1" - resolved "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" - assert@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz#95fc1c616d48713510680f2eaf2d10dd22e02d32" - integrity sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A== + version "2.1.0" + resolved "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" + integrity sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw== dependencies: - es6-object-assign "^1.1.0" - is-nan "^1.2.1" - object-is "^1.0.1" - util "^0.12.0" + call-bind "^1.0.2" + is-nan "^1.3.2" + object-is "^1.1.5" + object.assign "^4.1.4" + util "^0.12.5" assertion-error@^1.1.0: version "1.1.0" @@ -2790,14 +2053,16 @@ assertion-error@^1.1.0: integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== async@^3.0.1: - version "3.2.5" - resolved "https://registry.npmjs.org/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66" - integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg== + version "3.2.6" + resolved "https://registry.npmjs.org/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" + integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== -available-typed-arrays@^1.0.2: - version "1.0.4" - resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz#9e0ae84ecff20caae6a94a1c3bc39b955649b7a9" - integrity sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA== +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" babel-loader@8.3.0: version "8.3.0" @@ -2807,62 +2072,31 @@ babel-loader@8.3.0: find-cache-dir "^3.3.1" loader-utils "^2.0.0" make-dir "^3.1.0" - schema-utils "^2.6.5" - -babel-plugin-dynamic-import-node@^2.3.3: - version "2.3.3" - resolved "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" - integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== - dependencies: - object.assign "^4.1.0" - -babel-plugin-polyfill-corejs2@^0.2.2: - version "0.2.2" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" - integrity sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ== - dependencies: - "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.2" - semver "^6.1.1" - -babel-plugin-polyfill-corejs2@^0.4.5: - version "0.4.10" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.10.tgz#276f41710b03a64f6467433cab72cbc2653c38b1" - integrity sha512-rpIuu//y5OX6jVU+a5BCn1R5RSZYWAl2Nar76iwaOdycqb6JPxediskWFMMl7stfwNJR4b7eiQvh5fB5TEQJTQ== - dependencies: - "@babel/compat-data" "^7.22.6" - "@babel/helper-define-polyfill-provider" "^0.6.1" - semver "^6.3.1" - -babel-plugin-polyfill-corejs3@^0.2.2: - version "0.2.3" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.3.tgz#72add68cf08a8bf139ba6e6dfc0b1d504098e57b" - integrity sha512-rCOFzEIJpJEAU14XCcV/erIf/wZQMmMT5l5vXOpL5uoznyOGfDIjPj6FVytMvtzaKSTSVKouOCTPJ5OMUZH30g== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" - core-js-compat "^3.14.0" + schema-utils "^2.6.5" -babel-plugin-polyfill-corejs3@^0.8.3: - version "0.8.7" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.7.tgz#941855aa7fdaac06ed24c730a93450d2b2b76d04" - integrity sha512-KyDvZYxAzkC0Aj2dAPyDzi2Ym15e5JKZSK+maI7NAwSqofvuFglbSsxE7wUOvTg9oFVnHMzVzBKcqEb4PJgtOA== +babel-plugin-polyfill-corejs2@^0.4.10: + version "0.4.11" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz#30320dfe3ffe1a336c15afdcdafd6fd615b25e33" + integrity sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q== dependencies: - "@babel/helper-define-polyfill-provider" "^0.4.4" - core-js-compat "^3.33.1" + "@babel/compat-data" "^7.22.6" + "@babel/helper-define-polyfill-provider" "^0.6.2" + semver "^6.3.1" -babel-plugin-polyfill-regenerator@^0.2.2: - version "0.2.2" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz#b310c8d642acada348c1fa3b3e6ce0e851bee077" - integrity sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg== +babel-plugin-polyfill-corejs3@^0.10.4, babel-plugin-polyfill-corejs3@^0.10.6: + version "0.10.6" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" + integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.6.2" + core-js-compat "^3.38.0" -babel-plugin-polyfill-regenerator@^0.5.2: - version "0.5.5" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.5.tgz#8b0c8fc6434239e5d7b8a9d1f832bb2b0310f06a" - integrity sha512-OJGYZlhLqBh2DDHeqAxWB1XIvr49CxiJ2gIt61/PU55CQK4Z58OzMqjDe1zwQdQk+rBYsRc+1rJmdajM3gimHg== +babel-plugin-polyfill-regenerator@^0.6.1: + version "0.6.2" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.2.tgz#addc47e240edd1da1058ebda03021f382bba785e" + integrity sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.5.0" + "@babel/helper-define-polyfill-provider" "^0.6.2" balanced-match@^1.0.0: version "1.0.2" @@ -2882,7 +2116,7 @@ base64id@2.0.0, base64id@~2.0.0: batch@0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" - integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY= + integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== big.js@^5.2.2: version "5.2.2" @@ -2890,68 +2124,45 @@ big.js@^5.2.2: integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + version "2.3.0" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - bn.js@^5.2.1: version "5.2.1" resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.0: - version "1.20.0" - resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" - integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== +body-parser@1.20.3, body-parser@^1.19.0: + version "1.20.3" + resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== dependencies: bytes "3.1.2" - content-type "~1.0.4" + content-type "~1.0.5" debug "2.6.9" depd "2.0.0" destroy "1.2.0" http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.10.3" - raw-body "2.5.1" + qs "6.13.0" + raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" -body-parser@^1.19.0: - version "1.19.0" - resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - -bonjour-service@^1.0.11: - version "1.0.12" - resolved "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.0.12.tgz#28fbd4683f5f2e36feedb833e24ba661cac960c3" - integrity sha512-pMmguXYCu63Ug37DluMKEHdxc+aaIf/ay4YbF8Gxtba+9d3u+rmEWy61VK3Z3hp8Rskok3BunHYnG0dUHAsblw== +bonjour-service@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.2.1.tgz#eb41b3085183df3321da1264719fbada12478d02" + integrity sha512-oSzCS2zV14bh2kji6vNe7vrpJYCHGvcZnlffFQ1MEoX/WOeQ/teD8SYWKR942OI3INjq8OMNJlbPK5LLLUxFDw== dependencies: - array-flatten "^2.1.2" - dns-equal "^1.0.0" fast-deep-equal "^3.1.3" - multicast-dns "^7.2.4" + multicast-dns "^7.2.5" brace-expansion@^1.1.7: version "1.1.11" @@ -2961,17 +2172,17 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== +braces@^3.0.2, braces@^3.0.3, braces@~3.0.2: + version "3.0.3" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - fill-range "^7.0.1" + fill-range "^7.1.1" brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== browser-resolve@^2.0.0: version "2.0.0" @@ -2985,7 +2196,7 @@ browser-stdout@1.3.1: resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: +browserify-aes@^1.0.4, browserify-aes@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== @@ -2997,7 +2208,7 @@ browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: inherits "^2.0.1" safe-buffer "^5.0.1" -browserify-cipher@^1.0.0: +browserify-cipher@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== @@ -3017,14 +2228,15 @@ browserify-des@^1.0.0: safe-buffer "^5.1.2" browserify-rsa@^4.0.0, browserify-rsa@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" - integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== + version "4.1.1" + resolved "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.1.tgz#06e530907fe2949dc21fc3c2e2302e10b1437238" + integrity sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ== dependencies: - bn.js "^5.0.0" - randombytes "^2.0.1" + bn.js "^5.2.1" + randombytes "^2.1.0" + safe-buffer "^5.2.1" -browserify-sign@^4.0.0: +browserify-sign@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz#7afe4c01ec7ee59a89a558a4b75bd85ae62d4208" integrity sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw== @@ -3047,36 +2259,25 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^4.14.5, browserslist@^4.16.6: - version "4.16.6" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" - integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== +browserslist@^4.14.5, browserslist@^4.23.3, browserslist@^4.24.0: + version "4.24.2" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== dependencies: - caniuse-lite "^1.0.30001219" - colorette "^1.2.2" - electron-to-chromium "^1.3.723" - escalade "^3.1.1" - node-releases "^1.1.71" - -browserslist@^4.22.2, browserslist@^4.22.3: - version "4.23.0" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" - integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== - dependencies: - caniuse-lite "^1.0.30001587" - electron-to-chromium "^1.4.668" - node-releases "^2.0.14" - update-browserslist-db "^1.0.13" + caniuse-lite "^1.0.30001669" + electron-to-chromium "^1.5.41" + node-releases "^2.0.18" + update-browserslist-db "^1.1.1" buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + version "1.1.2" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== buffer@^5.4.3: version "5.7.1" @@ -3089,45 +2290,45 @@ buffer@^5.4.3: builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== + +bundle-name@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz#f3b96b34160d6431a19d7688135af7cfb8797889" + integrity sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q== + dependencies: + run-applescript "^7.0.0" bytes@3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + integrity sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw== bytes@3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== +call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" camelcase@^6.0.0: - version "6.2.0" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + version "6.3.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001219: - version "1.0.30001245" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001245.tgz#45b941bbd833cb0fa53861ff2bae746b3c6ca5d4" - integrity sha512-768fM9j1PKXpOCKws6eTo3RHmvTUsG9UrpT4WoREFeZgJBTi4/X9g565azS/rVUGtqb8nt7FjLeF5u4kukERnA== - -caniuse-lite@^1.0.30001587: - version "1.0.30001597" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001597.tgz#8be94a8c1d679de23b22fbd944232aa1321639e6" - integrity sha512-7LjJvmQU6Sj7bL0j5b5WY/3n7utXUJvAe1lxhsHDbLmwX9mdL86Yjtr+5SRCyf8qME4M7pU2hswj0FpyBVCv9w== +caniuse-lite@^1.0.30001669: + version "1.0.30001669" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" + integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== chai@4.4.1: version "4.4.1" @@ -3142,19 +2343,10 @@ chai@4.4.1: pathval "^1.1.1" type-detect "^4.0.8" -chalk@^2.0.0, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chalk@^4.1.0: - version "4.1.1" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" - integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== + 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" @@ -3166,7 +2358,7 @@ check-error@^1.0.3: dependencies: get-func-name "^2.0.2" -chokidar@3.5.3, chokidar@^3.5.3: +chokidar@3.5.3: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -3181,10 +2373,10 @@ chokidar@3.5.3, chokidar@^3.5.3: optionalDependencies: fsevents "~2.3.2" -chokidar@^3.5.1: - version "3.5.2" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== +chokidar@^3.5.1, chokidar@^3.6.0: + version "3.6.0" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -3197,9 +2389,9 @@ chokidar@^3.5.1: fsevents "~2.3.2" chrome-trace-event@^1.0.2: - version "1.0.3" - resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" - integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + version "1.0.4" + resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" + integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" @@ -3218,6 +2410,15 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" @@ -3230,14 +2431,7 @@ clone-deep@^4.0.1: clone@^1.0.2: version "1.0.4" resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== color-convert@^2.0.1: version "2.0.1" @@ -3246,25 +2440,15 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^1.2.2: - version "1.2.2" - resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" - integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== - colorette@^2.0.10, colorette@^2.0.14: - version "2.0.16" - resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" - integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== + version "2.0.20" + resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" + integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== colors@1.4.0: version "1.4.0" @@ -3274,32 +2458,27 @@ colors@1.4.0: combine-source-map@^0.8.0: version "0.8.0" resolved "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" - integrity sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos= + integrity sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg== dependencies: convert-source-map "~1.1.0" inline-source-map "~0.6.0" lodash.memoize "~3.0.3" source-map "~0.5.3" +commander@^10.0.1: + version "10.0.1" + resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== + commander@^2.20.0: version "2.20.3" resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^7.0.0: - version "7.2.0" - resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - commondir@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - -component-emitter@~1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== compressible@~2.0.16: version "2.0.18" @@ -3324,7 +2503,7 @@ compression@^1.7.4: concat-map@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== connect-history-api-fallback@^2.0.0: version "2.0.0" @@ -3349,7 +2528,7 @@ console-browserify@^1.2.0: constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= + integrity sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ== content-disposition@0.5.4: version "0.5.4" @@ -3358,17 +2537,15 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.4, content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" + version "1.9.0" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== convert-source-map@^2.0.0: version "2.0.0" @@ -3378,42 +2555,34 @@ convert-source-map@^2.0.0: convert-source-map@~1.1.0: version "1.1.3" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" - integrity sha1-SCnId+n+SbMWHzvzZziI4gRpmGA= + integrity sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg== cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== - -cookie@~0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== +cookie@0.7.1: + version "0.7.1" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" + integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== -core-js-compat@^3.14.0, core-js-compat@^3.15.0: - version "3.15.2" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.15.2.tgz#47272fbb479880de14b4e6081f71f3492f5bd3cb" - integrity sha512-Wp+BJVvwopjI+A1EFqm2dwUmWYXrvucmtIB2LgXn/Rb+gWPKYxtmb4GKHGKG/KGF1eK9jfjzT38DITbTOCX/SQ== - dependencies: - browserslist "^4.16.6" - semver "7.0.0" +cookie@~0.7.2: + version "0.7.2" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" + integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== -core-js-compat@^3.31.0, core-js-compat@^3.33.1: - version "3.36.0" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.36.0.tgz#087679119bc2fdbdefad0d45d8e5d307d45ba190" - integrity sha512-iV9Pd/PsgjNWBXeq8XRtWVSgz2tKAfhfvBs7qxYty+RlRd+OCksaWmOnc4JKrTc1cToXL1N0s3l/vwlxPtdElw== +core-js-compat@^3.31.0, core-js-compat@^3.38.0, core-js-compat@^3.38.1: + version "3.38.1" + resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz#2bc7a298746ca5a7bcb9c164bcb120f2ebc09a09" + integrity sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw== dependencies: - browserslist "^4.22.3" + browserslist "^4.23.3" core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + version "1.0.3" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== cors@~2.8.5: version "2.8.5" @@ -3423,7 +2592,7 @@ cors@~2.8.5: object-assign "^4" vary "^1" -create-ecdh@^4.0.0: +create-ecdh@^4.0.4: version "4.0.4" resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== @@ -3442,7 +2611,7 @@ create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: ripemd160 "^2.0.1" sha.js "^2.4.0" -create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: +create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== @@ -3464,36 +2633,32 @@ cross-spawn@^7.0.3: which "^2.0.1" crypto-browserify@^3.12.0: - version "3.12.0" - resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + version "3.12.1" + resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.1.tgz#bb8921bec9acc81633379aa8f52d69b0b69e0dac" + integrity sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ== dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" + browserify-cipher "^1.0.1" + browserify-sign "^4.2.3" + create-ecdh "^4.0.4" + create-hash "^1.2.0" + create-hmac "^1.1.7" + diffie-hellman "^5.0.3" + hash-base "~3.0.4" + inherits "^2.0.4" + pbkdf2 "^3.1.2" + public-encrypt "^4.0.3" + randombytes "^2.1.0" + randomfill "^1.0.4" custom-event@~1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= - -date-format@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.3.tgz#f63de5dc08dc02efd8ef32bf2a6918e486f35873" - integrity sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ== + integrity sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg== -date-format@^4.0.4, date-format@^4.0.5: - version "4.0.5" - resolved "https://registry.npmjs.org/date-format/-/date-format-4.0.5.tgz#ba385f89782c6cb114cf45dfa4704c6bb29fca51" - integrity sha512-zBhRiN/M0gDxUoM2xRtzTjJzSg0XEi1ofYpF84PfXeS3hN2PsGxmc7jw3DNQtFlimRbMmob5FC3G0cJq6jQQpw== +date-format@^4.0.14: + version "4.0.14" + resolved "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz#7a8e584434fb169a521c8b7aa481f355810d9400" + integrity sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg== debug@2.6.9: version "2.6.9" @@ -3502,19 +2667,19 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@4.3.3, debug@^4.1.0, debug@^4.1.1, debug@^4.3.3, debug@~4.3.1, debug@~4.3.2: +debug@4.3.3: version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== dependencies: ms "2.1.2" -debug@^4.3.1: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2, debug@~4.3.4: + version "4.3.7" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== dependencies: - ms "2.1.2" + ms "^2.1.3" decamelize@^4.0.0: version "4.0.0" @@ -3522,37 +2687,54 @@ decamelize@^4.0.0: integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== deep-eql@^4.1.3: - version "4.1.3" - resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" - integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + version "4.1.4" + resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz#d0d3912865911bb8fac5afb4e3acfa6a28dc72b7" + integrity sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg== dependencies: type-detect "^4.0.0" -default-gateway@^6.0.3: - version "6.0.3" - resolved "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz#819494c888053bdb743edbf343d6cdf7f2943a71" - integrity sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg== +default-browser-id@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz#a1d98bf960c15082d8a3fa69e83150ccccc3af26" + integrity sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA== + +default-browser@^5.2.1: + version "5.2.1" + resolved "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz#7b7ba61204ff3e425b556869ae6d3e9d9f1712cf" + integrity sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg== dependencies: - execa "^5.0.0" + bundle-name "^4.1.0" + default-browser-id "^5.0.0" defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= + version "1.0.4" + resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== dependencies: clone "^1.0.2" -define-lazy-prop@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" - integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== +define-data-property@^1.0.1, define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" -define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== +define-lazy-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz#dbb19adfb746d7fc6d734a06b72f4a00d021255f" + integrity sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg== + +define-properties@^1.1.3, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== dependencies: - object-keys "^1.0.12" + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" depd@2.0.0: version "2.0.0" @@ -3562,12 +2744,12 @@ depd@2.0.0: depd@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + version "1.1.0" + resolved "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz#1d37f5766f3bbff4ee9638e871a8768c173b81da" + integrity sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg== dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -3585,7 +2767,7 @@ detect-node@^2.0.4: di@^0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= + integrity sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA== diff@5.0.0: version "5.0.0" @@ -3597,7 +2779,7 @@ diff@^4.0.1: resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diffie-hellman@^5.0.0: +diffie-hellman@^5.0.3: version "5.0.3" resolved "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== @@ -3606,22 +2788,17 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" -dns-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" - integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0= - dns-packet@^5.2.2: - version "5.3.1" - resolved "https://registry.npmjs.org/dns-packet/-/dns-packet-5.3.1.tgz#eb94413789daec0f0ebe2fcc230bdc9d7c91b43d" - integrity sha512-spBwIj0TK0Ey3666GwIdWVfUpLyubpU53BTCu8iPn4r4oXd9O14Hjg3EHw3ts2oed77/SeckunUYCyRlSngqHw== + version "5.6.1" + resolved "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz#ae888ad425a9d1478a0674256ab866de1012cf2f" + integrity sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw== dependencies: "@leichtgewicht/ip-codec" "^2.0.1" dom-serialize@^2.2.1: version "2.2.1" resolved "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= + integrity sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ== dependencies: custom-event "~1.0.0" ent "~2.2.0" @@ -3629,42 +2806,24 @@ dom-serialize@^2.2.1: void-elements "^2.0.0" domain-browser@^4.16.0: - version "4.19.0" - resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-4.19.0.tgz#1093e17c0a17dbd521182fe90d49ac1370054af1" - integrity sha512-fRA+BaAWOR/yr/t7T9E9GJztHPeFjj8U35ajyAjCDtAAnTn1Rc1f6W6VGPJrO1tkQv9zWu+JRof7z6oQtiYVFQ== + version "4.23.0" + resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-4.23.0.tgz#427ebb91efcb070f05cffdfb8a4e9a6c25f8c94b" + integrity sha512-ArzcM/II1wCCujdCNyQjXrAFwS4mrLh4C7DZWlaI8mdh7h3BfKdNd3bKXITfl2PT9FtfQqaGvhi1vPRQPimjGA== ee-first@1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -electron-to-chromium@^1.3.723: - version "1.3.775" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.775.tgz#046517d1f2cea753e06fff549995b9dc45e20082" - integrity sha512-EGuiJW4yBPOTj2NtWGZcX93ZE8IGj33HJAx4d3ouE2zOfW2trbWU+t1e0yzLr1qQIw81++txbM3BH52QwSRE6Q== - -electron-to-chromium@^1.4.668: - version "1.4.705" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.705.tgz#ef4f912620bd7c9555a20554ffc568184c0ddceb" - integrity sha512-LKqhpwJCLhYId2VVwEzFXWrqQI5n5zBppz1W9ehhTlfYU8CUUW6kClbN8LHF/v7flMgRdETS772nqywJ+ckVAw== - -elliptic@^6.5.3: - version "6.5.4" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" +electron-to-chromium@^1.5.41: + version "1.5.45" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.45.tgz#fa592ce6a88b44d23acbc7453a2feab98996e6c9" + integrity sha512-vOzZS6uZwhhbkZbcRyiy99Wg+pYFV5hk+5YaECvx0+Z31NR3Tt5zS6dze2OepT6PCTzVzT0dIJItti+uAW5zmw== -elliptic@^6.5.5: - version "6.5.5" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz#c715e09f78b6923977610d4c2346d6ce22e6dded" - integrity sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw== +elliptic@^6.5.3, elliptic@^6.5.5: + version "6.5.7" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" + integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== dependencies: bn.js "^4.11.9" brorand "^1.1.0" @@ -3687,110 +2846,86 @@ emojis-list@^3.0.0: encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== -engine.io-parser@~5.0.3: - version "5.0.3" - resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz#ca1f0d7b11e290b4bfda251803baea765ed89c09" - integrity sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg== - dependencies: - "@socket.io/base64-arraybuffer" "~1.0.2" +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== -engine.io@~6.2.0: - version "6.2.0" - resolved "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz#003bec48f6815926f2b1b17873e576acd54f41d0" - integrity sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg== +engine.io-parser@~5.2.1: + version "5.2.3" + resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz#00dc5b97b1f233a23c9398d0209504cf5f94d92f" + integrity sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q== + +engine.io@~6.6.0: + version "6.6.2" + resolved "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz#32bd845b4db708f8c774a4edef4e5c8a98b3da72" + integrity sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw== dependencies: "@types/cookie" "^0.4.1" "@types/cors" "^2.8.12" "@types/node" ">=10.0.0" accepts "~1.3.4" base64id "2.0.0" - cookie "~0.4.1" + cookie "~0.7.2" cors "~2.8.5" debug "~4.3.1" - engine.io-parser "~5.0.3" - ws "~8.2.3" + engine.io-parser "~5.2.1" + ws "~8.17.1" enhanced-resolve@^5.10.0: - version "5.12.0" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" - integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== + version "5.17.1" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" + integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" ent@~2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= + version "2.2.1" + resolved "https://registry.npmjs.org/ent/-/ent-2.2.1.tgz#68dc99a002f115792c26239baedaaea9e70c0ca2" + integrity sha512-QHuXVeZx9d+tIQAz/XztU0ZwZf2Agg9CcXcgE1rurqvdBeDBrpSwjl8/6XUqMg7tw2Y7uAdKb2sRv+bSEFqQ5A== + dependencies: + punycode "^1.4.1" envinfo@^7.7.3: - version "7.8.1" - resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + version "7.14.0" + resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz#26dac5db54418f2a4c1159153a0b2ae980838aae" + integrity sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg== -es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: - version "1.18.3" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0" - integrity sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw== +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.2" - is-callable "^1.2.3" - is-negative-zero "^2.0.1" - is-regex "^1.1.3" - is-string "^1.0.6" - object-inspect "^1.10.3" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" + get-intrinsic "^1.2.4" + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-module-lexer@^0.9.0: version "0.9.3" resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -es6-object-assign@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c" - integrity sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw= - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.1.1, escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-html@~1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== escape-string-regexp@4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -3812,9 +2947,9 @@ estraverse@^4.1.1: integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + 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" @@ -3824,7 +2959,7 @@ esutils@^2.0.2: etag@~1.8.1: version "1.8.1" resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== eventemitter3@^4.0.0: version "4.0.7" @@ -3844,52 +2979,37 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -express@^4.17.3: - version "4.18.1" - resolved "https://registry.npmjs.org/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" - integrity sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q== +express@^4.19.2: + version "4.21.1" + resolved "https://registry.npmjs.org/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281" + integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.0" + body-parser "1.20.3" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.7.1" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.2.0" + finalhandler "1.3.1" fresh "0.5.2" http-errors "2.0.0" - merge-descriptors "1.0.1" + merge-descriptors "1.0.3" methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "0.1.10" proxy-addr "~2.0.7" - qs "6.10.3" + qs "6.13.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" + send "0.19.0" + serve-static "1.16.2" setprototypeof "1.2.0" statuses "2.0.1" type-is "~1.6.18" @@ -3911,10 +3031,15 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-uri@^3.0.1: + version "3.0.3" + resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" + integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== + fastest-levenshtein@^1.0.12: - version "1.0.12" - resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" - integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== + version "1.0.16" + resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" + integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== faye-websocket@0.11.4, faye-websocket@^0.11.3: version "0.11.4" @@ -3923,10 +3048,10 @@ faye-websocket@0.11.4, faye-websocket@^0.11.3: dependencies: websocket-driver ">=0.5.1" -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" @@ -3943,13 +3068,13 @@ finalhandler@1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== +finalhandler@1.3.1: + version "1.3.1" + resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" + integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== dependencies: debug "2.6.9" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" on-finished "2.4.1" parseurl "~1.3.3" @@ -3981,62 +3106,61 @@ find-up@^4.0.0: locate-path "^5.0.0" path-exists "^4.0.0" -firebase@9.23.0: - version "9.23.0" - resolved "https://registry.npmjs.org/firebase/-/firebase-9.23.0.tgz#71fea60d704bfed8e92162911544fd6564a04d0e" - integrity sha512-/4lUVY0lUvBDIaeY1q6dUYhS8Sd18Qb9CgWkPZICUo9IXpJNCEagfNZXBBFCkMTTN5L5gx2Hjr27y21a9NzUcA== - dependencies: - "@firebase/analytics" "0.10.0" - "@firebase/analytics-compat" "0.2.6" - "@firebase/app" "0.9.13" - "@firebase/app-check" "0.8.0" - "@firebase/app-check-compat" "0.3.7" - "@firebase/app-compat" "0.2.13" - "@firebase/app-types" "0.9.0" - "@firebase/auth" "0.23.2" - "@firebase/auth-compat" "0.4.2" - "@firebase/database" "0.14.4" - "@firebase/database-compat" "0.3.4" - "@firebase/firestore" "3.13.0" - "@firebase/firestore-compat" "0.3.12" - "@firebase/functions" "0.10.0" - "@firebase/functions-compat" "0.3.5" - "@firebase/installations" "0.6.4" - "@firebase/installations-compat" "0.2.4" - "@firebase/messaging" "0.12.4" - "@firebase/messaging-compat" "0.2.4" - "@firebase/performance" "0.6.4" - "@firebase/performance-compat" "0.2.4" - "@firebase/remote-config" "0.4.4" - "@firebase/remote-config-compat" "0.2.4" - "@firebase/storage" "0.11.2" - "@firebase/storage-compat" "0.3.2" - "@firebase/util" "1.9.3" +firebase@11.0.1-canary.e577a408c: + version "11.0.1-canary.e577a408c" + resolved "https://registry.npmjs.org/firebase/-/firebase-11.0.1-canary.e577a408c.tgz#8ff1226de8f2e986a8c1506c345b8ab25377d7ae" + integrity sha512-/PqcZ4owoH/ahTbliiNPmuNT4LYcH6YlbCR3kvzm4RK/hbFD572wzFxhpukKSzvjhhng+xXG+CuMBOU1rtyIPQ== + dependencies: + "@firebase/analytics" "0.10.9-canary.e577a408c" + "@firebase/analytics-compat" "0.2.15-canary.e577a408c" + "@firebase/app" "0.10.15-canary.e577a408c" + "@firebase/app-check" "0.8.9-canary.e577a408c" + "@firebase/app-check-compat" "0.3.16-canary.e577a408c" + "@firebase/app-compat" "0.2.45-canary.e577a408c" + "@firebase/app-types" "0.9.2-canary.e577a408c" + "@firebase/auth" "1.8.0-canary.e577a408c" + "@firebase/auth-compat" "0.5.15-canary.e577a408c" + "@firebase/data-connect" "0.1.1-canary.e577a408c" + "@firebase/database" "1.0.9-canary.e577a408c" + "@firebase/database-compat" "2.0.0-canary.e577a408c" + "@firebase/firestore" "4.7.4-canary.e577a408c" + "@firebase/firestore-compat" "0.3.39-canary.e577a408c" + "@firebase/functions" "0.11.9-canary.e577a408c" + "@firebase/functions-compat" "0.3.15-canary.e577a408c" + "@firebase/installations" "0.6.10-canary.e577a408c" + "@firebase/installations-compat" "0.2.10-canary.e577a408c" + "@firebase/messaging" "0.12.13-canary.e577a408c" + "@firebase/messaging-compat" "0.2.13-canary.e577a408c" + "@firebase/performance" "0.6.10-canary.e577a408c" + "@firebase/performance-compat" "0.2.10-canary.e577a408c" + "@firebase/remote-config" "0.4.10-canary.e577a408c" + "@firebase/remote-config-compat" "0.2.10-canary.e577a408c" + "@firebase/storage" "0.13.3-canary.e577a408c" + "@firebase/storage-compat" "0.3.13-canary.e577a408c" + "@firebase/util" "1.10.1-canary.e577a408c" + "@firebase/vertexai" "1.0.0-canary.e577a408c" flat@^5.0.2: version "5.0.2" resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -flatted@^3.2.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" - integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== - -flatted@^3.2.5: - version "3.2.5" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" - integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== +flatted@^3.2.7: + version "3.3.1" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" + integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== follow-redirects@^1.0.0: - version "1.15.6" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + version "1.15.9" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" forwarded@0.2.0: version "0.2.0" @@ -4046,45 +3170,31 @@ forwarded@0.2.0: fresh@0.5.2: version "0.5.2" resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== -fs-extra@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== dependencies: graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs-extra@^10.0.1: - version "10.0.1" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz#27de43b4320e833f6867cc044bfce29fdf0ef3b8" - integrity sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs-monkey@^1.0.4: - version "1.0.5" - resolved "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz#fe450175f0db0d7ea758102e1d84096acb925788" - integrity sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew== + jsonfile "^4.0.0" + universalify "^0.1.0" fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + version "2.3.3" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== gensync@^1.0.0-beta.2: version "1.0.0-beta.2" @@ -4101,19 +3211,16 @@ get-func-name@^2.0.1, get-func-name@^2.0.2: resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== +get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" glob-parent@~5.1.2: version "5.1.2" @@ -4140,14 +3247,14 @@ glob@7.2.0: path-is-absolute "^1.0.0" glob@^7.1.3, glob@^7.1.6, glob@^7.1.7: - version "7.1.7" - resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + 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.0.4" + minimatch "^3.1.1" once "^1.3.0" path-is-absolute "^1.0.0" @@ -4156,20 +3263,17 @@ globals@^11.1.0: resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6: - version "4.2.6" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== - -graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" -graceful-fs@^4.2.9: - version "4.2.10" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: + version "4.2.11" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== growl@1.10.5: version "1.10.5" @@ -4181,32 +3285,34 @@ handle-thing@^2.0.0: resolved "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg== -has-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - 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== -has-symbols@^1.0.1, has-symbols@^1.0.2: +has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== -has@^1.0.3: +has-symbols@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== dependencies: - function-bind "^1.1.1" + has-symbols "^1.0.3" hash-base@^3.0.0: version "3.1.0" @@ -4217,7 +3323,7 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash-base@~3.0: +hash-base@~3.0, hash-base@~3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" integrity sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow== @@ -4233,6 +3339,13 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hasown@^2.0.0, hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + he@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -4241,7 +3354,7 @@ he@1.2.0: hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" @@ -4250,17 +3363,17 @@ hmac-drbg@^1.0.1: hpack.js@^2.1.6: version "2.1.6" resolved "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" - integrity sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI= + integrity sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ== dependencies: inherits "^2.0.1" obuf "^1.0.0" readable-stream "^2.0.1" wbuf "^1.1.0" -html-entities@^2.3.2: - version "2.3.2" - resolved "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz#760b404685cb1d794e4f4b744332e3b00dcfe488" - integrity sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ== +html-entities@^2.4.0: + version "2.5.2" + resolved "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f" + integrity sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA== html-escaper@^2.0.0: version "2.0.2" @@ -4270,18 +3383,7 @@ html-escaper@^2.0.0: http-deceiver@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" - integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= - -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" + integrity sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw== http-errors@2.0.0: version "2.0.0" @@ -4297,7 +3399,7 @@ http-errors@2.0.0: http-errors@~1.6.2: version "1.6.3" resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= + integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== dependencies: depd "~1.1.2" inherits "2.0.3" @@ -4305,14 +3407,14 @@ http-errors@~1.6.2: statuses ">= 1.4.0 < 2" http-parser-js@>=0.5.1: - version "0.5.3" - resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9" - integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== + version "0.5.8" + resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" + integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== http-proxy-middleware@^2.0.3: - version "2.0.6" - resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" - integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== + version "2.0.7" + resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" + integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== dependencies: "@types/http-proxy" "^1.17.8" http-proxy "^1.18.1" @@ -4332,12 +3434,12 @@ http-proxy@^1.18.1: https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +hyperdyperid@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b" + integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A== iconv-lite@0.4.24: version "0.4.24" @@ -4346,11 +3448,6 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -idb@7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/idb/-/idb-7.0.1.tgz#d2875b3a2f205d854ee307f6d196f246fea590a7" - integrity sha512-UUxlE7vGWK5RfB/fDwEGgRf84DY/ieqNha6msMV99UsEMQhJ1RwbCd8AYBj3QMgnE3VZnfQvm4oKVCJTYlqIgg== - idb@7.1.1: version "7.1.1" resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b" @@ -4362,9 +3459,9 @@ ieee754@^1.1.13: integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== import-local@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" - integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== + version "3.2.0" + resolved "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" + integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -4372,7 +3469,7 @@ import-local@^3.0.2: inflight@^1.0.4: version "1.0.6" resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" wrappy "1" @@ -4385,41 +3482,37 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i inherits@2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== inline-source-map@~0.6.0: - version "0.6.2" - resolved "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" - integrity sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU= + version "0.6.3" + resolved "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.3.tgz#db9d553037fa74bf95dfbff186375fcf5c563cdd" + integrity sha512-1aVsPEsJWMJq/pdMU61CDlm1URcW702MTB4w9/zUjMus6H/Py8o7g68Pr9D4I6QluWGt/KdmswuRhaA05xVR1w== dependencies: source-map "~0.5.3" -interpret@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" - integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== +interpret@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" + integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== -ipaddr.js@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz#eca256a7a877e917aeb368b0a7497ddf42ef81c0" - integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng== +ipaddr.js@^2.1.0: + version "2.2.0" + resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz#d33fa7bac284f4de7af949638c9d68157c6b92e8" + integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA== is-arguments@^1.0.4: - version "1.1.0" - resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" - integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== + version "1.1.1" + resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== dependencies: - call-bind "^1.0.0" - -is-bigint@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" - integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== + call-bind "^1.0.2" + has-tostringtag "^1.0.0" is-binary-path@~2.1.0: version "2.1.0" @@ -4428,39 +3521,27 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-boolean-object@^1.1.0: - version "1.1.1" - resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" - integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng== - dependencies: - call-bind "^1.0.2" - -is-callable@^1.1.4, is-callable@^1.2.3: - version "1.2.3" - resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" - integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== +is-callable@^1.1.3: + version "1.2.7" + resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.2.0: - version "2.5.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz#f754843617c70bfd29b7bd87327400cda5c18491" - integrity sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg== +is-core-module@^2.13.0: + version "2.15.1" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" + integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== dependencies: - has "^1.0.3" - -is-date-object@^1.0.1: - version "1.0.4" - resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" - integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== + hasown "^2.0.2" -is-docker@^2.0.0, is-docker@^2.1.1: - version "2.2.1" - resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== +is-docker@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz#90093aa3106277d8a77a5910dbae71747e15a200" + integrity sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ== is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -4468,18 +3549,27 @@ is-fullwidth-code-point@^3.0.0: integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-generator-function@^1.0.7: - version "1.0.9" - resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz#e5f82c2323673e7fcad3d12858c83c4039f6399c" - integrity sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A== + version "1.0.10" + resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" + integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== + dependencies: + has-tostringtag "^1.0.0" is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + version "4.0.3" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" -is-nan@^1.2.1: +is-inside-container@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz#e81fba699662eb31dbdaf26766a61d4814717ea4" + integrity sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA== + dependencies: + is-docker "^3.0.0" + +is-nan@^1.3.2: version "1.3.2" resolved "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== @@ -4487,15 +3577,10 @@ is-nan@^1.2.1: call-bind "^1.0.0" define-properties "^1.1.3" -is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== - -is-number-object@^1.0.4: - version "1.0.5" - resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb" - integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw== +is-network-error@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz#d26a760e3770226d11c169052f266a4803d9c997" + integrity sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g== is-number@^7.0.0: version "7.0.0" @@ -4519,78 +3604,49 @@ is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-regex@^1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" - integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== - dependencies: - call-bind "^1.0.2" - has-symbols "^1.0.2" - -is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== - -is-string@^1.0.5, is-string@^1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" - integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - is-typed-array@^1.1.3: - version "1.1.5" - resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz#f32e6e096455e329eb7b423862456aa213f0eb4e" - integrity sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug== + version "1.1.13" + resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" + integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== dependencies: - available-typed-arrays "^1.0.2" - call-bind "^1.0.2" - es-abstract "^1.18.0-next.2" - foreach "^2.0.5" - has-symbols "^1.0.1" + which-typed-array "^1.1.14" is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -is-wsl@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== +is-wsl@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz#e1c657e39c10090afcbedec61720f6b924c3cbd2" + integrity sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw== dependencies: - is-docker "^2.0.0" + is-inside-container "^1.0.0" isarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isbinaryfile@^4.0.8: - version "4.0.8" - resolved "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.8.tgz#5d34b94865bd4946633ecc78a026fc76c5b11fcf" - integrity sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w== + version "4.0.10" + resolved "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" + integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw== isexe@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== isobject@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== istanbul-lib-coverage@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" - integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== + version "3.2.2" + resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== istanbul-lib-instrument@^4.0.0: version "4.0.3" @@ -4603,35 +3659,35 @@ istanbul-lib-instrument@^4.0.0: semver "^6.3.0" istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + version "3.0.1" + resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" + make-dir "^4.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" - integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== + version "4.0.1" + resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== dependencies: debug "^4.1.1" istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" istanbul-reports@^3.0.0: - version "3.0.2" - resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" - integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== + version "3.1.7" + resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" + integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-worker@^27.0.2: - version "27.0.6" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed" - integrity sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA== +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== dependencies: "@types/node" "*" merge-stream "^2.0.0" @@ -4649,15 +3705,10 @@ js-yaml@4.1.0: dependencies: argparse "^2.0.1" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= +jsesc@^3.0.2, jsesc@~3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== json-parse-even-better-errors@^2.3.1: version "2.3.1" @@ -4677,26 +3728,17 @@ json-schema-traverse@^1.0.0: json-stringify-safe@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json5@^2.1.2: - version "2.2.0" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@^2.2.3: +json5@^2.1.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== optionalDependencies: graceful-fs "^4.1.6" @@ -4817,15 +3859,23 @@ kind-of@^6.0.2: resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +launch-editor@^2.6.1: + version "2.9.1" + resolved "https://registry.npmjs.org/launch-editor/-/launch-editor-2.9.1.tgz#253f173bd441e342d4344b4dae58291abb425047" + integrity sha512-Gcnl4Bd+hRO9P9icCP/RVVT2o8SFlPXofuCxvA2SaZuH45whSvf5p8x5oih5ftLiVhEI4sp5xDY+R+b3zJBh5w== + dependencies: + picocolors "^1.0.0" + shell-quote "^1.8.1" + loader-runner@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" - integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== + version "4.3.0" + resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" + integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129" - integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== + version "2.0.4" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" + integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" @@ -4848,17 +3898,17 @@ locate-path@^6.0.0: lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" - integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== lodash.memoize@~3.0.3: version "3.0.4" resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" - integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= + integrity sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A== lodash@^4.17.19, lodash@^4.17.21: version "4.17.21" @@ -4873,37 +3923,21 @@ log-symbols@4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -log4js@^6.3.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.0.tgz#3f63ccfc8033c83cd617a4d2d50e48be5944eae9" - integrity sha512-ysc/XUecZJuN8NoKOssk3V0cQ29xY4fra6fnigZa5VwxFsCsvdqsdnEuAxNN89LlHpbE4KUD3zGcn+kFqonSVQ== - dependencies: - date-format "^4.0.3" - debug "^4.3.3" - flatted "^3.2.4" - rfdc "^1.3.0" - streamroller "^3.0.2" - -log4js@^6.4.1: - version "6.4.2" - resolved "https://registry.npmjs.org/log4js/-/log4js-6.4.2.tgz#45ec783835acc525b397f52cf086e26994fe3b70" - integrity sha512-k80cggS2sZQLBwllpT1p06GtfvzMmSdUCkW96f0Hj83rKGJDAu2vZjt9B9ag2vx8Zz1IXzxoLgqvRJCdMKybGg== +log4js@^6.3.0, log4js@^6.4.1: + version "6.9.1" + resolved "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz#aba5a3ff4e7872ae34f8b4c533706753709e38b6" + integrity sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g== dependencies: - date-format "^4.0.4" - debug "^4.3.3" - flatted "^3.2.5" + date-format "^4.0.14" + debug "^4.3.4" + flatted "^3.2.7" rfdc "^1.3.0" - streamroller "^3.0.4" - -long@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + streamroller "^3.1.5" 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== + version "5.2.3" + resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== loupe@^2.3.6: version "2.3.7" @@ -4920,19 +3954,26 @@ lru-cache@^5.1.1: yallist "^3.0.2" magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== + version "0.25.9" + resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" + integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== dependencies: - sourcemap-codec "^1.4.4" + sourcemap-codec "^1.4.8" -make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: +make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: semver "^6.0.0" +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -4945,19 +3986,22 @@ md5.js@^1.3.4: media-typer@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== -memfs@^3.4.3: - version "3.6.0" - resolved "https://registry.npmjs.org/memfs/-/memfs-3.6.0.tgz#d7a2110f86f79dd950a8b6df6d57bc984aa185f6" - integrity sha512-EGowvkkgbMcIChjMTMkESFDbZeSh8xZ7kNSF0hAiAN4Jh6jgHCRS0Ga/+C8y6Au+oqpezRHCfPsmJ2+DwAgiwQ== +memfs@^4.6.0: + version "4.14.0" + resolved "https://registry.npmjs.org/memfs/-/memfs-4.14.0.tgz#48d5e85a03ea0b428280003212fbca3063531be3" + integrity sha512-JUeY0F/fQZgIod31Ja1eJgiSxLn7BfQlCnqhwXFBzFHEw63OdLK7VJUJ7bnzNsWgCyoUP5tEp1VRY8rDaYzqOA== dependencies: - fs-monkey "^1.0.4" + "@jsonjoy.com/json-pack" "^1.0.3" + "@jsonjoy.com/util" "^1.3.0" + tree-dump "^1.0.1" + tslib "^2.0.0" -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= +merge-descriptors@1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== merge-stream@^2.0.0: version "2.0.0" @@ -4967,15 +4011,15 @@ merge-stream@^2.0.0: methods@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== micromatch@^4.0.2: - version "4.0.4" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + version "4.0.8" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: - braces "^3.0.1" - picomatch "^2.2.3" + braces "^3.0.3" + picomatch "^2.3.1" miller-rabin@^4.0.0: version "4.0.1" @@ -4985,36 +4029,17 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.48.0, "mime-db@>= 1.43.0 < 2": - version "1.48.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" - integrity sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== - -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - mime-db@1.52.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.27, mime-types@~2.1.17, mime-types@~2.1.24: - version "2.1.31" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b" - integrity sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== - dependencies: - mime-db "1.48.0" - -mime-types@^2.1.31: - version "2.1.34" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== - dependencies: - mime-db "1.51.0" +"mime-db@>= 1.43.0 < 2": + version "1.53.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz#3cb63cd820fc29896d9d4e8c32ab4fcd74ccb447" + integrity sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg== -mime-types@~2.1.34: +mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -5027,14 +4052,9 @@ mime@1.6.0: integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== mime@^2.5.2: - version "2.5.2" - resolved "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" - integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + version "2.6.0" + resolved "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" @@ -5044,7 +4064,7 @@ minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== minimatch@4.2.1: version "4.2.1" @@ -5053,24 +4073,24 @@ minimatch@4.2.1: dependencies: brace-expansion "^1.1.7" -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== +minimatch@^3.0.4, 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" -minimist@^1.2.3, minimist@^1.2.5: +minimist@^1.2.3, minimist@^1.2.6: version "1.2.8" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== mkdirp@^0.5.5: - version "0.5.5" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + 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.5" + minimist "^1.2.6" mocha@9.2.2: version "9.2.2" @@ -5105,22 +4125,22 @@ mocha@9.2.2: ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== ms@2.1.2: version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3: +ms@2.1.3, ms@^2.1.3: version "2.1.3" resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -multicast-dns@^7.2.4: - version "7.2.4" - resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.4.tgz#cf0b115c31e922aeb20b64e6556cbeb34cf0dd19" - integrity sha512-XkCYOU+rr2Ft3LI6w4ye51M3VK31qJXFIxu0XLw169PtKG0Zx47OrXeVW/GCYOfpC9s1yyyf1S+L8/4LY0J9Zw== +multicast-dns@^7.2.5: + version "7.2.5" + resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz#77eb46057f4d7adbd16d9290fa7299f6fa64cced" + integrity sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg== dependencies: dns-packet "^5.2.2" thunky "^1.0.2" @@ -5130,11 +4150,6 @@ nanoid@3.3.1: resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - negotiator@0.6.3: version "0.6.3" resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" @@ -5145,76 +4160,52 @@ neo-async@^2.6.2: resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -node-fetch@2.6.7: - version "2.6.7" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - node-forge@^1: version "1.3.1" resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== -node-releases@^1.1.71: - version "1.1.73" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20" - integrity sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg== - -node-releases@^2.0.14: - version "2.0.14" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" - integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== +node-releases@^2.0.18: + version "2.0.18" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" + integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - object-assign@^4: version "4.1.1" resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-inspect@^1.10.3: - version "1.11.0" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.9.0: - version "1.12.0" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" - integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== +object-inspect@^1.13.1: + version "1.13.2" + resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" + integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== -object-is@^1.0.1: - version "1.1.5" - resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== +object-is@^1.1.5: + version "1.1.6" + resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" + integrity sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" + call-bind "^1.0.7" + define-properties "^1.2.1" -object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object.assign@^4.1.0, object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== +object.assign@^4.1.4: + version "4.1.5" + resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" + call-bind "^1.0.5" + define-properties "^1.2.1" + has-symbols "^1.0.3" object-keys "^1.1.1" obuf@^1.0.0, obuf@^1.1.2: @@ -5222,7 +4213,7 @@ obuf@^1.0.0, obuf@^1.1.2: resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== -on-finished@2.4.1: +on-finished@2.4.1, on-finished@^2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== @@ -5232,7 +4223,7 @@ on-finished@2.4.1: on-finished@~2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + integrity sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww== dependencies: ee-first "1.1.1" @@ -5244,30 +4235,24 @@ on-headers@~1.0.2: once@^1.3.0: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -open@^8.0.9: - version "8.4.0" - resolved "https://registry.npmjs.org/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" - integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q== +open@^10.0.3: + version "10.1.0" + resolved "https://registry.npmjs.org/open/-/open-10.1.0.tgz#a7795e6e5d519abe4286d9937bb24b51122598e1" + integrity sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw== dependencies: - define-lazy-prop "^2.0.0" - is-docker "^2.1.1" - is-wsl "^2.2.0" + default-browser "^5.2.1" + define-lazy-prop "^3.0.0" + is-inside-container "^1.0.0" + is-wsl "^3.1.0" os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== p-limit@^2.2.0: version "2.3.0" @@ -5276,7 +4261,7 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.0.2, p-limit@^3.1.0: +p-limit@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -5297,12 +4282,13 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" -p-retry@^4.5.0: - version "4.6.1" - resolved "https://registry.npmjs.org/p-retry/-/p-retry-4.6.1.tgz#8fcddd5cdf7a67a0911a9cf2ef0e5df7f602316c" - integrity sha512-e2xXGNhZOZ0lfgR9kL34iGlU8N/KO0xZnQxVEwdeOvpqNDQfdnxIYizvWtK8RglUa3bGqI8g0R/BdfzLMxRkiA== +p-retry@^6.2.0: + version "6.2.0" + resolved "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz#8d6df01af298750009691ce2f9b3ad2d5968f3bd" + integrity sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA== dependencies: - "@types/retry" "^0.12.0" + "@types/retry" "0.12.2" + is-network-error "^1.0.0" retry "^0.13.1" p-try@^2.0.0: @@ -5311,29 +4297,20 @@ p-try@^2.0.0: integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== pad@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz#be7a1d1cb6757049b4ad5b70e71977158fea95d1" - integrity sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg== + version "3.3.0" + resolved "https://registry.npmjs.org/pad/-/pad-3.3.0.tgz#364c264ba0b1600468d85db1b8ddb9b522522d70" + integrity sha512-2/G2Q8J/lbkJ3Zf595U9jattrUkM1rwTr3s4n9smp3+ALe66V+t3I75SG0qjWzuQgmXOgiUS0/qE97S+0hP7Cw== dependencies: wcwidth "^1.0.1" + optionalDependencies: + "@rollup/rollup-linux-x64-gnu" "4.9.5" pako@~1.0.5: version "1.0.11" resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== -parse-asn1@^5.0.0: - version "5.1.6" - resolved "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== - dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - -parse-asn1@^5.1.7: +parse-asn1@^5.0.0, parse-asn1@^5.1.7: version "5.1.7" resolved "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz#73cdaaa822125f9647165625eb45f8a051d2df06" integrity sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg== @@ -5363,29 +4340,29 @@ path-exists@^4.0.0: 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 sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^3.0.0, path-key@^3.1.0: +path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: +path-parse@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -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= +path-to-regexp@0.1.10: + version "0.1.10" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" + integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== pathval@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== -pbkdf2@^3.0.3, pbkdf2@^3.1.2: +pbkdf2@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== @@ -5396,17 +4373,12 @@ pbkdf2@^3.0.3, pbkdf2@^3.1.2: safe-buffer "^5.0.1" sha.js "^2.4.8" -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.0" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +picocolors@^1.0.0, picocolors@^1.1.0: + version "1.1.1" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== -picomatch@^2.2.3: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -5418,6 +4390,11 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +possible-typed-array-names@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" + integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -5426,31 +4403,12 @@ process-nextick-args@~2.0.0: process@^0.11.10: version "0.11.10" resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - -protobufjs@^6.11.3: - version "6.11.4" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" - integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@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" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== -protobufjs@^7.0.0: - version "7.2.6" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz#4a0ccd79eb292717aacf07530a07e0ed20278215" - integrity sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw== +protobufjs@^7.2.5: + version "7.4.0" + resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" + integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -5473,7 +4431,7 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" -public-encrypt@^4.0.0: +public-encrypt@^4.0.3: version "4.0.3" resolved "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== @@ -5485,42 +4443,32 @@ public-encrypt@^4.0.0: randombytes "^2.0.1" safe-buffer "^5.1.2" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + version "2.3.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== qjobs@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== -qs@6.10.3: - version "6.10.3" - resolved "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" - integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== +qs@6.13.0, qs@^6.12.3: + version "6.13.0" + resolved "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== dependencies: - side-channel "^1.0.4" - -qs@6.7.0: - version "6.7.0" - resolved "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + side-channel "^1.0.6" querystring-es3@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" @@ -5529,7 +4477,7 @@ randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" -randomfill@^1.0.3: +randomfill@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== @@ -5542,40 +4490,17 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" http-errors "2.0.0" iconv-lite "0.4.24" unpipe "1.0.0" -readable-stream@^2.0.1: - version "2.3.7" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^2.3.8: +readable-stream@^2.0.1, readable-stream@^2.3.8: version "2.3.8" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== @@ -5589,9 +4514,9 @@ readable-stream@^2.3.8: util-deprecate "~1.0.1" readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.5.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + version "3.6.2" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" @@ -5604,43 +4529,29 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -rechoir@^0.7.0: - version "0.7.0" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca" - integrity sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q== +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== dependencies: - resolve "^1.9.0" + resolve "^1.20.0" -regenerate-unicode-properties@^10.1.0: - version "10.1.0" - resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" - integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== +regenerate-unicode-properties@^10.2.0: + version "10.2.0" + resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz#626e39df8c372338ea9b8028d1f99dc3fd9c3db0" + integrity sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA== dependencies: regenerate "^1.4.2" -regenerate-unicode-properties@^8.2.0: - version "8.2.0" - resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" - integrity sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA== - dependencies: - regenerate "^1.4.0" - -regenerate@^1.4.0, regenerate@^1.4.2: +regenerate@^1.4.2: version "1.4.2" resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.4: - version "0.13.7" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" - integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== - -regenerator-transform@^0.14.2: - version "0.14.5" - resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4" - integrity sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw== - dependencies: - "@babel/runtime" "^7.8.4" +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== regenerator-transform@^0.15.2: version "0.15.2" @@ -5649,70 +4560,34 @@ regenerator-transform@^0.15.2: dependencies: "@babel/runtime" "^7.8.4" -regexpu-core@^4.7.1: - version "4.7.1" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz#2dea5a9a07233298fbf0db91fa9abc4c6e0f8ad6" - integrity sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ== - dependencies: - regenerate "^1.4.0" - regenerate-unicode-properties "^8.2.0" - regjsgen "^0.5.1" - regjsparser "^0.6.4" - unicode-match-property-ecmascript "^1.0.4" - unicode-match-property-value-ecmascript "^1.2.0" - -regexpu-core@^5.2.1: - version "5.2.2" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" - integrity sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw== - dependencies: - regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsgen "^0.7.1" - regjsparser "^0.9.1" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.1.0" - -regexpu-core@^5.3.1: - version "5.3.2" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" - integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== +regexpu-core@^6.1.1: + version "6.1.1" + resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.1.1.tgz#b469b245594cb2d088ceebc6369dceb8c00becac" + integrity sha512-k67Nb9jvwJcJmVpw0jPttR1/zVfnKf8Km0IPatrU/zJ5XeG3+Slx0xLXs9HByJSzXzrlz5EDvN6yLNMDc2qdnw== dependencies: - "@babel/regjsgen" "^0.8.0" regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsparser "^0.9.1" + regenerate-unicode-properties "^10.2.0" + regjsgen "^0.8.0" + regjsparser "^0.11.0" unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.1.0" -regjsgen@^0.5.1: - version "0.5.2" - resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733" - integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== - -regjsgen@^0.7.1: - version "0.7.1" - resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.7.1.tgz#ee5ef30e18d3f09b7c369b76e7c2373ed25546f6" - integrity sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA== - -regjsparser@^0.6.4: - version "0.6.9" - resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz#b489eef7c9a2ce43727627011429cf833a7183e6" - integrity sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ== - dependencies: - jsesc "~0.5.0" +regjsgen@^0.8.0: + version "0.8.0" + resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz#df23ff26e0c5b300a6470cad160a9d090c3a37ab" + integrity sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q== -regjsparser@^0.9.1: - version "0.9.1" - resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" - integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== +regjsparser@^0.11.0: + version "0.11.1" + resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.11.1.tgz#ae55c74f646db0c8fcb922d4da635e33da405149" + integrity sha512-1DHODs4B8p/mQHU9kr+jv8+wIC9mtG4eBHxWxIq5mhjE3D5oORhCc6deRKzTjs9DcfRFmj9BHSDguZklqCGFWQ== dependencies: - jsesc "~0.5.0" + jsesc "~3.0.2" require-directory@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== require-from-string@^2.0.2: version "2.0.2" @@ -5722,7 +4597,7 @@ require-from-string@^2.0.2: requires-port@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== resolve-cwd@^3.0.0: version "3.0.0" @@ -5736,13 +4611,14 @@ resolve-from@^5.0.0: resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.14.2, resolve@^1.17.0, resolve@^1.9.0: - version "1.20.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== +resolve@^1.14.2, resolve@^1.17.0, resolve@^1.20.0: + version "1.22.8" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" retry@^0.13.1: version "0.13.1" @@ -5750,11 +4626,11 @@ retry@^0.13.1: integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== rfdc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" - integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + version "1.4.1" + resolved "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" + integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== -rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -5769,6 +4645,11 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +run-applescript@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz#e5a553c2bffd620e169d276c1cd8f1b64778fbeb" + integrity sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A== + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -5779,7 +4660,7 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.1.0: +"safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -5793,60 +4674,52 @@ schema-utils@^2.6.5: ajv "^6.12.4" ajv-keywords "^3.5.2" -schema-utils@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.0.tgz#95986eb604f66daadeed56e379bfe7a7f963cdb9" - integrity sha512-tTEaeYkyIhEZ9uWgAjDerWov3T9MgX8dhhy2r0IGeeX4W8ngtGl1++dUve/RUqzuaASSh7shwCDJjEzthxki8w== - dependencies: - "@types/json-schema" "^7.0.7" - ajv "^6.12.5" - ajv-keywords "^3.5.2" - -schema-utils@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" - integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== +schema-utils@^3.1.0, schema-utils@^3.1.1: + version "3.3.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== dependencies: "@types/json-schema" "^7.0.8" ajv "^6.12.5" ajv-keywords "^3.5.2" -schema-utils@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz#60331e9e3ae78ec5d16353c467c34b3a0a1d3df7" - integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== +schema-utils@^4.0.0, schema-utils@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" + integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== dependencies: "@types/json-schema" "^7.0.9" - ajv "^8.8.0" + ajv "^8.9.0" ajv-formats "^2.1.1" - ajv-keywords "^5.0.0" + ajv-keywords "^5.1.0" select-hose@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" - integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= + integrity sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg== -selfsigned@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz#18a7613d714c0cd3385c48af0075abf3f266af61" - integrity sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ== +selfsigned@^2.4.1: + version "2.4.1" + resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz#560d90565442a3ed35b674034cec4e95dceb4ae0" + integrity sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q== dependencies: + "@types/node-forge" "^1.3.0" node-forge "^1" -semver@7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: +semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -send@0.18.0: - version "0.18.0" - resolved "https://registry.npmjs.org/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== +semver@^7.5.3: + version "7.6.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + +send@0.19.0: + version "0.19.0" + resolved "https://registry.npmjs.org/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== dependencies: debug "2.6.9" depd "2.0.0" @@ -5862,17 +4735,24 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@6.0.0, serialize-javascript@^6.0.0: +serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.1: + version "6.0.2" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== + dependencies: + randombytes "^2.1.0" + serve-index@^1.9.1: version "1.9.1" resolved "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" - integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk= + integrity sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw== dependencies: accepts "~1.3.4" batch "0.6.1" @@ -5882,31 +4762,38 @@ serve-index@^1.9.1: mime-types "~2.1.17" parseurl "~1.3.2" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.16.2: + version "1.16.2" + resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== dependencies: - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.18.0" + send "0.19.0" + +set-function-length@^1.2.1: + version "1.2.2" + resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== setprototypeof@1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - setprototypeof@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" @@ -5939,45 +4826,49 @@ shebang-regex@^3.0.0: resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" +shell-quote@^1.8.1: + version "1.8.1" + resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" + integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== -signal-exit@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== +side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== + dependencies: + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" -socket.io-adapter@~2.4.0: - version "2.4.0" - resolved "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz#b50a4a9ecdd00c34d4c8c808224daa1a786152a6" - integrity sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg== +socket.io-adapter@~2.5.2: + version "2.5.5" + resolved "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz#c7a1f9c703d7756844751b6ff9abfc1780664082" + integrity sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg== + dependencies: + debug "~4.3.4" + ws "~8.17.1" -socket.io-parser@~4.0.4: - version "4.0.4" - resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz#9ea21b0d61508d18196ef04a2c6b9ab630f4c2b0" - integrity sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g== +socket.io-parser@~4.2.4: + version "4.2.4" + resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz#c806966cf7270601e47469ddeec30fbdfda44c83" + integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== dependencies: - "@types/component-emitter" "^1.2.10" - component-emitter "~1.3.0" + "@socket.io/component-emitter" "~3.1.0" debug "~4.3.1" socket.io@^4.4.1: - version "4.5.0" - resolved "https://registry.npmjs.org/socket.io/-/socket.io-4.5.0.tgz#78ae2e84784c29267086a416620c18ef95b37186" - integrity sha512-slTYqU2jCgMjXwresG8grhUi/cC6GjzmcfqArzaH3BN/9I/42eZk9yamNvZJdBfTubkjEdKAKs12NEztId+bUA== + version "4.8.1" + resolved "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz#fa0eaff965cc97fdf4245e8d4794618459f7558a" + integrity sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg== dependencies: accepts "~1.3.4" base64id "~2.0.0" + cors "~2.8.5" debug "~4.3.2" - engine.io "~6.2.0" - socket.io-adapter "~2.4.0" - socket.io-parser "~4.0.4" + engine.io "~6.6.0" + socket.io-adapter "~2.5.2" + socket.io-parser "~4.2.4" sockjs@^0.3.24: version "0.3.24" @@ -5988,30 +4879,30 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" -source-map-support@~0.5.19: - version "0.5.19" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@^0.5.0, source-map@~0.5.3: - version "0.5.7" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - source-map@^0.6.0, 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== -source-map@^0.7.3, source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== +source-map@^0.7.3: + version "0.7.4" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" + integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== + +source-map@~0.5.3: + version "0.5.7" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== -sourcemap-codec@^1.4.4: +sourcemap-codec@^1.4.8: version "1.4.8" resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== @@ -6044,10 +4935,10 @@ statuses@2.0.1: resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: +"statuses@>= 1.4.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== stream-browserify@^3.0.0: version "3.0.0" @@ -6067,48 +4958,23 @@ stream-http@^3.1.0: readable-stream "^3.6.0" xtend "^4.0.2" -streamroller@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.2.tgz#30418d0eee3d6c93ec897f892ed098e3a81e68b7" - integrity sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA== - dependencies: - date-format "^4.0.3" - debug "^4.1.1" - fs-extra "^10.0.0" - -streamroller@^3.0.4: - version "3.0.5" - resolved "https://registry.npmjs.org/streamroller/-/streamroller-3.0.5.tgz#17e348dc2a662f9f325373549ab91d55316051ab" - integrity sha512-5uzTEUIi4OB5zy/H30kbUN/zpDNJsFUA+Z47ZL8EfrP93lcZvRLEqdbhdunEPa7CouuAzXXsHpCJ9dg90Umw7g== +streamroller@^3.1.5: + version "3.1.5" + resolved "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz#1263182329a45def1ffaef58d31b15d13d2ee7ff" + integrity sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw== dependencies: - date-format "^4.0.5" - debug "^4.3.3" - fs-extra "^10.0.1" + date-format "^4.0.14" + debug "^4.3.4" + fs-extra "^8.1.0" -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -string.prototype.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" + strip-ansi "^6.0.1" string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" @@ -6124,17 +4990,12 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - ansi-regex "^5.0.0" - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + ansi-regex "^5.0.1" strip-json-comments@3.1.1: version "3.1.1" @@ -6148,13 +5009,6 @@ supports-color@8.1.1, supports-color@^8.0.0: dependencies: has-flag "^4.0.0" -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -6162,31 +5016,41 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + tapable@^2.1.1, tapable@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b" - integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw== + version "2.2.1" + resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== terser-webpack-plugin@^5.1.3: - version "5.1.4" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz#c369cf8a47aa9922bd0d8a94fe3d3da11a7678a1" - integrity sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA== - dependencies: - jest-worker "^27.0.2" - p-limit "^3.1.0" - schema-utils "^3.0.0" - serialize-javascript "^6.0.0" - source-map "^0.6.1" - terser "^5.7.0" - -terser@^5.7.0: - version "5.7.1" - resolved "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz#2dc7a61009b66bb638305cb2a824763b116bf784" - integrity sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg== - dependencies: + version "5.3.10" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" + integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== + dependencies: + "@jridgewell/trace-mapping" "^0.3.20" + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.1" + terser "^5.26.0" + +terser@^5.26.0: + version "5.36.0" + resolved "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz#8b0dbed459ac40ff7b4c9fd5a3a2029de105180e" + integrity sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w== + dependencies: + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.19" + source-map-support "~0.5.20" + +thingies@^1.20.0: + version "1.21.0" + resolved "https://registry.npmjs.org/thingies/-/thingies-1.21.0.tgz#e80fbe58fd6fdaaab8fad9b67bd0a5c943c445c1" + integrity sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g== thunky@^1.0.2: version "1.1.0" @@ -6201,16 +5065,9 @@ timers-browserify@^2.0.11: setimmediate "^1.0.4" 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" - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + version "0.2.3" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" + integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== to-regex-range@^5.0.1: version "5.0.1" @@ -6219,25 +5076,20 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - toidentifier@1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= +tree-dump@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz#c460d5921caeb197bde71d0e9a7b479848c5b8ac" + integrity sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ== -tslib@^2.1.0: - version "2.3.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" - integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== +tslib@^2.0.0, tslib@^2.1.0: + version "2.8.0" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz#d124c86c3c05a40a91e6fdea4021bd31d377971b" + integrity sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA== tty-browserify@^0.0.1: version "0.0.1" @@ -6245,11 +5097,11 @@ tty-browserify@^0.0.1: integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== type-detect@^4.0.0, type-detect@^4.0.8: - version "4.0.8" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + version "4.1.0" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz#deb2453e8f08dcae7ae98c626b13dddb0155906c" + integrity sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw== -type-is@~1.6.17, type-is@~1.6.18: +type-is@~1.6.18: version "1.6.18" resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -6257,43 +5109,25 @@ type-is@~1.6.17, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typescript@4.7.4: - version "4.7.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== +typescript@5.5.4: + version "5.5.4" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" + integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== ua-parser-js@^0.7.30: - version "0.7.31" - resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6" - integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ== - -unbox-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" + version "0.7.39" + resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.39.tgz#c71efb46ebeabc461c4612d22d54f88880fabe7e" + integrity sha512-IZ6acm6RhQHNibSt7+c09hhvsKy9WUr4DVbeq9U8o71qxyYtJpQeDxQnMrVqnIFMLcQjHO0I9wgfO2vIahht4w== -unicode-canonical-property-names-ecmascript@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" - integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== +undici-types@~6.19.8: + version "6.19.8" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" - integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== - -unicode-match-property-ecmascript@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" - integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== - dependencies: - unicode-canonical-property-names-ecmascript "^1.0.4" - unicode-property-aliases-ecmascript "^1.0.4" + version "2.0.1" + resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz#cb3173fe47ca743e228216e4a3ddc4c84d628cc2" + integrity sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg== unicode-match-property-ecmascript@^2.0.0: version "2.0.0" @@ -6303,43 +5137,33 @@ unicode-match-property-ecmascript@^2.0.0: unicode-canonical-property-names-ecmascript "^2.0.0" unicode-property-aliases-ecmascript "^2.0.0" -unicode-match-property-value-ecmascript@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz#0d91f600eeeb3096aa962b1d6fc88876e64ea531" - integrity sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ== - unicode-match-property-value-ecmascript@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" - integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== - -unicode-property-aliases-ecmascript@^1.0.4: - version "1.1.0" - resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" - integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== + version "2.2.0" + resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz#a0401aee72714598f739b68b104e4fe3a0cb3c71" + integrity sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg== unicode-property-aliases-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8" - integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== + version "2.1.0" + resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== -update-browserslist-db@^1.0.13: - version "1.0.13" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" - integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== +update-browserslist-db@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" + integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.2.0" + picocolors "^1.1.0" uri-js@^4.2.2: version "4.4.1" @@ -6349,34 +5173,33 @@ uri-js@^4.2.2: punycode "^2.1.0" url@^0.11.0: - version "0.11.0" - resolved "https://registry.npmjs.org/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + version "0.11.4" + resolved "https://registry.npmjs.org/url/-/url-0.11.4.tgz#adca77b3562d56b72746e76b330b7f27b6721f3c" + integrity sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg== dependencies: - punycode "1.3.2" - querystring "0.2.0" + punycode "^1.4.1" + qs "^6.12.3" util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -util@^0.12.0, util@^0.12.1: - version "0.12.4" - resolved "https://registry.npmjs.org/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" - integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== +util@^0.12.1, util@^0.12.5: + version "0.12.5" + resolved "https://registry.npmjs.org/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" + integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== dependencies: inherits "^2.0.3" is-arguments "^1.0.4" is-generator-function "^1.0.7" is-typed-array "^1.1.3" - safe-buffer "^5.1.2" which-typed-array "^1.1.2" utils-merge@1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== uuid@^8.3.2: version "8.3.2" @@ -6386,7 +5209,7 @@ uuid@^8.3.2: vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== vm-browserify@^1.1.2: version "1.1.2" @@ -6396,12 +5219,12 @@ vm-browserify@^1.1.2: void-elements@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= + integrity sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung== watchpack@^2.4.0: - version "2.4.0" - resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" - integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== + version "2.4.2" + resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" + integrity sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -6416,85 +5239,82 @@ wbuf@^1.1.0, wbuf@^1.7.3: wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== dependencies: defaults "^1.0.3" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -webpack-cli@4.10.0: - version "4.10.0" - resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" - integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== +webpack-cli@5.1.4: + version "5.1.4" + resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz#c8e046ba7eaae4911d7e71e2b25b776fcc35759b" + integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.2.0" - "@webpack-cli/info" "^1.5.0" - "@webpack-cli/serve" "^1.7.0" + "@webpack-cli/configtest" "^2.1.1" + "@webpack-cli/info" "^2.0.2" + "@webpack-cli/serve" "^2.0.5" colorette "^2.0.14" - commander "^7.0.0" + commander "^10.0.1" cross-spawn "^7.0.3" + envinfo "^7.7.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" - interpret "^2.2.0" - rechoir "^0.7.0" + interpret "^3.1.1" + rechoir "^0.8.0" webpack-merge "^5.7.3" -webpack-dev-middleware@^5.3.1: - version "5.3.4" - resolved "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.4.tgz#eb7b39281cbce10e104eb2b8bf2b63fce49a3517" - integrity sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q== +webpack-dev-middleware@^7.4.2: + version "7.4.2" + resolved "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-7.4.2.tgz#40e265a3d3d26795585cff8207630d3a8ff05877" + integrity sha512-xOO8n6eggxnwYpy1NlzUKpvrjfJTvae5/D6WOK0S2LSo7vjmo5gCM1DbLUmFqrMTJP+W/0YZNctm7jasWvLuBA== dependencies: colorette "^2.0.10" - memfs "^3.4.3" + memfs "^4.6.0" mime-types "^2.1.31" + on-finished "^2.4.1" range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@4.11.1: - version "4.11.1" - resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.11.1.tgz#ae07f0d71ca0438cf88446f09029b92ce81380b5" - integrity sha512-lILVz9tAUy1zGFwieuaQtYiadImb5M3d+H+L1zDYalYoDl0cksAB1UNyuE5MMWJrG6zR1tXkCP2fitl7yoUJiw== - dependencies: - "@types/bonjour" "^3.5.9" - "@types/connect-history-api-fallback" "^1.3.5" - "@types/express" "^4.17.13" - "@types/serve-index" "^1.9.1" - "@types/serve-static" "^1.13.10" - "@types/sockjs" "^0.3.33" - "@types/ws" "^8.5.1" +webpack-dev-server@5.1.0: + version "5.1.0" + resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.1.0.tgz#8f44147402b4d8ab99bfeb9b6880daa1411064e5" + integrity sha512-aQpaN81X6tXie1FoOB7xlMfCsN19pSvRAeYUHOdFWOlhpQ/LlbfTqYwwmEDFV0h8GGuqmCmKmT+pxcUV/Nt2gQ== + dependencies: + "@types/bonjour" "^3.5.13" + "@types/connect-history-api-fallback" "^1.5.4" + "@types/express" "^4.17.21" + "@types/serve-index" "^1.9.4" + "@types/serve-static" "^1.15.5" + "@types/sockjs" "^0.3.36" + "@types/ws" "^8.5.10" ansi-html-community "^0.0.8" - bonjour-service "^1.0.11" - chokidar "^3.5.3" + bonjour-service "^1.2.1" + chokidar "^3.6.0" colorette "^2.0.10" compression "^1.7.4" connect-history-api-fallback "^2.0.0" - default-gateway "^6.0.3" - express "^4.17.3" + express "^4.19.2" graceful-fs "^4.2.6" - html-entities "^2.3.2" + html-entities "^2.4.0" http-proxy-middleware "^2.0.3" - ipaddr.js "^2.0.1" - open "^8.0.9" - p-retry "^4.5.0" - rimraf "^3.0.2" - schema-utils "^4.0.0" - selfsigned "^2.1.1" + ipaddr.js "^2.1.0" + launch-editor "^2.6.1" + open "^10.0.3" + p-retry "^6.2.0" + schema-utils "^4.2.0" + selfsigned "^2.4.1" serve-index "^1.9.1" sockjs "^0.3.24" spdy "^4.0.2" - webpack-dev-middleware "^5.3.1" - ws "^8.4.2" + webpack-dev-middleware "^7.4.2" + ws "^8.18.0" webpack-merge@^5.7.3: - version "5.8.0" - resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" - integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== + version "5.10.0" + resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz#a3ad5d773241e9c682803abf628d4cd62b8a4177" + integrity sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA== dependencies: clone-deep "^4.0.1" + flat "^5.0.2" wildcard "^2.0.0" webpack-sources@^3.2.3: @@ -6546,37 +5366,16 @@ websocket-extensions@>=0.1.1: resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which-typed-array@^1.1.2: - version "1.1.4" - resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz#8fcb7d3ee5adf2d771066fba7cf37e32fe8711ff" - integrity sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA== +which-typed-array@^1.1.14, which-typed-array@^1.1.2: + version "1.1.15" + resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" + integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA== dependencies: - available-typed-arrays "^1.0.2" - call-bind "^1.0.0" - es-abstract "^1.18.0-next.1" - foreach "^2.0.5" - function-bind "^1.1.1" - has-symbols "^1.0.1" - is-typed-array "^1.1.3" + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.2" which@2.0.2, which@^2.0.1: version "2.0.2" @@ -6593,9 +5392,9 @@ which@^1.2.1: isexe "^2.0.0" wildcard@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" - integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== + version "2.0.1" + resolved "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" + integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== workerpool@6.2.0: version "6.2.0" @@ -6614,17 +5413,17 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -ws@^8.4.2: - version "8.6.0" - resolved "https://registry.npmjs.org/ws/-/ws-8.6.0.tgz#e5e9f1d9e7ff88083d0c0dd8281ea662a42c9c23" - integrity sha512-AzmM3aH3gk0aX7/rZLYvjdvZooofDu3fFOzGqcSnQ1tOcTWwhM/o+q++E8mAyVVIyUdajrkzWUGftaVSDLn1bw== +ws@^8.18.0: + version "8.18.0" + resolved "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== -ws@~8.2.3: - version "8.2.3" - resolved "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz#63a56456db1b04367d0b721a0b80cae6d8becbba" - integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA== +ws@~8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== xtend@^4.0.2: version "4.0.2" @@ -6651,6 +5450,11 @@ 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-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + yargs-unparser@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" @@ -6661,7 +5465,7 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@16.2.0, yargs@^16.1.1, yargs@^16.2.0: +yargs@16.2.0, yargs@^16.1.1: version "16.2.0" resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== @@ -6674,6 +5478,19 @@ yargs@16.2.0, yargs@^16.1.1, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yargs@^17.7.2: + version "17.7.2" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" diff --git a/integration/compat-interop/package.json b/integration/compat-interop/package.json index 3491521aadd..37e697d37eb 100644 --- a/integration/compat-interop/package.json +++ b/integration/compat-interop/package.json @@ -8,22 +8,25 @@ "test:debug": "karma start --browsers Chrome --auto-watch" }, "dependencies": { - "@firebase/app": "0.10.11", - "@firebase/app-compat": "0.2.41", - "@firebase/analytics": "0.10.8", - "@firebase/analytics-compat": "0.2.14", - "@firebase/auth": "1.7.9", - "@firebase/auth-compat": "0.5.14", - "@firebase/functions": "0.11.8", - "@firebase/functions-compat": "0.3.14", - "@firebase/messaging": "0.12.11", - "@firebase/messaging-compat": "0.2.11", - "@firebase/performance": "0.6.9", - "@firebase/performance-compat": "0.2.9", - "@firebase/remote-config": "0.4.9", - "@firebase/remote-config-compat": "0.2.9" + "@firebase/app": "0.10.15", + "@firebase/app-compat": "0.2.45", + "@firebase/analytics": "0.10.9", + "@firebase/analytics-compat": "0.2.15", + "@firebase/auth": "1.8.0", + "@firebase/auth-compat": "0.5.15", + "@firebase/functions": "0.11.9", + "@firebase/functions-compat": "0.3.15", + "@firebase/messaging": "0.12.13", + "@firebase/messaging-compat": "0.2.13", + "@firebase/performance": "0.6.10", + "@firebase/performance-compat": "0.2.10", + "@firebase/remote-config": "0.4.10", + "@firebase/remote-config-compat": "0.2.10" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/integration/compat-interop/tsconfig.json b/integration/compat-interop/tsconfig.json index 4da78214594..735f3df7fbd 100644 --- a/integration/compat-interop/tsconfig.json +++ b/integration/compat-interop/tsconfig.json @@ -8,7 +8,7 @@ "moduleResolution": "node", "noImplicitAny": true, "outDir": "dist", - "target": "ES5", + "target": "es2017", "sourceMap": true, "esModuleInterop": true }, diff --git a/integration/compat-typings/package.json b/integration/compat-typings/package.json index 11639312c27..45ed087a0d7 100644 --- a/integration/compat-typings/package.json +++ b/integration/compat-typings/package.json @@ -10,6 +10,9 @@ "firebase": "*" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" + }, + "engines": { + "node": ">=18.0.0" } -} \ No newline at end of file +} diff --git a/integration/firebase/package.json b/integration/firebase/package.json index 5dfd652a2a2..c831bba2b77 100644 --- a/integration/firebase/package.json +++ b/integration/firebase/package.json @@ -7,7 +7,7 @@ "test:ci": "node ../../scripts/run_tests_in_ci.js -s test" }, "devDependencies": { - "firebase": "10.13.2", + "firebase": "11.0.1", "@types/chai": "4.3.14", "@types/mocha": "9.1.1", "chai": "4.4.1", @@ -20,6 +20,9 @@ "karma-typescript": "5.5.4", "mocha": "9.2.2", "npm-run-all": "4.1.5", - "typescript": "4.7.4" + "typescript": "5.5.4" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/integration/firebase/tsconfig.json b/integration/firebase/tsconfig.json index 4da78214594..735f3df7fbd 100644 --- a/integration/firebase/tsconfig.json +++ b/integration/firebase/tsconfig.json @@ -8,7 +8,7 @@ "moduleResolution": "node", "noImplicitAny": true, "outDir": "dist", - "target": "ES5", + "target": "es2017", "sourceMap": true, "esModuleInterop": true }, diff --git a/integration/firestore/package.json b/integration/firestore/package.json index c2019dcc442..e0a4304d8e9 100644 --- a/integration/firestore/package.json +++ b/integration/firestore/package.json @@ -14,8 +14,8 @@ "test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome" }, "dependencies": { - "@firebase/app": "0.10.11", - "@firebase/firestore": "4.7.2" + "@firebase/app": "0.10.15", + "@firebase/firestore": "4.7.4" }, "devDependencies": { "@types/mocha": "9.1.1", @@ -29,8 +29,11 @@ "karma-spec-reporter": "0.0.36", "mocha": "9.2.2", "ts-loader": "9.5.1", - "typescript": "4.2.2", + "typescript": "5.5.4", "webpack": "5.76.0", "webpack-stream": "7.0.0" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/integration/messaging/package.json b/integration/messaging/package.json index 3431c913b15..a6bdde34991 100644 --- a/integration/messaging/package.json +++ b/integration/messaging/package.json @@ -9,13 +9,15 @@ "test:manual": "mocha --exit" }, "devDependencies": { - "firebase": "10.13.2", + "firebase": "11.0.1", "chai": "4.4.1", "chromedriver": "119.0.1", "express": "4.19.2", "geckodriver": "2.0.4", "mocha": "9.2.2", - "undici": "6.19.7", "selenium-assistant": "6.1.1" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/integration/messaging/test/utils/sendMessage.js b/integration/messaging/test/utils/sendMessage.js index 1d2e95054eb..6393e90364c 100644 --- a/integration/messaging/test/utils/sendMessage.js +++ b/integration/messaging/test/utils/sendMessage.js @@ -15,7 +15,6 @@ * limitations under the License. */ -const undici = require('undici'); const FCM_SEND_ENDPOINT = 'https://fcm.googleapis.com/fcm/send'; // Rotatable fcm server key. It's generally a bad idea to expose server keys. The reason is to // simplify testing process (no need to implement server side decryption of git secret). The @@ -28,7 +27,7 @@ module.exports = async payload => { 'Requesting to send an FCM message with payload: ' + JSON.stringify(payload) ); - const response = await undici.fetch(FCM_SEND_ENDPOINT, { + const response = await fetch(FCM_SEND_ENDPOINT, { method: 'POST', body: JSON.stringify(payload), headers: { diff --git a/package.json b/package.json index a001a659c48..62fe45a3256 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", "engines": { - "node": "^8.13.0 || >=10.10.0" + "node": ">=18.0.0" }, "homepage": "https://github.com/firebase/firebase-js-sdk", "keywords": [ @@ -80,7 +80,7 @@ "@types/long": "4.0.2", "@types/mocha": "9.1.1", "@types/mz": "2.7.8", - "@types/node": "16.18.68", + "@types/node": "18.19.57", "@types/request": "2.48.12", "@types/sinon": "9.0.11", "@types/sinon-chai": "3.2.12", @@ -120,10 +120,10 @@ "karma-firefox-launcher": "2.1.3", "karma-mocha": "2.0.1", "karma-mocha-reporter": "2.2.5", - "karma-safari-launcher": "1.0.0", "karma-sourcemap-loader": "0.4.0", "karma-spec-reporter": "0.0.36", "karma-summary-reporter": "3.1.1", + "karma-webkit-launcher": "2.6.0", "karma-webpack": "5.0.0", "lcov-result-merger": "3.3.0", "lerna": "4.0.0", @@ -139,6 +139,7 @@ "nyc": "15.1.0", "ora": "5.4.1", "patch-package": "7.0.2", + "playwright": "1.46.1", "postinstall-postinstall": "2.1.0", "prettier": "2.8.7", "protractor": "5.4.2", @@ -155,8 +156,7 @@ "tsec": "0.2.8", "tslint": "6.1.3", "typedoc": "0.16.11", - "typescript": "4.7.4", - "undici": "6.19.7", + "typescript": "5.5.4", "watch": "1.0.2", "webpack": "5.76.0", "yargs": "17.7.2" diff --git a/packages/analytics-compat/CHANGELOG.md b/packages/analytics-compat/CHANGELOG.md index 264580d3e2b..56551612379 100644 --- a/packages/analytics-compat/CHANGELOG.md +++ b/packages/analytics-compat/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/analytics-compat +## 0.2.15 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/analytics@0.10.9 + - @firebase/component@0.6.10 + - @firebase/util@1.10.1 + ## 0.2.14 ### Patch Changes diff --git a/packages/analytics-compat/package.json b/packages/analytics-compat/package.json index 861e5baf519..c6a57c931bb 100644 --- a/packages/analytics-compat/package.json +++ b/packages/analytics-compat/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/analytics-compat", - "version": "0.2.14", + "version": "0.2.15", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -24,11 +22,11 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.41", + "@firebase/app-compat": "0.2.45", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/analytics-compat", @@ -54,10 +52,10 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/analytics": "0.10.8", + "@firebase/component": "0.6.10", + "@firebase/analytics": "0.10.9", "@firebase/analytics-types": "0.8.2", - "@firebase/util": "1.10.0", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "nyc": { diff --git a/packages/analytics-compat/rollup.config.js b/packages/analytics-compat/rollup.config.js index 0fccfa7a26c..49b8ac0d21e 100644 --- a/packages/analytics-compat/rollup.config.js +++ b/packages/analytics-compat/rollup.config.js @@ -25,51 +25,33 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), json({ preferConst: true }) ]; -const esmBuilds = [ - { - input: 'src/index.ts', - output: { - file: pkg.browser, - format: 'es', - sourcemap: true - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es2017BuildPlugins, emitModulePackageFile()] +const esmBuild = { + input: 'src/index.ts', + output: { + file: pkg.browser, + format: 'es', + sourcemap: true }, - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es5BuildPlugins, emitModulePackageFile()] - } -]; + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [...buildPlugins, emitModulePackageFile()] +}; -const cjsBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: es5BuildPlugins - } -]; +const cjsBuild = { + input: 'src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: buildPlugins +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/analytics-interop-types/package.json b/packages/analytics-interop-types/package.json index 79526603147..f0a988897d9 100644 --- a/packages/analytics-interop-types/package.json +++ b/packages/analytics-interop-types/package.json @@ -20,6 +20,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/analytics-types/package.json b/packages/analytics-types/package.json index 4b9452848f0..26ac177f142 100644 --- a/packages/analytics-types/package.json +++ b/packages/analytics-types/package.json @@ -20,6 +20,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index cefb7a26891..13ae87ef46e 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/analytics +## 0.10.9 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/installations@0.6.10 + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 0.10.8 ### Patch Changes diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 590ba9c6640..6b6040a89d1 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/analytics", - "version": "0.10.8", + "version": "0.10.9", "description": "A analytics package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/analytics-public.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -41,21 +39,21 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/installations": "0.6.10", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/analytics", diff --git a/packages/analytics/rollup.config.js b/packages/analytics/rollup.config.js index 509b9690c5e..6acafe03b5d 100644 --- a/packages/analytics/rollup.config.js +++ b/packages/analytics/rollup.config.js @@ -27,22 +27,10 @@ const deps = [ ...Object.keys(Object.assign({}, pkg.peerDependencies, pkg.dependencies)) ]; -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), json({ preferConst: true }) ]; @@ -50,16 +38,6 @@ const es2017BuildPlugins = [ * ESM builds */ const esmBuilds = [ - { - input: 'src/index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)), - emitModulePackageFile() - ] - }, { input: 'src/index.ts', output: { @@ -69,7 +47,7 @@ const esmBuilds = [ }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)), emitModulePackageFile() ] @@ -82,11 +60,15 @@ const esmBuilds = [ const cjsBuilds = [ { input: 'src/index.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) ] } ]; diff --git a/packages/analytics/src/index.ts b/packages/analytics/src/index.ts index ed785fba94b..f79725db7bd 100644 --- a/packages/analytics/src/index.ts +++ b/packages/analytics/src/index.ts @@ -66,7 +66,7 @@ function registerAnalytics(): void { ); registerVersion(name, version); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); function internalFactory( diff --git a/packages/analytics/testing/get-fake-firebase-services.ts b/packages/analytics/testing/get-fake-firebase-services.ts index 596e431e0b2..4d666a76d25 100644 --- a/packages/analytics/testing/get-fake-firebase-services.ts +++ b/packages/analytics/testing/get-fake-firebase-services.ts @@ -15,7 +15,12 @@ * limitations under the License. */ -import { FirebaseApp, initializeApp, _registerComponent } from '@firebase/app'; +import { + FirebaseApp, + initializeApp, + _registerComponent, + _addOrOverwriteComponent +} from '@firebase/app'; import { Component, ComponentType } from '@firebase/component'; import { _FirebaseInstallationsInternal } from '@firebase/installations'; import { AnalyticsService } from '../src/factory'; @@ -78,5 +83,18 @@ export function getFullApp(fakeAppParams?: { ) ); const app = initializeApp({ ...fakeConfig, ...fakeAppParams }); + _addOrOverwriteComponent( + app, + //@ts-ignore + new Component( + 'heartbeat', + () => { + return { + triggerHeartbeat: () => {} + } as any; + }, + ComponentType.PUBLIC + ) + ); return app; } diff --git a/packages/app-check-compat/CHANGELOG.md b/packages/app-check-compat/CHANGELOG.md index 337bb02105d..d35d9852fa2 100644 --- a/packages/app-check-compat/CHANGELOG.md +++ b/packages/app-check-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/app-check-compat +## 0.3.16 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/app-check@0.8.9 + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 0.3.15 ### Patch Changes diff --git a/packages/app-check-compat/package.json b/packages/app-check-compat/package.json index 8fa928c7c35..169772febca 100644 --- a/packages/app-check-compat/package.json +++ b/packages/app-check-compat/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/app-check-compat", - "version": "0.3.15", + "version": "0.3.16", "description": "A compat App Check package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -36,22 +34,22 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/app-check": "0.8.8", + "@firebase/app-check": "0.8.9", "@firebase/app-check-types": "0.5.2", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.41", + "@firebase/app-compat": "0.2.45", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/app-check", @@ -67,5 +65,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/app-check-compat/rollup.config.js b/packages/app-check-compat/rollup.config.js index e3cc4ea55de..137f3a27fad 100644 --- a/packages/app-check-compat/rollup.config.js +++ b/packages/app-check-compat/rollup.config.js @@ -25,32 +25,14 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), json({ preferConst: true }) ]; const esmBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es5BuildPlugins, emitModulePackageFile()] - }, { input: 'src/index.ts', output: { @@ -59,16 +41,20 @@ const esmBuilds = [ sourcemap: true }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es2017BuildPlugins, emitModulePackageFile()] + plugins: [...buildPlugins, emitModulePackageFile()] } ]; const cjsBuilds = [ { input: 'src/index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: es5BuildPlugins + plugins: buildPlugins } ]; diff --git a/packages/app-check-interop-types/package.json b/packages/app-check-interop-types/package.json index 983eca2a748..333ca0649af 100644 --- a/packages/app-check-interop-types/package.json +++ b/packages/app-check-interop-types/package.json @@ -20,6 +20,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/app-check-types/package.json b/packages/app-check-types/package.json index fdc130f4281..16a3692e2de 100644 --- a/packages/app-check-types/package.json +++ b/packages/app-check-types/package.json @@ -20,6 +20,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/app-check/CHANGELOG.md b/packages/app-check/CHANGELOG.md index 5015f24f2c7..7cc3cf78a89 100644 --- a/packages/app-check/CHANGELOG.md +++ b/packages/app-check/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/app-check +## 0.8.9 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 0.8.8 ### Patch Changes diff --git a/packages/app-check/package.json b/packages/app-check/package.json index cdef13bfeba..f537ac4c4d4 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/app-check", - "version": "0.8.8", + "version": "0.8.9", "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/app-check-public.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -39,20 +37,20 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", + "@firebase/logger": "0.4.3", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/app-check", @@ -68,5 +66,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/app-check/rollup.config.js b/packages/app-check/rollup.config.js index e3cc4ea55de..137f3a27fad 100644 --- a/packages/app-check/rollup.config.js +++ b/packages/app-check/rollup.config.js @@ -25,32 +25,14 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), json({ preferConst: true }) ]; const esmBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es5BuildPlugins, emitModulePackageFile()] - }, { input: 'src/index.ts', output: { @@ -59,16 +41,20 @@ const esmBuilds = [ sourcemap: true }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es2017BuildPlugins, emitModulePackageFile()] + plugins: [...buildPlugins, emitModulePackageFile()] } ]; const cjsBuilds = [ { input: 'src/index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: es5BuildPlugins + plugins: buildPlugins } ]; diff --git a/packages/app-compat/CHANGELOG.md b/packages/app-compat/CHANGELOG.md index 405318ebf80..eeff3cd9b94 100644 --- a/packages/app-compat/CHANGELOG.md +++ b/packages/app-compat/CHANGELOG.md @@ -1,5 +1,38 @@ # @firebase/app-compat +## 0.2.45 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.10.15 + +## 0.2.44 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + - @firebase/app@0.10.14 + +## 0.2.43 + +### Patch Changes + +- Updated dependencies []: + - @firebase/app@0.10.13 + +## 0.2.42 + +### Patch Changes + +- Updated dependencies [[`beaa4dffb`](https://github.com/firebase/firebase-js-sdk/commit/beaa4dffb7f48cb12ccc6c1d1b7cdc9c3605fc04)]: + - @firebase/app@0.10.12 + ## 0.2.41 ### Patch Changes diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index 3aab3504c04..3d159345f5e 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -1,21 +1,17 @@ { "name": "@firebase/app-compat", - "version": "0.2.41", + "version": "0.2.45", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm5.js", "lite": "dist/index.lite.js", - "liteesm5": "dist/index.lite.esm5.js", "exports": { ".": { "types": "./dist/app-compat-public.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", "lite": "./dist/index.lite.js", - "liteesm5": "./dist/index.lite.esm5.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -41,10 +37,10 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.10.11", - "@firebase/util": "1.10.0", - "@firebase/logger": "0.4.2", - "@firebase/component": "0.6.9", + "@firebase/app": "0.10.15", + "@firebase/util": "1.10.1", + "@firebase/logger": "0.4.3", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "devDependencies": { @@ -52,7 +48,7 @@ "@rollup/plugin-json": "4.1.0", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/app-compat", @@ -68,5 +64,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/app-compat/rollup.config.js b/packages/app-compat/rollup.config.js index 055b75f3836..5bc1c799aa2 100644 --- a/packages/app-compat/rollup.config.js +++ b/packages/app-compat/rollup.config.js @@ -25,46 +25,15 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, abortOnError: false }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - abortOnError: false, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), - json({ - preferConst: true - }) + json({ preferConst: true }) ]; const esmBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - plugins: [...es5BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, - { - input: 'src/index.lite.ts', - output: { - file: pkg['liteesm5'], - format: 'es', - sourcemap: true - }, - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, { input: 'src/index.ts', output: { @@ -72,7 +41,7 @@ const esmBuilds = [ format: 'es', sourcemap: true }, - plugins: [...es2017BuildPlugins, emitModulePackageFile()], + plugins: [...buildPlugins, emitModulePackageFile()], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { @@ -82,7 +51,7 @@ const esmBuilds = [ format: 'es', sourcemap: true }, - plugins: es2017BuildPlugins, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; @@ -90,8 +59,12 @@ const esmBuilds = [ const cjsBuilds = [ { input: 'src/index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, - plugins: es5BuildPlugins, + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; diff --git a/packages/app-types/package.json b/packages/app-types/package.json index cd2e3ce4533..9edbf4b1290 100644 --- a/packages/app-types/package.json +++ b/packages/app-types/package.json @@ -24,6 +24,6 @@ "@firebase/logger": "0.2.6" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 09e7cfe0592..f33a0d0cf97 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,34 @@ # @firebase/app +## 0.10.15 + +### Patch Changes + +- Update SDK_VERSION. + +## 0.10.14 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + +## 0.10.13 + +### Patch Changes + +- Update SDK_VERSION. + +## 0.10.12 + +### Patch Changes + +- [`beaa4dffb`](https://github.com/firebase/firebase-js-sdk/commit/beaa4dffb7f48cb12ccc6c1d1b7cdc9c3605fc04) [#8480](https://github.com/firebase/firebase-js-sdk/pull/8480) - Included Data Connect product. + ## 0.10.11 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index c413787ea2c..cdbb10f51fa 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/app", - "version": "0.10.11", + "version": "0.10.15", "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm5.js", "exports": { ".": { "types": "./dist/app-public.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -39,9 +37,9 @@ "typings:internal": "node ../../scripts/build/use_typings.js ./dist/app.d.ts" }, "dependencies": { - "@firebase/util": "1.10.0", - "@firebase/logger": "0.4.2", - "@firebase/component": "0.6.9", + "@firebase/util": "1.10.1", + "@firebase/logger": "0.4.3", + "@firebase/component": "0.6.10", "idb": "7.1.1", "tslib": "^2.1.0" }, @@ -52,7 +50,7 @@ "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-dts": "5.3.1", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/app", @@ -68,5 +66,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/app/rollup.config.js b/packages/app/rollup.config.js index 6900b5f0f4a..ec5a279a1c2 100644 --- a/packages/app/rollup.config.js +++ b/packages/app/rollup.config.js @@ -28,44 +28,17 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), - json({ - preferConst: true - }) + json({ preferConst: true }) ]; const esmBuilds = [ /** * Browser Builds */ - { - input: 'src/index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace({ - ...generateBuildTargetReplaceConfig('esm', 5), - '__RUNTIME_ENV__': '' - }), - emitModulePackageFile() - ] - }, { input: 'src/index.ts', output: { @@ -75,7 +48,7 @@ const esmBuilds = [ }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace({ ...generateBuildTargetReplaceConfig('esm', 2017), '__RUNTIME_ENV__': '' @@ -88,12 +61,16 @@ const esmBuilds = [ const cjsBuilds = [ { input: 'src/index.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ - ...es5BuildPlugins, + ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('cjs', 5), + ...generateBuildTargetReplaceConfig('cjs', 2017), '__RUNTIME_ENV__': 'node' }) ] diff --git a/packages/app/src/registerCoreComponents.ts b/packages/app/src/registerCoreComponents.ts index 744b916e4c0..f0141dbf155 100644 --- a/packages/app/src/registerCoreComponents.ts +++ b/packages/app/src/registerCoreComponents.ts @@ -40,7 +40,7 @@ export function registerCoreComponents(variant?: string): void { // Register `app` package. registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); // Register platform SDK identifier (no version). registerVersion('fire-js', ''); diff --git a/packages/auth-compat/CHANGELOG.md b/packages/auth-compat/CHANGELOG.md index 6967a6a2782..bee7aa1d73d 100644 --- a/packages/auth-compat/CHANGELOG.md +++ b/packages/auth-compat/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/auth-compat +## 0.5.15 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`b942e9e6e`](https://github.com/firebase/firebase-js-sdk/commit/b942e9e6e22d184d21f3e452cd35122592a3a372)]: + - @firebase/component@0.6.10 + - @firebase/auth@1.8.0 + - @firebase/util@1.10.1 + ## 0.5.14 ### Patch Changes diff --git a/packages/auth-compat/demo/package.json b/packages/auth-compat/demo/package.json index 098a3ad3007..b6cc9d3c142 100644 --- a/packages/auth-compat/demo/package.json +++ b/packages/auth-compat/demo/package.json @@ -34,7 +34,7 @@ "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-uglify": "6.0.4", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/auth-compat/demo", diff --git a/packages/auth-compat/index.node.ts b/packages/auth-compat/index.node.ts index 6d8dd2c07a5..1513148bea9 100644 --- a/packages/auth-compat/index.node.ts +++ b/packages/auth-compat/index.node.ts @@ -23,15 +23,6 @@ */ export * from './index'; import { FetchProvider } from '@firebase/auth/internal'; -import { - fetch as undiciFetch, - Headers as undiciHeaders, - Response as undiciResponse -} from 'undici'; import './index'; -FetchProvider.initialize( - undiciFetch as unknown as typeof fetch, - undiciHeaders as unknown as typeof Headers, - undiciResponse as unknown as typeof Response -); +FetchProvider.initialize(fetch, Headers, Response); diff --git a/packages/auth-compat/karma.conf.js b/packages/auth-compat/karma.conf.js index f3f14e8d1b1..6283ffbc3f1 100644 --- a/packages/auth-compat/karma.conf.js +++ b/packages/auth-compat/karma.conf.js @@ -30,18 +30,6 @@ module.exports = function (config) { // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha'], - // undici is a fetch polyfill that test helpers call for Node tests, and browser tests should - // ignore its import to avoid compilation errors in those test helpers. - webpack: { - ...webpackBase, - resolve: { - ...webpackBase.resolve, - alias: { - 'undici': false - } - } - }, - client: Object.assign({}, karmaBase.client, getClientConfig()) }); diff --git a/packages/auth-compat/package.json b/packages/auth-compat/package.json index dd69dc9f993..55cf19d1492 100644 --- a/packages/auth-compat/package.json +++ b/packages/auth-compat/package.json @@ -1,12 +1,11 @@ { "name": "@firebase/auth-compat", - "version": "0.5.14", + "version": "0.5.15", "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@8 and prior versions", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm.js", "exports": { ".": { "types": "./dist/auth-compat/index.d.ts", @@ -15,7 +14,6 @@ "import": "./dist/esm/index.node.esm.js", "require": "./dist/index.node.cjs.js" }, - "esm5": "./dist/index.esm.js", "browser": { "require": "./dist/index.cjs.js", "import": "./dist/index.esm2017.js" @@ -51,22 +49,21 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/auth": "1.7.9", + "@firebase/auth": "1.8.0", "@firebase/auth-types": "0.12.2", - "@firebase/component": "0.6.9", - "@firebase/util": "1.10.0", - "undici": "6.19.7", + "@firebase/component": "0.6.10", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app-compat": "0.2.41", + "@firebase/app-compat": "0.2.45", "@rollup/plugin-json": "4.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", "selenium-webdriver": "4.8.0", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/auth-compat", @@ -82,5 +79,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/auth-compat/rollup.config.js b/packages/auth-compat/rollup.config.js index cb3491541c4..b2872f977fd 100644 --- a/packages/auth-compat/rollup.config.js +++ b/packages/auth-compat/rollup.config.js @@ -27,40 +27,9 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -/** - * Common plugins for all builds - */ -const commonPlugins = [json(), resolve()]; - -const es5BuildPlugins = [ - ...commonPlugins, - typescriptPlugin({ - typescript - }) -]; - -const es2017BuildPlugins = [ - ...commonPlugins, - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }) -]; +const buildPlugins = [json(), resolve(), typescriptPlugin({ typescript })]; const browserBuilds = [ - { - input: 'index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - treeshake: { - moduleSideEffects: false - } - }, { input: 'index.ts', output: { @@ -68,7 +37,7 @@ const browserBuilds = [ format: 'es', sourcemap: true }, - plugins: es2017BuildPlugins, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), treeshake: { moduleSideEffects: false @@ -81,7 +50,7 @@ const browserBuilds = [ format: 'cjs', sourcemap: true }, - plugins: es2017BuildPlugins, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), treeshake: { moduleSideEffects: false @@ -92,8 +61,12 @@ const browserBuilds = [ const nodeBuilds = [ { input: 'index.node.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - plugins: es5BuildPlugins, + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), treeshake: { moduleSideEffects: true @@ -104,7 +77,7 @@ const nodeBuilds = [ output: [ { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } ], - plugins: [...es2017BuildPlugins, emitModulePackageFile()], + plugins: [...buildPlugins, emitModulePackageFile()], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), treeshake: { moduleSideEffects: true @@ -144,7 +117,7 @@ const umdBuild = { ); }` }, - plugins: [...es5BuildPlugins, uglify()], + plugins: [...buildPlugins, uglify()], external: ['@firebase/app-compat', '@firebase/app'] }; diff --git a/packages/auth-interop-types/package.json b/packages/auth-interop-types/package.json index ed0f01f6f09..9cfc47fad7a 100644 --- a/packages/auth-interop-types/package.json +++ b/packages/auth-interop-types/package.json @@ -20,6 +20,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/auth-types/package.json b/packages/auth-types/package.json index c8ec943e011..f1e8cf3fae6 100644 --- a/packages/auth-types/package.json +++ b/packages/auth-types/package.json @@ -24,6 +24,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 09d04e7e1be..4c6ebfe474d 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,22 @@ # @firebase/auth +## 1.8.0 + +### Minor Changes + +- [`b942e9e6e`](https://github.com/firebase/firebase-js-sdk/commit/b942e9e6e22d184d21f3e452cd35122592a3a372) [#8568](https://github.com/firebase/firebase-js-sdk/pull/8568) - [feature] Added reCAPTCHA Enterprise support for app verification during phone authentication. + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 1.7.9 ### Patch Changes diff --git a/packages/auth/README.md b/packages/auth/README.md index 979a35182d2..74e52968aa4 100644 --- a/packages/auth/README.md +++ b/packages/auth/README.md @@ -54,9 +54,12 @@ firebase emulators:exec --project foo-bar --only auth "yarn test:integration:loc ### Integration testing with the production backend -Currently, MFA TOTP and password policy tests only run against the production backend (since they are not supported on the emulator yet). +Currently, MFA TOTP, password policy, and reCAPTCHA Enterprise phone verification tests only run +against the production backend (since they are not supported on the emulator yet). Running against the backend also makes it a more reliable end-to-end test. +#### TOTP + The TOTP tests require the following email/password combination to exist in the project, so if you are running this test against your test project, please create this user: 'totpuser-donotdelete@test.com', 'password' @@ -71,6 +74,8 @@ curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Conten }' ``` +#### Password policy + The password policy tests require a tenant configured with a password policy that requires all options to exist in the project. If you are running this test against your test project, please create the tenant and configure the policy with the following curl command: @@ -98,6 +103,32 @@ curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Conten Replace the tenant ID `passpol-tenant-d7hha` in [test/integration/flows/password_policy.test.ts](https://github.com/firebase/firebase-js-sdk/blob/main/packages/auth/test/integration/flows/password_policy.test.ts) with the ID for the newly created tenant. The tenant ID can be found at the end of the `name` property in the response and is in the format `passpol-tenant-xxxxx`. +#### reCAPTCHA Enterprise phone verification + +The reCAPTCHA Enterprise phone verification tests require reCAPTCHA Enterprise to be enabled and +the following fictional phone number to be configured and in the project. + +If you are running this +test against your project, please [add this test phone number](https://firebase.google.com/docs/auth/web/phone-auth#create-fictional-phone-numbers-and-verification-codes): + +'+1 555-555-1000', SMS code: '123456' + +Follow [this guide](https://cloud.google.com/identity-platform/docs/recaptcha-enterprise) to enable reCAPTCHA +Enterprise, then use the following curl command to set reCAPTCHA Enterprise to ENFORCE for phone provider: + +``` +curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" -H "X-Goog-User-Project: $ +{PROJECT_ID}" -X POST https://identitytoolkit.googleapis.com/v2/projects/${PROJECT_ID}/config?updateMask=recaptchaConfig.phoneEnforcementState,recaptchaConfig.useSmsBotScore,recaptchaConfig.useSmsTollFraudProtection -d ' +{ + "name": "projects/{PROJECT_ID}", + "recaptchaConfig": { + "phoneEnforcementState": "ENFORCE", + "useSmsBotScore": "true", + "useSmsTollFraudProtection": "true", + }, +}' +``` + ### Selenium Webdriver tests These tests assume that you have both Firefox and Chrome installed on your diff --git a/packages/auth/api-extractor.json b/packages/auth/api-extractor.json index ca7e1ee6983..f7279fcac15 100644 --- a/packages/auth/api-extractor.json +++ b/packages/auth/api-extractor.json @@ -1,6 +1,6 @@ { "extends": "../../config/api-extractor.json", - "mainEntryPointFilePath": "/dist/esm5/index.d.ts", + "mainEntryPointFilePath": "/dist/esm2017/index.d.ts", "dtsRollup": { "enabled": true, "untrimmedFilePath": "/dist/.d.ts", diff --git a/packages/auth/cordova/demo/rollup.config.js b/packages/auth/cordova/demo/rollup.config.js index 252e2e6b622..21654b783d2 100644 --- a/packages/auth/cordova/demo/rollup.config.js +++ b/packages/auth/cordova/demo/rollup.config.js @@ -18,28 +18,15 @@ import resolve from '@rollup/plugin-node-resolve'; import strip from '@rollup/plugin-strip'; /** - * Common plugins for all builds + * Browser Build */ -const commonPlugins = [ - strip({ - functions: ['debugAssert.*'] - }) -]; +const esmBuild = { + input: 'src/index.js', + output: [{ file: 'www/dist/bundle.js', format: 'esm', sourcemap: true }], + plugins: [ + strip({ functions: ['debugAssert.*'] }), + resolve({ mainFields: ['module', 'main'] }) + ] +}; -const es5Builds = [ - /** - * Browser Builds - */ - { - input: 'src/index.js', - output: [{ file: 'www/dist/bundle.js', format: 'esm', sourcemap: true }], - plugins: [ - ...commonPlugins, - resolve({ - mainFields: ['module', 'main'] - }) - ] - } -]; - -export default [...es5Builds]; +export default esmBuild; diff --git a/packages/auth/demo/rollup.config.js b/packages/auth/demo/rollup.config.js index 49aff45b419..ce6a2893210 100644 --- a/packages/auth/demo/rollup.config.js +++ b/packages/auth/demo/rollup.config.js @@ -21,17 +21,8 @@ import typescript from 'typescript'; import pkg from './package.json'; -/** - * Common plugins for all builds - */ -const commonPlugins = [ - strip({ - functions: ['debugAssert.*'] - }) -]; - const workerPlugins = [ - ...commonPlugins, + strip({ functions: ['debugAssert.*'] }), resolve({ mainFields: ['webworker', 'module', 'main'] }), @@ -44,7 +35,7 @@ const workerPlugins = [ lib: [ // TODO: remove this 'dom', - 'es2015', + 'es2017', 'webworker' ] } @@ -52,30 +43,33 @@ const workerPlugins = [ }) ]; -const es5Builds = [ - /** - * Browser Builds - */ +const esmBuilds = [ { input: 'src/index.js', output: [{ file: pkg.browser, format: 'esm', sourcemap: true }], plugins: [ - ...commonPlugins, - resolve({ - mainFields: ['module', 'main'] - }) + strip({ functions: ['debugAssert.*'] }), + resolve({ mainFields: ['module', 'main'] }) ] }, { input: 'src/worker/web-worker.ts', - output: [{ file: pkg.webworker, format: 'esm', sourcemap: true }], + output: { + file: pkg.webworker, + format: 'esm', + sourcemap: true + }, plugins: workerPlugins }, { input: 'src/worker/service-worker.ts', - output: [{ file: pkg.serviceworker, format: 'esm', sourcemap: true }], + output: { + file: pkg.serviceworker, + format: 'esm', + sourcemap: true + }, plugins: workerPlugins } ]; -export default [...es5Builds]; +export default [...esmBuilds]; diff --git a/packages/auth/demo/src/worker/tsconfig.json b/packages/auth/demo/src/worker/tsconfig.json index e160c5c6b47..1081b12233f 100644 --- a/packages/auth/demo/src/worker/tsconfig.json +++ b/packages/auth/demo/src/worker/tsconfig.json @@ -2,9 +2,9 @@ "extends": "../../../config/tsconfig.base.json", "compilerOptions": { "outDir": "dist", - "target": "es2015", + "target": "es2017", "lib": [ - "es2015", + "es2017", "webworker" ] }, diff --git a/packages/auth/internal/package.json b/packages/auth/internal/package.json index 8dd06ec9378..4ecfdccbd20 100644 --- a/packages/auth/internal/package.json +++ b/packages/auth/internal/package.json @@ -4,7 +4,9 @@ "main": "../dist/node/internal.js", "module": "../dist/esm2017/internal.js", "browser": "../dist/esm2017/internal.js", - "esm5": "../dist/esm5/internal.js", - "typings": "../dist/esm5/internal/index.d.ts", - "private": true + "typings": "../dist/esm2017/internal/index.d.ts", + "private": true, + "engines": { + "node": ">=18.0.0" + } } diff --git a/packages/auth/karma.conf.js b/packages/auth/karma.conf.js index 1d28c329f55..161f4819d32 100644 --- a/packages/auth/karma.conf.js +++ b/packages/auth/karma.conf.js @@ -27,17 +27,6 @@ module.exports = function (config) { // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha'], - // undici is a fetch polyfill that test helpers call for Node tests, and browser tests should - // ignore its import to avoid compilation errors in those test helpers. - webpack: { - ...webpackBase, - resolve: { - ...webpackBase.resolve, - alias: { - 'undici': false - } - } - }, client: Object.assign({}, karmaBase.client, getClientConfig(argv)) }); @@ -51,7 +40,8 @@ function getTestFiles(argv) { if (argv.prodbackend) { return [ 'test/integration/flows/totp.test.ts', - 'test/integration/flows/password_policy.test.ts' + 'test/integration/flows/password_policy.test.ts', + 'test/integration/flows/recaptcha_enterprise.test.ts' ]; } return argv.local diff --git a/packages/auth/package.json b/packages/auth/package.json index 5cff7192eff..f6645c35eac 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/auth", - "version": "1.7.9", + "version": "1.8.0", "description": "The Firebase Authenticaton component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/node/index.js", @@ -9,8 +9,7 @@ "module": "dist/esm2017/index.js", "cordova": "dist/cordova/index.js", "web-extension": "dist/web-extension-esm2017/index.js", - "webworker": "dist/index.webworker.esm5.js", - "esm5": "dist/esm5/index.js", + "webworker": "dist/index.webworker.js", "exports": { ".": { "types": "./dist/auth-public.d.ts", @@ -29,9 +28,8 @@ }, "webworker": { "types": "./dist/index.webworker.d.ts", - "default": "./dist/index.webworker.esm5.js" + "default": "./dist/index.webworker.js" }, - "esm5": "./dist/esm5/index.js", "browser": { "require": "./dist/browser-cjs/index.js", "import": "./dist/esm2017/index.js" @@ -63,7 +61,6 @@ "types": "./dist/cordova/internal/index.d.ts", "default": "./dist/cordova/internal.js" }, - "esm5": "./dist/esm5/internal.js", "browser": { "require": "./dist/browser-cjs/internal.js", "import": "./dist/esm2017/internal.js" @@ -127,15 +124,14 @@ } }, "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "undici": "6.19.7", + "@firebase/component": "0.6.10", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-strip": "2.1.0", "@types/express": "4.17.21", @@ -145,7 +141,7 @@ "rollup-plugin-typescript2": "0.31.2", "selenium-webdriver": "4.8.0", "totp-generator": "0.0.14", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/auth", @@ -161,5 +157,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/auth/rollup.config.js b/packages/auth/rollup.config.js index 46d3ee0380d..6af229962bd 100644 --- a/packages/auth/rollup.config.js +++ b/packages/auth/rollup.config.js @@ -44,44 +44,13 @@ const nodeAliasPlugin = alias({ ] }); -const es5BuildPlugins = [ +const buildPlugins = [ json(), - strip({ - functions: ['debugAssert.*'] - }), - typescriptPlugin({ - typescript - }) -]; - -const es2017BuildPlugins = [ - json(), - strip({ - functions: ['debugAssert.*'] - }), - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }) + strip({ functions: ['debugAssert.*'] }), + typescriptPlugin({ typescript }) ]; const browserBuilds = [ - { - input: { - index: 'index.ts', - internal: 'internal/index.ts' - }, - output: [{ dir: 'dist/esm5', format: 'es', sourcemap: true }], - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)) - ], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, { input: { index: 'index.ts', @@ -93,7 +62,7 @@ const browserBuilds = [ sourcemap: true }, plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -105,7 +74,7 @@ const browserBuilds = [ }, output: [{ dir: 'dist/browser-cjs', format: 'cjs', sourcemap: true }], plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -124,7 +93,7 @@ const browserWebExtensionBuilds = [ sourcemap: true }, plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)), emitModulePackageFile() ], @@ -137,7 +106,7 @@ const browserWebExtensionBuilds = [ }, output: [{ dir: 'dist/web-extension-cjs', format: 'cjs', sourcemap: true }], plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -153,8 +122,8 @@ const nodeBuilds = [ output: [{ dir: 'dist/node', format: 'cjs', sourcemap: true }], plugins: [ nodeAliasPlugin, - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, @@ -166,7 +135,7 @@ const nodeBuilds = [ output: [{ dir: 'dist/node-esm', format: 'es', sourcemap: true }], plugins: [ nodeAliasPlugin, - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)), emitModulePackageFile() ], @@ -179,10 +148,14 @@ const cordovaBuild = { index: 'index.cordova.ts', internal: 'internal/index.ts' }, - output: [{ dir: 'dist/cordova', format: 'es', sourcemap: true }], + output: { + dir: 'dist/cordova', + format: 'es', + sourcemap: true + }, plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('esm', 2017)) ], external: id => [...deps, 'cordova'].some(dep => id === dep || id.startsWith(`${dep}/`)) @@ -195,8 +168,8 @@ const rnBuild = { }, output: [{ dir: 'dist/rn', format: 'cjs', sourcemap: true }], plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], external: id => [...deps, 'react-native'].some( @@ -206,7 +179,11 @@ const rnBuild = { const webWorkerBuild = { input: 'index.webworker.ts', - output: [{ file: pkg.webworker, format: 'es', sourcemap: true }], + output: { + file: pkg.webworker, + format: 'es', + sourcemap: true + }, plugins: [ json(), strip({ @@ -218,12 +195,12 @@ const webWorkerBuild = { lib: [ // Remove dom after we figure out why navigator stuff doesn't exist 'dom', - 'es2015', + 'es2017', 'webworker' ] } }), - replace(generateBuildTargetReplaceConfig('esm', 5)) + replace(generateBuildTargetReplaceConfig('esm', 2017)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }; diff --git a/packages/auth/src/api/account_management/mfa.test.ts b/packages/auth/src/api/account_management/mfa.test.ts index 9f036471087..152f1fb53d3 100644 --- a/packages/auth/src/api/account_management/mfa.test.ts +++ b/packages/auth/src/api/account_management/mfa.test.ts @@ -20,7 +20,12 @@ import chaiAsPromised from 'chai-as-promised'; import { FirebaseError } from '@firebase/util'; -import { Endpoint, HttpHeader } from '../'; +import { + Endpoint, + HttpHeader, + RecaptchaClientType, + RecaptchaVersion +} from '../'; import { mockEndpoint } from '../../../test/helpers/api/helper'; import { testAuth, TestAuth } from '../../../test/helpers/mock_auth'; import * as mockFetch from '../../../test/helpers/mock_fetch'; @@ -40,7 +45,10 @@ describe('api/account_management/startEnrollPhoneMfa', () => { idToken: 'id-token', phoneEnrollmentInfo: { phoneNumber: 'phone-number', - recaptchaToken: 'captcha-token' + recaptchaToken: 'captcha-token', + captchaResponse: 'captcha-response', + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE } }; diff --git a/packages/auth/src/api/account_management/mfa.ts b/packages/auth/src/api/account_management/mfa.ts index db9a4120d3d..f43217e8abf 100644 --- a/packages/auth/src/api/account_management/mfa.ts +++ b/packages/auth/src/api/account_management/mfa.ts @@ -18,6 +18,8 @@ import { Endpoint, HttpMethod, + RecaptchaClientType, + RecaptchaVersion, _addTidIfNecessary, _performApiRequest } from '../index'; @@ -55,7 +57,12 @@ export interface StartPhoneMfaEnrollmentRequest { idToken: string; phoneEnrollmentInfo: { phoneNumber: string; - recaptchaToken: string; + // reCAPTCHA v2 token + recaptchaToken?: string; + // reCAPTCHA Enterprise token + captchaResponse?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; }; tenantId?: string; } diff --git a/packages/auth/src/api/authentication/mfa.test.ts b/packages/auth/src/api/authentication/mfa.test.ts index fd7d811ec36..5574136f999 100644 --- a/packages/auth/src/api/authentication/mfa.test.ts +++ b/packages/auth/src/api/authentication/mfa.test.ts @@ -20,7 +20,12 @@ import chaiAsPromised from 'chai-as-promised'; import { FirebaseError } from '@firebase/util'; -import { Endpoint, HttpHeader } from '../'; +import { + Endpoint, + HttpHeader, + RecaptchaClientType, + RecaptchaVersion +} from '../'; import { mockEndpoint } from '../../../test/helpers/api/helper'; import { testAuth, TestAuth } from '../../../test/helpers/mock_auth'; import * as mockFetch from '../../../test/helpers/mock_fetch'; @@ -34,7 +39,10 @@ describe('api/authentication/startSignInPhoneMfa', () => { mfaPendingCredential: 'my-creds', mfaEnrollmentId: 'my-enrollment-id', phoneSignInInfo: { - recaptchaToken: 'captcha-token' + recaptchaToken: 'captcha-token', + captchaResponse: 'captcha-response', + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE } }; diff --git a/packages/auth/src/api/authentication/mfa.ts b/packages/auth/src/api/authentication/mfa.ts index 0ad85a7ef82..c6dc6854e98 100644 --- a/packages/auth/src/api/authentication/mfa.ts +++ b/packages/auth/src/api/authentication/mfa.ts @@ -19,6 +19,8 @@ import { _performApiRequest, Endpoint, HttpMethod, + RecaptchaClientType, + RecaptchaVersion, _addTidIfNecessary } from '../index'; import { Auth } from '../../model/public_types'; @@ -47,7 +49,12 @@ export interface StartPhoneMfaSignInRequest { mfaPendingCredential: string; mfaEnrollmentId: string; phoneSignInInfo: { - recaptchaToken: string; + // reCAPTCHA v2 token + recaptchaToken?: string; + // reCAPTCHA Enterprise token + captchaResponse?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; }; tenantId?: string; } diff --git a/packages/auth/src/api/authentication/sms.test.ts b/packages/auth/src/api/authentication/sms.test.ts index 420797b1c97..d72e7973077 100644 --- a/packages/auth/src/api/authentication/sms.test.ts +++ b/packages/auth/src/api/authentication/sms.test.ts @@ -21,7 +21,12 @@ import chaiAsPromised from 'chai-as-promised'; import { ProviderId } from '../../model/enums'; import { FirebaseError } from '@firebase/util'; -import { Endpoint, HttpHeader } from '../'; +import { + Endpoint, + HttpHeader, + RecaptchaClientType, + RecaptchaVersion +} from '../'; import { mockEndpoint } from '../../../test/helpers/api/helper'; import { testAuth, TestAuth } from '../../../test/helpers/mock_auth'; import * as mockFetch from '../../../test/helpers/mock_fetch'; @@ -38,7 +43,10 @@ use(chaiAsPromised); describe('api/authentication/sendPhoneVerificationCode', () => { const request = { phoneNumber: '123456789', - recaptchaToken: 'captchad' + recaptchaToken: 'captchad', + captchaResponse: 'captcha-response', + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE }; let auth: TestAuth; diff --git a/packages/auth/src/api/authentication/sms.ts b/packages/auth/src/api/authentication/sms.ts index 93a8a2e5abf..26db0634288 100644 --- a/packages/auth/src/api/authentication/sms.ts +++ b/packages/auth/src/api/authentication/sms.ts @@ -18,6 +18,8 @@ import { Endpoint, HttpMethod, + RecaptchaClientType, + RecaptchaVersion, _addTidIfNecessary, _makeTaggedError, _performApiRequest, @@ -30,8 +32,13 @@ import { Auth } from '../../model/public_types'; export interface SendPhoneVerificationCodeRequest { phoneNumber: string; - recaptchaToken: string; + // reCAPTCHA v2 token + recaptchaToken?: string; tenantId?: string; + // reCAPTCHA Enterprise token + captchaResponse?: string; + clientType?: RecaptchaClientType; + recaptchaVersion?: RecaptchaVersion; } export interface SendPhoneVerificationCodeResponse { diff --git a/packages/auth/src/api/index.ts b/packages/auth/src/api/index.ts index 12d89b2bd7d..4813ace9507 100644 --- a/packages/auth/src/api/index.ts +++ b/packages/auth/src/api/index.ts @@ -86,7 +86,10 @@ export const enum RecaptchaVersion { export const enum RecaptchaActionName { SIGN_IN_WITH_PASSWORD = 'signInWithPassword', GET_OOB_CODE = 'getOobCode', - SIGN_UP_PASSWORD = 'signUpPassword' + SIGN_UP_PASSWORD = 'signUpPassword', + SEND_VERIFICATION_CODE = 'sendVerificationCode', + MFA_SMS_ENROLLMENT = 'mfaSmsEnrollment', + MFA_SMS_SIGNIN = 'mfaSmsSignIn' } export const enum EnforcementState { @@ -97,8 +100,9 @@ export const enum EnforcementState { } // Providers that have reCAPTCHA Enterprise support. -export const enum RecaptchaProvider { - EMAIL_PASSWORD_PROVIDER = 'EMAIL_PASSWORD_PROVIDER' +export const enum RecaptchaAuthProvider { + EMAIL_PASSWORD_PROVIDER = 'EMAIL_PASSWORD_PROVIDER', + PHONE_PROVIDER = 'PHONE_PROVIDER' } export const DEFAULT_API_TIMEOUT_MS = new Delay(30_000, 60_000); @@ -237,20 +241,20 @@ export async function _performSignInRequest( request?: T, customErrorMap: Partial> = {} ): Promise { - const serverResponse = (await _performApiRequest( + const serverResponse = await _performApiRequest( auth, method, path, request, customErrorMap - )) as V; + ); if ('mfaPendingCredential' in serverResponse) { _fail(auth, AuthErrorCode.MFA_REQUIRED, { _serverResponse: serverResponse }); } - return serverResponse; + return serverResponse as V; } export function _getFinalTarget( diff --git a/packages/auth/src/core/auth/register.ts b/packages/auth/src/core/auth/register.ts index 4b891618d3a..9d0d6b4559d 100644 --- a/packages/auth/src/core/auth/register.ts +++ b/packages/auth/src/core/auth/register.ts @@ -130,6 +130,6 @@ export function registerAuth(clientPlatform: ClientPlatform): void { ); registerVersion(name, version, getVersionForPlatform(clientPlatform)); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/auth/src/core/credentials/email.test.ts b/packages/auth/src/core/credentials/email.test.ts index 3ed3cc5a81f..c18958460fa 100644 --- a/packages/auth/src/core/credentials/email.test.ts +++ b/packages/auth/src/core/credentials/email.test.ts @@ -137,6 +137,7 @@ describe('core/credentials/email', () => { beforeEach(async () => { auth = await testAuth(); + auth.settings.appVerificationDisabledForTesting = false; }); context('email & password', () => { diff --git a/packages/auth/src/core/credentials/email.ts b/packages/auth/src/core/credentials/email.ts index 4a3186ef2a4..9399296a59d 100644 --- a/packages/auth/src/core/credentials/email.ts +++ b/packages/auth/src/core/credentials/email.ts @@ -32,7 +32,11 @@ import { AuthErrorCode } from '../errors'; import { _fail } from '../util/assert'; import { AuthCredential } from './auth_credential'; import { handleRecaptchaFlow } from '../../platform_browser/recaptcha/recaptcha_enterprise_verifier'; -import { RecaptchaActionName, RecaptchaClientType } from '../../api'; +import { + RecaptchaActionName, + RecaptchaClientType, + RecaptchaAuthProvider +} from '../../api'; import { SignUpRequest } from '../../api/authentication/sign_up'; /** * Interface that represents the credentials returned by {@link EmailAuthProvider} for @@ -128,7 +132,8 @@ export class EmailAuthCredential extends AuthCredential { auth, request, RecaptchaActionName.SIGN_IN_WITH_PASSWORD, - signInWithPassword + signInWithPassword, + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER ); case SignInMethod.EMAIL_LINK: return signInWithEmailLink(auth, { @@ -158,7 +163,8 @@ export class EmailAuthCredential extends AuthCredential { auth, request, RecaptchaActionName.SIGN_UP_PASSWORD, - linkEmailPassword + linkEmailPassword, + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER ); case SignInMethod.EMAIL_LINK: return signInWithEmailLinkForLinking(auth, { diff --git a/packages/auth/src/core/strategies/email_and_password.test.ts b/packages/auth/src/core/strategies/email_and_password.test.ts index 95fe8c8c06c..047e86dc17f 100644 --- a/packages/auth/src/core/strategies/email_and_password.test.ts +++ b/packages/auth/src/core/strategies/email_and_password.test.ts @@ -74,6 +74,7 @@ describe('core/strategies/sendPasswordResetEmail', () => { beforeEach(async () => { auth = await testAuth(); + auth.settings.appVerificationDisabledForTesting = false; mockFetch.setUp(); }); diff --git a/packages/auth/src/core/strategies/email_and_password.ts b/packages/auth/src/core/strategies/email_and_password.ts index f98ef683a92..fbfa871bc7c 100644 --- a/packages/auth/src/core/strategies/email_and_password.ts +++ b/packages/auth/src/core/strategies/email_and_password.ts @@ -41,7 +41,11 @@ import { getModularInstance } from '@firebase/util'; import { OperationType } from '../../model/enums'; import { handleRecaptchaFlow } from '../../platform_browser/recaptcha/recaptcha_enterprise_verifier'; import { IdTokenResponse } from '../../model/id_token'; -import { RecaptchaActionName, RecaptchaClientType } from '../../api'; +import { + RecaptchaActionName, + RecaptchaClientType, + RecaptchaAuthProvider +} from '../../api'; import { _isFirebaseServerApp } from '@firebase/app'; /** @@ -117,7 +121,8 @@ export async function sendPasswordResetEmail( authInternal, request, RecaptchaActionName.GET_OOB_CODE, - authentication.sendPasswordResetEmail + authentication.sendPasswordResetEmail, + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER ); } @@ -291,7 +296,8 @@ export async function createUserWithEmailAndPassword( authInternal, request, RecaptchaActionName.SIGN_UP_PASSWORD, - signUp + signUp, + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER ); const response = await signUpResponse.catch(error => { if ( diff --git a/packages/auth/src/core/strategies/email_link.test.ts b/packages/auth/src/core/strategies/email_link.test.ts index 945da88e47b..97f8cdc7c7a 100644 --- a/packages/auth/src/core/strategies/email_link.test.ts +++ b/packages/auth/src/core/strategies/email_link.test.ts @@ -58,6 +58,7 @@ describe('core/strategies/sendSignInLinkToEmail', () => { beforeEach(async () => { auth = await testAuth(); + auth.settings.appVerificationDisabledForTesting = false; mockFetch.setUp(); }); diff --git a/packages/auth/src/core/strategies/email_link.ts b/packages/auth/src/core/strategies/email_link.ts index 351583a6bb5..0049f1ef95e 100644 --- a/packages/auth/src/core/strategies/email_link.ts +++ b/packages/auth/src/core/strategies/email_link.ts @@ -33,7 +33,11 @@ import { _assert } from '../util/assert'; import { getModularInstance } from '@firebase/util'; import { _castAuth } from '../auth/auth_impl'; import { handleRecaptchaFlow } from '../../platform_browser/recaptcha/recaptcha_enterprise_verifier'; -import { RecaptchaActionName, RecaptchaClientType } from '../../api'; +import { + RecaptchaActionName, + RecaptchaClientType, + RecaptchaAuthProvider +} from '../../api'; import { _isFirebaseServerApp } from '@firebase/app'; import { _serverAppCurrentUserOperationNotSupportedError } from '../../core/util/assert'; @@ -108,7 +112,8 @@ export async function sendSignInLinkToEmail( authInternal, request, RecaptchaActionName.GET_OOB_CODE, - api.sendSignInLinkToEmail + api.sendSignInLinkToEmail, + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER ); } diff --git a/packages/auth/src/platform_browser/providers/phone.test.ts b/packages/auth/src/platform_browser/providers/phone.test.ts index 9293b5e4ee6..752aa2a892d 100644 --- a/packages/auth/src/platform_browser/providers/phone.test.ts +++ b/packages/auth/src/platform_browser/providers/phone.test.ts @@ -15,22 +15,45 @@ * limitations under the License. */ -import { expect } from 'chai'; +import { expect, use } from 'chai'; +import chaiAsPromised from 'chai-as-promised'; import * as sinon from 'sinon'; -import { mockEndpoint } from '../../../test/helpers/api/helper'; +import { FirebaseError } from '@firebase/util'; + +import { + mockEndpoint, + mockEndpointWithParams +} from '../../../test/helpers/api/helper'; import { testAuth, TestAuth } from '../../../test/helpers/mock_auth'; import * as fetch from '../../../test/helpers/mock_fetch'; -import { Endpoint } from '../../api'; +import { + Endpoint, + RecaptchaClientType, + RecaptchaVersion, + RecaptchaAuthProvider, + EnforcementState +} from '../../api'; import { RecaptchaVerifier } from '../../platform_browser/recaptcha/recaptcha_verifier'; import { PhoneAuthProvider } from './phone'; +import { FAKE_TOKEN } from '../recaptcha/recaptcha_enterprise_verifier'; +import { MockGreCAPTCHATopLevel } from '../recaptcha/recaptcha_mock'; +import { ApplicationVerifierInternal } from '../../model/application_verifier'; + +use(chaiAsPromised); describe('platform_browser/providers/phone', () => { let auth: TestAuth; + let v2Verifier: ApplicationVerifierInternal; beforeEach(async () => { fetch.setUp(); auth = await testAuth(); + auth.settings.appVerificationDisabledForTesting = false; + v2Verifier = new RecaptchaVerifier(auth, document.createElement('div'), {}); + sinon + .stub(v2Verifier, 'verify') + .returns(Promise.resolve('verification-code')); }); afterEach(() => { @@ -39,26 +62,173 @@ describe('platform_browser/providers/phone', () => { }); context('#verifyPhoneNumber', () => { - it('calls verify on the appVerifier and then calls the server', async () => { + it('calls verify on the appVerifier and then calls the server when recaptcha enterprise is disabled', async () => { + const recaptchaConfigResponseOff = { + // no recaptcha key if no rCE provider is enabled + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.OFF + } + ] + }; + const recaptcha = new MockGreCAPTCHATopLevel(); + if (typeof window === 'undefined') { + return; + } + window.grecaptcha = recaptcha; + sinon + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve('enterprise-token')); + + mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + { + clientType: RecaptchaClientType.WEB, + version: RecaptchaVersion.ENTERPRISE + }, + recaptchaConfigResponseOff + ); + const route = mockEndpoint(Endpoint.SEND_VERIFICATION_CODE, { sessionInfo: 'verification-id' }); - const verifier = new RecaptchaVerifier( - auth, - document.createElement('div'), - {} + const provider = new PhoneAuthProvider(auth); + const result = await provider.verifyPhoneNumber( + '+15105550000', + v2Verifier + ); + expect(result).to.eq('verification-id'); + expect(route.calls[0].request).to.eql({ + phoneNumber: '+15105550000', + recaptchaToken: 'verification-code', + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('throws an error if verify without appVerifier when recaptcha enterprise is disabled', async () => { + const recaptchaConfigResponseOff = { + // no recaptcha key if no rCE provider is enabled + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.OFF + } + ] + }; + const recaptcha = new MockGreCAPTCHATopLevel(); + if (typeof window === 'undefined') { + return; + } + window.grecaptcha = recaptcha; + sinon + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve('enterprise-token')); + + mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + { + clientType: RecaptchaClientType.WEB, + version: RecaptchaVersion.ENTERPRISE + }, + recaptchaConfigResponseOff + ); + + const provider = new PhoneAuthProvider(auth); + await expect( + provider.verifyPhoneNumber('+15105550000') + ).to.be.rejectedWith(FirebaseError, 'auth/argument-error'); + }); + + it('calls the server without appVerifier when recaptcha enterprise is enabled', async () => { + const recaptchaConfigResponseEnforce = { + recaptchaKey: 'foo/bar/to/site-key', + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.ENFORCE + } + ] + }; + const recaptcha = new MockGreCAPTCHATopLevel(); + if (typeof window === 'undefined') { + return; + } + window.grecaptcha = recaptcha; + sinon + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve('enterprise-token')); + + mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + { + clientType: RecaptchaClientType.WEB, + version: RecaptchaVersion.ENTERPRISE + }, + recaptchaConfigResponseEnforce ); + + const route = mockEndpoint(Endpoint.SEND_VERIFICATION_CODE, { + sessionInfo: 'verification-id' + }); + + const provider = new PhoneAuthProvider(auth); + const result = await provider.verifyPhoneNumber('+15105550000'); + expect(result).to.eq('verification-id'); + expect(route.calls[0].request).to.eql({ + phoneNumber: '+15105550000', + captchaResponse: 'enterprise-token', + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('calls the server when recaptcha enterprise is enabled', async () => { + const recaptchaConfigResponseEnforce = { + recaptchaKey: 'foo/bar/to/site-key', + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.ENFORCE + } + ] + }; + const recaptcha = new MockGreCAPTCHATopLevel(); + if (typeof window === 'undefined') { + return; + } + window.grecaptcha = recaptcha; sinon - .stub(verifier, 'verify') - .returns(Promise.resolve('verification-code')); + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve('enterprise-token')); + + mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + { + clientType: RecaptchaClientType.WEB, + version: RecaptchaVersion.ENTERPRISE + }, + recaptchaConfigResponseEnforce + ); + + const route = mockEndpoint(Endpoint.SEND_VERIFICATION_CODE, { + sessionInfo: 'verification-id' + }); const provider = new PhoneAuthProvider(auth); - const result = await provider.verifyPhoneNumber('+15105550000', verifier); + const result = await provider.verifyPhoneNumber( + '+15105550000', + v2Verifier + ); expect(result).to.eq('verification-id'); expect(route.calls[0].request).to.eql({ phoneNumber: '+15105550000', - recaptchaToken: 'verification-code' + captchaResponse: 'enterprise-token', + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE }); }); }); diff --git a/packages/auth/src/platform_browser/providers/phone.ts b/packages/auth/src/platform_browser/providers/phone.ts index 2b5c0874b70..f67d82e1792 100644 --- a/packages/auth/src/platform_browser/providers/phone.ts +++ b/packages/auth/src/platform_browser/providers/phone.ts @@ -95,16 +95,18 @@ export class PhoneAuthProvider { * * @param phoneInfoOptions - The user's {@link PhoneInfoOptions}. The phone number should be in * E.164 format (e.g. +16505550101). - * @param applicationVerifier - For abuse prevention, this method also requires a - * {@link ApplicationVerifier}. This SDK includes a reCAPTCHA-based implementation, - * {@link RecaptchaVerifier}. + * @param applicationVerifier - An {@link ApplicationVerifier}, which prevents + * requests from unauthorized clients. This SDK includes an implementation + * based on reCAPTCHA v2, {@link RecaptchaVerifier}. If you've enabled + * reCAPTCHA Enterprise bot protection in Enforce mode, this parameter is + * optional; in all other configurations, the parameter is required. * * @returns A Promise for a verification ID that can be passed to - * {@link PhoneAuthProvider.credential} to identify this flow.. + * {@link PhoneAuthProvider.credential} to identify this flow. */ verifyPhoneNumber( phoneOptions: PhoneInfoOptions | string, - applicationVerifier: ApplicationVerifier + applicationVerifier?: ApplicationVerifier ): Promise { return _verifyPhoneNumber( this.auth, diff --git a/packages/auth/src/platform_browser/recaptcha/recaptcha.test.ts b/packages/auth/src/platform_browser/recaptcha/recaptcha.test.ts index 42a758840f6..1fd4de730d0 100644 --- a/packages/auth/src/platform_browser/recaptcha/recaptcha.test.ts +++ b/packages/auth/src/platform_browser/recaptcha/recaptcha.test.ts @@ -29,7 +29,7 @@ import { import { isV2, isEnterprise, RecaptchaConfig } from './recaptcha'; import { GetRecaptchaConfigResponse } from '../../api/authentication/recaptcha'; -import { EnforcementState } from '../../api/index'; +import { EnforcementState, RecaptchaAuthProvider } from '../../api/index'; use(chaiAsPromised); use(sinonChai); @@ -39,17 +39,60 @@ describe('platform_browser/recaptcha/recaptcha', () => { let recaptchaV2: MockReCaptcha; let recaptchaV3: MockGreCAPTCHA; let recaptchaEnterprise: MockGreCAPTCHATopLevel; - let recaptchaConfig: RecaptchaConfig; const TEST_SITE_KEY = 'test-site-key'; const GET_RECAPTCHA_CONFIG_RESPONSE: GetRecaptchaConfigResponse = { recaptchaKey: 'projects/testproj/keys/' + TEST_SITE_KEY, recaptchaEnforcementState: [ - { provider: 'EMAIL_PASSWORD_PROVIDER', enforcementState: 'ENFORCE' } + { + provider: RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER, + enforcementState: EnforcementState.ENFORCE + }, + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.AUDIT + } ] }; + const GET_RECAPTCHA_CONFIG_RESPONSE_OFF: GetRecaptchaConfigResponse = { + recaptchaKey: 'projects/testproj/keys/' + TEST_SITE_KEY, + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER, + enforcementState: EnforcementState.OFF + }, + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.OFF + } + ] + }; + + const GET_RECAPTCHA_CONFIG_RESPONSE_ENFORCE_AND_OFF: GetRecaptchaConfigResponse = + { + recaptchaKey: 'projects/testproj/keys/' + TEST_SITE_KEY, + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER, + enforcementState: EnforcementState.ENFORCE + }, + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.OFF + } + ] + }; + + const recaptchaConfig = new RecaptchaConfig(GET_RECAPTCHA_CONFIG_RESPONSE); + const recaptchaConfigOff = new RecaptchaConfig( + GET_RECAPTCHA_CONFIG_RESPONSE_OFF + ); + const recaptchaConfigEnforceAndOff = new RecaptchaConfig( + GET_RECAPTCHA_CONFIG_RESPONSE_ENFORCE_AND_OFF + ); + context('#verify', () => { beforeEach(async () => { auth = await testAuth(); @@ -74,30 +117,63 @@ describe('platform_browser/recaptcha/recaptcha', () => { }); context('#RecaptchaConfig', () => { - beforeEach(async () => { - recaptchaConfig = new RecaptchaConfig(GET_RECAPTCHA_CONFIG_RESPONSE); - }); - it('should construct the recaptcha config from the backend response', () => { expect(recaptchaConfig.siteKey).to.eq(TEST_SITE_KEY); expect(recaptchaConfig.recaptchaEnforcementState[0]).to.eql({ - provider: 'EMAIL_PASSWORD_PROVIDER', - enforcementState: 'ENFORCE' + provider: RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER, + enforcementState: EnforcementState.ENFORCE + }); + expect(recaptchaConfig.recaptchaEnforcementState[1]).to.eql({ + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.AUDIT + }); + expect(recaptchaConfigEnforceAndOff.recaptchaEnforcementState[1]).to.eql({ + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.OFF }); }); it('#getProviderEnforcementState should return the correct enforcement state of the provider', () => { expect( - recaptchaConfig.getProviderEnforcementState('EMAIL_PASSWORD_PROVIDER') + recaptchaConfig.getProviderEnforcementState( + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER + ) ).to.eq(EnforcementState.ENFORCE); + expect( + recaptchaConfig.getProviderEnforcementState( + RecaptchaAuthProvider.PHONE_PROVIDER + ) + ).to.eq(EnforcementState.AUDIT); + expect( + recaptchaConfigEnforceAndOff.getProviderEnforcementState( + RecaptchaAuthProvider.PHONE_PROVIDER + ) + ).to.eq(EnforcementState.OFF); expect(recaptchaConfig.getProviderEnforcementState('invalid-provider')).to .be.null; }); it('#isProviderEnabled should return the enablement state of the provider', () => { - expect(recaptchaConfig.isProviderEnabled('EMAIL_PASSWORD_PROVIDER')).to.be - .true; + expect( + recaptchaConfig.isProviderEnabled( + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER + ) + ).to.be.true; + expect( + recaptchaConfig.isProviderEnabled(RecaptchaAuthProvider.PHONE_PROVIDER) + ).to.be.true; + expect( + recaptchaConfigEnforceAndOff.isProviderEnabled( + RecaptchaAuthProvider.PHONE_PROVIDER + ) + ).to.be.false; expect(recaptchaConfig.isProviderEnabled('invalid-provider')).to.be.false; }); + + it('#isAnyProviderEnabled should return true if at least one provider is enabled', () => { + expect(recaptchaConfig.isAnyProviderEnabled()).to.be.true; + expect(recaptchaConfigEnforceAndOff.isAnyProviderEnabled()).to.be.true; + expect(recaptchaConfigOff.isAnyProviderEnabled()).to.be.false; + }); }); }); diff --git a/packages/auth/src/platform_browser/recaptcha/recaptcha.ts b/packages/auth/src/platform_browser/recaptcha/recaptcha.ts index bb1b79895c0..c84f25d139f 100644 --- a/packages/auth/src/platform_browser/recaptcha/recaptcha.ts +++ b/packages/auth/src/platform_browser/recaptcha/recaptcha.ts @@ -20,7 +20,11 @@ import { GetRecaptchaConfigResponse, RecaptchaEnforcementProviderState } from '../../api/authentication/recaptcha'; -import { EnforcementState, _parseEnforcementState } from '../../api/index'; +import { + EnforcementState, + RecaptchaAuthProvider, + _parseEnforcementState +} from '../../api/index'; // reCAPTCHA v2 interface export interface Recaptcha { @@ -135,4 +139,17 @@ export class RecaptchaConfig { this.getProviderEnforcementState(providerStr) === EnforcementState.AUDIT ); } + + /** + * Returns true if reCAPTCHA Enterprise protection is enabled in at least one provider, otherwise + * returns false. + * + * @returns Whether or not reCAPTCHA Enterprise protection is enabled for at least one provider. + */ + isAnyProviderEnabled(): boolean { + return ( + this.isProviderEnabled(RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER) || + this.isProviderEnabled(RecaptchaAuthProvider.PHONE_PROVIDER) + ); + } } diff --git a/packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.ts b/packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.ts index ecbe6c0232d..b2510d34929 100644 --- a/packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.ts +++ b/packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.ts @@ -24,7 +24,9 @@ import { Endpoint, RecaptchaClientType, RecaptchaVersion, - RecaptchaActionName + RecaptchaActionName, + RecaptchaAuthProvider, + EnforcementState } from '../../api'; import { mockEndpointWithParams } from '../../../test/helpers/api/helper'; import { testAuth, TestAuth } from '../../../test/helpers/mock_auth'; @@ -36,7 +38,8 @@ import { MockGreCAPTCHATopLevel } from './recaptcha_mock'; import { RecaptchaEnterpriseVerifier, FAKE_TOKEN, - handleRecaptchaFlow + handleRecaptchaFlow, + injectRecaptchaFields } from './recaptcha_enterprise_verifier'; import { RecaptchaConfig } from './recaptcha'; import { AuthErrorCode } from '../../core/errors'; @@ -53,8 +56,12 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => { recaptchaKey: 'foo/bar/to/site-key', recaptchaEnforcementState: [ { - provider: 'EMAIL_PASSWORD_PROVIDER', - enforcementState: 'ENFORCE' + provider: RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER, + enforcementState: EnforcementState.ENFORCE + }, + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.ENFORCE } ] }; @@ -65,17 +72,47 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => { recaptchaKey: 'foo/bar/to/site-key', recaptchaEnforcementState: [ { - provider: 'EMAIL_PASSWORD_PROVIDER', - enforcementState: 'OFF' + provider: RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER, + enforcementState: EnforcementState.OFF + }, + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.OFF } ] }; const recaptchaConfigOff = new RecaptchaConfig(recaptchaConfigResponseOff); + const recaptchaConfigResponseAudit = { + recaptchaKey: 'foo/bar/to/site-key', + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER, + enforcementState: EnforcementState.AUDIT + }, + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.AUDIT + } + ] + }; + const recaptchaConfigAudit = new RecaptchaConfig( + recaptchaConfigResponseAudit + ); + + const getRecaptchaConfigRequest = { + clientType: RecaptchaClientType.WEB, + version: RecaptchaVersion.ENTERPRISE + }; + + let recaptcha: MockGreCAPTCHATopLevel; beforeEach(async () => { auth = await testAuth(); + auth.settings.appVerificationDisabledForTesting = false; mockFetch.setUp(); verifier = new RecaptchaEnterpriseVerifier(auth); + recaptcha = new MockGreCAPTCHATopLevel(); + window.grecaptcha = recaptcha; }); afterEach(() => { @@ -84,21 +121,10 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => { }); context('#verify', () => { - const request = { - clientType: RecaptchaClientType.WEB, - version: RecaptchaVersion.ENTERPRISE - }; - - let recaptcha: MockGreCAPTCHATopLevel; - beforeEach(() => { - recaptcha = new MockGreCAPTCHATopLevel(); - window.grecaptcha = recaptcha; - }); - it('returns if response is available', async () => { mockEndpointWithParams( Endpoint.GET_RECAPTCHA_CONFIG, - request, + getRecaptchaConfigRequest, recaptchaConfigResponseEnforce ); sinon @@ -110,7 +136,7 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => { it('reject if error is thrown when retrieve site key', async () => { mockEndpointWithParams( Endpoint.GET_RECAPTCHA_CONFIG, - request, + getRecaptchaConfigRequest, { error: { code: 400, @@ -131,7 +157,7 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => { it('return fake recaptcha token if error is thrown when retrieve recaptcha token', async () => { mockEndpointWithParams( Endpoint.GET_RECAPTCHA_CONFIG, - request, + getRecaptchaConfigRequest, recaptchaConfigResponseEnforce ); sinon @@ -141,55 +167,51 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => { }); }); - context('handleRecaptchaFlow', () => { + context('#handleRecaptchaFlow', () => { let mockAuthInstance: AuthInternal; let mockRequest: any; let mockActionMethod: sinon.SinonStub; beforeEach(async () => { mockAuthInstance = await testAuth(); - mockRequest = {}; + mockRequest = { foo: 'bar' }; mockActionMethod = sinon.stub(); + sinon + .stub(RecaptchaEnterpriseVerifier.prototype, 'verify') + .resolves('recaptcha-response'); }); afterEach(() => { sinon.restore(); }); - it('should call actionMethod with request if emailPasswordEnabled is true', async () => { + it('EMAIL_PASSWORD_PROVIDER - should call actionMethod with request if recaptcha enterprise is enabled', async () => { if (typeof window === 'undefined') { return; } sinon .stub(mockAuthInstance, '_getRecaptchaConfig') .returns(recaptchaConfigEnforce); - sinon - .stub(RecaptchaEnterpriseVerifier.prototype, 'verify') - .resolves('recaptcha-response'); - mockRequest = { foo: 'bar' }; mockActionMethod = sinon.stub().resolves('testResponse'); const response = await handleRecaptchaFlow( mockAuthInstance, mockRequest, RecaptchaActionName.SIGN_IN_WITH_PASSWORD, - mockActionMethod + mockActionMethod, + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER ); expect(mockActionMethod).to.have.been.calledOnce; expect(response).to.equal('testResponse'); }); - // "Errors like "MISSING_RECAPTCHA_TOKEN" will be handled irrespective of the enablement status of "emailPasswordEnabled", but this test verifies the more likely scenario where emailPasswordEnabled is false" - it('should handle MISSING_RECAPTCHA_TOKEN error when emailPasswordEnabled is false', async () => { + // "Errors like "MISSING_RECAPTCHA_TOKEN" will be handled irrespective of the enablement status of EMAIL_PASSWORD_PROVIDER, but this test verifies the more likely scenario where EMAIL_PASSWORD_PROVIDER is disabled" + it('EMAIL_PASSWORD_PROVIDER - should handle MISSING_RECAPTCHA_TOKEN error when recaptcha enterprise is disabled', async () => { if (typeof window === 'undefined') { return; } sinon .stub(mockAuthInstance, '_getRecaptchaConfig') .returns(recaptchaConfigOff); - sinon - .stub(RecaptchaEnterpriseVerifier.prototype, 'verify') - .resolves('recaptcha-response'); - mockRequest = { foo: 'bar' }; let callCount = 0; mockActionMethod = sinon.stub().callsFake(() => { callCount++; @@ -205,23 +227,20 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => { mockAuthInstance, mockRequest, RecaptchaActionName.SIGN_IN_WITH_PASSWORD, - mockActionMethod + mockActionMethod, + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER ); expect(mockActionMethod).to.have.been.calledTwice; expect(response).to.equal('testResponse'); }); - it('should handle non MISSING_RECAPTCHA_TOKEN error when emailPasswordEnabled is false', async () => { + it('EMAIL_PASSWORD_PROVIDER - should handle non MISSING_RECAPTCHA_TOKEN error when recaptcha enterprise is disabled', async () => { if (typeof window === 'undefined') { return; } sinon .stub(mockAuthInstance, '_getRecaptchaConfig') .returns(recaptchaConfigOff); - sinon - .stub(RecaptchaEnterpriseVerifier.prototype, 'verify') - .resolves('recaptcha-response'); - mockRequest = { foo: 'bar' }; let callCount = 0; mockActionMethod = sinon.stub().callsFake(() => { callCount++; @@ -238,12 +257,266 @@ describe('platform_browser/recaptcha/recaptcha_enterprise_verifier', () => { mockAuthInstance, mockRequest, RecaptchaActionName.SIGN_IN_WITH_PASSWORD, - mockActionMethod + mockActionMethod, + RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER ); await expect(response).to.be.rejectedWith( AuthErrorCode.RECAPTCHA_NOT_ENABLED ); expect(mockActionMethod).to.have.been.calledOnce; }); + + it('PHONE_PROVIDER - should call actionMethod with request if recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + sinon + .stub(mockAuthInstance, '_getRecaptchaConfig') + .returns(recaptchaConfigEnforce); + mockActionMethod = sinon.stub().resolves('testResponse'); + const response = await handleRecaptchaFlow( + mockAuthInstance, + mockRequest, + RecaptchaActionName.SEND_VERIFICATION_CODE, + mockActionMethod, + RecaptchaAuthProvider.PHONE_PROVIDER + ); + expect(mockActionMethod).to.have.been.calledOnce; + expect(response).to.equal('testResponse'); + }); + + it('PHONE_PROVIDER - should handle MISSING_RECAPTCHA_TOKEN error when the enforcement state is audit', async () => { + if (typeof window === 'undefined') { + return; + } + sinon + .stub(mockAuthInstance, '_getRecaptchaConfig') + .returns(recaptchaConfigAudit); + let callCount = 0; + mockActionMethod = sinon.stub().callsFake(() => { + callCount++; + if (callCount === 1) { + return Promise.reject( + _createError(AuthErrorCode.MISSING_RECAPTCHA_TOKEN) + ); + } else { + return Promise.resolve('testResponse'); + } + }); + const response = await handleRecaptchaFlow( + mockAuthInstance, + mockRequest, + RecaptchaActionName.SEND_VERIFICATION_CODE, + mockActionMethod, + RecaptchaAuthProvider.PHONE_PROVIDER + ); + expect(mockActionMethod).to.have.been.calledTwice; + expect(response).to.equal('testResponse'); + }); + + it('PHONE_PROVIDER - should handle INVALID_APP_CREDENTIAL error when the enforcement state is audit', async () => { + if (typeof window === 'undefined') { + return; + } + sinon + .stub(mockAuthInstance, '_getRecaptchaConfig') + .returns(recaptchaConfigAudit); + let callCount = 0; + mockActionMethod = sinon.stub().callsFake(() => { + callCount++; + if (callCount === 1) { + return Promise.reject( + _createError(AuthErrorCode.INVALID_APP_CREDENTIAL) + ); + } else { + return Promise.resolve('testResponse'); + } + }); + const response = await handleRecaptchaFlow( + mockAuthInstance, + mockRequest, + RecaptchaActionName.SEND_VERIFICATION_CODE, + mockActionMethod, + RecaptchaAuthProvider.PHONE_PROVIDER + ); + expect(mockActionMethod).to.have.been.calledTwice; + expect(response).to.equal('testResponse'); + }); + + it('PHONE_PROVIDER - should handle non MISSING_RECAPTCHA_TOKEN and non INVALID_APP_CREDENTIAL error', async () => { + if (typeof window === 'undefined') { + return; + } + sinon + .stub(mockAuthInstance, '_getRecaptchaConfig') + .returns(recaptchaConfigAudit); + let callCount = 0; + mockActionMethod = sinon.stub().callsFake(() => { + callCount++; + if (callCount === 1) { + return Promise.reject( + _createError(AuthErrorCode.INVALID_RECAPTCHA_TOKEN) + ); + } else { + return Promise.resolve('testResponse'); + } + }); + + const response = handleRecaptchaFlow( + mockAuthInstance, + mockRequest, + RecaptchaActionName.SEND_VERIFICATION_CODE, + mockActionMethod, + RecaptchaAuthProvider.PHONE_PROVIDER + ); + await expect(response).to.be.rejectedWith( + AuthErrorCode.INVALID_RECAPTCHA_TOKEN + ); + expect(mockActionMethod).to.have.been.calledOnce; + }); + }); + + context('#injectRecaptchaFields', () => { + it('injects recaptcha enterprise fields into SignInWithPassword request', async () => { + mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + getRecaptchaConfigRequest, + recaptchaConfigResponseEnforce + ); + sinon + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve('recaptcha-response')); + + const request = { + returnSecureToken: true, + email: 'email', + password: 'password', + clientType: RecaptchaClientType.WEB + }; + const requestWithRecaptcha = await injectRecaptchaFields( + auth, + request, + RecaptchaActionName.SIGN_IN_WITH_PASSWORD, + false + ); + const expectedRequest = { + returnSecureToken: true, + email: 'email', + password: 'password', + clientType: RecaptchaClientType.WEB, + captchaResponse: 'recaptcha-response', + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }; + + expect(requestWithRecaptcha).to.eql(expectedRequest); + }); + + it('injects recaptcha enterprise fields when captchaResp is true', async () => { + mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + getRecaptchaConfigRequest, + recaptchaConfigResponseEnforce + ); + sinon + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve('recaptcha-response')); + + const request = { + requestType: 'requestType', + email: 'email', + clientType: RecaptchaClientType.WEB + }; + const requestWithRecaptcha = await injectRecaptchaFields( + auth, + request, + RecaptchaActionName.GET_OOB_CODE, + true + ); + const expectedRequest = { + requestType: 'requestType', + email: 'email', + clientType: RecaptchaClientType.WEB, + captchaResp: 'recaptcha-response', + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }; + + expect(requestWithRecaptcha).to.eql(expectedRequest); + }); + + it('injects recaptcha enterprise fields into StartPhoneMfaEnrollment request', async () => { + mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + getRecaptchaConfigRequest, + recaptchaConfigResponseEnforce + ); + sinon + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve('recaptcha-response')); + + const request = { + idToken: 'idToken', + phoneEnrollmentInfo: { + phoneNumber: '123456', + recaptchaToken: 'recaptcha-token', + clientType: RecaptchaClientType.WEB + } + }; + const requestWithRecaptcha = await injectRecaptchaFields( + auth, + request, + RecaptchaActionName.MFA_SMS_ENROLLMENT, + false + ); + const expectedRequest = { + idToken: 'idToken', + phoneEnrollmentInfo: { + phoneNumber: '123456', + recaptchaToken: 'recaptcha-token', + captchaResponse: 'recaptcha-response', + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + } + }; + + expect(requestWithRecaptcha).to.eql(expectedRequest); + }); + + it('injects recaptcha enterprise fields into StartPhoneMfaSignInRequest request', async () => { + mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + getRecaptchaConfigRequest, + recaptchaConfigResponseEnforce + ); + sinon + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve('recaptcha-response')); + + const request = { + mfaPendingCredential: 'mfaPendingCredential', + mfaEnrollmentId: 'mfaEnrollmentId', + phoneSignInInfo: { + recaptchaToken: 'recaptcha-token', + clientType: RecaptchaClientType.WEB + } + }; + const requestWithRecaptcha = await injectRecaptchaFields( + auth, + request, + RecaptchaActionName.MFA_SMS_SIGNIN, + false + ); + const expectedRequest = { + mfaPendingCredential: 'mfaPendingCredential', + mfaEnrollmentId: 'mfaEnrollmentId', + phoneSignInInfo: { + recaptchaToken: 'recaptcha-token', + captchaResponse: 'recaptcha-response', + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + } + }; + + expect(requestWithRecaptcha).to.eql(expectedRequest); + }); }); }); diff --git a/packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.ts b/packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.ts index cccd737defc..53796664de6 100644 --- a/packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.ts +++ b/packages/auth/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.ts @@ -22,7 +22,8 @@ import { RecaptchaClientType, RecaptchaVersion, RecaptchaActionName, - RecaptchaProvider + RecaptchaAuthProvider, + EnforcementState } from '../../api'; import { Auth } from '../../model/public_types'; @@ -30,6 +31,9 @@ import { AuthInternal } from '../../model/auth'; import { _castAuth } from '../../core/auth/auth_impl'; import * as jsHelpers from '../load_js'; import { AuthErrorCode } from '../../core/errors'; +import { StartPhoneMfaEnrollmentRequest } from '../../api/account_management/mfa'; +import { StartPhoneMfaSignInRequest } from '../../api/authentication/mfa'; +import { MockGreCAPTCHATopLevel } from './recaptcha_mock'; export const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = 'recaptcha-enterprise'; export const FAKE_TOKEN = 'NO_RECAPTCHA'; @@ -119,6 +123,12 @@ export class RecaptchaEnterpriseVerifier { } } + // Returns Promise for a mock token when appVerificationDisabledForTesting is true. + if (this.auth.settings.appVerificationDisabledForTesting) { + const mockRecaptcha = new MockGreCAPTCHATopLevel(); + return mockRecaptcha.execute('siteKey', { action: 'verify' }); + } + return new Promise((resolve, reject) => { retrieveSiteKey(this.auth) .then(siteKey => { @@ -152,21 +162,66 @@ export class RecaptchaEnterpriseVerifier { } } -export async function injectRecaptchaFields( +export async function injectRecaptchaFields( auth: AuthInternal, request: T, action: RecaptchaActionName, - captchaResp = false + isCaptchaResp = false, + isFakeToken = false ): Promise { const verifier = new RecaptchaEnterpriseVerifier(auth); let captchaResponse; - try { - captchaResponse = await verifier.verify(action); - } catch (error) { - captchaResponse = await verifier.verify(action, true); + + if (isFakeToken) { + captchaResponse = FAKE_TOKEN; + } else { + try { + captchaResponse = await verifier.verify(action); + } catch (error) { + captchaResponse = await verifier.verify(action, true); + } } + const newRequest = { ...request }; - if (!captchaResp) { + if ( + action === RecaptchaActionName.MFA_SMS_ENROLLMENT || + action === RecaptchaActionName.MFA_SMS_SIGNIN + ) { + if ('phoneEnrollmentInfo' in newRequest) { + const phoneNumber = ( + newRequest as unknown as StartPhoneMfaEnrollmentRequest + ).phoneEnrollmentInfo.phoneNumber; + const recaptchaToken = ( + newRequest as unknown as StartPhoneMfaEnrollmentRequest + ).phoneEnrollmentInfo.recaptchaToken; + + Object.assign(newRequest, { + 'phoneEnrollmentInfo': { + phoneNumber, + recaptchaToken, + captchaResponse, + 'clientType': RecaptchaClientType.WEB, + 'recaptchaVersion': RecaptchaVersion.ENTERPRISE + } + }); + } else if ('phoneSignInInfo' in newRequest) { + const recaptchaToken = ( + newRequest as unknown as StartPhoneMfaSignInRequest + ).phoneSignInInfo.recaptchaToken; + + Object.assign(newRequest, { + 'phoneSignInInfo': { + recaptchaToken, + captchaResponse, + 'clientType': RecaptchaClientType.WEB, + 'recaptchaVersion': RecaptchaVersion.ENTERPRISE + } + }); + } + return newRequest; + } + + if (!isCaptchaResp) { Object.assign(newRequest, { captchaResponse }); } else { Object.assign(newRequest, { 'captchaResp': captchaResponse }); @@ -179,45 +234,112 @@ export async function injectRecaptchaFields( } type ActionMethod = ( - auth: Auth, + auth: AuthInternal, request: TRequest ) => Promise; -export async function handleRecaptchaFlow( +export async function handleRecaptchaFlow( authInstance: AuthInternal, request: TRequest, actionName: RecaptchaActionName, - actionMethod: ActionMethod + actionMethod: ActionMethod, + recaptchaAuthProvider: RecaptchaAuthProvider ): Promise { - if ( - authInstance - ._getRecaptchaConfig() - ?.isProviderEnabled(RecaptchaProvider.EMAIL_PASSWORD_PROVIDER) - ) { - const requestWithRecaptcha = await injectRecaptchaFields( - authInstance, - request, - actionName, - actionName === RecaptchaActionName.GET_OOB_CODE - ); - return actionMethod(authInstance, requestWithRecaptcha); + if (recaptchaAuthProvider === RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER) { + if ( + authInstance + ._getRecaptchaConfig() + ?.isProviderEnabled(RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER) + ) { + const requestWithRecaptcha = await injectRecaptchaFields( + authInstance, + request, + actionName, + actionName === RecaptchaActionName.GET_OOB_CODE + ); + return actionMethod(authInstance, requestWithRecaptcha); + } else { + return actionMethod(authInstance, request).catch(async error => { + if (error.code === `auth/${AuthErrorCode.MISSING_RECAPTCHA_TOKEN}`) { + console.log( + `${actionName} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.` + ); + const requestWithRecaptcha = await injectRecaptchaFields( + authInstance, + request, + actionName, + actionName === RecaptchaActionName.GET_OOB_CODE + ); + return actionMethod(authInstance, requestWithRecaptcha); + } else { + return Promise.reject(error); + } + }); + } + } else if (recaptchaAuthProvider === RecaptchaAuthProvider.PHONE_PROVIDER) { + if ( + authInstance + ._getRecaptchaConfig() + ?.isProviderEnabled(RecaptchaAuthProvider.PHONE_PROVIDER) + ) { + const requestWithRecaptcha = await injectRecaptchaFields( + authInstance, + request, + actionName + ); + + return actionMethod(authInstance, requestWithRecaptcha).catch( + async error => { + if ( + authInstance + ._getRecaptchaConfig() + ?.getProviderEnforcementState( + RecaptchaAuthProvider.PHONE_PROVIDER + ) === EnforcementState.AUDIT + ) { + // AUDIT mode + if ( + error.code === `auth/${AuthErrorCode.MISSING_RECAPTCHA_TOKEN}` || + error.code === `auth/${AuthErrorCode.INVALID_APP_CREDENTIAL}` + ) { + console.log( + `Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${actionName} flow.` + ); + // reCAPTCHA Enterprise token is missing or reCAPTCHA Enterprise token + // check fails. + // Fallback to reCAPTCHA v2 flow. + const requestWithRecaptchaFields = await injectRecaptchaFields( + authInstance, + request, + actionName, + false, // isCaptchaResp + true // isFakeToken + ); + // This will call the PhoneApiCaller to fetch and inject reCAPTCHA v2 token. + return actionMethod(authInstance, requestWithRecaptchaFields); + } + } + // ENFORCE mode or AUDIT mode with any other error. + return Promise.reject(error); + } + ); + } else { + // Do reCAPTCHA v2 flow. + const requestWithRecaptchaFields = await injectRecaptchaFields( + authInstance, + request, + actionName, + false, // isCaptchaResp + true // isFakeToken + ); + + // This will call the PhoneApiCaller to fetch and inject v2 token. + return actionMethod(authInstance, requestWithRecaptchaFields); + } } else { - return actionMethod(authInstance, request).catch(async error => { - if (error.code === `auth/${AuthErrorCode.MISSING_RECAPTCHA_TOKEN}`) { - console.log( - `${actionName} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.` - ); - const requestWithRecaptcha = await injectRecaptchaFields( - authInstance, - request, - actionName, - actionName === RecaptchaActionName.GET_OOB_CODE - ); - return actionMethod(authInstance, requestWithRecaptcha); - } else { - return Promise.reject(error); - } - }); + return Promise.reject( + recaptchaAuthProvider + ' provider is not supported.' + ); } } @@ -236,7 +358,7 @@ export async function _initializeRecaptchaConfig(auth: Auth): Promise { authInternal._tenantRecaptchaConfigs[authInternal.tenantId] = config; } - if (config.isProviderEnabled(RecaptchaProvider.EMAIL_PASSWORD_PROVIDER)) { + if (config.isAnyProviderEnabled()) { const verifier = new RecaptchaEnterpriseVerifier(authInternal); void verifier.verify(); } diff --git a/packages/auth/src/platform_browser/strategies/phone.test.ts b/packages/auth/src/platform_browser/strategies/phone.test.ts index 1290375a1d1..58a5bdaf6ad 100644 --- a/packages/auth/src/platform_browser/strategies/phone.test.ts +++ b/packages/auth/src/platform_browser/strategies/phone.test.ts @@ -23,11 +23,21 @@ import sinonChai from 'sinon-chai'; import { OperationType, ProviderId } from '../../model/enums'; import { FirebaseError } from '@firebase/util'; -import { mockEndpoint } from '../../../test/helpers/api/helper'; +import { + mockEndpoint, + mockEndpointWithParams +} from '../../../test/helpers/api/helper'; import { makeJWT } from '../../../test/helpers/jwt'; import { testAuth, testUser, TestAuth } from '../../../test/helpers/mock_auth'; import * as fetch from '../../../test/helpers/mock_fetch'; -import { Endpoint } from '../../api'; +import { ServerError } from '../../api/errors'; +import { + Endpoint, + RecaptchaClientType, + RecaptchaVersion, + RecaptchaAuthProvider, + EnforcementState +} from '../../api'; import { MultiFactorInfoImpl } from '../../mfa/mfa_info'; import { MultiFactorSessionImpl } from '../../mfa/mfa_session'; import { multiFactor, MultiFactorUserImpl } from '../../mfa/mfa_user'; @@ -36,32 +46,103 @@ import { IdTokenResponse, IdTokenResponseKind } from '../../model/id_token'; import { UserInternal } from '../../model/user'; import { RecaptchaVerifier } from '../../platform_browser/recaptcha/recaptcha_verifier'; import { PhoneAuthCredential } from '../../core/credentials/phone'; +import { FAKE_TOKEN } from '../recaptcha/recaptcha_enterprise_verifier'; +import { MockGreCAPTCHATopLevel } from '../../platform_browser/recaptcha/recaptcha_mock'; + import { _verifyPhoneNumber, linkWithPhoneNumber, reauthenticateWithPhoneNumber, signInWithPhoneNumber, - updatePhoneNumber + updatePhoneNumber, + injectRecaptchaV2Token } from './phone'; use(chaiAsPromised); use(sinonChai); +const RECAPTCHA_V2_TOKEN = 'v2-token'; +const RECAPTCHA_ENTERPRISE_TOKEN = 'enterprise-token'; + +const recaptchaConfigResponseEnforce = { + recaptchaKey: 'foo/bar/to/site-key', + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.ENFORCE + } + ] +}; +const recaptchaConfigResponseAudit = { + recaptchaKey: 'foo/bar/to/site-key', + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.AUDIT + } + ] +}; +const recaptchaConfigResponseOff = { + // no recaptcha key if no rCE provider is enabled + recaptchaEnforcementState: [ + { + provider: RecaptchaAuthProvider.PHONE_PROVIDER, + enforcementState: EnforcementState.OFF + } + ] +}; + +function mockRecaptchaEnterpriseEnablement( + enablementState: EnforcementState +): fetch.Route | undefined { + if (typeof window === 'undefined') { + return; + } + + let recaptchaConfigResponse = {}; + if (enablementState === EnforcementState.ENFORCE) { + recaptchaConfigResponse = recaptchaConfigResponseEnforce; + } else if (enablementState === EnforcementState.AUDIT) { + recaptchaConfigResponse = recaptchaConfigResponseAudit; + } else { + recaptchaConfigResponse = recaptchaConfigResponseOff; + } + + const recaptcha = new MockGreCAPTCHATopLevel(); + window.grecaptcha = recaptcha; + sinon + .stub(recaptcha.enterprise, 'execute') + .returns(Promise.resolve(RECAPTCHA_ENTERPRISE_TOKEN)); + + return mockEndpointWithParams( + Endpoint.GET_RECAPTCHA_CONFIG, + { + clientType: RecaptchaClientType.WEB, + version: RecaptchaVersion.ENTERPRISE + }, + recaptchaConfigResponse + ); +} + describe('platform_browser/strategies/phone', () => { let auth: TestAuth; - let verifier: ApplicationVerifierInternal; + let v2Verifier: ApplicationVerifierInternal; let sendCodeEndpoint: fetch.Route; beforeEach(async () => { auth = await testAuth(); + auth.settings.appVerificationDisabledForTesting = false; fetch.setUp(); sendCodeEndpoint = mockEndpoint(Endpoint.SEND_VERIFICATION_CODE, { sessionInfo: 'session-info' }); - verifier = new RecaptchaVerifier(auth, document.createElement('div'), {}); - sinon.stub(verifier, 'verify').returns(Promise.resolve('recaptcha-token')); + v2Verifier = new RecaptchaVerifier(auth, document.createElement('div'), {}); + sinon + .stub(v2Verifier, 'verify') + .returns(Promise.resolve(RECAPTCHA_V2_TOKEN)); + mockRecaptchaEnterpriseEnablement(EnforcementState.OFF); }); afterEach(() => { @@ -70,22 +151,75 @@ describe('platform_browser/strategies/phone', () => { }); describe('signInWithPhoneNumber', () => { - it('calls verify phone number', async () => { - await signInWithPhoneNumber(auth, '+15105550000', verifier); + it('calls verify phone number when recaptcha enterprise is disabled', async () => { + if (typeof window === 'undefined') { + return; + } + await signInWithPhoneNumber(auth, '+15105550000', v2Verifier); + + expect(sendCodeEndpoint.calls[0].request).to.eql({ + recaptchaToken: RECAPTCHA_V2_TOKEN, + phoneNumber: '+15105550000', + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('calls verify phone number when recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.ENFORCE); + await signInWithPhoneNumber(auth, '+15105550000', v2Verifier); expect(sendCodeEndpoint.calls[0].request).to.eql({ - recaptchaToken: 'recaptcha-token', - phoneNumber: '+15105550000' + phoneNumber: '+15105550000', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE }); }); + it('calls verify phone number without a v2 RecaptchaVerifier when recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.ENFORCE); + await signInWithPhoneNumber(auth, '+15105550000'); + + expect(sendCodeEndpoint.calls[0].request).to.eql({ + phoneNumber: '+15105550000', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('throws an error if verify phone number without a v2 RecaptchaVerifier when recaptcha enterprise is disabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.OFF); + + await expect( + signInWithPhoneNumber(auth, '+15105550000') + ).to.be.rejectedWith(FirebaseError, 'auth/argument-error'); + }); + context('ConfirmationResult', () => { it('result contains verification id baked in', async () => { - const result = await signInWithPhoneNumber(auth, 'number', verifier); + if (typeof window === 'undefined') { + return; + } + const result = await signInWithPhoneNumber(auth, 'number', v2Verifier); expect(result.verificationId).to.eq('session-info'); }); it('calling #confirm finishes the sign in flow', async () => { + if (typeof window === 'undefined') { + return; + } const idTokenResponse: IdTokenResponse = { idToken: 'my-id-token', refreshToken: 'my-refresh-token', @@ -104,7 +238,7 @@ describe('platform_browser/strategies/phone', () => { users: [{ localId: 'uid' }] }); - const result = await signInWithPhoneNumber(auth, 'number', verifier); + const result = await signInWithPhoneNumber(auth, 'number', v2Verifier); const userCred = await result.confirm('6789'); expect(userCred.user.uid).to.eq('uid'); expect(userCred.operationType).to.eq(OperationType.SIGN_IN); @@ -129,6 +263,9 @@ describe('platform_browser/strategies/phone', () => { }); it('rejects if a phone provider is already linked', async () => { + if (typeof window === 'undefined') { + return; + } getAccountInfoEndpoint.response = { users: [ { @@ -139,29 +276,56 @@ describe('platform_browser/strategies/phone', () => { }; await expect( - linkWithPhoneNumber(user, 'number', verifier) + linkWithPhoneNumber(user, 'number', v2Verifier) ).to.be.rejectedWith( FirebaseError, 'Firebase: User can only be linked to one identity for the given provider. (auth/provider-already-linked).' ); }); - it('calls verify phone number', async () => { - await linkWithPhoneNumber(user, '+15105550000', verifier); + it('calls verify phone number when recaptcha enterprise is disabled', async () => { + if (typeof window === 'undefined') { + return; + } + await linkWithPhoneNumber(user, '+15105550000', v2Verifier); expect(sendCodeEndpoint.calls[0].request).to.eql({ - recaptchaToken: 'recaptcha-token', - phoneNumber: '+15105550000' + recaptchaToken: RECAPTCHA_V2_TOKEN, + phoneNumber: '+15105550000', + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('calls verify phone number when recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.ENFORCE); + await linkWithPhoneNumber(user, '+15105550000', v2Verifier); + + expect(sendCodeEndpoint.calls[0].request).to.eql({ + phoneNumber: '+15105550000', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE }); }); context('ConfirmationResult', () => { it('result contains verification id baked in', async () => { - const result = await linkWithPhoneNumber(user, 'number', verifier); + if (typeof window === 'undefined') { + return; + } + const result = await linkWithPhoneNumber(user, 'number', v2Verifier); expect(result.verificationId).to.eq('session-info'); }); it('calling #confirm finishes the sign in flow', async () => { + if (typeof window === 'undefined') { + return; + } const idTokenResponse: IdTokenResponse = { idToken: 'my-id-token', refreshToken: 'my-refresh-token', @@ -182,7 +346,7 @@ describe('platform_browser/strategies/phone', () => { const initialIdToken = await user.getIdToken(); - const result = await linkWithPhoneNumber(user, 'number', verifier); + const result = await linkWithPhoneNumber(user, 'number', v2Verifier); const userCred = await result.confirm('6789'); expect(userCred.user.uid).to.eq('uid'); expect(userCred.operationType).to.eq(OperationType.LINK); @@ -206,26 +370,53 @@ describe('platform_browser/strategies/phone', () => { user = testUser(auth, 'uid', 'email', true); }); - it('calls verify phone number', async () => { - await reauthenticateWithPhoneNumber(user, '+15105550000', verifier); + it('calls verify phone number when recaptcha enterprise is disabled', async () => { + if (typeof window === 'undefined') { + return; + } + await reauthenticateWithPhoneNumber(user, '+15105550000', v2Verifier); + + expect(sendCodeEndpoint.calls[0].request).to.eql({ + recaptchaToken: RECAPTCHA_V2_TOKEN, + phoneNumber: '+15105550000', + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('calls verify phone number when recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.ENFORCE); + await reauthenticateWithPhoneNumber(user, '+15105550000', v2Verifier); expect(sendCodeEndpoint.calls[0].request).to.eql({ - recaptchaToken: 'recaptcha-token', - phoneNumber: '+15105550000' + phoneNumber: '+15105550000', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE }); }); context('ConfirmationResult', () => { it('result contains verification id baked in', async () => { + if (typeof window === 'undefined') { + return; + } const result = await reauthenticateWithPhoneNumber( user, 'number', - verifier + v2Verifier ); expect(result.verificationId).to.eq('session-info'); }); it('calling #confirm finishes the sign in flow', async () => { + if (typeof window === 'undefined') { + return; + } const idTokenResponse: IdTokenResponse = { idToken: makeJWT({ 'sub': 'uid' }), refreshToken: 'my-refresh-token', @@ -247,7 +438,7 @@ describe('platform_browser/strategies/phone', () => { const result = await reauthenticateWithPhoneNumber( user, 'number', - verifier + v2Verifier ); const userCred = await result.confirm('6789'); expect(userCred.user.uid).to.eq('uid'); @@ -260,6 +451,9 @@ describe('platform_browser/strategies/phone', () => { }); it('rejects if the uid mismatches', async () => { + if (typeof window === 'undefined') { + return; + } const idTokenResponse: IdTokenResponse = { idToken: makeJWT({ 'sub': 'different-uid' }), refreshToken: 'my-refresh-token', @@ -274,7 +468,7 @@ describe('platform_browser/strategies/phone', () => { const result = await reauthenticateWithPhoneNumber( user, 'number', - verifier + v2Verifier ); await expect(result.confirm('code')).to.be.rejectedWith( FirebaseError, @@ -286,27 +480,188 @@ describe('platform_browser/strategies/phone', () => { describe('_verifyPhoneNumber', () => { it('works with a string phone number', async () => { - const sessionInfo = await _verifyPhoneNumber(auth, 'number', verifier); + if (typeof window === 'undefined') { + return; + } + const sessionInfo = await _verifyPhoneNumber(auth, 'number', v2Verifier); expect(sessionInfo).to.eq('session-info'); expect(sendCodeEndpoint.calls[0].request).to.eql({ - recaptchaToken: 'recaptcha-token', - phoneNumber: 'number' + recaptchaToken: RECAPTCHA_V2_TOKEN, + phoneNumber: 'number', + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE }); }); it('works with an options object', async () => { + if (typeof window === 'undefined') { + return; + } const sessionInfo = await _verifyPhoneNumber( auth, { phoneNumber: 'number' }, - verifier + v2Verifier ); expect(sessionInfo).to.eq('session-info'); expect(sendCodeEndpoint.calls[0].request).to.eql({ - recaptchaToken: 'recaptcha-token', - phoneNumber: 'number' + recaptchaToken: RECAPTCHA_V2_TOKEN, + phoneNumber: 'number', + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('works when recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.AUDIT); + const sessionInfo = await _verifyPhoneNumber(auth, 'number', v2Verifier); + expect(sessionInfo).to.eq('session-info'); + expect(sendCodeEndpoint.calls[0].request).to.eql({ + phoneNumber: 'number', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('works without v2 RecaptchaVerifier when recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.ENFORCE); + const sessionInfo = await _verifyPhoneNumber(auth, 'number'); + expect(sessionInfo).to.eq('session-info'); + expect(sendCodeEndpoint.calls[0].request).to.eql({ + phoneNumber: 'number', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('throws error if calls verify phone number without v2 RecaptchaVerifier when recaptcha enterprise is disabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.OFF); + + await expect(_verifyPhoneNumber(auth, 'number')).to.be.rejectedWith( + FirebaseError, + 'auth/argument-error' + ); + }); + + it('calls fallback to recaptcha v2 flow when receiving MISSING_RECAPTCHA_TOKEN error in recaptcha enterprise audit mode', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.AUDIT); + const failureMock = mockEndpoint( + Endpoint.SEND_VERIFICATION_CODE, + { + error: { + code: 400, + message: ServerError.MISSING_RECAPTCHA_TOKEN + } + }, + 400 + ); + await expect( + _verifyPhoneNumber(auth, 'number', v2Verifier) + ).to.be.rejectedWith( + 'Firebase: The reCAPTCHA token is missing when sending request to the backend. (auth/missing-recaptcha-token).' + ); + expect(failureMock.calls.length).to.eq(2); + // First call should have a recaptcha enterprise token + expect(failureMock.calls[0].request).to.eql({ + phoneNumber: 'number', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + // Second call should have a recaptcha v2 token + expect(failureMock.calls[1].request).to.eql({ + recaptchaToken: RECAPTCHA_V2_TOKEN, + phoneNumber: 'number', + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('calls fallback to recaptcha v2 flow when receiving INVALID_APP_CREDENTIAL error in recaptcha enterprise audit mode', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.AUDIT); + const failureMock = mockEndpoint( + Endpoint.SEND_VERIFICATION_CODE, + { + error: { + code: 400, + message: ServerError.INVALID_APP_CREDENTIAL + } + }, + 400 + ); + await expect( + _verifyPhoneNumber(auth, 'number', v2Verifier) + ).to.be.rejectedWith( + 'Firebase: The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired. (auth/invalid-app-credential).' + ); + expect(failureMock.calls.length).to.eq(2); + // First call should have a recaptcha enterprise token + expect(failureMock.calls[0].request).to.eql({ + phoneNumber: 'number', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + // Second call should have a recaptcha v2 token + expect(failureMock.calls[1].request).to.eql({ + recaptchaToken: RECAPTCHA_V2_TOKEN, + phoneNumber: 'number', + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }); + }); + + it('does not call fallback to recaptcha v2 flow when receiving other errors in recaptcha enterprise audit mode', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.AUDIT); + const failureMock = mockEndpoint( + Endpoint.SEND_VERIFICATION_CODE, + { + error: { + code: 400, + message: ServerError.INVALID_RECAPTCHA_TOKEN + } + }, + 400 + ); + await expect( + _verifyPhoneNumber(auth, 'number', v2Verifier) + ).to.be.rejectedWith( + 'Firebase: The reCAPTCHA token is invalid when sending request to the backend. (auth/invalid-recaptcha-token).' + ); + // First call should have a recaptcha enterprise token + expect(failureMock.calls[0].request).to.eql({ + phoneNumber: 'number', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE }); + // No fallback to recaptcha v2 flow + expect(failureMock.calls.length).to.eq(1); }); context('MFA', () => { @@ -322,7 +677,39 @@ describe('platform_browser/strategies/phone', () => { mfaUser = multiFactor(user) as MultiFactorUserImpl; }); - it('works with an enrollment flow', async () => { + it('works with an enrollment flow when recaptcha enterprise is disabled', async () => { + if (typeof window === 'undefined') { + return; + } + const endpoint = mockEndpoint(Endpoint.START_MFA_ENROLLMENT, { + phoneSessionInfo: { + sessionInfo: 'session-info' + } + }); + const session = (await mfaUser.getSession()) as MultiFactorSessionImpl; + const sessionInfo = await _verifyPhoneNumber( + auth, + { phoneNumber: 'number', session }, + v2Verifier + ); + expect(sessionInfo).to.eq('session-info'); + expect(endpoint.calls[0].request).to.eql({ + idToken: session.credential, + phoneEnrollmentInfo: { + phoneNumber: 'number', + recaptchaToken: RECAPTCHA_V2_TOKEN, + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + } + }); + }); + + it('works with an enrollment flow when recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.ENFORCE); const endpoint = mockEndpoint(Endpoint.START_MFA_ENROLLMENT, { phoneSessionInfo: { sessionInfo: 'session-info' @@ -332,19 +719,24 @@ describe('platform_browser/strategies/phone', () => { const sessionInfo = await _verifyPhoneNumber( auth, { phoneNumber: 'number', session }, - verifier + v2Verifier ); expect(sessionInfo).to.eq('session-info'); expect(endpoint.calls[0].request).to.eql({ idToken: session.credential, phoneEnrollmentInfo: { phoneNumber: 'number', - recaptchaToken: 'recaptcha-token' + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE } }); }); - it('works when completing the sign in flow', async () => { + it('works when completing the sign in flow and recaptcha enterprise is disabled', async () => { + if (typeof window === 'undefined') { + return; + } const endpoint = mockEndpoint(Endpoint.START_MFA_SIGN_IN, { phoneResponseInfo: { sessionInfo: 'session-info' @@ -364,30 +756,77 @@ describe('platform_browser/strategies/phone', () => { session, multiFactorHint: mfaInfo }, - verifier + v2Verifier ); expect(sessionInfo).to.eq('session-info'); expect(endpoint.calls[0].request).to.eql({ mfaPendingCredential: 'mfa-pending-credential', mfaEnrollmentId: 'mfa-enrollment-id', phoneSignInInfo: { - recaptchaToken: 'recaptcha-token' + recaptchaToken: RECAPTCHA_V2_TOKEN, + captchaResponse: FAKE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + } + }); + }); + + it('works when completing the sign in flow and recaptcha enterprise is enabled', async () => { + if (typeof window === 'undefined') { + return; + } + mockRecaptchaEnterpriseEnablement(EnforcementState.ENFORCE); + const endpoint = mockEndpoint(Endpoint.START_MFA_SIGN_IN, { + phoneResponseInfo: { + sessionInfo: 'session-info' + } + }); + const session = MultiFactorSessionImpl._fromMfaPendingCredential( + 'mfa-pending-credential' + ); + const mfaInfo = MultiFactorInfoImpl._fromServerResponse(auth, { + mfaEnrollmentId: 'mfa-enrollment-id', + enrolledAt: Date.now(), + phoneInfo: 'phone-number-from-enrollment' + }); + const sessionInfo = await _verifyPhoneNumber( + auth, + { + session, + multiFactorHint: mfaInfo + }, + v2Verifier + ); + expect(sessionInfo).to.eq('session-info'); + expect(endpoint.calls[0].request).to.eql({ + mfaPendingCredential: 'mfa-pending-credential', + mfaEnrollmentId: 'mfa-enrollment-id', + phoneSignInInfo: { + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE } }); }); }); - it('throws if the verifier does not return a string', async () => { - (verifier.verify as sinon.SinonStub).returns(Promise.resolve(123)); + it('throws if the v2Verifier does not return a string', async () => { + if (typeof window === 'undefined') { + return; + } + (v2Verifier.verify as sinon.SinonStub).returns(Promise.resolve(123)); await expect( - _verifyPhoneNumber(auth, 'number', verifier) + _verifyPhoneNumber(auth, 'number', v2Verifier) ).to.be.rejectedWith(FirebaseError, 'auth/argument-error'); }); - it('throws if the verifier type is not recaptcha', async () => { + it('throws if the v2Verifier type is not recaptcha', async () => { + if (typeof window === 'undefined') { + return; + } const mutVerifier: { -readonly [K in keyof ApplicationVerifierInternal]: ApplicationVerifierInternal[K]; - } = verifier; + } = v2Verifier; mutVerifier.type = 'not-recaptcha-thats-for-sure'; await expect( _verifyPhoneNumber(auth, 'number', mutVerifier) @@ -395,19 +834,26 @@ describe('platform_browser/strategies/phone', () => { }); it('resets the verifier after successful verification', async () => { - sinon.spy(verifier, '_reset'); - expect(await _verifyPhoneNumber(auth, 'number', verifier)).to.eq( + if (typeof window === 'undefined') { + return; + } + sinon.spy(v2Verifier, '_reset'); + expect(await _verifyPhoneNumber(auth, 'number', v2Verifier)).to.eq( 'session-info' ); - expect(verifier._reset).to.have.been.called; + expect(v2Verifier._reset).to.have.been.called; }); it('resets the verifier after a failed verification', async () => { - sinon.spy(verifier, '_reset'); - (verifier.verify as sinon.SinonStub).returns(Promise.resolve(123)); - - await expect(_verifyPhoneNumber(auth, 'number', verifier)).to.be.rejected; - expect(verifier._reset).to.have.been.called; + if (typeof window === 'undefined') { + return; + } + sinon.spy(v2Verifier, '_reset'); + (v2Verifier.verify as sinon.SinonStub).returns(Promise.resolve(123)); + + await expect(_verifyPhoneNumber(auth, 'number', v2Verifier)).to.be + .rejected; + expect(v2Verifier._reset).to.have.been.called; }); }); @@ -455,4 +901,90 @@ describe('platform_browser/strategies/phone', () => { expect(reloadMock.calls.length).to.eq(1); }); }); + + describe('#injectRecaptchaV2Token', () => { + it('injects recaptcha v2 token into SendPhoneVerificationCode request', async () => { + const request = { + phoneNumber: '123456', + clientType: RecaptchaClientType.WEB, + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }; + + const requestWithV2Token = await injectRecaptchaV2Token( + auth, + request, + v2Verifier + ); + + const expectedRequest = { + phoneNumber: '123456', + recaptchaToken: RECAPTCHA_V2_TOKEN, + clientType: RecaptchaClientType.WEB, + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + }; + expect(requestWithV2Token).to.eql(expectedRequest); + }); + + it('injects recaptcha v2 token into StartPhoneMfaEnrollment request', async () => { + const request = { + idToken: 'idToken', + phoneEnrollmentInfo: { + phoneNumber: '123456', + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + } + }; + + const requestWithRecaptcha = await injectRecaptchaV2Token( + auth, + request, + v2Verifier + ); + + const expectedRequest = { + idToken: 'idToken', + phoneEnrollmentInfo: { + phoneNumber: '123456', + recaptchaToken: RECAPTCHA_V2_TOKEN, + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + } + }; + expect(requestWithRecaptcha).to.eql(expectedRequest); + }); + + it('injects recaptcha enterprise fields into StartPhoneMfaSignInRequest request', async () => { + const request = { + mfaPendingCredential: 'mfaPendingCredential', + mfaEnrollmentId: 'mfaEnrollmentId', + phoneSignInInfo: { + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + } + }; + + const requestWithRecaptcha = await injectRecaptchaV2Token( + auth, + request, + v2Verifier + ); + + const expectedRequest = { + mfaPendingCredential: 'mfaPendingCredential', + mfaEnrollmentId: 'mfaEnrollmentId', + phoneSignInInfo: { + recaptchaToken: RECAPTCHA_V2_TOKEN, + captchaResponse: RECAPTCHA_ENTERPRISE_TOKEN, + clientType: RecaptchaClientType.WEB, + recaptchaVersion: RecaptchaVersion.ENTERPRISE + } + }; + expect(requestWithRecaptcha).to.eql(expectedRequest); + }); + }); }); diff --git a/packages/auth/src/platform_browser/strategies/phone.ts b/packages/auth/src/platform_browser/strategies/phone.ts index 9e0c34d7058..ebbad499add 100644 --- a/packages/auth/src/platform_browser/strategies/phone.ts +++ b/packages/auth/src/platform_browser/strategies/phone.ts @@ -24,9 +24,26 @@ import { UserCredential } from '../../model/public_types'; -import { startEnrollPhoneMfa } from '../../api/account_management/mfa'; -import { startSignInPhoneMfa } from '../../api/authentication/mfa'; -import { sendPhoneVerificationCode } from '../../api/authentication/sms'; +import { + startEnrollPhoneMfa, + StartPhoneMfaEnrollmentRequest, + StartPhoneMfaEnrollmentResponse +} from '../../api/account_management/mfa'; +import { + startSignInPhoneMfa, + StartPhoneMfaSignInRequest, + StartPhoneMfaSignInResponse +} from '../../api/authentication/mfa'; +import { + sendPhoneVerificationCode, + SendPhoneVerificationCodeRequest, + SendPhoneVerificationCodeResponse +} from '../../api/authentication/sms'; +import { + RecaptchaActionName, + RecaptchaClientType, + RecaptchaAuthProvider +} from '../../api'; import { ApplicationVerifierInternal } from '../../model/application_verifier'; import { PhoneAuthCredential } from '../../core/credentials/phone'; import { AuthErrorCode } from '../../core/errors'; @@ -50,6 +67,11 @@ import { RECAPTCHA_VERIFIER_TYPE } from '../recaptcha/recaptcha_verifier'; import { _castAuth } from '../../core/auth/auth_impl'; import { getModularInstance } from '@firebase/util'; import { ProviderId } from '../../model/enums'; +import { + FAKE_TOKEN, + handleRecaptchaFlow, + _initializeRecaptchaConfig +} from '../recaptcha/recaptcha_enterprise_verifier'; import { _isFirebaseServerApp } from '@firebase/app'; interface OnConfirmationCallback { @@ -80,12 +102,15 @@ class ConfirmationResultImpl implements ConfirmationResult { * provides the code sent to their phone, call {@link ConfirmationResult.confirm} * with the code to sign the user in. * - * For abuse prevention, this method also requires a {@link ApplicationVerifier}. - * This SDK includes a reCAPTCHA-based implementation, {@link RecaptchaVerifier}. + * For abuse prevention, this method requires a {@link ApplicationVerifier}. + * This SDK includes an implementation based on reCAPTCHA v2, {@link RecaptchaVerifier}. * This function can work on other platforms that do not support the * {@link RecaptchaVerifier} (like React Native), but you need to use a * third-party {@link ApplicationVerifier} implementation. * + * If you've enabled project-level reCAPTCHA Enterprise bot protection in + * Enforce mode, you can omit the {@link ApplicationVerifier}. + * * This method does not work in a Node.js environment or with {@link Auth} instances created with a * {@link @firebase/app#FirebaseServerApp}. * @@ -107,7 +132,7 @@ class ConfirmationResultImpl implements ConfirmationResult { export async function signInWithPhoneNumber( auth: Auth, phoneNumber: string, - appVerifier: ApplicationVerifier + appVerifier?: ApplicationVerifier ): Promise { if (_isFirebaseServerApp(auth.app)) { return Promise.reject( @@ -140,7 +165,7 @@ export async function signInWithPhoneNumber( export async function linkWithPhoneNumber( user: User, phoneNumber: string, - appVerifier: ApplicationVerifier + appVerifier?: ApplicationVerifier ): Promise { const userInternal = getModularInstance(user) as UserInternal; await _assertLinkedStatus(false, userInternal, ProviderId.PHONE); @@ -172,7 +197,7 @@ export async function linkWithPhoneNumber( export async function reauthenticateWithPhoneNumber( user: User, phoneNumber: string, - appVerifier: ApplicationVerifier + appVerifier?: ApplicationVerifier ): Promise { const userInternal = getModularInstance(user) as UserInternal; if (_isFirebaseServerApp(userInternal.auth.app)) { @@ -190,6 +215,11 @@ export async function reauthenticateWithPhoneNumber( ); } +type PhoneApiCaller = ( + auth: AuthInternal, + request: TRequest +) => Promise; + /** * Returns a verification ID to be used in conjunction with the SMS code that is sent. * @@ -197,22 +227,23 @@ export async function reauthenticateWithPhoneNumber( export async function _verifyPhoneNumber( auth: AuthInternal, options: PhoneInfoOptions | string, - verifier: ApplicationVerifierInternal + verifier?: ApplicationVerifierInternal ): Promise { - const recaptchaToken = await verifier.verify(); + if (!auth._getRecaptchaConfig()) { + try { + await _initializeRecaptchaConfig(auth); + } catch (error) { + // If an error occurs while fetching the config, there is no way to know the enablement state + // of Phone provider, so we proceed with recaptcha V2 verification. + // The error is likely "recaptchaKey undefined", as reCAPTCHA Enterprise is not + // enabled for any provider. + console.log( + 'Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.' + ); + } + } try { - _assert( - typeof recaptchaToken === 'string', - auth, - AuthErrorCode.ARGUMENT_ERROR - ); - _assert( - verifier.type === RECAPTCHA_VERIFIER_TYPE, - auth, - AuthErrorCode.ARGUMENT_ERROR - ); - let phoneInfoOptions: PhoneInfoOptions; if (typeof options === 'string') { @@ -232,13 +263,53 @@ export async function _verifyPhoneNumber( auth, AuthErrorCode.INTERNAL_ERROR ); - const response = await startEnrollPhoneMfa(auth, { + + const startPhoneMfaEnrollmentRequest: StartPhoneMfaEnrollmentRequest = { idToken: session.credential, phoneEnrollmentInfo: { phoneNumber: phoneInfoOptions.phoneNumber, - recaptchaToken + clientType: RecaptchaClientType.WEB + } + }; + + const startEnrollPhoneMfaActionCallback: PhoneApiCaller< + StartPhoneMfaEnrollmentRequest, + StartPhoneMfaEnrollmentResponse + > = async ( + authInstance: AuthInternal, + request: StartPhoneMfaEnrollmentRequest + ) => { + // If reCAPTCHA Enterprise token is FAKE_TOKEN, fetch reCAPTCHA v2 token and inject into request. + if (request.phoneEnrollmentInfo.captchaResponse === FAKE_TOKEN) { + _assert( + verifier?.type === RECAPTCHA_VERIFIER_TYPE, + authInstance, + AuthErrorCode.ARGUMENT_ERROR + ); + + const requestWithRecaptchaV2 = await injectRecaptchaV2Token( + authInstance, + request, + verifier + ); + return startEnrollPhoneMfa(authInstance, requestWithRecaptchaV2); } + return startEnrollPhoneMfa(authInstance, request); + }; + + const startPhoneMfaEnrollmentResponse: Promise = + handleRecaptchaFlow( + auth, + startPhoneMfaEnrollmentRequest, + RecaptchaActionName.MFA_SMS_ENROLLMENT, + startEnrollPhoneMfaActionCallback, + RecaptchaAuthProvider.PHONE_PROVIDER + ); + + const response = await startPhoneMfaEnrollmentResponse.catch(error => { + return Promise.reject(error); }); + return response.phoneSessionInfo.sessionInfo; } else { _assert( @@ -250,24 +321,107 @@ export async function _verifyPhoneNumber( phoneInfoOptions.multiFactorHint?.uid || phoneInfoOptions.multiFactorUid; _assert(mfaEnrollmentId, auth, AuthErrorCode.MISSING_MFA_INFO); - const response = await startSignInPhoneMfa(auth, { + + const startPhoneMfaSignInRequest: StartPhoneMfaSignInRequest = { mfaPendingCredential: session.credential, mfaEnrollmentId, phoneSignInInfo: { - recaptchaToken + clientType: RecaptchaClientType.WEB + } + }; + + const startSignInPhoneMfaActionCallback: PhoneApiCaller< + StartPhoneMfaSignInRequest, + StartPhoneMfaSignInResponse + > = async ( + authInstance: AuthInternal, + request: StartPhoneMfaSignInRequest + ) => { + // If reCAPTCHA Enterprise token is FAKE_TOKEN, fetch reCAPTCHA v2 token and inject into request. + if (request.phoneSignInInfo.captchaResponse === FAKE_TOKEN) { + _assert( + verifier?.type === RECAPTCHA_VERIFIER_TYPE, + authInstance, + AuthErrorCode.ARGUMENT_ERROR + ); + + const requestWithRecaptchaV2 = await injectRecaptchaV2Token( + authInstance, + request, + verifier + ); + return startSignInPhoneMfa(authInstance, requestWithRecaptchaV2); } + return startSignInPhoneMfa(authInstance, request); + }; + + const startPhoneMfaSignInResponse: Promise = + handleRecaptchaFlow( + auth, + startPhoneMfaSignInRequest, + RecaptchaActionName.MFA_SMS_SIGNIN, + startSignInPhoneMfaActionCallback, + RecaptchaAuthProvider.PHONE_PROVIDER + ); + + const response = await startPhoneMfaSignInResponse.catch(error => { + return Promise.reject(error); }); + return response.phoneResponseInfo.sessionInfo; } } else { - const { sessionInfo } = await sendPhoneVerificationCode(auth, { - phoneNumber: phoneInfoOptions.phoneNumber, - recaptchaToken + const sendPhoneVerificationCodeRequest: SendPhoneVerificationCodeRequest = + { + phoneNumber: phoneInfoOptions.phoneNumber, + clientType: RecaptchaClientType.WEB + }; + + const sendPhoneVerificationCodeActionCallback: PhoneApiCaller< + SendPhoneVerificationCodeRequest, + SendPhoneVerificationCodeResponse + > = async ( + authInstance: AuthInternal, + request: SendPhoneVerificationCodeRequest + ) => { + // If reCAPTCHA Enterprise token is FAKE_TOKEN, fetch reCAPTCHA v2 token and inject into request. + if (request.captchaResponse === FAKE_TOKEN) { + _assert( + verifier?.type === RECAPTCHA_VERIFIER_TYPE, + authInstance, + AuthErrorCode.ARGUMENT_ERROR + ); + + const requestWithRecaptchaV2 = await injectRecaptchaV2Token( + authInstance, + request, + verifier + ); + return sendPhoneVerificationCode( + authInstance, + requestWithRecaptchaV2 + ); + } + return sendPhoneVerificationCode(authInstance, request); + }; + + const sendPhoneVerificationCodeResponse: Promise = + handleRecaptchaFlow( + auth, + sendPhoneVerificationCodeRequest, + RecaptchaActionName.SEND_VERIFICATION_CODE, + sendPhoneVerificationCodeActionCallback, + RecaptchaAuthProvider.PHONE_PROVIDER + ); + + const response = await sendPhoneVerificationCodeResponse.catch(error => { + return Promise.reject(error); }); - return sessionInfo; + + return response.sessionInfo; } } finally { - verifier._reset(); + verifier?._reset(); } } @@ -306,3 +460,75 @@ export async function updatePhoneNumber( } await _link(userInternal, credential); } + +// Helper function that fetches and injects a reCAPTCHA v2 token into the request. +export async function injectRecaptchaV2Token( + auth: AuthInternal, + request: T, + recaptchaV2Verifier: ApplicationVerifierInternal +): Promise { + _assert( + recaptchaV2Verifier.type === RECAPTCHA_VERIFIER_TYPE, + auth, + AuthErrorCode.ARGUMENT_ERROR + ); + + const recaptchaV2Token = await recaptchaV2Verifier.verify(); + + _assert( + typeof recaptchaV2Token === 'string', + auth, + AuthErrorCode.ARGUMENT_ERROR + ); + + const newRequest = { ...request }; + + if ('phoneEnrollmentInfo' in newRequest) { + const phoneNumber = ( + newRequest as unknown as StartPhoneMfaEnrollmentRequest + ).phoneEnrollmentInfo.phoneNumber; + const captchaResponse = ( + newRequest as unknown as StartPhoneMfaEnrollmentRequest + ).phoneEnrollmentInfo.captchaResponse; + const clientType = (newRequest as unknown as StartPhoneMfaEnrollmentRequest) + .phoneEnrollmentInfo.clientType; + const recaptchaVersion = ( + newRequest as unknown as StartPhoneMfaEnrollmentRequest + ).phoneEnrollmentInfo.recaptchaVersion; + + Object.assign(newRequest, { + 'phoneEnrollmentInfo': { + phoneNumber, + recaptchaToken: recaptchaV2Token, + captchaResponse, + clientType, + recaptchaVersion + } + }); + + return newRequest; + } else if ('phoneSignInInfo' in newRequest) { + const captchaResponse = ( + newRequest as unknown as StartPhoneMfaSignInRequest + ).phoneSignInInfo.captchaResponse; + const clientType = (newRequest as unknown as StartPhoneMfaSignInRequest) + .phoneSignInInfo.clientType; + const recaptchaVersion = ( + newRequest as unknown as StartPhoneMfaSignInRequest + ).phoneSignInInfo.recaptchaVersion; + + Object.assign(newRequest, { + 'phoneSignInInfo': { + recaptchaToken: recaptchaV2Token, + captchaResponse, + clientType, + recaptchaVersion + } + }); + + return newRequest; + } else { + Object.assign(newRequest, { 'recaptchaToken': recaptchaV2Token }); + return newRequest; + } +} diff --git a/packages/auth/src/platform_node/index.ts b/packages/auth/src/platform_node/index.ts index 41da18ff643..67618b5b773 100644 --- a/packages/auth/src/platform_node/index.ts +++ b/packages/auth/src/platform_node/index.ts @@ -28,18 +28,9 @@ import { AuthImpl } from '../core/auth/auth_impl'; import { FetchProvider } from '../core/util/fetch_provider'; import { getDefaultEmulatorHost } from '@firebase/util'; -import { - fetch as undiciFetch, - Headers as undiciHeaders, - Response as undiciResponse -} from 'undici'; // Initialize the fetch polyfill, the types are slightly off so just cast and hope for the best -FetchProvider.initialize( - undiciFetch as unknown as typeof fetch, - undiciHeaders as unknown as typeof Headers, - undiciResponse as unknown as typeof Response -); +FetchProvider.initialize(fetch, Headers, Response); // First, we set up the various platform-specific features for Node (register // the version and declare the Node getAuth function) diff --git a/packages/auth/test/helpers/integration/emulator_rest_helpers.ts b/packages/auth/test/helpers/integration/emulator_rest_helpers.ts index 32b9aad2129..5a96d193ee1 100644 --- a/packages/auth/test/helpers/integration/emulator_rest_helpers.ts +++ b/packages/auth/test/helpers/integration/emulator_rest_helpers.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { fetch as undiciFetch, RequestInit as undiciRequestInit } from 'undici'; import { getAppConfig, getEmulatorUrl } from './settings'; export interface VerificationSession { @@ -88,9 +87,8 @@ function doFetch(url: string, request?: RequestInit): ReturnType { if (typeof document !== 'undefined') { return fetch(url, request); } else { - return undiciFetch( - url, - request as undiciRequestInit - ) as unknown as ReturnType; + return fetch(url, request as RequestInit) as unknown as ReturnType< + typeof fetch + >; } } diff --git a/packages/auth/test/integration/flows/recaptcha_enterprise.test.ts b/packages/auth/test/integration/flows/recaptcha_enterprise.test.ts new file mode 100644 index 00000000000..00cec9dfd7e --- /dev/null +++ b/packages/auth/test/integration/flows/recaptcha_enterprise.test.ts @@ -0,0 +1,199 @@ +/** + * @license + * Copyright 2024 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, use } from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import sinonChai from 'sinon-chai'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { + linkWithPhoneNumber, + PhoneAuthProvider, + reauthenticateWithPhoneNumber, + signInAnonymously, + signInWithPhoneNumber, + unlink, + updatePhoneNumber, + Auth, + OperationType, + ProviderId +} from '@firebase/auth'; +import { + cleanUpTestInstance, + getTestInstance +} from '../../helpers/integration/helpers'; + +import { getEmulatorUrl } from '../../helpers/integration/settings'; + +use(chaiAsPromised); +use(sinonChai); + +let auth: Auth; +let emulatorUrl: string | null; + +// NOTE: These happy test cases don't use a real phone number. In order to run these tests +// you must allowlist the following phone number as "testing" numbers in the Auth console. +// https://console.firebase.google.com/u/0/project/_/authentication/providers +// • +1 (555) 555-1000, SMS code 123456 + +const FICTIONAL_PHONE = { + phoneNumber: '+15555551000', + code: '123456' +}; + +// This phone number is not allowlisted. It is used in error test cases to catch errors, as +// using fictional phone number always receives success response from the server. +// Note: Don't use this for happy cases because we want to avoid sending actual SMS message. +const NONFICTIONAL_PHONE = { + phoneNumber: '+15555553000' +}; + +// These tests are written when reCAPTCHA Enterprise is set to ENFORCE. In order to run these tests +// you must enable reCAPTCHA Enterprise in Cloud Console and set enforcement state for PHONE_PROVIDER +// to ENFORCE. +// The CI project has reCAPTCHA bot-score and toll fraud protection enabled. +describe('Integration test: phone auth with reCAPTCHA Enterprise ENFORCE mode', () => { + beforeEach(() => { + emulatorUrl = getEmulatorUrl(); + if (!emulatorUrl) { + auth = getTestInstance(); + // Sets to false to generate the real reCAPTCHA Enterprise token + auth.settings.appVerificationDisabledForTesting = false; + } + }); + + afterEach(async () => { + if (!emulatorUrl) { + await cleanUpTestInstance(auth); + } + }); + + it('allows user to sign in with phone number', async function () { + if (emulatorUrl) { + this.skip(); + } + + // This generates real recaptcha token and use it for verification + const confirmationResult = await signInWithPhoneNumber( + auth, + FICTIONAL_PHONE.phoneNumber + ); + expect(confirmationResult.verificationId).not.to.be.null; + + const userCred = await confirmationResult.confirm('123456'); + expect(auth.currentUser).to.eq(userCred.user); + expect(userCred.operationType).to.eq(OperationType.SIGN_IN); + + const user = userCred.user; + expect(user.isAnonymous).to.be.false; + expect(user.uid).to.be.a('string'); + expect(user.phoneNumber).to.eq(FICTIONAL_PHONE.phoneNumber); + }); + + it('throws error if recaptcha token is invalid', async function () { + if (emulatorUrl) { + this.skip(); + } + // Simulates a fake token by setting this to true + auth.settings.appVerificationDisabledForTesting = true; + + // Use unallowlisted phone number to trigger real reCAPTCHA Enterprise verification + // Since it will throw an error, no SMS will be sent. + await expect( + signInWithPhoneNumber(auth, NONFICTIONAL_PHONE.phoneNumber) + ).to.be.rejectedWith('auth/invalid-recaptcha-token'); + }); + + it('anonymous users can upgrade using phone number', async function () { + if (emulatorUrl) { + this.skip(); + } + const { user } = await signInAnonymously(auth); + const { uid: anonId } = user; + + const provider = new PhoneAuthProvider(auth); + const verificationId = await provider.verifyPhoneNumber( + FICTIONAL_PHONE.phoneNumber + ); + + await updatePhoneNumber( + user, + PhoneAuthProvider.credential(verificationId, FICTIONAL_PHONE.code) + ); + expect(user.phoneNumber).to.eq(FICTIONAL_PHONE.phoneNumber); + + await auth.signOut(); + + const cr = await signInWithPhoneNumber(auth, FICTIONAL_PHONE.phoneNumber); + const { user: secondSignIn } = await cr.confirm(FICTIONAL_PHONE.code); + + expect(secondSignIn.uid).to.eq(anonId); + expect(secondSignIn.isAnonymous).to.be.false; + expect(secondSignIn.providerData[0].phoneNumber).to.eq( + FICTIONAL_PHONE.phoneNumber + ); + expect(secondSignIn.providerData[0].providerId).to.eq('phone'); + }); + + it('anonymous users can link (and unlink) phone number', async function () { + if (emulatorUrl) { + this.skip(); + } + const { user } = await signInAnonymously(auth); + const { uid: anonId } = user; + + const confirmationResult = await linkWithPhoneNumber( + user, + FICTIONAL_PHONE.phoneNumber + ); + const linkResult = await confirmationResult.confirm(FICTIONAL_PHONE.code); + expect(linkResult.operationType).to.eq(OperationType.LINK); + expect(linkResult.user.uid).to.eq(user.uid); + expect(linkResult.user.phoneNumber).to.eq(FICTIONAL_PHONE.phoneNumber); + + await unlink(user, ProviderId.PHONE); + expect(auth.currentUser!.uid).to.eq(anonId); + // Is anonymous stays false even after unlinking + expect(auth.currentUser!.isAnonymous).to.be.false; + expect(auth.currentUser!.phoneNumber).to.be.null; + }); + + it('allows the user to reauthenticate with phone number', async function () { + if (emulatorUrl) { + this.skip(); + } + // Create a phone user first + let confirmationResult = await signInWithPhoneNumber( + auth, + FICTIONAL_PHONE.phoneNumber + ); + const { user } = await confirmationResult.confirm(FICTIONAL_PHONE.code); + const oldToken = await user.getIdToken(); + + // Wait a bit to ensure the sign in time is different in the token + await new Promise((resolve): void => { + setTimeout(resolve, 1500); + }); + + confirmationResult = await reauthenticateWithPhoneNumber( + user, + FICTIONAL_PHONE.phoneNumber + ); + await confirmationResult.confirm(FICTIONAL_PHONE.code); + + expect(await user.getIdToken()).not.to.eq(oldToken); + }); +}); diff --git a/packages/component/CHANGELOG.md b/packages/component/CHANGELOG.md index 72fa50e8e2c..8ab0bb795f6 100644 --- a/packages/component/CHANGELOG.md +++ b/packages/component/CHANGELOG.md @@ -1,5 +1,14 @@ # @firebase/component +## 0.6.10 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/util@1.10.1 + ## 0.6.9 ### Patch Changes diff --git a/packages/component/package.json b/packages/component/package.json index 3ae6f40e90c..a01723c79bf 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/component", - "version": "0.6.9", + "version": "0.6.10", "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm5.js", "exports": { ".": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -33,14 +31,14 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/util": "1.10.0", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/component", @@ -56,5 +54,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/component/rollup.config.js b/packages/component/rollup.config.js index f0cc1a84e98..11d18692c8c 100644 --- a/packages/component/rollup.config.js +++ b/packages/component/rollup.config.js @@ -24,49 +24,24 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }) -]; +const buildPlugins = [typescriptPlugin({ typescript })]; -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }) -]; +const esmBuild = { + input: 'index.ts', + output: { file: pkg.module, format: 'es', sourcemap: true }, + plugins: [...buildPlugins, emitModulePackageFile()], + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +}; -const esmBuilds = [ - { - input: 'index.ts', - output: { file: pkg.module, format: 'es', sourcemap: true }, - plugins: [...es2017BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +const cjsBuild = { + input: 'index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true }, - { - input: 'index.ts', - output: { - file: pkg.esm5, - format: 'es', - sourcemap: true - }, - plugins: [...es5BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; + plugins: buildPlugins, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +}; -const cjsBuilds = [ - { - input: 'index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; - -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/data-connect/CHANGELOG.md b/packages/data-connect/CHANGELOG.md index 4607da62337..80e5ffda8d4 100644 --- a/packages/data-connect/CHANGELOG.md +++ b/packages/data-connect/CHANGELOG.md @@ -1,10 +1,30 @@ ## Unreleased + +## 0.1.1 + +### Patch Changes + +- [`cf988b0b1`](https://github.com/firebase/firebase-js-sdk/commit/cf988b0b1217a06e5d1b9130d6048178626dac48) [#8570](https://github.com/firebase/firebase-js-sdk/pull/8570) - - Throw error when calling `executeQuery` with mutations + +- [`813b9fad6`](https://github.com/firebase/firebase-js-sdk/commit/813b9fad63ff7b8798e4f4e17ccd528a784698d9) [#8565](https://github.com/firebase/firebase-js-sdk/pull/8565) - - Modified user agent to use language instead of platform + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + +## 0.1.0 + +### Minor Changes + +- [`beaa4dffb`](https://github.com/firebase/firebase-js-sdk/commit/beaa4dffb7f48cb12ccc6c1d1b7cdc9c3605fc04) [#8480](https://github.com/firebase/firebase-js-sdk/pull/8480) - Included Data Connect product. + * Added app check support # @firebase/data-connect ## 0.0.3 -* Updated reporting to use @firebase/data-connect instead of @firebase/connect. -* Added functionality to retry queries and mutations if the server responds with UNAUTHENTICATED. -* Moved `validateArgs` to core SDK. -* Updated errors to only show relevant details to the user. -* Added ability to track whether user is calling core sdk or generated sdk. +- Updated reporting to use @firebase/data-connect instead of @firebase/connect. +- Added functionality to retry queries and mutations if the server responds with UNAUTHENTICATED. +- Moved `validateArgs` to core SDK. +- Updated errors to only show relevant details to the user. +- Added ability to track whether user is calling core sdk or generated sdk. diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index ba697fb9a76..4db4d4df609 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -1,12 +1,11 @@ { "name": "@firebase/data-connect", - "version": "0.0.3", + "version": "0.1.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", "exports": { ".": { "types": "./dist/public.d.ts", @@ -14,7 +13,6 @@ "import": "./dist/node-esm/index.node.esm.js", "require": "./dist/index.node.cjs.js" }, - "esm5": "./dist/index.esm5.js", "browser": { "require": "./dist/index.cjs.js", "import": "./dist/index.esm2017.js" @@ -51,16 +49,16 @@ }, "dependencies": { "@firebase/auth-interop-types": "0.2.3", - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", + "@firebase/component": "0.6.10", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/data-connect", @@ -77,4 +75,4 @@ ], "reportDir": "./coverage/node" } -} \ No newline at end of file +} diff --git a/packages/data-connect/rollup.config.js b/packages/data-connect/rollup.config.js index cb220911d69..56b6464d274 100644 --- a/packages/data-connect/rollup.config.js +++ b/packages/data-connect/rollup.config.js @@ -35,47 +35,15 @@ function onWarn(warning, defaultWarn) { defaultWarn(warning); } -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, abortOnError: false }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, - abortOnError: false - }), json({ preferConst: true }) ]; const browserBuilds = [ - { - input: 'src/index.ts', - output: [ - { - file: pkg.esm5, - format: 'es', - sourcemap: true - } - ], - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)) - ], - treeshake: { - moduleSideEffects: false - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - onwarn: onWarn - }, { input: 'src/index.ts', output: [ @@ -86,7 +54,7 @@ const browserBuilds = [ } ], plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)) ], treeshake: { @@ -97,15 +65,13 @@ const browserBuilds = [ }, { input: 'src/index.ts', - output: [ - { - file: 'dist/index.cjs.js', - format: 'cjs', - sourcemap: true - } - ], + output: { + file: pkg.exports['.'].browser.require, + format: 'cjs', + sourcemap: true + }, plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], treeshake: { @@ -119,10 +85,14 @@ const browserBuilds = [ const nodeBuilds = [ { input: 'src/index.node.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], treeshake: { moduleSideEffects: false @@ -138,7 +108,7 @@ const nodeBuilds = [ sourcemap: true }, plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)), emitModulePackageFile() ], diff --git a/packages/data-connect/src/core/QueryManager.ts b/packages/data-connect/src/core/QueryManager.ts index c82e0fee903..8b7c59aea85 100644 --- a/packages/data-connect/src/core/QueryManager.ts +++ b/packages/data-connect/src/core/QueryManager.ts @@ -37,7 +37,7 @@ import { DataConnectTransport } from '../network'; import { encoderImpl } from '../util/encoder'; import { setIfNotExists } from '../util/map'; -import { DataConnectError } from './error'; +import { Code, DataConnectError } from './error'; interface TrackedQuery { ref: Omit, 'dataConnect'>; @@ -172,6 +172,12 @@ export class QueryManager { executeQuery( queryRef: QueryRef ): QueryPromise { + if (queryRef.refType !== QUERY_STR) { + throw new DataConnectError( + Code.INVALID_ARGUMENT, + `ExecuteQuery can only execute query operation` + ); + } const key = encoderImpl({ name: queryRef.name, variables: queryRef.variables, diff --git a/packages/data-connect/src/network/fetch.ts b/packages/data-connect/src/network/fetch.ts index 928b9f873cf..06ef6dd8285 100644 --- a/packages/data-connect/src/network/fetch.ts +++ b/packages/data-connect/src/network/fetch.ts @@ -26,7 +26,7 @@ export function initializeFetch(fetchImpl: typeof fetch): void { function getGoogApiClientValue(_isUsingGen: boolean): string { let str = 'gl-js/ fire/' + SDK_VERSION; if (_isUsingGen) { - str += ' web/gen'; + str += ' js/gen'; } return str; } diff --git a/packages/data-connect/test/unit/QueryManager.test.ts b/packages/data-connect/test/unit/QueryManager.test.ts new file mode 100644 index 00000000000..9acc948d57c --- /dev/null +++ b/packages/data-connect/test/unit/QueryManager.test.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2024 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 { deleteApp, FirebaseApp, initializeApp } from '@firebase/app'; +import { expect } from 'chai'; +import * as chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import { + DataConnect, + executeQuery, + getDataConnect, + mutationRef, + queryRef +} from '../../src'; +import { Code, DataConnectError } from '../../src/core/error'; +chai.use(chaiAsPromised); + +describe('Query Manager Tests', () => { + let dc: DataConnect; + let app: FirebaseApp; + const APPID = 'MYAPPID'; + const APPNAME = 'MYAPPNAME'; + + beforeEach(() => { + app = initializeApp({ projectId: 'p', appId: APPID }, APPNAME); + dc = getDataConnect(app, { + connector: 'c', + location: 'l', + service: 's' + }); + }); + afterEach(async () => { + await dc._delete(); + await deleteApp(app); + }); + + it('should refuse to make requests to execute non-query operations', async () => { + const query = queryRef(dc, 'q'); + const mutation = mutationRef(dc, 'm'); + + const error = new DataConnectError( + Code.INVALID_ARGUMENT, + `ExecuteQuery can only execute query operation` + ); + + // @ts-ignore + expect(() => executeQuery(mutation)).to.throw(error.message); + expect(() => executeQuery(query)).to.not.throw(error.message); + }); +}); diff --git a/packages/data-connect/test/unit/userAgent.test.ts b/packages/data-connect/test/unit/userAgent.test.ts index d218969fb75..9e9637a7ea6 100644 --- a/packages/data-connect/test/unit/userAgent.test.ts +++ b/packages/data-connect/test/unit/userAgent.test.ts @@ -57,7 +57,7 @@ describe('User Agent Tests', () => { 'https://firebasedataconnect.googleapis.com/v1beta/projects/p/locations/l/services/s/connectors/c:executeQuery', { headers: { - ['X-Goog-Api-Client']: 'gl-js/ fire/' + SDK_VERSION + ' web/gen' + ['X-Goog-Api-Client']: 'gl-js/ fire/' + SDK_VERSION + ' js/gen' } } ); diff --git a/packages/database-compat/CHANGELOG.md b/packages/database-compat/CHANGELOG.md index d8ce29ad975..2cc8a90cdc8 100644 --- a/packages/database-compat/CHANGELOG.md +++ b/packages/database-compat/CHANGELOG.md @@ -1,5 +1,24 @@ # @firebase/database-compat +## 2.0.0 + +### Major Changes + +- [`0f5a9aad0`](https://github.com/firebase/firebase-js-sdk/commit/0f5a9aad0936af4c2df50d083db73306ebe069bc) [#8586](https://github.com/firebase/firebase-js-sdk/pull/8586) - Set required version of Node to >=18. + +## 1.0.9 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/database@1.0.9 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + - @firebase/database-types@1.0.6 + ## 1.0.8 ### Patch Changes diff --git a/packages/database-compat/package.json b/packages/database-compat/package.json index 5f554f1644c..e601f88ed12 100644 --- a/packages/database-compat/package.json +++ b/packages/database-compat/package.json @@ -1,12 +1,11 @@ { "name": "@firebase/database-compat", - "version": "1.0.8", + "version": "2.0.0", "description": "The Realtime Database component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", "license": "Apache-2.0", "typings": "dist/database-compat/src/index.d.ts", "files": [ @@ -21,7 +20,6 @@ "import": "./dist/node-esm/index.js", "require": "./dist/index.js" }, - "esm5": "./dist/index.esm5.js", "browser": { "require": "./dist/index.js", "import": "./dist/index.esm2017.js" @@ -51,16 +49,16 @@ "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../database/dist/public.d.ts -o dist/database-compat/src/index.d.ts -a -r Database:types.FirebaseDatabase -r Query:types.Query -r DatabaseReference:types.Reference -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/database" }, "dependencies": { - "@firebase/database": "1.0.8", - "@firebase/database-types": "1.0.5", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/database": "1.0.9", + "@firebase/database-types": "1.0.6", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.41", - "typescript": "4.7.4" + "@firebase/app-compat": "0.2.45", + "typescript": "5.5.4" }, "repository": { "directory": "packages/database-compat", @@ -69,5 +67,8 @@ }, "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/database-compat/rollup.config.js b/packages/database-compat/rollup.config.js index bba2fba3c44..57ec9aee2ba 100644 --- a/packages/database-compat/rollup.config.js +++ b/packages/database-compat/rollup.config.js @@ -34,24 +34,11 @@ function onWarn(warning, defaultWarn) { defaultWarn(warning); } -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, abortOnError: false }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, - abortOnError: false - }), json({ preferConst: true }) ]; @@ -68,7 +55,7 @@ const esmBuilds = [ sourcemap: true } ], - plugins: [...es2017BuildPlugins, emitModulePackageFile()], + plugins: [...buildPlugins, emitModulePackageFile()], treeshake: { moduleSideEffects: false }, @@ -76,24 +63,8 @@ const esmBuilds = [ onwarn: onWarn }, /** - * Browser Builds + * Browser Build */ - { - input: 'src/index.ts', - output: [ - { - file: pkg.esm5, - format: 'es', - sourcemap: true - } - ], - plugins: es5BuildPlugins, - treeshake: { - moduleSideEffects: false - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - onwarn: onWarn - }, { input: 'src/index.ts', output: [ @@ -103,7 +74,7 @@ const esmBuilds = [ sourcemap: true } ], - plugins: es2017BuildPlugins, + plugins: buildPlugins, treeshake: { moduleSideEffects: false }, @@ -125,7 +96,7 @@ const cjsBuilds = [ sourcemap: true } ], - plugins: es5BuildPlugins, + plugins: buildPlugins, treeshake: { moduleSideEffects: false }, @@ -146,7 +117,7 @@ const cjsBuilds = [ } ], plugins: [ - ...es5BuildPlugins, + ...buildPlugins, resolveModule({ exportConditions: ['standalone'], preferBuiltins: true diff --git a/packages/database-compat/test/transaction.test.ts b/packages/database-compat/test/transaction.test.ts index 55d7b5042c0..950e9b74e5f 100644 --- a/packages/database-compat/test/transaction.test.ts +++ b/packages/database-compat/test/transaction.test.ts @@ -847,9 +847,11 @@ describe('Transaction Tests', () => { ref1.transaction( current => { retries++; - // We should be getting server events while the transaction is outstanding. - for (let i = 0; i < (current || 0); i++) { - expect(events[i]).to.equal(i); + if (typeof current === 'number') { + // We should be getting server events while the transaction is outstanding. + for (let i = 0; i < (current || 0); i++) { + expect(events[i]).to.equal(i); + } } if (current === SETS - 1) { @@ -919,7 +921,7 @@ describe('Transaction Tests', () => { current => { if (current == null) { return 0; - } else if (current < COUNT) { + } else if (typeof current === 'number' && current < COUNT) { return (current as number) + 1; } else { shouldCommit = false; diff --git a/packages/database-types/CHANGELOG.md b/packages/database-types/CHANGELOG.md index 4294de7b6f3..252d2456b00 100644 --- a/packages/database-types/CHANGELOG.md +++ b/packages/database-types/CHANGELOG.md @@ -1,5 +1,12 @@ # @firebase/database-types +## 1.0.6 + +### Patch Changes + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/util@1.10.1 + ## 1.0.5 ### Patch Changes diff --git a/packages/database-types/package.json b/packages/database-types/package.json index 76191ca33dd..c42763ad0d8 100644 --- a/packages/database-types/package.json +++ b/packages/database-types/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/database-types", - "version": "1.0.5", + "version": "1.0.6", "description": "@firebase/database Types", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -13,7 +13,7 @@ ], "dependencies": { "@firebase/app-types": "0.9.2", - "@firebase/util": "1.10.0" + "@firebase/util": "1.10.1" }, "repository": { "directory": "packages/database-types", @@ -24,6 +24,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/database/CHANGELOG.md b/packages/database/CHANGELOG.md index eaae4e7846c..9814093f64e 100644 --- a/packages/database/CHANGELOG.md +++ b/packages/database/CHANGELOG.md @@ -1,5 +1,16 @@ # Unreleased +## 1.0.9 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 1.0.8 ### Patch Changes diff --git a/packages/database/package.json b/packages/database/package.json index 87c405255c7..214433b7f94 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,12 +1,11 @@ { "name": "@firebase/database", - "version": "1.0.8", + "version": "1.0.9", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", "standalone": "dist/index.standalone.js", "exports": { ".": { @@ -15,7 +14,6 @@ "import": "./dist/node-esm/index.node.esm.js", "require": "./dist/index.node.cjs.js" }, - "esm5": "./dist/index.esm5.js", "standalone": "./dist/index.standalone.js", "browser": { "require": "./dist/index.cjs.js", @@ -50,19 +48,19 @@ "license": "Apache-2.0", "peerDependencies": {}, "dependencies": { - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "@firebase/app-check-interop-types": "0.3.2", "@firebase/auth-interop-types": "0.2.3", "faye-websocket": "0.11.4", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/database", @@ -78,5 +76,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/database/rollup.config.js b/packages/database/rollup.config.js index 886a177e4d9..293eaf06811 100644 --- a/packages/database/rollup.config.js +++ b/packages/database/rollup.config.js @@ -35,47 +35,15 @@ function onWarn(warning, defaultWarn) { defaultWarn(warning); } -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, abortOnError: false }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, - abortOnError: false - }), json({ preferConst: true }) ]; const browserBuilds = [ - { - input: 'src/index.ts', - output: [ - { - file: pkg.esm5, - format: 'es', - sourcemap: true - } - ], - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)) - ], - treeshake: { - moduleSideEffects: false - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - onwarn: onWarn - }, { input: 'src/index.ts', output: [ @@ -86,7 +54,7 @@ const browserBuilds = [ } ], plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)) ], treeshake: { @@ -105,7 +73,7 @@ const browserBuilds = [ } ], plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], treeshake: { @@ -119,10 +87,14 @@ const browserBuilds = [ const nodeBuilds = [ { input: 'src/index.node.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], treeshake: { moduleSideEffects: false @@ -138,7 +110,7 @@ const nodeBuilds = [ sourcemap: true }, plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)), emitModulePackageFile() ], @@ -154,7 +126,7 @@ const nodeBuilds = [ { input: 'src/index.standalone.ts', output: [{ file: pkg.standalone, format: 'cjs', sourcemap: true }], - plugins: es5BuildPlugins, + plugins: buildPlugins, treeshake: { moduleSideEffects: false }, diff --git a/packages/database/src/register.ts b/packages/database/src/register.ts index cd2be0aaa7e..9322368526b 100644 --- a/packages/database/src/register.ts +++ b/packages/database/src/register.ts @@ -47,6 +47,6 @@ export function registerDatabase(variant?: string): void { ).setMultipleInstances(true) ); registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/firebase/CHANGELOG.md b/packages/firebase/CHANGELOG.md index bb0350f1640..42913f9a843 100644 --- a/packages/firebase/CHANGELOG.md +++ b/packages/firebase/CHANGELOG.md @@ -1,5 +1,82 @@ # firebase +## 11.0.1 + +### Patch Changes + +- Updated dependencies [[`0f5a9aad0`](https://github.com/firebase/firebase-js-sdk/commit/0f5a9aad0936af4c2df50d083db73306ebe069bc)]: + - @firebase/database-compat@2.0.0 + - @firebase/app@0.10.15 + - @firebase/app-compat@0.2.45 + +## 11.0.0 + +### Major Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Release VertexAI in Firebase for general availability. + +### Minor Changes + +- [`b942e9e6e`](https://github.com/firebase/firebase-js-sdk/commit/b942e9e6e22d184d21f3e452cd35122592a3a372) [#8568](https://github.com/firebase/firebase-js-sdk/pull/8568) - [feature] Added reCAPTCHA Enterprise support for app verification during phone authentication. + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`cf988b0b1`](https://github.com/firebase/firebase-js-sdk/commit/cf988b0b1217a06e5d1b9130d6048178626dac48), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`b942e9e6e`](https://github.com/firebase/firebase-js-sdk/commit/b942e9e6e22d184d21f3e452cd35122592a3a372), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`813b9fad6`](https://github.com/firebase/firebase-js-sdk/commit/813b9fad63ff7b8798e4f4e17ccd528a784698d9), [`a2146910c`](https://github.com/firebase/firebase-js-sdk/commit/a2146910ccb0efd1e0dc4496c328358d5afdea61)]: + - @firebase/data-connect@0.1.1 + - @firebase/vertexai@1.0.0 + - @firebase/installations-compat@0.2.10 + - @firebase/remote-config-compat@0.2.10 + - @firebase/performance-compat@0.2.10 + - @firebase/analytics-compat@0.2.15 + - @firebase/app-check-compat@0.3.16 + - @firebase/firestore-compat@0.3.39 + - @firebase/functions-compat@0.3.15 + - @firebase/messaging-compat@0.2.13 + - @firebase/database-compat@1.0.9 + - @firebase/storage-compat@0.3.13 + - @firebase/installations@0.6.10 + - @firebase/remote-config@0.4.10 + - @firebase/auth-compat@0.5.15 + - @firebase/performance@0.6.10 + - @firebase/app-compat@0.2.44 + - @firebase/analytics@0.10.9 + - @firebase/app-check@0.8.9 + - @firebase/firestore@4.7.4 + - @firebase/functions@0.11.9 + - @firebase/messaging@0.12.13 + - @firebase/database@1.0.9 + - @firebase/storage@0.13.3 + - @firebase/auth@1.8.0 + - @firebase/util@1.10.1 + - @firebase/app@0.10.14 + +## 10.14.1 + +### Patch Changes + +- Updated dependencies [[`d6fa58854`](https://github.com/firebase/firebase-js-sdk/commit/d6fa58854e3cc976eab150154e2786043bc5e563)]: + - @firebase/app@0.10.13 + - @firebase/messaging@0.12.12 + - @firebase/app-compat@0.2.43 + - @firebase/messaging-compat@0.2.12 + +## 10.14.0 + +### Minor Changes + +- [`beaa4dffb`](https://github.com/firebase/firebase-js-sdk/commit/beaa4dffb7f48cb12ccc6c1d1b7cdc9c3605fc04) [#8480](https://github.com/firebase/firebase-js-sdk/pull/8480) - Included Data Connect product. + +### Patch Changes + +- Updated dependencies [[`beaa4dffb`](https://github.com/firebase/firebase-js-sdk/commit/beaa4dffb7f48cb12ccc6c1d1b7cdc9c3605fc04), [`ff0475c41`](https://github.com/firebase/firebase-js-sdk/commit/ff0475c41bfdac19872934f68b7f4e2651fd9a63), [`47b091324`](https://github.com/firebase/firebase-js-sdk/commit/47b09132463d6a038b441d4623c24ca61e56505d)]: + - @firebase/app@0.10.12 + - @firebase/data-connect@0.1.0 + - @firebase/firestore@4.7.3 + - @firebase/app-compat@0.2.42 + - @firebase/firestore-compat@0.3.38 + ## 10.13.2 ### Patch Changes diff --git a/packages/firebase/compat/rollup.config.js b/packages/firebase/compat/rollup.config.js index 4b481b93b1f..1f850011b13 100644 --- a/packages/firebase/compat/rollup.config.js +++ b/packages/firebase/compat/rollup.config.js @@ -284,43 +284,16 @@ const completeBuilds = [ }, plugins: [ sourcemaps(), - resolveModule({ - exportConditions: ['liteesm5', 'esm5'] - }), - typescriptPluginCDN, - json(), - commonjs(), - uglify(uglifyOptions) - ] - }, - /** - * Performance script Build in ES2017 - */ - { - input: `${__dirname}/index.perf.ts`, - output: { - file: 'firebase-performance-standalone-compat.es2017.js', - format: 'umd', - sourcemap: true, - name: GLOBAL_NAME - }, - plugins: [ - sourcemaps(), - resolveModule({ - exportConditions: ['lite'] - }), + resolveModule({ exportConditions: ['lite'] }), rollupTypescriptPlugin({ typescript, tsconfigOverride: { compilerOptions: { - target: 'es2017', declaration: false } } }), - json({ - preferConst: true - }), + json({ preferConst: true }), commonjs(), terser() ] diff --git a/packages/firebase/package.json b/packages/firebase/package.json index 2982609af40..f716238f483 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -1,6 +1,6 @@ { "name": "firebase", - "version": "10.13.2", + "version": "11.0.1", "description": "Firebase JavaScript library for web and Node.js", "author": "Firebase (https://firebase.google.com/)", "license": "Apache-2.0", @@ -227,17 +227,17 @@ }, "default": "./storage/dist/esm/index.esm.js" }, - "./vertexai-preview": { - "types": "./vertexai-preview/dist/vertexai-preview/index.d.ts", + "./vertexai": { + "types": "./vertexai/dist/vertexai/index.d.ts", "node": { - "require": "./vertexai-preview/dist/index.cjs.js", - "import": "./vertexai-preview/dist/index.mjs" + "require": "./vertexai/dist/index.cjs.js", + "import": "./vertexai/dist/index.mjs" }, "browser": { - "require": "./vertexai-preview/dist/index.cjs.js", - "import": "./vertexai-preview/dist/esm/index.esm.js" + "require": "./vertexai/dist/index.cjs.js", + "import": "./vertexai/dist/esm/index.esm.js" }, - "default": "./vertexai-preview/dist/esm/index.esm.js" + "default": "./vertexai/dist/esm/index.esm.js" }, "./compat/analytics": { "types": "./compat/analytics/dist/compat/analytics/index.d.ts", @@ -399,34 +399,34 @@ "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "dependencies": { - "@firebase/app": "0.10.11", - "@firebase/app-compat": "0.2.41", + "@firebase/app": "0.10.15", + "@firebase/app-compat": "0.2.45", "@firebase/app-types": "0.9.2", - "@firebase/auth": "1.7.9", - "@firebase/auth-compat": "0.5.14", - "@firebase/data-connect": "0.0.3", - "@firebase/database": "1.0.8", - "@firebase/database-compat": "1.0.8", - "@firebase/firestore": "4.7.2", - "@firebase/firestore-compat": "0.3.37", - "@firebase/functions": "0.11.8", - "@firebase/functions-compat": "0.3.14", - "@firebase/installations": "0.6.9", - "@firebase/installations-compat": "0.2.9", - "@firebase/messaging": "0.12.11", - "@firebase/messaging-compat": "0.2.11", - "@firebase/storage": "0.13.2", - "@firebase/storage-compat": "0.3.12", - "@firebase/performance": "0.6.9", - "@firebase/performance-compat": "0.2.9", - "@firebase/remote-config": "0.4.9", - "@firebase/remote-config-compat": "0.2.9", - "@firebase/analytics": "0.10.8", - "@firebase/analytics-compat": "0.2.14", - "@firebase/app-check": "0.8.8", - "@firebase/app-check-compat": "0.3.15", - "@firebase/util": "1.10.0", - "@firebase/vertexai-preview": "0.0.4" + "@firebase/auth": "1.8.0", + "@firebase/auth-compat": "0.5.15", + "@firebase/data-connect": "0.1.1", + "@firebase/database": "1.0.9", + "@firebase/database-compat": "2.0.0", + "@firebase/firestore": "4.7.4", + "@firebase/firestore-compat": "0.3.39", + "@firebase/functions": "0.11.9", + "@firebase/functions-compat": "0.3.15", + "@firebase/installations": "0.6.10", + "@firebase/installations-compat": "0.2.10", + "@firebase/messaging": "0.12.13", + "@firebase/messaging-compat": "0.2.13", + "@firebase/storage": "0.13.3", + "@firebase/storage-compat": "0.3.13", + "@firebase/performance": "0.6.10", + "@firebase/performance-compat": "0.2.10", + "@firebase/remote-config": "0.4.10", + "@firebase/remote-config-compat": "0.2.10", + "@firebase/analytics": "0.10.9", + "@firebase/analytics-compat": "0.2.15", + "@firebase/app-check": "0.8.9", + "@firebase/app-check-compat": "0.3.16", + "@firebase/util": "1.10.1", + "@firebase/vertexai": "1.0.0" }, "devDependencies": { "rollup": "2.79.1", @@ -439,7 +439,7 @@ "gulp": "4.0.2", "gulp-sourcemaps": "3.0.0", "gulp-replace": "1.1.4", - "typescript": "4.2.2", + "typescript": "5.5.4", "rollup-plugin-license": "3.0.1" }, "components": [ @@ -459,8 +459,8 @@ "messaging", "messaging/sw", "database", - "data-connect", - "vertexai-preview" + "vertexai", + "data-connect" ], "typings": "empty.d.ts" } diff --git a/packages/firebase/rollup.config.js b/packages/firebase/rollup.config.js index beeb2123ba8..fda0dc0ebb0 100644 --- a/packages/firebase/rollup.config.js +++ b/packages/firebase/rollup.config.js @@ -36,6 +36,8 @@ const typescriptPlugin = rollupTypescriptPlugin({ const typescriptPluginCDN = rollupTypescriptPlugin({ typescript, + allowJs: true, + include: ['*.ts', '**/*.ts', '*.js', '**/*.js'], tsconfigOverride: { compilerOptions: { declaration: false diff --git a/packages/firebase/vertexai-preview/index.ts b/packages/firebase/vertexai/index.ts similarity index 93% rename from packages/firebase/vertexai-preview/index.ts rename to packages/firebase/vertexai/index.ts index 20d7697c1e0..2645fd3004f 100644 --- a/packages/firebase/vertexai-preview/index.ts +++ b/packages/firebase/vertexai/index.ts @@ -15,4 +15,4 @@ * limitations under the License. */ -export * from '@firebase/vertexai-preview'; +export * from '@firebase/vertexai'; diff --git a/packages/firebase/vertexai-preview/package.json b/packages/firebase/vertexai/package.json similarity index 55% rename from packages/firebase/vertexai-preview/package.json rename to packages/firebase/vertexai/package.json index 9dfe8f0c3fa..20e04a3bbb5 100644 --- a/packages/firebase/vertexai-preview/package.json +++ b/packages/firebase/vertexai/package.json @@ -1,7 +1,7 @@ { - "name": "firebase/vertexai-preview", + "name": "firebase/vertexai", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm.js", "module": "dist/esm/index.esm.js", - "typings": "dist/vertexai-preview/index.d.ts" + "typings": "dist/vertexai/index.d.ts" } \ No newline at end of file diff --git a/packages/firestore-compat/CHANGELOG.md b/packages/firestore-compat/CHANGELOG.md index ec4bda71559..a9b76657367 100644 --- a/packages/firestore-compat/CHANGELOG.md +++ b/packages/firestore-compat/CHANGELOG.md @@ -1,5 +1,25 @@ # @firebase/firestore-compat +## 0.3.39 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/firestore@4.7.4 + - @firebase/util@1.10.1 + +## 0.3.38 + +### Patch Changes + +- Updated dependencies [[`ff0475c41`](https://github.com/firebase/firebase-js-sdk/commit/ff0475c41bfdac19872934f68b7f4e2651fd9a63), [`47b091324`](https://github.com/firebase/firebase-js-sdk/commit/47b09132463d6a038b441d4623c24ca61e56505d)]: + - @firebase/firestore@4.7.3 + ## 0.3.37 ### Patch Changes diff --git a/packages/firestore-compat/package.json b/packages/firestore-compat/package.json index 1292712a5a9..5015eea131d 100644 --- a/packages/firestore-compat/package.json +++ b/packages/firestore-compat/package.json @@ -1,13 +1,12 @@ { "name": "@firebase/firestore-compat", - "version": "0.3.37", + "version": "0.3.39", "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "react-native": "dist/index.rn.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", "exports": { ".": { "types": "./dist/src/index.d.ts", @@ -16,7 +15,6 @@ "require": "./dist/index.node.cjs.js" }, "react-native": "./dist/index.rn.js", - "esm5": "./dist/index.esm5.js", "browser": { "require": "./dist/index.cjs.js", "import": "./dist/index.esm2017.js" @@ -48,14 +46,14 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/firestore": "4.7.2", - "@firebase/util": "1.10.0", + "@firebase/component": "0.6.10", + "@firebase/firestore": "4.7.4", + "@firebase/util": "1.10.1", "@firebase/firestore-types": "3.0.2", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.41", + "@firebase/app-compat": "0.2.45", "@types/eslint": "7.29.0", "rollup": "2.79.1", "rollup-plugin-sourcemaps": "0.6.3", @@ -63,7 +61,7 @@ "rollup-plugin-typescript2": "0.31.2", "@rollup/plugin-node-resolve": "13.3.0", "ts-node": "10.9.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "license": "Apache-2.0", "typings": "dist/src/index.d.ts", @@ -74,5 +72,8 @@ }, "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/firestore-compat/rollup.config.js b/packages/firestore-compat/rollup.config.js index ecf6d42ca91..c85af11225f 100644 --- a/packages/firestore-compat/rollup.config.js +++ b/packages/firestore-compat/rollup.config.js @@ -38,14 +38,6 @@ const es2017Plugins = [ json({ preferConst: true }) ]; -const es5Plugins = [ - typescriptPlugin({ - typescript, - transformers: [util.removeAssertTransformer] - }), - json({ preferConst: true }) -]; - const browserBuilds = [ { input: './src/index.ts', @@ -57,18 +49,6 @@ const browserBuilds = [ plugins: es2017Plugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, - { - input: './src/index.ts', - output: [ - { - file: pkg.esm5, - format: 'es', - sourcemap: true - } - ], - plugins: es5Plugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, { input: './src/index.ts', output: [ diff --git a/packages/firestore-types/package.json b/packages/firestore-types/package.json index b797abb86dd..9a21e29e803 100644 --- a/packages/firestore-types/package.json +++ b/packages/firestore-types/package.json @@ -24,6 +24,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.2.2" + "typescript": "5.5.4" } } diff --git a/packages/firestore/CHANGELOG.md b/packages/firestore/CHANGELOG.md index 5fddaa183b1..187c08756be 100644 --- a/packages/firestore/CHANGELOG.md +++ b/packages/firestore/CHANGELOG.md @@ -1,5 +1,27 @@ # @firebase/firestore +## 4.7.4 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/webchannel-wrapper@1.0.2 + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + +## 4.7.3 + +### Patch Changes + +- [`ff0475c41`](https://github.com/firebase/firebase-js-sdk/commit/ff0475c41bfdac19872934f68b7f4e2651fd9a63) [#8259](https://github.com/firebase/firebase-js-sdk/pull/8259) - Re-enable useFetchStreams with the latest WebChannel implementation. This reduces the memory usage of WebChannel. + +- [`47b091324`](https://github.com/firebase/firebase-js-sdk/commit/47b09132463d6a038b441d4623c24ca61e56505d) [#8430](https://github.com/firebase/firebase-js-sdk/pull/8430) - Refactor Firestore client instantiation. This prepares for future features that require client to restart. + ## 4.7.2 ### Patch Changes diff --git a/packages/firestore/lite/package.json b/packages/firestore/lite/package.json index dbef6c78d6c..ef362535fdb 100644 --- a/packages/firestore/lite/package.json +++ b/packages/firestore/lite/package.json @@ -6,7 +6,9 @@ "module": "../dist/lite/index.browser.esm2017.js", "browser": "../dist/lite/index.browser.esm2017.js", "react-native": "../dist/lite/index.rn.esm2017.js", - "esm5": "../dist/lite/index.browser.esm5.js", "typings": "../dist/lite/index.d.ts", - "private": true + "private": true, + "engines": { + "node": ">=18.0.0" + } } diff --git a/packages/firestore/package.json b/packages/firestore/package.json index b1c4626dbd7..896aaa55d6e 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -1,8 +1,8 @@ { "name": "@firebase/firestore", - "version": "4.7.2", + "version": "4.7.4", "engines": { - "node": ">=10.10.0" + "node": ">=18.0.0" }, "description": "The Cloud Firestore component of the Firebase JS SDK.", "author": "Firebase (https://firebase.google.com/)", @@ -62,7 +62,6 @@ "import": "./dist/index.node.mjs" }, "react-native": "./dist/index.rn.js", - "esm5": "./dist/index.esm5.js", "browser": { "require": "./dist/index.cjs.js", "import": "./dist/index.esm2017.js" @@ -76,7 +75,6 @@ "import": "./dist/lite/index.node.mjs" }, "react-native": "./dist/lite/index.rn.esm2017.js", - "esm5": "./dist/lite/index.browser.esm5.js", "browser": { "require": "./dist/lite/index.cjs.js", "import": "./dist/lite/index.browser.esm2017.js" @@ -90,29 +88,27 @@ "react-native": "dist/index.rn.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", "license": "Apache-2.0", "files": [ "dist", "lite/package.json" ], "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "@firebase/webchannel-wrapper": "1.0.1", + "@firebase/component": "0.6.10", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", + "@firebase/webchannel-wrapper": "1.0.2", "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", - "undici": "6.19.7", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.11", - "@firebase/app-compat": "0.2.41", - "@firebase/auth": "1.7.9", + "@firebase/app": "0.10.15", + "@firebase/app-compat": "0.2.45", + "@firebase/auth": "1.8.0", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-json": "4.1.0", "@types/eslint": "7.29.0", @@ -129,7 +125,7 @@ "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-dts": "5.3.1", "ts-node": "10.9.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/firestore", diff --git a/packages/firestore/rollup.config.js b/packages/firestore/rollup.config.js index 0f6a42205fd..c9604fee55d 100644 --- a/packages/firestore/rollup.config.js +++ b/packages/firestore/rollup.config.js @@ -32,43 +32,29 @@ import pkg from './package.json'; const sourcemaps = require('rollup-plugin-sourcemaps'); const util = require('./rollup.shared'); -const nodePlugins = function () { - return [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, - cacheDir: tmp.dirSync(), - abortOnError: true, - transformers: [util.removeAssertTransformer] - }), - json({ preferConst: true }), - replace({ - '__GRPC_VERSION__': grpcVersion - }) - ]; -}; +const nodePlugins = [ + typescriptPlugin({ + typescript, + cacheDir: tmp.dirSync(), + abortOnError: true, + transformers: [util.removeAssertTransformer] + }), + json({ preferConst: true }), + replace({ + '__GRPC_VERSION__': grpcVersion + }) +]; -const browserPlugins = function () { - return [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, - cacheDir: tmp.dirSync(), - abortOnError: true, - transformers: [util.removeAssertAndPrefixInternalTransformer] - }), - json({ preferConst: true }), - terser(util.manglePrivatePropertiesOptions) - ]; -}; +const browserPlugins = [ + typescriptPlugin({ + typescript, + cacheDir: tmp.dirSync(), + abortOnError: true, + transformers: [util.removeAssertAndPrefixInternalTransformer] + }), + json({ preferConst: true }), + terser(util.manglePrivatePropertiesOptions) +]; const allBuilds = [ // Intermediate Node ESM build without build target reporting @@ -81,7 +67,7 @@ const allBuilds = [ format: 'es', sourcemap: true }, - plugins: [alias(util.generateAliasConfig('node')), ...nodePlugins()], + plugins: [alias(util.generateAliasConfig('node')), ...nodePlugins], external: util.resolveNodeExterns, treeshake: { moduleSideEffects: false @@ -97,7 +83,17 @@ const allBuilds = [ sourcemap: true }, plugins: [ - ...util.es2017ToEs5Plugins(/* mangled= */ false), + typescriptPlugin({ + typescript, + tsconfigOverride: { + compilerOptions: { + allowJs: true + } + }, + include: ['dist/**/*.js'], + cacheDir: tmp.dirSync() + }), + sourcemaps(), replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], external: util.resolveNodeExterns, @@ -132,26 +128,7 @@ const allBuilds = [ format: 'es', sourcemap: true }, - plugins: [alias(util.generateAliasConfig('browser')), ...browserPlugins()], - external: util.resolveBrowserExterns, - treeshake: { - moduleSideEffects: false - } - }, - // Convert es2017 build to ES5 - { - input: pkg['browser'], - output: [ - { - file: pkg['esm5'], - format: 'es', - sourcemap: true - } - ], - plugins: [ - ...util.es2017ToEs5Plugins(/* mangled= */ true), - replace(generateBuildTargetReplaceConfig('esm', 5)) - ], + plugins: [alias(util.generateAliasConfig('browser')), ...browserPlugins], external: util.resolveBrowserExterns, treeshake: { moduleSideEffects: false @@ -205,7 +182,7 @@ const allBuilds = [ }, plugins: [ alias(util.generateAliasConfig('rn')), - ...browserPlugins(), + ...browserPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)) ], external: util.resolveBrowserExterns, diff --git a/packages/firestore/rollup.config.lite.js b/packages/firestore/rollup.config.lite.js index 369a9210262..25209966fe8 100644 --- a/packages/firestore/rollup.config.lite.js +++ b/packages/firestore/rollup.config.lite.js @@ -30,40 +30,26 @@ import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_rep const util = require('./rollup.shared'); -const nodePlugins = function () { - return [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, - cacheDir: tmp.dirSync(), - abortOnError: true, - transformers: [util.removeAssertTransformer] - }), - json({ preferConst: true }) - ]; -}; +const nodePlugins = [ + typescriptPlugin({ + typescript, + cacheDir: tmp.dirSync(), + abortOnError: true, + transformers: [util.removeAssertTransformer] + }), + json({ preferConst: true }) +]; -const browserPlugins = function () { - return [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, - cacheDir: tmp.dirSync(), - abortOnError: true, - transformers: [util.removeAssertAndPrefixInternalTransformer] - }), - json({ preferConst: true }), - terser(util.manglePrivatePropertiesOptions) - ]; -}; +const browserPlugins = [ + typescriptPlugin({ + typescript, + cacheDir: tmp.dirSync(), + abortOnError: true, + transformers: [util.removeAssertAndPrefixInternalTransformer] + }), + json({ preferConst: true }), + terser(util.manglePrivatePropertiesOptions) +]; const allBuilds = [ // Intermediate Node ESM build without build target reporting @@ -78,7 +64,7 @@ const allBuilds = [ }, plugins: [ alias(util.generateAliasConfig('node_lite')), - ...nodePlugins(), + ...nodePlugins, replace({ '__RUNTIME_ENV__': 'node' }) @@ -101,14 +87,13 @@ const allBuilds = [ typescriptPlugin({ typescript, compilerOptions: { - allowJs: true, - target: 'es5' + allowJs: true }, include: ['dist/lite/*.js'] }), json(), sourcemaps(), - replace(generateBuildTargetReplaceConfig('cjs', 5)) + replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], external: util.resolveNodeExterns, treeshake: { @@ -144,7 +129,7 @@ const allBuilds = [ }, plugins: [ alias(util.generateAliasConfig('browser_lite')), - ...browserPlugins(), + ...browserPlugins, // setting it to empty string because browser is the default env replace({ '__RUNTIME_ENV__': '' @@ -155,25 +140,6 @@ const allBuilds = [ moduleSideEffects: false } }, - // Convert es2017 build to ES5 - { - input: path.resolve('./lite', pkg.browser), - output: [ - { - file: path.resolve('./lite', pkg.esm5), - format: 'es', - sourcemap: true - } - ], - plugins: [ - ...util.es2017ToEs5Plugins(/* mangled= */ true), - replace(generateBuildTargetReplaceConfig('esm', 5)) - ], - external: util.resolveBrowserExterns, - treeshake: { - moduleSideEffects: false - } - }, // Convert es2017 build to CJS { input: path.resolve('./lite', pkg.browser), @@ -222,7 +188,7 @@ const allBuilds = [ }, plugins: [ alias(util.generateAliasConfig('rn_lite')), - ...browserPlugins(), + ...browserPlugins, replace({ ...generateBuildTargetReplaceConfig('esm', 2017), '__RUNTIME_ENV__': 'rn' diff --git a/packages/firestore/rollup.shared.js b/packages/firestore/rollup.shared.js index 44253d24d38..1b33ddf0b1b 100644 --- a/packages/firestore/rollup.shared.js +++ b/packages/firestore/rollup.shared.js @@ -34,10 +34,9 @@ const pkg = require('./package.json'); // This file contains shared utilities for Firestore's rollup builds. // Firestore is released in a number of different build configurations: -// - Browser builds that support persistence in ES5 CJS and ES5 ESM formats and -// ES2017 in ESM format. -// - In-memory Browser builds that support persistence in ES5 CJS and ES5 ESM -// formats and ES2017 in ESM format. +// - Browser builds that support persistence in ES2017 CJS and ESM formats. +// - In-memory Browser builds that support persistence in ES2017 CJS and ESM +// formats. // - A NodeJS build that supports persistence (to be used with an IndexedDb // shim) // - A in-memory only NodeJS build @@ -248,11 +247,6 @@ exports.es2017Plugins = function (platform, mangled = false) { alias(generateAliasConfig(platform)), typescriptPlugin({ typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, cacheDir: tmp.dirSync(), transformers: [removeAssertAndPrefixInternalTransformer] }), @@ -264,11 +258,6 @@ exports.es2017Plugins = function (platform, mangled = false) { alias(generateAliasConfig(platform)), typescriptPlugin({ typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, cacheDir: tmp.dirSync(), transformers: [removeAssertTransformer] }), @@ -277,50 +266,6 @@ exports.es2017Plugins = function (platform, mangled = false) { } }; -exports.es2017ToEs5Plugins = function (mangled = false) { - if (mangled) { - return [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - allowJs: true - } - }, - include: ['dist/**/*.js'], - cacheDir: tmp.dirSync() - }), - terser({ - output: { - comments: 'all', - beautify: true - }, - // See comment above `manglePrivatePropertiesOptions`. This build did - // not have the identical variable name issue but we should be - // consistent. - mangle: { - reserved: ['_getProvider'] - } - }), - sourcemaps() - ]; - } else { - return [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - allowJs: true - } - }, - include: ['dist/**/*.js'], - cacheDir: tmp.dirSync() - }), - sourcemaps() - ]; - } -}; - exports.es2017PluginsCompat = function ( platform, pathTransformer, @@ -331,11 +276,6 @@ exports.es2017PluginsCompat = function ( alias(generateAliasConfig(platform)), typescriptPlugin({ typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, cacheDir: tmp.dirSync(), abortOnError: true, transformers: [ @@ -351,11 +291,6 @@ exports.es2017PluginsCompat = function ( alias(generateAliasConfig(platform)), typescriptPlugin({ typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, cacheDir: tmp.dirSync(), abortOnError: true, transformers: [removeAssertTransformer, pathTransformer] diff --git a/packages/firestore/scripts/build-bundle.js b/packages/firestore/scripts/build-bundle.js index e7d1fdf5145..b44311571e3 100644 --- a/packages/firestore/scripts/build-bundle.js +++ b/packages/firestore/scripts/build-bundle.js @@ -14,4 +14,4 @@ * 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. - */var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};var __generator=this&&this.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]=0){var method=declaration.name.text;if(method==="debugAssert"){updatedNode=ts.createOmittedExpression()}else if(method==="hardAssert"){updatedNode=ts.createCall(declaration.name,undefined,[node.arguments[0]])}else if(method==="fail"){updatedNode=ts.createCall(declaration.name,undefined,[])}}}}if(updatedNode){ts.setSourceMapRange(updatedNode,ts.getSourceMapRange(node));return updatedNode}else{return node}};return RemoveAsserts}(); + */exports.__esModule=true;exports.removeAsserts=void 0;var ts=require("typescript");var ASSERT_LOCATION="packages/firestore/src/util/assert.ts";function removeAsserts(program){var removeAsserts=new RemoveAsserts(program.getTypeChecker());return function(context){return function(file){return removeAsserts.visitNodeAndChildren(file,context)}}}exports.removeAsserts=removeAsserts;var RemoveAsserts=function(){function RemoveAsserts(typeChecker){this.typeChecker=typeChecker}RemoveAsserts.prototype.visitNodeAndChildren=function(node,context){var _this=this;return ts.visitEachChild(this.visitNode(node),(function(childNode){return _this.visitNodeAndChildren(childNode,context)}),context)};RemoveAsserts.prototype.visitNode=function(node){var updatedNode=null;if(ts.isCallExpression(node)){var signature=this.typeChecker.getResolvedSignature(node);if(signature&&signature.declaration&&signature.declaration.kind===ts.SyntaxKind.FunctionDeclaration){var declaration=signature.declaration;if(declaration&&declaration.getSourceFile().fileName.indexOf(ASSERT_LOCATION)>=0){var method=declaration.name.text;if(method==="debugAssert"){updatedNode=ts.factory.createOmittedExpression()}else if(method==="hardAssert"){updatedNode=ts.factory.createCallExpression(declaration.name,undefined,[node.arguments[0]])}else if(method==="fail"){updatedNode=ts.factory.createCallExpression(declaration.name,undefined,[])}}}}if(updatedNode){ts.setSourceMapRange(updatedNode,ts.getSourceMapRange(node));return updatedNode}else{return node}};return RemoveAsserts}(); \ No newline at end of file diff --git a/packages/firestore/scripts/remove-asserts.ts b/packages/firestore/scripts/remove-asserts.ts index f195f7bd2ab..fb3e2af6a34 100644 --- a/packages/firestore/scripts/remove-asserts.ts +++ b/packages/firestore/scripts/remove-asserts.ts @@ -64,17 +64,17 @@ class RemoveAsserts { ) { const method = declaration.name!.text; if (method === 'debugAssert') { - updatedNode = ts.createOmittedExpression(); + updatedNode = ts.factory.createOmittedExpression(); } else if (method === 'hardAssert') { // Remove the log message but keep the assertion - updatedNode = ts.createCall( + updatedNode = ts.factory.createCallExpression( declaration.name!, /*typeArgs*/ undefined, [node.arguments[0]] ); } else if (method === 'fail') { // Remove the log message - updatedNode = ts.createCall( + updatedNode = ts.factory.createCallExpression( declaration.name!, /*typeArgs*/ undefined, [] diff --git a/packages/firestore/scripts/rename-internals.js b/packages/firestore/scripts/rename-internals.js index 6015ec0540a..fa8394a2261 100644 --- a/packages/firestore/scripts/rename-internals.js +++ b/packages/firestore/scripts/rename-internals.js @@ -14,4 +14,4 @@ * 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. - */exports.__esModule=true;exports.renameInternals=void 0;var ts=require("typescript");var ignoredIdentifiers=["undefined"];var RenameInternals=function(){function RenameInternals(publicApi,prefix){this.publicApi=publicApi;this.prefix=prefix}RenameInternals.prototype.visitNodeAndChildren=function(node,context){var _this=this;return ts.visitEachChild(this.visitNode(node),(function(childNode){return _this.visitNodeAndChildren(childNode,context)}),context)};RenameInternals.prototype.visitNode=function(node){if(ts.isIdentifier(node)){var name_1=node.escapedText.toString();if(!this.publicApi.has(name_1)&&ignoredIdentifiers.indexOf(node.escapedText.toString())===-1){var newIdentifier=ts.createIdentifier(this.prefix+name_1);ts.setSourceMapRange(newIdentifier,ts.getSourceMapRange(node));return newIdentifier}}return node};return RenameInternals}();var DEFAULT_PREFIX="_";function renameInternals(program,config){var _a;var prefix=(_a=config.prefix)!==null&&_a!==void 0?_a:DEFAULT_PREFIX;var renamer=new RenameInternals(config.publicIdentifiers,prefix);return function(context){return function(file){return renamer.visitNodeAndChildren(file,context)}}}exports.renameInternals=renameInternals; \ No newline at end of file + */exports.__esModule=true;exports.renameInternals=void 0;var ts=require("typescript");var ignoredIdentifiers=["undefined"];var RenameInternals=function(){function RenameInternals(publicApi,prefix){this.publicApi=publicApi;this.prefix=prefix}RenameInternals.prototype.visitNodeAndChildren=function(node,context){var _this=this;return ts.visitEachChild(this.visitNode(node),(function(childNode){return _this.visitNodeAndChildren(childNode,context)}),context)};RenameInternals.prototype.visitNode=function(node){if(ts.isIdentifier(node)){var name_1=node.escapedText.toString();if(!this.publicApi.has(name_1)&&ignoredIdentifiers.indexOf(node.escapedText.toString())===-1){var newIdentifier=ts.factory.createIdentifier(this.prefix+name_1);ts.setSourceMapRange(newIdentifier,ts.getSourceMapRange(node));return newIdentifier}}return node};return RenameInternals}();var DEFAULT_PREFIX="_";function renameInternals(program,config){var _a;var prefix=(_a=config.prefix)!==null&&_a!==void 0?_a:DEFAULT_PREFIX;var renamer=new RenameInternals(config.publicIdentifiers,prefix);return function(context){return function(file){return renamer.visitNodeAndChildren(file,context)}}}exports.renameInternals=renameInternals; \ No newline at end of file diff --git a/packages/firestore/scripts/rename-internals.ts b/packages/firestore/scripts/rename-internals.ts index dfe691e1913..985c50d7249 100644 --- a/packages/firestore/scripts/rename-internals.ts +++ b/packages/firestore/scripts/rename-internals.ts @@ -48,7 +48,7 @@ class RenameInternals { !this.publicApi.has(name) && ignoredIdentifiers.indexOf(node.escapedText.toString()) === -1 ) { - const newIdentifier = ts.createIdentifier(this.prefix + name); + const newIdentifier = ts.factory.createIdentifier(this.prefix + name); ts.setSourceMapRange(newIdentifier, ts.getSourceMapRange(node)); return newIdentifier; } diff --git a/packages/firestore/src/api/cache_config.ts b/packages/firestore/src/api/cache_config.ts index fcfe429f554..072c67ec7a4 100644 --- a/packages/firestore/src/api/cache_config.ts +++ b/packages/firestore/src/api/cache_config.ts @@ -63,7 +63,9 @@ class MemoryLocalCacheImpl implements MemoryLocalCache { this._offlineComponentProvider = settings.garbageCollector._offlineComponentProvider; } else { - this._offlineComponentProvider = MemoryOfflineComponentProvider.provider; + this._offlineComponentProvider = { + build: () => new LruGcMemoryOfflineComponentProvider(undefined) + }; } } diff --git a/packages/firestore/src/core/firestore_client.ts b/packages/firestore/src/core/firestore_client.ts index 738348b016a..e2aa19aaba8 100644 --- a/packages/firestore/src/core/firestore_client.ts +++ b/packages/firestore/src/core/firestore_client.ts @@ -64,6 +64,7 @@ import { Aggregate } from './aggregate'; import { NamedQuery } from './bundle'; import { ComponentConfiguration, + LruGcMemoryOfflineComponentProvider, MemoryOfflineComponentProvider, OfflineComponentProvider, OnlineComponentProvider @@ -330,7 +331,7 @@ async function ensureOfflineComponents( logDebug(LOG_TAG, 'Using default OfflineComponentProvider'); await setOfflineComponentProvider( client, - new MemoryOfflineComponentProvider() + new LruGcMemoryOfflineComponentProvider(undefined) ); } } diff --git a/packages/firestore/src/platform/browser/byte_stream_reader.ts b/packages/firestore/src/platform/browser/byte_stream_reader.ts index 65875d4b225..82a4138218a 100644 --- a/packages/firestore/src/platform/browser/byte_stream_reader.ts +++ b/packages/firestore/src/platform/browser/byte_stream_reader.ts @@ -24,7 +24,7 @@ import { toByteStreamReaderHelper } from '../../util/byte_stream'; export function toByteStreamReader( source: BundleSource, bytesPerRead: number -): ReadableStreamReader { +): ReadableStreamDefaultReader { if (source instanceof Uint8Array) { return toByteStreamReaderHelper(source, bytesPerRead); } diff --git a/packages/firestore/src/platform/browser/webchannel_connection.ts b/packages/firestore/src/platform/browser/webchannel_connection.ts index 83e8faef88a..6813b88f65a 100644 --- a/packages/firestore/src/platform/browser/webchannel_connection.ts +++ b/packages/firestore/src/platform/browser/webchannel_connection.ts @@ -359,7 +359,7 @@ export class WebChannelConnection extends RestConnection { // Use any because msgData.error is not typed. const msgDataOrError: WebChannelError | object = msgData; const error = - msgDataOrError.error || + (msgDataOrError as WebChannelError)?.error || (msgDataOrError as WebChannelError[])[0]?.error; if (error) { logDebug( diff --git a/packages/firestore/src/platform/browser_lite/connection.ts b/packages/firestore/src/platform/browser_lite/connection.ts index a6464245441..573f743a882 100644 --- a/packages/firestore/src/platform/browser_lite/connection.ts +++ b/packages/firestore/src/platform/browser_lite/connection.ts @@ -24,5 +24,5 @@ export { newConnectivityMonitor } from '../browser/connection'; /** Initializes the HTTP connection for the REST API. */ export function newConnection(databaseInfo: DatabaseInfo): Connection { - return new FetchConnection(databaseInfo, fetch.bind(null)); + return new FetchConnection(databaseInfo); } diff --git a/packages/firestore/src/platform/browser_lite/fetch_connection.ts b/packages/firestore/src/platform/browser_lite/fetch_connection.ts index cad3c372ad5..d11247c8019 100644 --- a/packages/firestore/src/platform/browser_lite/fetch_connection.ts +++ b/packages/firestore/src/platform/browser_lite/fetch_connection.ts @@ -16,7 +16,6 @@ */ import { Token } from '../../api/credentials'; -import { DatabaseInfo } from '../../core/database_info'; import { Stream } from '../../remote/connection'; import { RestConnection } from '../../remote/rest_connection'; import { mapCodeFromHttpStatus } from '../../remote/rpc_error'; @@ -28,17 +27,6 @@ import { StringMap } from '../../util/types'; * (e.g. `fetch` or a polyfill). */ export class FetchConnection extends RestConnection { - /** - * @param databaseInfo - The connection info. - * @param fetchImpl - `fetch` or a Polyfill that implements the fetch API. - */ - constructor( - databaseInfo: DatabaseInfo, - private readonly fetchImpl: typeof fetch - ) { - super(databaseInfo); - } - openStream( rpcName: string, token: Token | null @@ -56,7 +44,7 @@ export class FetchConnection extends RestConnection { let response: Response; try { - response = await this.fetchImpl(url, { + response = await fetch(url, { method: 'POST', headers, body: requestJson diff --git a/packages/firestore/src/platform/byte_stream_reader.ts b/packages/firestore/src/platform/byte_stream_reader.ts index c66d19ee354..1442c0df294 100644 --- a/packages/firestore/src/platform/byte_stream_reader.ts +++ b/packages/firestore/src/platform/byte_stream_reader.ts @@ -27,7 +27,7 @@ import * as rn from './rn/byte_stream_reader'; export function toByteStreamReader( source: BundleSource, bytesPerRead: number = DEFAULT_BYTES_PER_READ -): ReadableStreamReader { +): ReadableStreamDefaultReader { if (isNode()) { return node.toByteStreamReader(source, bytesPerRead); } else if (isReactNative()) { diff --git a/packages/firestore/src/platform/node/byte_stream_reader.ts b/packages/firestore/src/platform/node/byte_stream_reader.ts index 9add9ce3cc9..507f13dfc21 100644 --- a/packages/firestore/src/platform/node/byte_stream_reader.ts +++ b/packages/firestore/src/platform/node/byte_stream_reader.ts @@ -26,7 +26,7 @@ import { valueDescription } from '../../util/input_validation'; export function toByteStreamReader( source: BundleSource, bytesPerRead: number -): ReadableStreamReader { +): ReadableStreamDefaultReader { if (!(source instanceof Uint8Array)) { throw new FirestoreError( Code.INVALID_ARGUMENT, diff --git a/packages/firestore/src/platform/node_lite/connection.ts b/packages/firestore/src/platform/node_lite/connection.ts index e85bb89bc97..7258661c184 100644 --- a/packages/firestore/src/platform/node_lite/connection.ts +++ b/packages/firestore/src/platform/node_lite/connection.ts @@ -15,8 +15,6 @@ * limitations under the License. */ -import { fetch as undiciFetch } from 'undici'; - import { DatabaseInfo } from '../../core/database_info'; import { Connection } from '../../remote/connection'; import { FetchConnection } from '../browser_lite/fetch_connection'; @@ -25,8 +23,5 @@ export { newConnectivityMonitor } from '../browser/connection'; /** Initializes the HTTP connection for the REST API. */ export function newConnection(databaseInfo: DatabaseInfo): Connection { - // undici is meant to be API compatible with `fetch`, but its type doesn't - // match 100%. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new FetchConnection(databaseInfo, undiciFetch as any); + return new FetchConnection(databaseInfo); } diff --git a/packages/firestore/src/register.ts b/packages/firestore/src/register.ts index 3abb38c9d86..573ac6f2020 100644 --- a/packages/firestore/src/register.ts +++ b/packages/firestore/src/register.ts @@ -60,6 +60,6 @@ export function registerFirestore( ).setMultipleInstances(true) ); registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/firestore/src/remote/watch_change.ts b/packages/firestore/src/remote/watch_change.ts index 38e10a23e35..0c69163095f 100644 --- a/packages/firestore/src/remote/watch_change.ts +++ b/packages/firestore/src/remote/watch_change.ts @@ -291,6 +291,7 @@ export class WatchChangeAggregator { /** Keeps track of the documents to update since the last raised snapshot. */ private pendingDocumentUpdates = mutableDocumentMap(); + private pendingDocumentUpdatesByTarget = documentTargetMap(); /** A mapping of document keys to their set of target IDs. */ private pendingDocumentTargetMapping = documentTargetMap(); @@ -587,16 +588,16 @@ export class WatchChangeAggregator { if (targetState.current && targetIsDocumentTarget(targetData.target)) { // Document queries for document that don't exist can produce an empty // result set. To update our local cache, we synthesize a document - // delete if we have not previously received the document. This - // resolves the limbo state of the document, removing it from - // limboDocumentRefs. + // delete if we have not previously received the document for this + // target. This resolves the limbo state of the document, removing it + // from limboDocumentRefs. // // TODO(dimond): Ideally we would have an explicit lookup target // instead resulting in an explicit delete message and we could // remove this special logic. const key = new DocumentKey(targetData.target.path); if ( - this.pendingDocumentUpdates.get(key) === null && + !this.ensureDocumentUpdateByTarget(key).has(targetId) && !this.targetContainsDocument(targetId, key) ) { this.removeDocumentFromTarget( @@ -655,6 +656,7 @@ export class WatchChangeAggregator { ); this.pendingDocumentUpdates = mutableDocumentMap(); + this.pendingDocumentUpdatesByTarget = documentTargetMap(); this.pendingDocumentTargetMapping = documentTargetMap(); this.pendingTargetResets = new SortedMap( primitiveComparator @@ -685,6 +687,12 @@ export class WatchChangeAggregator { document ); + this.pendingDocumentUpdatesByTarget = + this.pendingDocumentUpdatesByTarget.insert( + document.key, + this.ensureDocumentUpdateByTarget(document.key).add(targetId) + ); + this.pendingDocumentTargetMapping = this.pendingDocumentTargetMapping.insert( document.key, @@ -724,6 +732,12 @@ export class WatchChangeAggregator { this.ensureDocumentTargetMapping(key).delete(targetId) ); + this.pendingDocumentTargetMapping = + this.pendingDocumentTargetMapping.insert( + key, + this.ensureDocumentTargetMapping(key).add(targetId) + ); + if (updatedDocument) { this.pendingDocumentUpdates = this.pendingDocumentUpdates.insert( key, @@ -782,6 +796,18 @@ export class WatchChangeAggregator { return targetMapping; } + private ensureDocumentUpdateByTarget(key: DocumentKey): SortedSet { + let targetMapping = this.pendingDocumentUpdatesByTarget.get(key); + + if (!targetMapping) { + targetMapping = new SortedSet(primitiveComparator); + this.pendingDocumentUpdatesByTarget = + this.pendingDocumentUpdatesByTarget.insert(key, targetMapping); + } + + return targetMapping; + } + /** * Verifies that the user is still interested in this target (by calling * `getTargetDataForTarget()`) and that we are not waiting for pending ADDs diff --git a/packages/firestore/src/util/bundle_reader_impl.ts b/packages/firestore/src/util/bundle_reader_impl.ts index 05875fce1af..1e8890bf5a9 100644 --- a/packages/firestore/src/util/bundle_reader_impl.ts +++ b/packages/firestore/src/util/bundle_reader_impl.ts @@ -42,7 +42,7 @@ class BundleReaderImpl implements BundleReader { constructor( /** The reader to read from underlying binary bundle data source. */ - private reader: ReadableStreamReader, + private reader: ReadableStreamDefaultReader, readonly serializer: JsonProtoSerializer ) { this.textDecoder = newTextDecoder(); @@ -192,7 +192,7 @@ class BundleReaderImpl implements BundleReader { } export function newBundleReader( - reader: ReadableStreamReader, + reader: ReadableStreamDefaultReader, serializer: JsonProtoSerializer ): BundleReader { return new BundleReaderImpl(reader, serializer); diff --git a/packages/firestore/src/util/byte_stream.ts b/packages/firestore/src/util/byte_stream.ts index 0b65823ac91..1950ef1d316 100644 --- a/packages/firestore/src/util/byte_stream.ts +++ b/packages/firestore/src/util/byte_stream.ts @@ -33,7 +33,7 @@ export const DEFAULT_BYTES_PER_READ = 10240; export function toByteStreamReaderHelper( source: Uint8Array, bytesPerRead: number = DEFAULT_BYTES_PER_READ -): ReadableStreamReader { +): ReadableStreamDefaultReader { debugAssert( bytesPerRead > 0, `toByteStreamReader expects positive bytesPerRead, but got ${bytesPerRead}` diff --git a/packages/firestore/test/integration/api/database.test.ts b/packages/firestore/test/integration/api/database.test.ts index 7d025625fe7..81dc7362a22 100644 --- a/packages/firestore/test/integration/api/database.test.ts +++ b/packages/firestore/test/integration/api/database.test.ts @@ -2232,4 +2232,17 @@ apiDescribe('Database', persistence => { }); }); }); + + it('Lru GC is enabled by default.', () => { + const initialData = { key: 'value' }; + return withTestDb(persistence, async db => { + const docRef = doc(collection(db, 'test-collection')); + await setDoc(docRef, initialData); + return getDocFromCache(docRef).then(doc => { + expect(doc.exists()).to.be.true; + expect(doc.metadata.fromCache).to.be.true; + expect(doc.data()).to.deep.equal(initialData); + }); + }); + }); }); diff --git a/packages/firestore/test/integration/util/helpers.ts b/packages/firestore/test/integration/util/helpers.ts index 647360db463..465bc8edd61 100644 --- a/packages/firestore/test/integration/util/helpers.ts +++ b/packages/firestore/test/integration/util/helpers.ts @@ -181,9 +181,7 @@ function apiDescribeInternal( message: string, testSuite: (persistence: PersistenceMode) => void ): void { - const persistenceModes: PersistenceMode[] = [ - new MemoryEagerPersistenceMode() - ]; + const persistenceModes: PersistenceMode[] = [new MemoryLruPersistenceMode()]; if (isPersistenceAvailable()) { persistenceModes.push(new IndexedDbPersistenceMode()); } diff --git a/packages/firestore/test/unit/lite-api/types.test.ts b/packages/firestore/test/unit/lite-api/types.test.ts index 5326a288be7..65b2ffa43ba 100644 --- a/packages/firestore/test/unit/lite-api/types.test.ts +++ b/packages/firestore/test/unit/lite-api/types.test.ts @@ -600,7 +600,7 @@ describe('FirestoreTypeConverter', () => { stringProperty: string; numberProperty: number; } - const converter = { + const converter: FirestoreDataConverter = { toFirestore( modelObject: PartialWithFieldValue, options?: SetOptions diff --git a/packages/firestore/test/unit/specs/limbo_spec.test.ts b/packages/firestore/test/unit/specs/limbo_spec.test.ts index 0a4052cc72b..f6043a7fc9b 100644 --- a/packages/firestore/test/unit/specs/limbo_spec.test.ts +++ b/packages/firestore/test/unit/specs/limbo_spec.test.ts @@ -1171,4 +1171,284 @@ describeSpec('Limbo Documents:', [], () => { ); } ); + + specTest( + 'Fix #8474 - Limbo resolution for document is removed even if document updates for the document occurred before documentDelete in the global snapshot window', + [], + () => { + // onSnapshot(fullQuery) + const fullQuery = query('collection'); + + // getDocs(filterQuery) + const filterQuery = query('collection', filter('included', '==', true)); + + const docA = doc('collection/a', 1000, { key: 'a', included: false }); + const docA2 = doc('collection/a', 1007, { key: 'a', included: true }); + const docC = doc('collection/c', 1002, { key: 'c', included: true }); + + const limboQueryC = newQueryForPath(docC.key.path); + + return ( + spec() + // onSnapshot(fullQuery) - fullQuery is listening to documents in the collection for the full test + .userListens(fullQuery) + .watchAcksFull(fullQuery, 1001, docA, docC) + .expectEvents(fullQuery, { + fromCache: false, + added: [docA, docC] + }) + + // docC was deleted, this puts docC in limbo and causes a snapshot from cache (metadata-only change) + .watchRemovesDoc(docC.key, fullQuery) + .watchCurrents(fullQuery, 'resume-token-1002') + .watchSnapshots(1002) + .expectLimboDocs(docC.key) + .expectEvents(fullQuery, { + fromCache: true + }) + + // User begins getDocs(filterQuery) + .userListensForGet(filterQuery) + + // getDocs(filterQuery) will not resolve on the snapshot from cache + .expectEvents(filterQuery, { + fromCache: true, + added: [docC] + }) + + // Watch acks limbo and filter queries + .watchAcks(limboQueryC) + .watchAcks(filterQuery) + + // Watch responds to limboQueryC - docC was deleted + .watchDeletesDoc(docC.key, 1009, limboQueryC) + .watchCurrents(limboQueryC, 'resume-token-1009') + .watchSnapshots(1009, [limboQueryC, fullQuery]) + + // However, docC is still in limbo because there has not been a global snapshot + .expectLimboDocs(docC.key) + + // Rapid events of document update and delete caused by application + .watchRemovesDoc(docA.key, filterQuery) + .watchCurrents(filterQuery, 'resume-token-1004') + .watchSends({ affects: [filterQuery] }, docC) + .watchCurrents(filterQuery, 'resume-token-1005') + .watchRemovesDoc(docC.key, filterQuery) + .watchSends({ affects: [filterQuery] }, docA2) + .watchCurrents(filterQuery, 'resume-token-1007') + + .watchSnapshots(1010, [fullQuery, limboQueryC]) + + // All changes are current and we get a global snapshot + .watchSnapshots(1010, []) + + // Now docC is out of limbo + .expectLimboDocs() + .expectEvents(fullQuery, { + fromCache: false, + modified: [docA2], + removed: [docC] + }) + // Now getDocs(filterQuery) can be resolved + .expectEvents(filterQuery, { + fromCache: false, + removed: [docC], + added: [docA2] + }) + + // No more expected events + .watchSnapshots(1100, []) + ); + } + ); + + specTest( + 'Fix #8474 - Limbo resolution for document is removed even if document updates for the document occurred in the global snapshot window and no document delete was received for the limbo resolution query', + [], + () => { + // onSnapshot(fullQuery) + const fullQuery = query('collection'); + + // getDocs(filterQuery) + const filterQuery = query('collection', filter('included', '==', true)); + + const docA = doc('collection/a', 1000, { key: 'a', included: false }); + const docA2 = doc('collection/a', 1007, { key: 'a', included: true }); + const docC = doc('collection/c', 1002, { key: 'c', included: true }); + + const limboQueryC = newQueryForPath(docC.key.path); + + return ( + spec() + // onSnapshot(fullQuery) - fullQuery is listening to documents in the collection for the full test + .userListens(fullQuery) + .watchAcksFull(fullQuery, 1001, docA, docC) + .expectEvents(fullQuery, { + fromCache: false, + added: [docA, docC] + }) + + // docC was deleted, this puts docC in limbo and causes a snapshot from cache (metadata-only change) + .watchRemovesDoc(docC.key, fullQuery) + .watchCurrents(fullQuery, 'resume-token-1002') + .watchSnapshots(1002) + .expectLimboDocs(docC.key) + .expectEvents(fullQuery, { + fromCache: true + }) + + // User begins getDocs(filterQuery) + .userListensForGet(filterQuery) + + // getDocs(filterQuery) will not resolve on the snapshot from cache + .expectEvents(filterQuery, { + fromCache: true, + added: [docC] + }) + + // Watch acks limbo and filter queries + .watchAcks(limboQueryC) + .watchAcks(filterQuery) + + // Watch currents the limbo query, but did not send a document delete. + // This is and unexpected code path, but something that is called + // out as possible in the watch change aggregator. + .watchCurrents(limboQueryC, 'resume-token-1009') + .watchSnapshots(1009, [limboQueryC, fullQuery]) + + // However, docC is still in limbo because there has not been a global snapshot + .expectLimboDocs(docC.key) + + // Rapid events of document update and delete caused by application + .watchRemovesDoc(docA.key, filterQuery) + .watchCurrents(filterQuery, 'resume-token-1004') + .watchSends({ affects: [filterQuery] }, docC) + .watchCurrents(filterQuery, 'resume-token-1005') + .watchRemovesDoc(docC.key, filterQuery) + .watchSends({ affects: [filterQuery] }, docA2) + .watchCurrents(filterQuery, 'resume-token-1007') + + .watchSnapshots(1010, [fullQuery, limboQueryC]) + + // All changes are current and we get a global snapshot + .watchSnapshots(1010, []) + + // Now docC is out of limbo + .expectLimboDocs() + .expectEvents(fullQuery, { + fromCache: false, + modified: [docA2], + removed: [docC] + }) + // Now getDocs(filterQuery) can be resolved + .expectEvents(filterQuery, { + fromCache: false, + removed: [docC], + added: [docA2] + }) + + // No more expected events + .watchSnapshots(1100, []) + ); + } + ); + + specTest( + 'Fix #8474 - Handles code path of no ack for limbo resolution query before global snapshot', + [], + () => { + // onSnapshot(fullQuery) + const fullQuery = query('collection'); + + // getDocs(filterQuery) + const filterQuery = query('collection', filter('included', '==', true)); + + const docA = doc('collection/a', 1000, { key: 'a', included: false }); + const docA2 = doc('collection/a', 1007, { key: 'a', included: true }); + const docC = doc('collection/c', 1002, { key: 'c', included: true }); + + const limboQueryC = newQueryForPath(docC.key.path); + + return ( + spec() + // onSnapshot(fullQuery) - fullQuery is listening to documents in the collection for the full test + .userListens(fullQuery) + .watchAcksFull(fullQuery, 1001, docA, docC) + .expectEvents(fullQuery, { + fromCache: false, + added: [docA, docC] + }) + + // docC was deleted, this puts docC in limbo and causes a snapshot from cache (metadata-only change) + .watchRemovesDoc(docC.key, fullQuery) + .watchCurrents(fullQuery, 'resume-token-1002') + .watchSnapshots(1002) + .expectLimboDocs(docC.key) + .expectEvents(fullQuery, { + fromCache: true + }) + + // User begins getDocs(filterQuery) + .userListensForGet(filterQuery) + + // getDocs(filterQuery) will not resolve on the snapshot from cache + .expectEvents(filterQuery, { + fromCache: true, + added: [docC] + }) + + // Watch filter query + .watchAcks(filterQuery) + + // However, docC is still in limbo because there has not been a global snapshot + .expectLimboDocs(docC.key) + + // Rapid events of document update and delete caused by application + .watchRemovesDoc(docA.key, filterQuery) + .watchCurrents(filterQuery, 'resume-token-1004') + .watchSends({ affects: [filterQuery] }, docC) + .watchCurrents(filterQuery, 'resume-token-1005') + .watchRemovesDoc(docC.key, filterQuery) + .watchSends({ affects: [filterQuery] }, docA2) + .watchCurrents(filterQuery, 'resume-token-1007') + + .watchSnapshots(1010, [fullQuery, limboQueryC]) + + // All changes are current and we get a global snapshot + .watchSnapshots(1010, []) + + .expectEvents(fullQuery, { + fromCache: true, + modified: [docA2] + }) + // Now getDocs(filterQuery) can be resolved + .expectEvents(filterQuery, { + fromCache: true, + added: [docA2] + }) + + // Watch acks limbo query + .watchAcks(limboQueryC) + + // Watch responds to limboQueryC - docC was deleted + .watchDeletesDoc(docC.key, 1009, limboQueryC) + .watchCurrents(limboQueryC, 'resume-token-1009') + .watchSnapshots(1100, [limboQueryC]) + + // No more expected events + .watchSnapshots(1101, []) + + .expectLimboDocs() + .expectEvents(fullQuery, { + fromCache: false, + removed: [docC] + }) + // Now getDocs(filterQuery) can be resolved + .expectEvents(filterQuery, { + fromCache: false, + removed: [docC] + }) + ); + } + ); }); diff --git a/packages/firestore/test/unit/specs/spec_builder.ts b/packages/firestore/test/unit/specs/spec_builder.ts index d79cca9cd82..80dcd6519de 100644 --- a/packages/firestore/test/unit/specs/spec_builder.ts +++ b/packages/firestore/test/unit/specs/spec_builder.ts @@ -51,7 +51,7 @@ import { forEach } from '../../../src/util/obj'; import { ObjectMap } from '../../../src/util/obj_map'; import { isNullOrUndefined } from '../../../src/util/types'; import { firestore } from '../../util/api_helpers'; -import { TestSnapshotVersion } from '../../util/helpers'; +import { deletedDoc, TestSnapshotVersion } from '../../util/helpers'; import { RpcError } from './spec_rpc_error'; import { @@ -315,6 +315,15 @@ export class SpecBuilder { return this; } + /** Listen to query using the same options as executing a getDoc or getDocs */ + userListensForGet(query: Query, resume?: ResumeSpec): this { + this.addUserListenStep(query, resume, { + includeMetadataChanges: true, + waitForSyncWhenOnline: true + }); + return this; + } + userListensToCache(query: Query, resume?: ResumeSpec): this { this.addUserListenStep(query, resume, { source: Source.Cache }); return this; @@ -821,6 +830,23 @@ export class SpecBuilder { return this; } + watchDeletesDoc( + key: DocumentKey, + version: TestSnapshotVersion, + ...targets: Query[] + ): this { + this.nextStep(); + this.currentStep = { + watchEntity: { + doc: SpecBuilder.docToSpec( + deletedDoc(key.path.canonicalString(), version) + ), + removedTargets: targets.map(query => this.getTargetId(query)) + } + }; + return this; + } + watchFilters( queries: Query[], docs: DocumentKey[] = [], diff --git a/packages/firestore/test/unit/specs/spec_rpc_error.ts b/packages/firestore/test/unit/specs/spec_rpc_error.ts index 8d4a7073861..0560bdd65db 100644 --- a/packages/firestore/test/unit/specs/spec_rpc_error.ts +++ b/packages/firestore/test/unit/specs/spec_rpc_error.ts @@ -33,7 +33,8 @@ export class RpcError extends Error { this.code = mapRpcCodeFromCode(code); } - // TODO(mikelehen): Error is a function not a class in ES5 so extending it + // TODO(dlarocque): Improve this since we no longer target ES5. + // Error is a function not a class in ES5 so extending it // doesn't really work without hackery. Just manually set .message for now. this.message = message; } diff --git a/packages/firestore/test/unit/util/bundle.test.ts b/packages/firestore/test/unit/util/bundle.test.ts index b32ca0842b7..13647efa470 100644 --- a/packages/firestore/test/unit/util/bundle.test.ts +++ b/packages/firestore/test/unit/util/bundle.test.ts @@ -59,7 +59,7 @@ const encoder = newTextEncoder(); export function byteStreamReaderFromString( content: string, bytesPerRead: number -): ReadableStreamReader { +): ReadableStreamDefaultReader { const data = encoder.encode(content); return toByteStreamReader(data, bytesPerRead); } diff --git a/packages/firestore/test/util/helpers.ts b/packages/firestore/test/util/helpers.ts index dded004ebfd..c5865c3e0f7 100644 --- a/packages/firestore/test/util/helpers.ts +++ b/packages/firestore/test/util/helpers.ts @@ -172,12 +172,19 @@ export function doc( } export function deletedDoc( - keyStr: string, + keyStrOrDocumentKey: string | DocumentKey, ver: TestSnapshotVersion ): MutableDocument { - return MutableDocument.newNoDocument(key(keyStr), version(ver)).setReadTime( + if ( + keyStrOrDocumentKey instanceof String || + typeof keyStrOrDocumentKey === 'string' + ) { + keyStrOrDocumentKey = key(keyStrOrDocumentKey as string); + } + return MutableDocument.newNoDocument( + keyStrOrDocumentKey, version(ver) - ); + ).setReadTime(version(ver)); } export function unknownDoc( diff --git a/packages/functions-compat/CHANGELOG.md b/packages/functions-compat/CHANGELOG.md index 5c3122acf98..d195624b9d2 100644 --- a/packages/functions-compat/CHANGELOG.md +++ b/packages/functions-compat/CHANGELOG.md @@ -1,5 +1,20 @@ # @firebase/functions-compat +## 0.3.15 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove node bundle from the functions SDK as the node-specific fetch code has been removed in favor of using native fetch throughout the SDK. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`a2146910c`](https://github.com/firebase/firebase-js-sdk/commit/a2146910ccb0efd1e0dc4496c328358d5afdea61)]: + - @firebase/component@0.6.10 + - @firebase/functions@0.11.9 + - @firebase/util@1.10.1 + ## 0.3.14 ### Patch Changes diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 450850f7067..0f11b5d1227 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -1,25 +1,23 @@ { "name": "@firebase/functions-compat", - "version": "0.3.14", + "version": "0.3.15", "description": "", "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", + "main": "dist/index.cjs.js", + "browser": "dist/esm/index.esm2017.js", + "module": "dist/esm/index.esm2017.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "node": { - "import": "./dist/node-esm/index.node.esm.js", - "require": "./dist/index.node.cjs.js" + "require": "./dist/index.cjs.js", + "import": "./dist/esm/index.esm2017.js" }, - "esm5": "./dist/index.esm5.js", "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/esm/index.esm2017.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" }, @@ -31,11 +29,11 @@ "@firebase/app-compat": "0.x" }, "devDependencies": { - "@firebase/app-compat": "0.2.41", + "@firebase/app-compat": "0.2.45", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/functions-compat", @@ -57,17 +55,17 @@ "test:all": "run-p --npm-path npm test:browser test:node", "test:browser": "karma start", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", - "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", + "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --config ../../config/mocharc.node.js", "test:emulator": "env FIREBASE_FUNCTIONS_HOST=http://localhost FIREBASE_FUNCTIONS_PORT=5005 run-p --npm-path npm test:node", "trusted-type-check": "tsec -p tsconfig.json --noEmit", "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../functions/dist/functions-public.d.ts -o dist/src/index.d.ts -a -r Functions:types.FirebaseFunctions -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/functions" }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/functions": "0.11.8", + "@firebase/component": "0.6.10", + "@firebase/functions": "0.11.9", "@firebase/functions-types": "0.6.2", - "@firebase/util": "1.10.0", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "nyc": { @@ -75,5 +73,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/functions-compat/rollup.config.js b/packages/functions-compat/rollup.config.js index 949aeebd513..b85c7fa65c3 100644 --- a/packages/functions-compat/rollup.config.js +++ b/packages/functions-compat/rollup.config.js @@ -25,32 +25,14 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), json({ preferConst: true }) ]; -const browserBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, +const builds = [ { input: 'src/index.ts', output: { @@ -58,36 +40,19 @@ const browserBuilds = [ format: 'es', sourcemap: true }, - plugins: es2017BuildPlugins, + plugins: [...buildPlugins, emitModulePackageFile()], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { input: 'src/index.ts', output: { - file: './dist/index.cjs.js', + file: pkg.main, format: 'cjs', sourcemap: true }, - plugins: es2017BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; - -const nodeBuilds = [ - { - input: 'src/index.node.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, - { - input: 'src/index.node.ts', - output: [ - { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } - ], - plugins: [...es2017BuildPlugins, emitModulePackageFile()], + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; -export default [...browserBuilds, ...nodeBuilds]; +export default builds; diff --git a/packages/functions-types/package.json b/packages/functions-types/package.json index 9c59d3f954a..b237ffcf752 100644 --- a/packages/functions-types/package.json +++ b/packages/functions-types/package.json @@ -20,6 +20,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/functions/CHANGELOG.md b/packages/functions/CHANGELOG.md index ca6da3637a4..d4ca103c1e7 100644 --- a/packages/functions/CHANGELOG.md +++ b/packages/functions/CHANGELOG.md @@ -1,5 +1,21 @@ # @firebase/functions +## 0.11.9 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove node bundle from the functions SDK as the node-specific fetch code has been removed in favor of using native fetch throughout the SDK. + +- [`a2146910c`](https://github.com/firebase/firebase-js-sdk/commit/a2146910ccb0efd1e0dc4496c328358d5afdea61) [#8546](https://github.com/firebase/firebase-js-sdk/pull/8546) (fixes [#8511](https://github.com/firebase/firebase-js-sdk/issues/8511)) - Make the `FunctionsError` class publicly exported. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/util@1.10.1 + ## 0.11.8 ### Patch Changes diff --git a/packages/functions/karma.conf.js b/packages/functions/karma.conf.js index 3dc9b7d572c..db9bf05bfe0 100644 --- a/packages/functions/karma.conf.js +++ b/packages/functions/karma.conf.js @@ -26,18 +26,7 @@ module.exports = function (config) { files, // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha'], - // undici is a fetch polyfill that test helpers call for Node tests, and browser tests should - // ignore its import to avoid compilation errors in those test helpers. - webpack: { - ...webpackBase, - resolve: { - ...webpackBase.resolve, - alias: { - 'undici': false - } - } - } + frameworks: ['mocha'] }); config.set(karmaConfig); diff --git a/packages/functions/package.json b/packages/functions/package.json index dcad629250c..29792f16c70 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -1,25 +1,23 @@ { "name": "@firebase/functions", - "version": "0.11.8", + "version": "0.11.9", "description": "", "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.node.cjs.js", - "browser": "dist/index.esm2017.js", - "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm.js", + "main": "dist/index.cjs.js", + "browser": "dist/esm/index.esm2017.js", + "module": "dist/esm/index.esm2017.js", "exports": { ".": { "types": "./dist/functions-public.d.ts", "node": { - "import": "./dist/esm-node/index.node.esm.js", - "require": "./dist/index.node.cjs.js" + "import": "./dist/esm/index.esm2017.js", + "require": "./dist/index.cjs.js" }, - "esm5": "./dist/index.esm.js", "browser": { "require": "./dist/index.cjs.js", - "import": "./dist/index.esm2017.js" + "import": "./dist/esm/index.esm2017.js" }, - "default": "./dist/index.esm2017.js" + "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" }, @@ -38,7 +36,7 @@ "test:all": "run-p --npm-path npm test:browser test:node", "test:browser": "karma start", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", - "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", + "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.ts --config ../../config/mocharc.node.js", "test:emulator": "env FIREBASE_FUNCTIONS_EMULATOR_ORIGIN=http://localhost:5005 run-p --npm-path npm test:node", "trusted-type-check": "tsec -p tsconfig.json --noEmit", "api-report": "api-extractor run --local --verbose", @@ -51,11 +49,11 @@ "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/functions", @@ -67,12 +65,11 @@ }, "typings": "dist/src/index.d.ts", "dependencies": { - "@firebase/component": "0.6.9", + "@firebase/component": "0.6.10", "@firebase/messaging-interop-types": "0.2.2", "@firebase/auth-interop-types": "0.2.3", "@firebase/app-check-interop-types": "0.3.2", - "@firebase/util": "1.10.0", - "undici": "6.19.7", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "nyc": { @@ -80,5 +77,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/functions/rollup.config.js b/packages/functions/rollup.config.js index bb5506ea9b5..8d00f21d755 100644 --- a/packages/functions/rollup.config.js +++ b/packages/functions/rollup.config.js @@ -27,35 +27,14 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), json({ preferConst: true }) ]; -const browserBuilds = [ - { - input: 'src/index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)) - ] - }, +const builds = [ { input: 'src/index.ts', output: { @@ -65,47 +44,24 @@ const browserBuilds = [ }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ - ...es2017BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('esm', 2017)), + emitModulePackageFile() ] }, { input: 'src/index.ts', output: { - file: './dist/index.cjs.js', + file: pkg.main, format: 'cjs', sourcemap: true }, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('cjs', 2017)) ] } ]; -const nodeBuilds = [ - { - input: 'src/index.node.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) - ] - }, - { - input: 'src/index.node.ts', - output: [ - { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } - ], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es2017BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), - emitModulePackageFile() - ] - } -]; - -export default [...browserBuilds, ...nodeBuilds]; +export default builds; diff --git a/packages/functions/src/api.ts b/packages/functions/src/api.ts index a0e529ef671..a7804c2f573 100644 --- a/packages/functions/src/api.ts +++ b/packages/functions/src/api.ts @@ -32,6 +32,7 @@ import { getDefaultEmulatorHostnameAndPort } from '@firebase/util'; +export { FunctionsError } from './error'; export * from './public-types'; /** diff --git a/packages/functions/src/callable.test.ts b/packages/functions/src/callable.test.ts index a2036046f1a..439e7d4f154 100644 --- a/packages/functions/src/callable.test.ts +++ b/packages/functions/src/callable.test.ts @@ -57,6 +57,7 @@ async function expectError( await promise; } catch (e) { failed = true; + expect(e).to.be.instanceOf(FunctionsError); const error = e as FunctionsError; expect(error.code).to.equal(`${FUNCTIONS_TYPE}/${code}`); expect(error.message).to.equal(message); diff --git a/packages/functions/src/config.ts b/packages/functions/src/config.ts index 6c4dac26e6a..8dfadb52b54 100644 --- a/packages/functions/src/config.ts +++ b/packages/functions/src/config.ts @@ -35,10 +35,7 @@ const APP_CHECK_INTERNAL_NAME: AppCheckInternalComponentName = const MESSAGING_INTERNAL_NAME: MessagingInternalComponentName = 'messaging-internal'; -export function registerFunctions( - fetchImpl: typeof fetch, - variant?: string -): void { +export function registerFunctions(variant?: string): void { const factory: InstanceFactory<'functions'> = ( container: ComponentContainer, { instanceIdentifier: regionOrCustomDomain } @@ -55,8 +52,7 @@ export function registerFunctions( authProvider, messagingProvider, appCheckProvider, - regionOrCustomDomain, - fetchImpl + regionOrCustomDomain ); }; @@ -69,6 +65,6 @@ export function registerFunctions( ); registerVersion(name, version, variant); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/functions/src/error.ts b/packages/functions/src/error.ts index d6f59fd95d3..82fbf257fe3 100644 --- a/packages/functions/src/error.ts +++ b/packages/functions/src/error.ts @@ -49,10 +49,16 @@ const errorCodeMap: { [name: string]: FunctionsErrorCode } = { }; /** - * An explicit error that can be thrown from a handler to send an error to the - * client that called the function. + * An error returned by the Firebase Functions client SDK. + * + * See {@link FunctionsErrorCode} for full documentation of codes. + * + * @public */ export class FunctionsError extends FirebaseError { + /** + * Constructs a new instance of the `FunctionsError` class. + */ constructor( /** * A standard error code that will be returned to the client. This also @@ -61,11 +67,15 @@ export class FunctionsError extends FirebaseError { code: FunctionsErrorCode, message?: string, /** - * Extra data to be converted to JSON and included in the error response. + * Additional details to be converted to JSON and included in the error response. */ readonly details?: unknown ) { super(`${FUNCTIONS_TYPE}/${code}`, message || ''); + + // Since the FirebaseError constructor sets the prototype of `this` to FirebaseError.prototype, + // we also have to do it in all subclasses to allow for correct `instanceof` checks. + Object.setPrototypeOf(this, FunctionsError.prototype); } } diff --git a/packages/functions/src/index.node.ts b/packages/functions/src/index.node.ts deleted file mode 100644 index 6fb63173957..00000000000 --- a/packages/functions/src/index.node.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2017 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 { registerFunctions } from './config'; -import { fetch as undiciFetch } from 'undici'; - -export * from './api'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -registerFunctions(undiciFetch as any, 'node'); diff --git a/packages/functions/src/index.ts b/packages/functions/src/index.ts index 7318b3e64b7..6d404cc8245 100644 --- a/packages/functions/src/index.ts +++ b/packages/functions/src/index.ts @@ -25,4 +25,4 @@ import { registerFunctions } from './config'; export * from './api'; export * from './public-types'; -registerFunctions(fetch.bind(self)); +registerFunctions(); diff --git a/packages/functions/src/public-types.ts b/packages/functions/src/public-types.ts index 0637080f83d..311493d5fda 100644 --- a/packages/functions/src/public-types.ts +++ b/packages/functions/src/public-types.ts @@ -15,7 +15,6 @@ * limitations under the License. */ import { FirebaseApp } from '@firebase/app'; -import { FirebaseError } from '@firebase/util'; /** * An `HttpsCallableResult` wraps a single result from a function call. @@ -144,23 +143,6 @@ export type FunctionsErrorCodeCore = */ export type FunctionsErrorCode = `functions/${FunctionsErrorCodeCore}`; -/** - * An error returned by the Firebase Functions client SDK. - * @public - */ -export interface FunctionsError extends FirebaseError { - /** - * A standard error code that will be returned to the client. This also - * determines the HTTP status code of the response, as defined in code.proto. - */ - readonly code: FunctionsErrorCode; - - /** - * Extra data to be converted to JSON and included in the error response. - */ - readonly details?: unknown; -} - declare module '@firebase/component' { interface NameServiceMapping { 'functions': Functions; diff --git a/packages/functions/src/service.ts b/packages/functions/src/service.ts index c5fe7fa8a85..986dcbc735d 100644 --- a/packages/functions/src/service.ts +++ b/packages/functions/src/service.ts @@ -104,8 +104,7 @@ export class FunctionsService implements _FirebaseService { authProvider: Provider, messagingProvider: Provider, appCheckProvider: Provider, - regionOrCustomDomain: string = DEFAULT_REGION, - readonly fetchImpl: typeof fetch + regionOrCustomDomain: string = DEFAULT_REGION ) { this.contextProvider = new ContextProvider( authProvider, @@ -212,14 +211,13 @@ export function httpsCallableFromURL( async function postJSON( url: string, body: unknown, - headers: { [key: string]: string }, - fetchImpl: typeof fetch + headers: { [key: string]: string } ): Promise { headers['Content-Type'] = 'application/json'; let response: Response; try { - response = await fetchImpl(url, { + response = await fetch(url, { method: 'POST', body: JSON.stringify(body), headers @@ -296,7 +294,7 @@ async function callAtURL( const failAfterHandle = failAfter(timeout); const response = await Promise.race([ - postJSON(url, body, headers, functionsInstance.fetchImpl), + postJSON(url, body, headers), failAfterHandle.promise, functionsInstance.cancelAllRequests ]); diff --git a/packages/functions/test/utils.ts b/packages/functions/test/utils.ts index 0eb0b678c19..bcf0286b49d 100644 --- a/packages/functions/test/utils.ts +++ b/packages/functions/test/utils.ts @@ -21,7 +21,6 @@ import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { FunctionsService } from '../src/service'; import { connectFunctionsEmulator } from '../src/api'; -import { fetch as undiciFetch } from 'undici'; import { MessagingInternalComponentName } from '../../../packages/messaging-interop-types'; export function makeFakeApp(options: FirebaseOptions = {}): FirebaseApp { @@ -58,15 +57,12 @@ export function createTestService( new ComponentContainer('test') ) ): FunctionsService { - const fetchImpl: typeof fetch = - typeof window !== 'undefined' ? fetch.bind(window) : (undiciFetch as any); const functions = new FunctionsService( app, authProvider, messagingProvider, appCheckProvider, - region, - fetchImpl + region ); const useEmulator = !!process.env.FIREBASE_FUNCTIONS_EMULATOR_ORIGIN; if (useEmulator) { diff --git a/packages/installations-compat/CHANGELOG.md b/packages/installations-compat/CHANGELOG.md index eb9b825fdd4..25570ed15de 100644 --- a/packages/installations-compat/CHANGELOG.md +++ b/packages/installations-compat/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/installations-compat +## 0.2.10 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/installations@0.6.10 + - @firebase/component@0.6.10 + - @firebase/util@1.10.1 + ## 0.2.9 ### Patch Changes diff --git a/packages/installations-compat/package.json b/packages/installations-compat/package.json index bc663d6f2ce..81f292d3c78 100644 --- a/packages/installations-compat/package.json +++ b/packages/installations-compat/package.json @@ -1,16 +1,14 @@ { "name": "@firebase/installations-compat", - "version": "0.2.9", + "version": "0.2.10", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", "browser": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -46,23 +44,23 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app-compat": "0.2.41", + "@firebase/app-compat": "0.2.45", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-uglify": "6.0.4", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "peerDependencies": { "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.9", + "@firebase/installations": "0.6.10", "@firebase/installations-types": "0.5.2", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" } } diff --git a/packages/installations-compat/rollup.config.js b/packages/installations-compat/rollup.config.js index dff41008688..839c66d4413 100644 --- a/packages/installations-compat/rollup.config.js +++ b/packages/installations-compat/rollup.config.js @@ -23,45 +23,33 @@ import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_pa const deps = Object.keys({ ...pkg.peerDependencies, ...pkg.dependencies }); -const es5BuildPlugins = [typescriptPlugin({ typescript }), json()]; -const es2017BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } + typescript }), json({ preferConst: true }) ]; -const esmBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es5BuildPlugins, emitModulePackageFile()] +const esmBuild = { + input: 'src/index.ts', + output: { + file: pkg.browser, + format: 'es', + sourcemap: true }, - { - input: 'src/index.ts', - output: { - file: pkg.browser, - format: 'es', - sourcemap: true - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es2017BuildPlugins, emitModulePackageFile()] - } -]; + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [...buildPlugins, emitModulePackageFile()] +}; -const cjsBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: es5BuildPlugins - } -]; +const cjsBuild = { + input: 'src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: buildPlugins +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/installations-types/package.json b/packages/installations-types/package.json index f2f06145f52..7647ad385c8 100644 --- a/packages/installations-types/package.json +++ b/packages/installations-types/package.json @@ -23,6 +23,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/installations/CHANGELOG.md b/packages/installations/CHANGELOG.md index dcb168e8490..097fc7f3783 100644 --- a/packages/installations/CHANGELOG.md +++ b/packages/installations/CHANGELOG.md @@ -1,5 +1,15 @@ # @firebase/installations +## 0.6.10 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/util@1.10.1 + ## 0.6.9 ### Patch Changes diff --git a/packages/installations/package.json b/packages/installations/package.json index ff6c74bd23d..78b6dacc6da 100644 --- a/packages/installations/package.json +++ b/packages/installations/package.json @@ -1,16 +1,14 @@ { "name": "@firebase/installations", - "version": "0.6.9", + "version": "0.6.10", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", "browser": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/installations-public.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -51,21 +49,21 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.3.0", "rollup-plugin-typescript2": "0.31.2", "rollup-plugin-uglify": "6.0.4", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "peerDependencies": { "@firebase/app": "0.x" }, "dependencies": { - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "idb": "7.1.1", "tslib": "^2.1.0" } diff --git a/packages/installations/rollup.config.js b/packages/installations/rollup.config.js index 70628504fdb..7d083c63320 100644 --- a/packages/installations/rollup.config.js +++ b/packages/installations/rollup.config.js @@ -25,57 +25,40 @@ import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_pa const deps = [...Object.keys({ ...pkg.peerDependencies, ...pkg.dependencies })]; -const es5BuildPlugins = [typescriptPlugin({ typescript }), json()]; - -const es2017BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } + typescript }), json({ preferConst: true }) ]; -const esmBuilds = [ - { - input: 'src/index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)), - emitModulePackageFile() - ] +const esmBuild = { + input: 'src/index.ts', + output: { + file: pkg.browser, + format: 'es', + sourcemap: true }, - { - input: 'src/index.ts', - output: { - file: pkg.browser, - format: 'es', - sourcemap: true - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es2017BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), - emitModulePackageFile() - ] - } -]; + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [ + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('esm', 2017)), + emitModulePackageFile() + ] +}; -const cjsBuilds = [ - { - input: 'src/index.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) - ] - } -]; +const cjsBuild = { + input: 'src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [ + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) + ] +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/installations/src/index.ts b/packages/installations/src/index.ts index c16abc2b0b1..5a70ef10846 100644 --- a/packages/installations/src/index.ts +++ b/packages/installations/src/index.ts @@ -31,5 +31,5 @@ export * from './interfaces/public-types'; registerInstallations(); registerVersion(name, version); -// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation +// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); diff --git a/packages/installations/src/testing/compare-headers.ts b/packages/installations/src/testing/compare-headers.ts index 5b93c14933e..6c3681b3ca0 100644 --- a/packages/installations/src/testing/compare-headers.ts +++ b/packages/installations/src/testing/compare-headers.ts @@ -18,6 +18,7 @@ import { AssertionError, expect } from 'chai'; // Trick TS since it's set to target ES5. +// TODO(dlarocque): Improve this since we no longer target ES5. declare class HeadersWithEntries extends Headers { entries?(): Iterable<[string, string]>; } diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index e020cea5e2e..acd6583bed8 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/logger +## 0.4.3 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + ## 0.4.2 ### Patch Changes diff --git a/packages/logger/package.json b/packages/logger/package.json index 4a01f8d5593..ef7d8000c8b 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,16 +1,14 @@ { "name": "@firebase/logger", - "version": "0.4.2", + "version": "0.4.3", "description": "A logger package for use in the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm5.js", "exports": { ".": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -39,7 +37,7 @@ "devDependencies": { "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/logger", @@ -55,5 +53,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/logger/rollup.config.js b/packages/logger/rollup.config.js index e6bfbb4efe5..0089b01c801 100644 --- a/packages/logger/rollup.config.js +++ b/packages/logger/rollup.config.js @@ -20,53 +20,32 @@ import typescript from 'typescript'; import pkg from './package.json'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }) -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }) -]; +const buildPlugins = [typescriptPlugin({ typescript })]; const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const esmBuilds = [ - { - input: 'index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - plugins: [...es5BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +const esmBuild = { + input: 'index.ts', + output: { + file: pkg.module, + format: 'es', + sourcemap: true }, - { - input: 'index.ts', - output: { - file: pkg.module, - format: 'es', - sourcemap: true - }, - plugins: [...es2017BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; + plugins: [...buildPlugins, emitModulePackageFile()], + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +}; -const cjsBuilds = [ - { - input: 'index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; +const cjsBuild = { + input: 'index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + plugins: buildPlugins, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/messaging-compat/CHANGELOG.md b/packages/messaging-compat/CHANGELOG.md index 4319974b634..fe28f38476c 100644 --- a/packages/messaging-compat/CHANGELOG.md +++ b/packages/messaging-compat/CHANGELOG.md @@ -1,5 +1,23 @@ # @firebase/messaging-compat +## 0.2.13 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/messaging@0.12.13 + - @firebase/util@1.10.1 + +## 0.2.12 + +### Patch Changes + +- Updated dependencies [[`d6fa58854`](https://github.com/firebase/firebase-js-sdk/commit/d6fa58854e3cc976eab150154e2786043bc5e563)]: + - @firebase/messaging@0.12.12 + ## 0.2.11 ### Patch Changes diff --git a/packages/messaging-compat/package.json b/packages/messaging-compat/package.json index 3d529a8eb5b..22cc40dd608 100644 --- a/packages/messaging-compat/package.json +++ b/packages/messaging-compat/package.json @@ -1,18 +1,16 @@ { "name": "@firebase/messaging-compat", - "version": "0.2.11", + "version": "0.2.13", "license": "Apache-2.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -40,17 +38,17 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/messaging": "0.12.11", - "@firebase/component": "0.6.9", - "@firebase/util": "1.10.0", + "@firebase/messaging": "0.12.13", + "@firebase/component": "0.6.10", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.41", + "@firebase/app-compat": "0.2.45", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", "ts-essentials": "9.3.0", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/messaging", diff --git a/packages/messaging-compat/rollup.config.js b/packages/messaging-compat/rollup.config.js index 2bc0cecded0..b8a320641fc 100644 --- a/packages/messaging-compat/rollup.config.js +++ b/packages/messaging-compat/rollup.config.js @@ -25,51 +25,33 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), json({ preferConst: true }) ]; -const esmBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - plugins: [...es5BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +const esmBuild = { + input: 'src/index.ts', + output: { + file: pkg.browser, + format: 'es', + sourcemap: true }, - { - input: 'src/index.ts', - output: { - file: pkg.browser, - format: 'es', - sourcemap: true - }, - plugins: [...es2017BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; + plugins: [...buildPlugins, emitModulePackageFile()], + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +}; -const cjsBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; +const cjsBuild = { + input: 'src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + plugins: buildPlugins, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/messaging-interop-types/package.json b/packages/messaging-interop-types/package.json index 0de782552ff..2defbc5076f 100644 --- a/packages/messaging-interop-types/package.json +++ b/packages/messaging-interop-types/package.json @@ -20,6 +20,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/messaging/CHANGELOG.md b/packages/messaging/CHANGELOG.md index b109bb1af57..eb4c08bb226 100644 --- a/packages/messaging/CHANGELOG.md +++ b/packages/messaging/CHANGELOG.md @@ -1,5 +1,22 @@ # @firebase/messaging +## 0.12.13 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/installations@0.6.10 + - @firebase/component@0.6.10 + - @firebase/util@1.10.1 + +## 0.12.12 + +### Patch Changes + +- [`d6fa58854`](https://github.com/firebase/firebase-js-sdk/commit/d6fa58854e3cc976eab150154e2786043bc5e563) [#8534](https://github.com/firebase/firebase-js-sdk/pull/8534) - The logging endpoint has been updated to ensure proper logging of WebPush entries. This resolves an issue where BigQuery logs were missing WebPush data. The payload structure has also been updated in alignment with the latest logging requirements as specified in go/firelog. + ## 0.12.11 ### Patch Changes diff --git a/packages/messaging/package.json b/packages/messaging/package.json index 674b2feb246..c8f26f448e3 100644 --- a/packages/messaging/package.json +++ b/packages/messaging/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/messaging", - "version": "0.12.11", + "version": "0.12.13", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -8,13 +8,11 @@ "module": "dist/esm/index.esm2017.js", "sw": "dist/esm/index.sw.esm2017.js", "sw-main": "dist/index.sw.cjs", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/index-public.d.ts", "require": "./dist/index.cjs.js", "module": "./dist/esm/index.esm2017.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./sw": { @@ -54,20 +52,20 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.9", + "@firebase/installations": "0.6.10", "@firebase/messaging-interop-types": "0.2.2", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "idb": "7.1.1", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", "@rollup/plugin-json": "4.1.0", - "ts-essentials": "9.3.0", - "typescript": "4.7.4" + "ts-essentials": "10.0.2", + "typescript": "5.5.4" }, "repository": { "directory": "packages/messaging", diff --git a/packages/messaging/rollup.config.js b/packages/messaging/rollup.config.js index 297dc00c46f..506f0d30261 100644 --- a/packages/messaging/rollup.config.js +++ b/packages/messaging/rollup.config.js @@ -27,36 +27,14 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }), - json() -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }), json({ preferConst: true }) ]; const esmBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)), - emitModulePackageFile() - ], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, { input: 'src/index.ts', output: { @@ -65,7 +43,7 @@ const esmBuilds = [ sourcemap: true }, plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace(generateBuildTargetReplaceConfig('esm', 2017)), emitModulePackageFile() ], @@ -74,8 +52,12 @@ const esmBuilds = [ // sw builds { input: 'src/index.sw.ts', - output: { file: pkg.sw, format: 'es', sourcemap: true }, - plugins: es2017BuildPlugins, + output: { + file: pkg.sw, + format: 'es', + sourcemap: true + }, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; @@ -83,10 +65,14 @@ const esmBuilds = [ const cjsBuilds = [ { input: 'src/index.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, @@ -95,12 +81,13 @@ const cjsBuilds = [ // builds (contingent on updating the `idb` dependency). When we add // ESM Node builds, test with Nuxt and other SSR frameworks to see if // this can then be removed. + // TODO(dlarocque): ask Christina about this { input: 'src/index.sw.ts', output: { file: pkg['sw-main'], format: 'cjs', sourcemap: true }, plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) ], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } diff --git a/packages/messaging/src/helpers/logToFirelog.test.ts b/packages/messaging/src/helpers/logToFirelog.test.ts index 04e201bfc3a..fcc3402dd19 100644 --- a/packages/messaging/src/helpers/logToFirelog.test.ts +++ b/packages/messaging/src/helpers/logToFirelog.test.ts @@ -31,10 +31,7 @@ import { MessagingService } from '../messaging-service'; import { Stub } from '../testing/sinon-types'; import { getFakeMessagingService } from '../testing/fakes/messaging-service'; -const FIRELOG_ENDPOINT = LogModule._mergeStrings( - 'hts/frbslgigp.ogepscmv/ieo/eaylg', - 'tp:/ieaeogn-agolai.o/1frlglgc/o' -); +const LOG_ENDPOINT = 'https://play.google.com/log?format=json_proto3'; const FCM_TRANSPORT_KEY = LogModule._mergeStrings( 'AzSCbw63g1R0nCw85jG8', @@ -68,7 +65,7 @@ describe('logToFirelog', () => { // assert expect(fetchStub).to.be.calledOnceWith( - FIRELOG_ENDPOINT.concat('?key=', FCM_TRANSPORT_KEY), + LOG_ENDPOINT.concat('&key=', FCM_TRANSPORT_KEY), { method: 'POST', body: JSON.stringify(LogModule._createLogRequest([getFakeLogEvent()])) diff --git a/packages/messaging/src/helpers/logToFirelog.ts b/packages/messaging/src/helpers/logToFirelog.ts index 86b334ca91b..0e9ab096d87 100644 --- a/packages/messaging/src/helpers/logToFirelog.ts +++ b/packages/messaging/src/helpers/logToFirelog.ts @@ -36,10 +36,7 @@ import { import { MessagePayloadInternal } from '../interfaces/internal-message-payload'; import { MessagingService } from '../messaging-service'; -const FIRELOG_ENDPOINT = _mergeStrings( - 'hts/frbslgigp.ogepscmv/ieo/eaylg', - 'tp:/ieaeogn-agolai.o/1frlglgc/o' -); +const LOG_ENDPOINT = 'https://play.google.com/log?format=json_proto3'; const FCM_TRANSPORT_KEY = _mergeStrings( 'AzSCbw63g1R0nCw85jG8', @@ -97,7 +94,7 @@ export async function _dispatchLogEvents( do { try { response = await fetch( - FIRELOG_ENDPOINT.concat('?key=', FCM_TRANSPORT_KEY), + LOG_ENDPOINT.concat('&key=', FCM_TRANSPORT_KEY), { method: 'POST', body: JSON.stringify(logRequest) @@ -216,7 +213,9 @@ function createAndEnqueueLogEvent( /* eslint-disable camelcase */ logEvent.event_time_ms = Math.floor(Date.now()).toString(); - logEvent.source_extension_json_proto3 = JSON.stringify(fcmEvent); + logEvent.source_extension_json_proto3 = JSON.stringify({ + messaging_client_event: fcmEvent + }); if (!!productId) { logEvent.compliance_data = buildComplianceData(productId); diff --git a/packages/messaging/src/helpers/register.ts b/packages/messaging/src/helpers/register.ts index 7a9176f96d2..ef28cd2edad 100644 --- a/packages/messaging/src/helpers/register.ts +++ b/packages/messaging/src/helpers/register.ts @@ -104,7 +104,7 @@ export function registerMessagingInWindow(): void { ); registerVersion(name, version); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/messaging/src/interfaces/internal-message-payload.ts b/packages/messaging/src/interfaces/internal-message-payload.ts index 823959e9544..f0a0f99b1d4 100644 --- a/packages/messaging/src/interfaces/internal-message-payload.ts +++ b/packages/messaging/src/interfaces/internal-message-payload.ts @@ -33,7 +33,29 @@ export interface MessagePayloadInternal { collapse_key: string; } -export interface NotificationPayloadInternal extends NotificationOptions { +// https://developer.mozilla.org/en-US/docs/Web/API/Notification/actions +interface NotificationAction { + action: string; + icon?: string; + title: string; +} + +/** + * This interface defines experimental properties of NotificationOptions, that are not part of + * the interface in the generated DOM types at https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/179bdd84a944933a3103f29c2274c9f5a857b693/baselines/dom.generated.d.ts#L1012 + * https://developer.mozilla.org/en-US/docs/Web/API/Notification + */ +interface NotificationOptionsExperimental extends NotificationOptions { + readonly maxActions?: number; + readonly actions?: NotificationAction[]; + readonly image?: string; + readonly renotify?: boolean; + readonly timestamp?: EpochTimeStamp; + readonly vibrate?: VibratePattern; +} + +export interface NotificationPayloadInternal + extends NotificationOptionsExperimental { title: string; // Supported in the Legacy Send API. // See:https://firebase.google.com/docs/cloud-messaging/xmpp-server-ref. diff --git a/packages/messaging/src/testing/compare-headers.ts b/packages/messaging/src/testing/compare-headers.ts index 6f760caf32d..4e6ea3e489d 100644 --- a/packages/messaging/src/testing/compare-headers.ts +++ b/packages/messaging/src/testing/compare-headers.ts @@ -20,6 +20,7 @@ import './setup'; import { expect } from 'chai'; // Trick TS since it's set to target ES5. +// TODO(dlarocque): Improve this since we no longer target ES5. declare class HeadersWithEntries extends Headers { entries?(): Iterable<[string, string]>; } diff --git a/packages/performance-compat/CHANGELOG.md b/packages/performance-compat/CHANGELOG.md index 885fce26c01..e3dd6b08791 100644 --- a/packages/performance-compat/CHANGELOG.md +++ b/packages/performance-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/performance-compat +## 0.2.10 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/performance@0.6.10 + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 0.2.9 ### Patch Changes diff --git a/packages/performance-compat/package.json b/packages/performance-compat/package.json index 72a12d37042..1e5496b6d8b 100644 --- a/packages/performance-compat/package.json +++ b/packages/performance-compat/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/performance-compat", - "version": "0.2.9", + "version": "0.2.10", "description": "The compatibility package of Firebase Performance", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm5.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -40,11 +38,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/performance": "0.6.9", + "@firebase/performance": "0.6.10", "@firebase/performance-types": "0.2.2", - "@firebase/util": "1.10.0", - "@firebase/logger": "0.4.2", - "@firebase/component": "0.6.9", + "@firebase/util": "1.10.1", + "@firebase/logger": "0.4.3", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "devDependencies": { @@ -52,8 +50,8 @@ "@rollup/plugin-json": "4.1.0", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4", - "@firebase/app-compat": "0.2.41" + "typescript": "5.5.4", + "@firebase/app-compat": "0.2.45" }, "repository": { "directory": "packages/performance-compat", diff --git a/packages/performance-compat/rollup.config.js b/packages/performance-compat/rollup.config.js index d64b7bb89e5..e52495c401e 100644 --- a/packages/performance-compat/rollup.config.js +++ b/packages/performance-compat/rollup.config.js @@ -25,14 +25,7 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }), - json() -]; - -const es2017BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, tsconfigOverride: { @@ -46,32 +39,26 @@ const es2017BuildPlugins = [ }) ]; -const esmBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es5BuildPlugins, emitModulePackageFile()] +const esmBuild = { + input: 'src/index.ts', + output: { + file: pkg.browser, + format: 'es', + sourcemap: true }, - { - input: 'src/index.ts', - output: { - file: pkg.browser, - format: 'es', - sourcemap: true - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es2017BuildPlugins, emitModulePackageFile()] - } -]; + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [...buildPlugins, emitModulePackageFile()] +}; -const cjsBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: es5BuildPlugins - } -]; +const cjsBuild = { + input: 'src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: buildPlugins +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/performance-types/package.json b/packages/performance-types/package.json index 7bfe59f1e95..8bc3fd83093 100644 --- a/packages/performance-types/package.json +++ b/packages/performance-types/package.json @@ -12,7 +12,7 @@ "index.d.ts" ], "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/performance-types", diff --git a/packages/performance/CHANGELOG.md b/packages/performance/CHANGELOG.md index 10680e95ce4..bb3e4985da2 100644 --- a/packages/performance/CHANGELOG.md +++ b/packages/performance/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/performance +## 0.6.10 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/installations@0.6.10 + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 0.6.9 ### Patch Changes diff --git a/packages/performance/package.json b/packages/performance/package.json index de60407f2d4..36754a73bc4 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/performance", - "version": "0.6.9", + "version": "0.6.10", "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -40,19 +38,19 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/logger": "0.4.2", - "@firebase/installations": "0.6.9", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/logger": "0.4.3", + "@firebase/installations": "0.6.10", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/performance", diff --git a/packages/performance/rollup.config.js b/packages/performance/rollup.config.js index 4816210933d..ca9fdde7f54 100644 --- a/packages/performance/rollup.config.js +++ b/packages/performance/rollup.config.js @@ -27,52 +27,36 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [typescriptPlugin({ typescript }), json()]; -const es2017BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } + typescript }), json({ preferConst: true }) ]; -const esmBuilds = [ - { - input: 'src/index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)), - emitModulePackageFile() - ] - }, - { - input: 'src/index.ts', - output: [{ file: pkg.browser, format: 'es', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es2017BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), - emitModulePackageFile() - ] - } -]; +const esmBuild = { + input: 'src/index.ts', + output: [{ file: pkg.browser, format: 'es', sourcemap: true }], + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [ + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('esm', 2017)), + emitModulePackageFile() + ] +}; -const cjsBuilds = [ - { - input: 'src/index.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) - ] - } -]; +const cjsBuild = { + input: 'src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [ + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) + ] +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/performance/src/index.ts b/packages/performance/src/index.ts index 4d3713f0614..4ccb499b368 100644 --- a/packages/performance/src/index.ts +++ b/packages/performance/src/index.ts @@ -137,7 +137,7 @@ function registerPerformance(): void { new Component('performance', factory, ComponentType.PUBLIC) ); registerVersion(name, version); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/performance/src/utils/attributes_utils.ts b/packages/performance/src/utils/attributes_utils.ts index 294881a99d4..81bb2234bfe 100644 --- a/packages/performance/src/utils/attributes_utils.ts +++ b/packages/performance/src/utils/attributes_utils.ts @@ -39,14 +39,27 @@ const enum EffectiveConnectionType { CONNECTION_4G = 4 } +type ConnectionType = + | 'bluetooth' + | 'cellular' + | 'ethernet' + | 'mixed' + | 'none' + | 'other' + | 'unknown' + | 'wifi'; + /** * NetworkInformation + * This API is not well supported in all major browsers, so TypeScript does not provide types for it. * * ref: https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation */ +interface NetworkInformation extends EventTarget { + readonly type: ConnectionType; +} + interface NetworkInformationWithEffectiveType extends NetworkInformation { - // `effectiveType` is an experimental property and not included in - // TypeScript's typings for the native NetworkInformation interface readonly effectiveType?: 'slow-2g' | '2g' | '3g' | '4g'; } diff --git a/packages/remote-config-compat/CHANGELOG.md b/packages/remote-config-compat/CHANGELOG.md index d67719c6284..4187a8f4e4d 100644 --- a/packages/remote-config-compat/CHANGELOG.md +++ b/packages/remote-config-compat/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/remote-config-compat +## 0.2.10 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/remote-config@0.4.10 + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 0.2.9 ### Patch Changes diff --git a/packages/remote-config-compat/package.json b/packages/remote-config-compat/package.json index 1ea2ed030d5..ad3bc326d58 100644 --- a/packages/remote-config-compat/package.json +++ b/packages/remote-config-compat/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/remote-config-compat", - "version": "0.2.9", + "version": "0.2.10", "description": "The compatibility package of Remote Config", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm5.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -39,11 +37,11 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/remote-config": "0.4.9", + "@firebase/remote-config": "0.4.10", "@firebase/remote-config-types": "0.3.2", - "@firebase/util": "1.10.0", - "@firebase/logger": "0.4.2", - "@firebase/component": "0.6.9", + "@firebase/util": "1.10.1", + "@firebase/logger": "0.4.3", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "devDependencies": { @@ -51,8 +49,8 @@ "@rollup/plugin-json": "4.1.0", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4", - "@firebase/app-compat": "0.2.41" + "typescript": "5.5.4", + "@firebase/app-compat": "0.2.45" }, "repository": { "directory": "packages/remote-config-compat", diff --git a/packages/remote-config-compat/rollup.config.js b/packages/remote-config-compat/rollup.config.js index d64b7bb89e5..e52495c401e 100644 --- a/packages/remote-config-compat/rollup.config.js +++ b/packages/remote-config-compat/rollup.config.js @@ -25,14 +25,7 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }), - json() -]; - -const es2017BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, tsconfigOverride: { @@ -46,32 +39,26 @@ const es2017BuildPlugins = [ }) ]; -const esmBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es5BuildPlugins, emitModulePackageFile()] +const esmBuild = { + input: 'src/index.ts', + output: { + file: pkg.browser, + format: 'es', + sourcemap: true }, - { - input: 'src/index.ts', - output: { - file: pkg.browser, - format: 'es', - sourcemap: true - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [...es2017BuildPlugins, emitModulePackageFile()] - } -]; + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [...buildPlugins, emitModulePackageFile()] +}; -const cjsBuilds = [ - { - input: 'src/index.ts', - output: { file: pkg.main, format: 'cjs', sourcemap: true }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: es5BuildPlugins - } -]; +const cjsBuild = { + input: 'src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: buildPlugins +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/remote-config-types/package.json b/packages/remote-config-types/package.json index 29b39d10900..7d83613b25c 100644 --- a/packages/remote-config-types/package.json +++ b/packages/remote-config-types/package.json @@ -20,6 +20,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/remote-config/CHANGELOG.md b/packages/remote-config/CHANGELOG.md index ed91f7ede44..96f1d485160 100644 --- a/packages/remote-config/CHANGELOG.md +++ b/packages/remote-config/CHANGELOG.md @@ -1,5 +1,17 @@ # @firebase/remote-config +## 0.4.10 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/installations@0.6.10 + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 0.4.9 ### Patch Changes diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index c38dbc0ef26..761fa6a1e97 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/remote-config", - "version": "0.4.9", + "version": "0.4.10", "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/esm/index.esm2017.js", "module": "dist/esm/index.esm2017.js", - "esm5": "dist/esm/index.esm.js", "exports": { ".": { "types": "./dist/remote-config-public.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -42,18 +40,18 @@ "@firebase/app": "0.x" }, "dependencies": { - "@firebase/installations": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/installations": "0.6.10", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/remote-config", diff --git a/packages/remote-config/rollup.config.js b/packages/remote-config/rollup.config.js index dba933fa417..a7209c67e09 100644 --- a/packages/remote-config/rollup.config.js +++ b/packages/remote-config/rollup.config.js @@ -26,68 +26,44 @@ import pkg from './package.json'; const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -/** - * ES5 Builds - */ -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }), - json() -]; -const es2017BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } + typescript }), json({ preferConst: true }) ]; -const esmBuilds = [ - { - input: 'src/index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 5)), - emitModulePackageFile() - ] +const esmBuild = { + /** + * Browser Build + */ + input: 'src/index.ts', + output: { + file: pkg.browser, + format: 'es', + sourcemap: true }, - { - /** - * Browser Build - */ - input: 'src/index.ts', - output: { - file: pkg.browser, - format: 'es', - sourcemap: true - }, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es2017BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), - emitModulePackageFile() - ] - } -]; + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [ + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('esm', 2017)), + emitModulePackageFile() + ] +}; -const cjsBuilds = [ - { - input: 'src/index.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es5BuildPlugins, - replace(generateBuildTargetReplaceConfig('cjs', 5)) - ] - } -]; +const cjsBuild = { + input: 'src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), + plugins: [ + ...buildPlugins, + replace(generateBuildTargetReplaceConfig('cjs', 2017)) + ] +}; -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/remote-config/src/register.ts b/packages/remote-config/src/register.ts index ac8a8aae755..ff83e761888 100644 --- a/packages/remote-config/src/register.ts +++ b/packages/remote-config/src/register.ts @@ -52,7 +52,7 @@ export function registerRemoteConfig(): void { ); registerVersion(packageName, version); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(packageName, version, '__BUILD_TARGET__'); function remoteConfigFactory( diff --git a/packages/remote-config/test/remote_config.test.ts b/packages/remote-config/test/remote_config.test.ts index d275adcad89..f53f4a72c86 100644 --- a/packages/remote-config/test/remote_config.test.ts +++ b/packages/remote-config/test/remote_config.test.ts @@ -442,7 +442,7 @@ describe('RemoteConfig', () => { describe('fetch', () => { let timeoutStub: sinon.SinonStub< - [(...args: any[]) => void, number, ...any[]] + [callback: (args: void) => void, ms?: number | undefined] >; beforeEach(() => { client.fetch = sinon diff --git a/packages/rules-unit-testing/CHANGELOG.md b/packages/rules-unit-testing/CHANGELOG.md index ad35a58c879..b39c288e87b 100644 --- a/packages/rules-unit-testing/CHANGELOG.md +++ b/packages/rules-unit-testing/CHANGELOG.md @@ -1,5 +1,16 @@ # @firebase/rules-unit-testing +## 4.0.0 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`b942e9e6e`](https://github.com/firebase/firebase-js-sdk/commit/b942e9e6e22d184d21f3e452cd35122592a3a372)]: + - firebase@11.0.0 + ## 3.0.4 ### Patch Changes diff --git a/packages/rules-unit-testing/package.json b/packages/rules-unit-testing/package.json index 70e5b522683..d430b154545 100644 --- a/packages/rules-unit-testing/package.json +++ b/packages/rules-unit-testing/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/rules-unit-testing", - "version": "3.0.4", + "version": "4.0.0", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", @@ -20,7 +20,7 @@ "./package.json": "./package.json" }, "engines": { - "node": ">=10.10.0" + "node": ">=18.0.0" }, "files": [ "dist" @@ -43,7 +43,7 @@ "rollup-plugin-typescript2": "0.31.2" }, "peerDependencies": { - "firebase": "^10.0.0" + "firebase": "^11.0.0" }, "repository": { "directory": "packages/rules-unit-testing", @@ -53,9 +53,5 @@ "typings": "dist/index.d.ts", "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "dependencies": { - "node-fetch": "2.6.7", - "@types/node-fetch": "2.6.4" } } diff --git a/packages/rules-unit-testing/rollup.config.js b/packages/rules-unit-testing/rollup.config.js index bd56861015b..5811401fb74 100644 --- a/packages/rules-unit-testing/rollup.config.js +++ b/packages/rules-unit-testing/rollup.config.js @@ -20,23 +20,12 @@ import pkg from './package.json'; import typescript from 'typescript'; import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file'; -const plugins = [ +const buildPlugins = [ typescriptPlugin({ typescript }) ]; -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }) -]; - const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); @@ -44,16 +33,22 @@ const deps = Object.keys( export default [ { input: 'index.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - plugins: [...plugins], + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + plugins: [...buildPlugins], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { input: 'index.ts', - output: [ - { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } - ], - plugins: [...es2017BuildPlugins, emitModulePackageFile()], + output: { + file: pkg.exports['.'].node.import, + format: 'es', + sourcemap: true + }, + plugins: [...buildPlugins, emitModulePackageFile()], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; diff --git a/packages/rules-unit-testing/src/impl/discovery.ts b/packages/rules-unit-testing/src/impl/discovery.ts index 9798f017241..d32aab280e3 100644 --- a/packages/rules-unit-testing/src/impl/discovery.ts +++ b/packages/rules-unit-testing/src/impl/discovery.ts @@ -16,7 +16,6 @@ */ import { EmulatorConfig, HostAndPort } from '../public_types'; -import nodeFetch from 'node-fetch'; import { makeUrl, fixHostname } from './url'; /** @@ -27,9 +26,9 @@ import { makeUrl, fixHostname } from './url'; */ export async function discoverEmulators( hub: HostAndPort, - fetch: typeof nodeFetch = nodeFetch + fetchImpl: typeof fetch = fetch ): Promise { - const res = await fetch(makeUrl(hub, '/emulators')); + const res = await fetchImpl(makeUrl(hub, '/emulators')); if (!res.ok) { throw new Error( `HTTP Error ${res.status} when attempting to reach Emulator Hub at ${res.url}, are you sure it is running?` @@ -89,7 +88,7 @@ export function getEmulatorHostAndPort( discovered?: DiscoveredEmulators ) { if (conf && ('host' in conf || 'port' in conf)) { - const { host, port } = conf; + const { host, port } = conf as any; if (host || port) { if (!host || !port) { throw new Error( @@ -104,8 +103,8 @@ export function getEmulatorHostAndPort( ); } return { - host: fixHostname(conf.host, discovered?.hub?.host), - port: conf.port + host: fixHostname(host, discovered?.hub?.host), + port: port }; } } diff --git a/packages/rules-unit-testing/src/impl/rules.ts b/packages/rules-unit-testing/src/impl/rules.ts index 7d4d900367f..fefeb586233 100644 --- a/packages/rules-unit-testing/src/impl/rules.ts +++ b/packages/rules-unit-testing/src/impl/rules.ts @@ -17,7 +17,6 @@ import { HostAndPort } from '../public_types'; import { makeUrl } from './url'; -import fetch from 'node-fetch'; /** * @private diff --git a/packages/rules-unit-testing/src/impl/test_environment.ts b/packages/rules-unit-testing/src/impl/test_environment.ts index cb325912c29..eaafee85060 100644 --- a/packages/rules-unit-testing/src/impl/test_environment.ts +++ b/packages/rules-unit-testing/src/impl/test_environment.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import fetch from 'node-fetch'; import firebase from 'firebase/compat/app'; import 'firebase/compat/firestore'; import 'firebase/compat/database'; @@ -126,7 +125,7 @@ export class RulesTestEnvironmentImpl implements RulesTestEnvironment { return this.withSecurityRulesDisabled(async context => { const { items } = await context.storage().ref().listAll(); await Promise.all( - items.map(item => { + items.map((item: { delete: () => any }) => { return item.delete(); }) ); diff --git a/packages/rules-unit-testing/src/util.ts b/packages/rules-unit-testing/src/util.ts index c96b22d8597..abcad41ef9b 100644 --- a/packages/rules-unit-testing/src/util.ts +++ b/packages/rules-unit-testing/src/util.ts @@ -21,7 +21,6 @@ import { } from './impl/discovery'; import { fixHostname, makeUrl } from './impl/url'; import { HostAndPort } from './public_types'; -import fetch from 'node-fetch'; /** * Run a setup function with background Cloud Functions triggers disabled. This can be used to diff --git a/packages/rules-unit-testing/test/impl/discovery.test.ts b/packages/rules-unit-testing/test/impl/discovery.test.ts index a2ac2be767b..39b5628ddc2 100644 --- a/packages/rules-unit-testing/test/impl/discovery.test.ts +++ b/packages/rules-unit-testing/test/impl/discovery.test.ts @@ -71,7 +71,7 @@ describe('discoverEmulators()', () => { // Connect to port:0. Should always fail (although error codes may differ among OSes). await expect( discoverEmulators({ host: '127.0.0.1', port: 0 }) - ).to.be.rejectedWith(/EADDRNOTAVAIL|ECONNREFUSED/); + ).to.be.rejectedWith(/EADDRNOTAVAIL|ECONNREFUSED|fetch failed/); }); it('throws if response status is not 2xx', async () => { diff --git a/packages/rules-unit-testing/test/util.test.ts b/packages/rules-unit-testing/test/util.test.ts index 9dc778fb93e..e3b514d6a10 100644 --- a/packages/rules-unit-testing/test/util.test.ts +++ b/packages/rules-unit-testing/test/util.test.ts @@ -165,7 +165,7 @@ describe('assertFails()', () => { describe('withFunctionTriggersDisabled()', () => { it('disabling function triggers does not throw, returns value', async function () { - const fetchSpy = sinon.spy(require('node-fetch'), 'default'); + const fetchSpy = sinon.spy(globalThis, 'fetch'); const res = await withFunctionTriggersDisabled(() => { return Promise.resolve(1234); @@ -176,7 +176,7 @@ describe('withFunctionTriggersDisabled()', () => { }); it('disabling function triggers always re-enables, event when the function throws', async function () { - const fetchSpy = sinon.spy(require('node-fetch'), 'default'); + const fetchSpy = sinon.spy(globalThis, 'fetch'); const res = withFunctionTriggersDisabled(() => { throw new Error('I throw!'); diff --git a/packages/storage-compat/CHANGELOG.md b/packages/storage-compat/CHANGELOG.md index be93d428207..e48871ac4ab 100644 --- a/packages/storage-compat/CHANGELOG.md +++ b/packages/storage-compat/CHANGELOG.md @@ -1,5 +1,18 @@ # @firebase/storage-compat +## 0.3.13 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702), [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/storage@0.13.3 + - @firebase/util@1.10.1 + ## 0.3.12 ### Patch Changes diff --git a/packages/storage-compat/package.json b/packages/storage-compat/package.json index 3bc74ab1a54..6bcbda61e75 100644 --- a/packages/storage-compat/package.json +++ b/packages/storage-compat/package.json @@ -1,17 +1,15 @@ { "name": "@firebase/storage-compat", - "version": "0.3.12", + "version": "0.3.13", "description": "The Firebase Firestore compatibility package", "author": "Firebase (https://firebase.google.com/)", "main": "./dist/index.cjs.js", "browser": "./dist/esm/index.esm2017.js", "module": "./dist/esm/index.esm2017.js", - "esm5": "./dist/esm/index.esm5.js", "exports": { ".": { "types": "./dist/src/index.d.ts", "require": "./dist/index.cjs.js", - "esm5": "./dist/esm/index.esm5.js", "default": "./dist/esm/index.esm2017.js" }, "./package.json": "./package.json" @@ -39,19 +37,19 @@ "@firebase/app-compat": "0.x" }, "dependencies": { - "@firebase/storage": "0.13.2", + "@firebase/storage": "0.13.3", "@firebase/storage-types": "0.8.2", - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "devDependencies": { - "@firebase/app-compat": "0.2.41", - "@firebase/auth-compat": "0.5.14", + "@firebase/app-compat": "0.2.45", + "@firebase/auth-compat": "0.5.15", "rollup": "2.79.1", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "files": [ "dist" @@ -63,5 +61,8 @@ }, "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/storage-compat/rollup.config.js b/packages/storage-compat/rollup.config.js index 5aad0883255..59f6282bf5e 100644 --- a/packages/storage-compat/rollup.config.js +++ b/packages/storage-compat/rollup.config.js @@ -25,15 +25,7 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ - typescriptPlugin({ - typescript, - abortOnError: false - }), - json() -]; - -const es2017BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, abortOnError: false, @@ -46,41 +38,26 @@ const es2017BuildPlugins = [ json({ preferConst: true }) ]; -const esmBuilds = [ - { - input: './src/index.ts', - output: { - file: pkg.esm5, - format: 'es', - sourcemap: true - }, - plugins: [...es5BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +const esmBuild = { + input: './src/index.ts', + output: { + file: pkg.browser, + format: 'es', + sourcemap: true }, - { - input: './src/index.ts', - output: { - file: pkg.browser, - format: 'es', - sourcemap: true - }, - plugins: [...es2017BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; + plugins: [...buildPlugins, emitModulePackageFile()], + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +}; -const cjsBuilds = [ - { - input: './src/index.ts', - output: { - file: pkg.main, - format: 'cjs', - sourcemap: true - }, - plugins: [...es5BuildPlugins], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; +const cjsBuild = { + input: './src/index.ts', + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + plugins: buildPlugins, + external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) +}; -// eslint-disable-next-line import/no-default-export -export default [...esmBuilds, ...cjsBuilds]; +export default [esmBuild, cjsBuild]; diff --git a/packages/storage-types/package.json b/packages/storage-types/package.json index 1ace578c836..b27148fa740 100644 --- a/packages/storage-types/package.json +++ b/packages/storage-types/package.json @@ -24,6 +24,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 0a2b0cd2b8e..5e1407e30aa 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,17 @@ #Unreleased +## 0.13.3 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Removed dependency on undici and node-fetch in our node bundles, replacing them with the native fetch implementation. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/util@1.10.1 + ## 0.13.2 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 97807ce9a21..52f18def817 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,12 +1,11 @@ { "name": "@firebase/storage", - "version": "0.13.2", + "version": "0.13.3", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "module": "dist/index.esm2017.js", "browser": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", "exports": { ".": { "types": "./dist/storage-public.d.ts", @@ -14,7 +13,6 @@ "import": "./dist/node-esm/index.node.esm.js", "default": "./dist/index.node.cjs.js" }, - "esm5": "./dist/index.esm5.js", "browser": { "require": "./dist/index.cjs.js", "import": "./dist/index.esm2017.js" @@ -48,22 +46,21 @@ }, "license": "Apache-2.0", "dependencies": { - "@firebase/util": "1.10.0", - "@firebase/component": "0.6.9", - "undici": "6.19.7", + "@firebase/util": "1.10.1", + "@firebase/component": "0.6.10", "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" }, "devDependencies": { - "@firebase/app": "0.10.11", - "@firebase/auth": "1.7.9", + "@firebase/app": "0.10.15", + "@firebase/auth": "1.8.0", "rollup": "2.79.1", "@rollup/plugin-alias": "5.1.0", "@rollup/plugin-json": "4.1.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/storage", @@ -73,5 +70,8 @@ "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" }, - "typings": "dist/src/index.d.ts" + "typings": "dist/src/index.d.ts", + "engines": { + "node": ">=18.0.0" + } } diff --git a/packages/storage/rollup.config.js b/packages/storage/rollup.config.js index 73c9d7561aa..093cca0c654 100644 --- a/packages/storage/rollup.config.js +++ b/packages/storage/rollup.config.js @@ -41,44 +41,15 @@ const deps = Object.keys( const nodeDeps = [...deps, 'util']; -const es5Plugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, abortOnError: false }), - json() -]; - -const es2017Plugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - }, - abortOnError: false - }), json({ preferConst: true }) ]; const browserBuilds = [ - { - input: './src/index.ts', - output: { file: pkg.esm5, format: 'es', sourcemap: true }, - plugins: [ - alias(generateAliasConfig('browser')), - ...es5Plugins, - replace({ - ...generateBuildTargetReplaceConfig('esm', 5), - '__RUNTIME_ENV__': '' - }) - ], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - treeshake: { - moduleSideEffects: false - } - }, { input: './src/index.ts', output: { @@ -88,7 +59,7 @@ const browserBuilds = [ }, plugins: [ alias(generateAliasConfig('browser')), - ...es2017Plugins, + ...buildPlugins, replace({ ...generateBuildTargetReplaceConfig('esm', 2017), '__RUNTIME_ENV__': '' @@ -108,7 +79,7 @@ const browserBuilds = [ }, plugins: [ alias(generateAliasConfig('browser')), - ...es2017Plugins, + ...buildPlugins, replace({ ...generateBuildTargetReplaceConfig('cjs', 2017), '__RUNTIME_ENV__': '' @@ -127,9 +98,9 @@ const browserBuilds = [ ], plugins: [ alias(generateAliasConfig('browser')), - ...es5Plugins, + ...buildPlugins, replace({ - ...generateBuildTargetReplaceConfig('cjs', 5), + ...generateBuildTargetReplaceConfig('cjs', 2017), '__RUNTIME_ENV__': '' }) ], @@ -150,7 +121,7 @@ const nodeBuilds = [ }, plugins: [ alias(generateAliasConfig('node')), - ...es2017Plugins, + ...buildPlugins, replace({ ...generateBuildTargetReplaceConfig('cjs', 2017), '__RUNTIME_ENV__': 'node' @@ -171,7 +142,7 @@ const nodeBuilds = [ }, plugins: [ alias(generateAliasConfig('node')), - ...es2017Plugins, + ...buildPlugins, replace({ ...generateBuildTargetReplaceConfig('esm', 2017), '__RUNTIME_ENV__': 'node' diff --git a/packages/storage/src/index.ts b/packages/storage/src/index.ts index 1e19f5bf6eb..733a39c9ad8 100644 --- a/packages/storage/src/index.ts +++ b/packages/storage/src/index.ts @@ -70,7 +70,7 @@ function registerStorage(): void { ); //RUNTIME_ENV will be replaced during the compilation to "node" for nodejs and an empty string for browser registerVersion(name, version, '__RUNTIME_ENV__'); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/storage/src/platform/node/connection.ts b/packages/storage/src/platform/node/connection.ts index d7141e6ef68..c90f664c3b2 100644 --- a/packages/storage/src/platform/node/connection.ts +++ b/packages/storage/src/platform/node/connection.ts @@ -21,7 +21,6 @@ import { ErrorCode } from '../../implementation/connection'; import { internalError } from '../../implementation/error'; -import { fetch as undiciFetch, Headers as undiciHeaders } from 'undici'; /** An override for the text-based Connection. Used in tests. */ let textFactoryOverride: (() => Connection) | null = null; @@ -39,9 +38,8 @@ abstract class FetchConnection protected statusCode_: number | undefined; protected body_: ArrayBuffer | undefined; protected errorText_ = ''; - protected headers_: undiciHeaders | undefined; + protected headers_: Headers | undefined; protected sent_: boolean = false; - protected fetch_ = undiciFetch; constructor() { this.errorCode_ = ErrorCode.NO_ERROR; @@ -59,7 +57,7 @@ abstract class FetchConnection this.sent_ = true; try { - const response = await this.fetch_(url, { + const response = await fetch(url, { method, headers: headers || {}, body: body as NodeJS.ArrayBufferView | string @@ -163,7 +161,7 @@ export class FetchStreamConnection extends FetchConnection< this.sent_ = true; try { - const response = await this.fetch_(url, { + const response = await fetch(url, { method, headers: headers || {}, body: body as NodeJS.ArrayBufferView | string diff --git a/packages/storage/test/node/connection.test.ts b/packages/storage/test/node/connection.test.ts index 32c499f0209..925d1f8f7dc 100644 --- a/packages/storage/test/node/connection.test.ts +++ b/packages/storage/test/node/connection.test.ts @@ -24,9 +24,9 @@ describe('Connections', () => { it('FetchConnection.send() should not reject on network errors', async () => { const connection = new FetchBytesConnection(); - // need the casting here because fetch_ is a private member - stub(connection as any, 'fetch_').rejects(); + const fetchStub = stub(globalThis, 'fetch').rejects(); await connection.send('testurl', 'GET'); expect(connection.getErrorCode()).to.equal(ErrorCode.NETWORK_ERROR); + fetchStub.restore(); }); }); diff --git a/packages/template-types/package.json b/packages/template-types/package.json index 4929e4ec907..d1925c4d409 100644 --- a/packages/template-types/package.json +++ b/packages/template-types/package.json @@ -21,6 +21,6 @@ "url": "https://github.com/firebase/firebase-js-sdk/issues" }, "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" } } diff --git a/packages/template/CHANGELOG.md b/packages/template/CHANGELOG.md index 5248b3e859d..a2a8636c7d4 100644 --- a/packages/template/CHANGELOG.md +++ b/packages/template/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/template +## 0.2.5 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + ## 0.2.4 ### Patch Changes diff --git a/packages/template/package.json b/packages/template/package.json index 9f797e78984..2a2e0ccaac0 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -1,13 +1,12 @@ { "name": "@firebase/template", - "version": "0.2.4", + "version": "0.2.5", "private": true, "description": "A template package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", "exports": { ".": { "types": "./dist/index.d.ts", @@ -15,7 +14,6 @@ "import": "./dist/node-esm/index.node.esm.js", "require": "./dist/index.node.cjs.js" }, - "esm5": "./dist/index.esm5.js", "browser": { "require": "./dist/index.cjs.js", "import": "./dist/index.esm2017.js" @@ -50,10 +48,10 @@ }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/template", diff --git a/packages/template/rollup.config.js b/packages/template/rollup.config.js index 0417ac2a28d..18ee720efeb 100644 --- a/packages/template/rollup.config.js +++ b/packages/template/rollup.config.js @@ -24,30 +24,9 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }) -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }) -]; +const buildPlugins = [typescriptPlugin({ typescript })]; const browserBuilds = [ - { - input: 'index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, { input: 'index.ts', output: { @@ -55,7 +34,7 @@ const browserBuilds = [ format: 'es', sourcemap: true }, - plugins: es2017BuildPlugins, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { @@ -65,7 +44,7 @@ const browserBuilds = [ format: 'cjs', sourcemap: true }, - plugins: es2017BuildPlugins, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; @@ -73,16 +52,22 @@ const browserBuilds = [ const nodeBuilds = [ { input: 'index.node.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - plugins: es2017BuildPlugins, + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { input: 'index.node.ts', - output: [ - { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } - ], - plugins: [...es2017BuildPlugins, emitModulePackageFile()], + output: { + file: pkg.exports['.'].node.import, + format: 'es', + sourcemap: true + }, + plugins: [...buildPlugins, emitModulePackageFile()], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 995d2a83beb..c6d6d7d9403 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/util +## 1.10.1 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + ## 1.10.0 ### Minor Changes diff --git a/packages/util/package.json b/packages/util/package.json index 1ed335d7a95..128606efc68 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,12 +1,11 @@ { "name": "@firebase/util", - "version": "1.10.0", + "version": "1.10.1", "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", - "esm5": "dist/index.esm5.js", "exports": { ".": { "types": "./dist/util-public.d.ts", @@ -14,7 +13,6 @@ "import": "./dist/node-esm/index.node.esm.js", "require": "./dist/index.node.cjs.js" }, - "esm5": "./dist/index.esm5.js", "browser": { "require": "./dist/index.cjs.js", "import": "./dist/index.esm2017.js" @@ -49,7 +47,7 @@ "devDependencies": { "rollup": "2.79.1", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/util", @@ -65,5 +63,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/packages/util/rollup.config.js b/packages/util/rollup.config.js index 8f0d1312bfa..d428092d8ee 100644 --- a/packages/util/rollup.config.js +++ b/packages/util/rollup.config.js @@ -24,30 +24,9 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }) -]; - -const es2017BuildPlugins = [ - typescriptPlugin({ - typescript, - tsconfigOverride: { - compilerOptions: { - target: 'es2017' - } - } - }) -]; +const buildPlugins = [typescriptPlugin({ typescript })]; const browserBuilds = [ - { - input: 'index.ts', - output: [{ file: pkg.esm5, format: 'es', sourcemap: true }], - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, { input: 'index.ts', output: { @@ -55,7 +34,7 @@ const browserBuilds = [ format: 'es', sourcemap: true }, - plugins: es2017BuildPlugins, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { @@ -65,7 +44,7 @@ const browserBuilds = [ format: 'cjs', sourcemap: true }, - plugins: es2017BuildPlugins, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; @@ -73,16 +52,22 @@ const browserBuilds = [ const nodeBuilds = [ { input: 'index.node.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - plugins: es5BuildPlugins, + output: { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + plugins: buildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, { input: 'index.node.ts', - output: [ - { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } - ], - plugins: [...es2017BuildPlugins, emitModulePackageFile()], + output: { + file: pkg.exports['.'].node.import, + format: 'es', + sourcemap: true + }, + plugins: [...buildPlugins, emitModulePackageFile()], external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } ]; diff --git a/packages/util/src/crypt.ts b/packages/util/src/crypt.ts index 7cd32125043..bec79d5304d 100644 --- a/packages/util/src/crypt.ts +++ b/packages/util/src/crypt.ts @@ -104,6 +104,7 @@ interface Base64 { // We define it as an object literal instead of a class because a class compiled down to es5 can't // be treeshaked. https://github.com/rollup/rollup/issues/1691 // Static lookup maps, lazily populated by init_() +// TODO(dlarocque): Define this as a class, since we no longer target ES5. export const base64: Base64 = { /** * Maps bytes to characters. diff --git a/packages/util/src/errors.ts b/packages/util/src/errors.ts index 7946d706ea3..fdf9a71f719 100644 --- a/packages/util/src/errors.ts +++ b/packages/util/src/errors.ts @@ -86,6 +86,8 @@ export class FirebaseError extends Error { // Fix For ES5 // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + // TODO(dlarocque): Replace this with `new.target`: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget + // which we can now use since we no longer target ES5. Object.setPrototypeOf(this, FirebaseError.prototype); // Maintains proper stack trace for where our error was thrown. diff --git a/packages/vertexai/CHANGELOG.md b/packages/vertexai/CHANGELOG.md index bcbced86378..5453745c076 100644 --- a/packages/vertexai/CHANGELOG.md +++ b/packages/vertexai/CHANGELOG.md @@ -1,5 +1,20 @@ # @firebase/vertexai +## 1.0.0 + +### Major Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Release VertexAI in Firebase for general availability. + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + +- Updated dependencies [[`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702)]: + - @firebase/component@0.6.10 + - @firebase/logger@0.4.3 + - @firebase/util@1.10.1 + ## 0.0.4 ### Patch Changes diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 6023c4dc095..ff7243f0148 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -1,7 +1,7 @@ { - "name": "@firebase/vertexai-preview", - "version": "0.0.4", - "description": "A Firebase SDK for VertexAI (preview)", + "name": "@firebase/vertexai", + "version": "1.0.0", + "description": "A Firebase SDK for VertexAI", "author": "Firebase (https://firebase.google.com/)", "engines": { "node": ">=18.0.0" @@ -11,7 +11,7 @@ "module": "dist/esm/index.esm2017.js", "exports": { ".": { - "types": "./dist/vertexai-preview-public.d.ts", + "types": "./dist/vertexai-public.d.ts", "node": { "require": "./dist/index.cjs.js", "import": "./dist/esm/index.esm2017.js" @@ -40,7 +40,7 @@ "test:skip-clone": "karma start", "test:browser": "yarn testsetup && karma start", "api-report": "api-extractor run --local --verbose", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/vertexai-preview-public.d.ts", + "typings:public": "node ../../scripts/build/use_typings.js ./dist/vertexai-public.d.ts", "trusted-type-check": "tsec -p tsconfig.json --noEmit" }, "peerDependencies": { @@ -49,19 +49,19 @@ }, "dependencies": { "@firebase/app-check-interop-types": "0.3.2", - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", + "@firebase/component": "0.6.10", + "@firebase/logger": "0.4.3", + "@firebase/util": "1.10.1", "tslib": "^2.1.0" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/app": "0.10.11", + "@firebase/app": "0.10.15", "@rollup/plugin-json": "4.1.0", "rollup": "2.79.1", "rollup-plugin-replace": "2.2.0", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/vertexai", diff --git a/packages/vertexai/rollup.config.js b/packages/vertexai/rollup.config.js index 6e99c03e913..3a1313a6bff 100644 --- a/packages/vertexai/rollup.config.js +++ b/packages/vertexai/rollup.config.js @@ -27,14 +27,7 @@ const deps = Object.keys( Object.assign({}, pkg.peerDependencies, pkg.dependencies) ); -const es5BuildPlugins = [ - typescriptPlugin({ - typescript - }), - json() -]; - -const es2017BuildPlugins = [ +const buildPlugins = [ typescriptPlugin({ typescript, tsconfigOverride: { @@ -55,7 +48,7 @@ const browserBuilds = [ sourcemap: true }, plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace({ ...generateBuildTargetReplaceConfig('esm', 2017), __PACKAGE_VERSION__: pkg.version @@ -72,7 +65,7 @@ const browserBuilds = [ sourcemap: true }, plugins: [ - ...es2017BuildPlugins, + ...buildPlugins, replace({ ...generateBuildTargetReplaceConfig('cjs', 2017), __PACKAGE_VERSION__: pkg.version @@ -85,8 +78,12 @@ const browserBuilds = [ // const nodeBuilds = [ // { // input: 'index.node.ts', -// output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], -// plugins: es2017BuildPlugins, +// output: { +// file: pkg.main, +// format: 'cjs', +// sourcemap: true +// }, +// plugins: buildPlugins, // external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) // }, // { @@ -94,7 +91,7 @@ const browserBuilds = [ // output: [ // { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } // ], -// plugins: [...es2017BuildPlugins, emitModulePackageFile()], +// plugins: [...buildPlugins, emitModulePackageFile()], // external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) // } // ]; diff --git a/packages/vertexai/src/api.test.ts b/packages/vertexai/src/api.test.ts index 794c5045012..b6c96923856 100644 --- a/packages/vertexai/src/api.test.ts +++ b/packages/vertexai/src/api.test.ts @@ -39,8 +39,9 @@ describe('Top level API', () => { getGenerativeModel(fakeVertexAI, {} as ModelParams); } catch (e) { expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_MODEL); - expect((e as VertexAIError).message).equals( - `Must provide a model name. Example: getGenerativeModel({ model: 'my-model-name' })` + expect((e as VertexAIError).message).includes( + `VertexAI: Must provide a model name. Example: ` + + `getGenerativeModel({ model: 'my-model-name' }) (vertexAI/${VertexAIErrorCode.NO_MODEL})` ); } }); @@ -54,7 +55,9 @@ describe('Top level API', () => { } catch (e) { expect((e as VertexAIError).code).includes(VertexAIErrorCode.NO_API_KEY); expect((e as VertexAIError).message).equals( - `The "apiKey" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid API key.` + `VertexAI: The "apiKey" field is empty in the local ` + + `Firebase config. Firebase VertexAI requires this field to` + + ` contain a valid API key. (vertexAI/${VertexAIErrorCode.NO_API_KEY})` ); } }); @@ -70,7 +73,9 @@ describe('Top level API', () => { VertexAIErrorCode.NO_PROJECT_ID ); expect((e as VertexAIError).message).equals( - `The "projectId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid project ID.` + `VertexAI: The "projectId" field is empty in the local` + + ` Firebase config. Firebase VertexAI requires this field ` + + `to contain a valid project ID. (vertexAI/${VertexAIErrorCode.NO_PROJECT_ID})` ); } }); diff --git a/packages/vertexai/src/api.ts b/packages/vertexai/src/api.ts index 92d5aac7144..42f33ed2a85 100644 --- a/packages/vertexai/src/api.ts +++ b/packages/vertexai/src/api.ts @@ -26,6 +26,7 @@ import { VertexAIError } from './errors'; import { GenerativeModel } from './models/generative-model'; export { ChatSession } from './methods/chat-session'; +export * from './requests/schema-builder'; export { GenerativeModel }; @@ -38,7 +39,7 @@ declare module '@firebase/component' { } /** - * Returns a {@link VertexAI} instance for the given app. + * Returns a {@link VertexAI} instance for the given app. * * @public * @@ -58,7 +59,7 @@ export function getVertexAI( } /** - * Returns a {@link GenerativeModel} class with methods for inference + * Returns a {@link GenerativeModel} class with methods for inference * and other functionality. * * @public diff --git a/packages/vertexai/src/constants.ts b/packages/vertexai/src/constants.ts index 97f6d813abc..3ff894f354b 100644 --- a/packages/vertexai/src/constants.ts +++ b/packages/vertexai/src/constants.ts @@ -21,9 +21,9 @@ export const VERTEX_TYPE = 'vertexAI'; export const DEFAULT_LOCATION = 'us-central1'; -export const DEFAULT_BASE_URL = 'https://firebaseml.googleapis.com'; +export const DEFAULT_BASE_URL = 'https://firebasevertexai.googleapis.com'; -export const DEFAULT_API_VERSION = 'v2beta'; +export const DEFAULT_API_VERSION = 'v1beta'; export const PACKAGE_VERSION = version; diff --git a/packages/vertexai/src/errors.ts b/packages/vertexai/src/errors.ts index 46db2fd271f..b643a5f552d 100644 --- a/packages/vertexai/src/errors.ts +++ b/packages/vertexai/src/errors.ts @@ -28,21 +28,21 @@ export class VertexAIError extends FirebaseError { /** * Constructs a new instance of the `VertexAIError` class. * - * @param code - The error code from {@link VertexAIErrorCode}. + * @param code - The error code from {@link VertexAIErrorCode}. * @param message - A human-readable message describing the error. * @param customErrorData - Optional error data. */ constructor( readonly code: VertexAIErrorCode, - readonly message: string, + message: string, readonly customErrorData?: CustomErrorData ) { // Match error format used by FirebaseError from ErrorFactory const service = VERTEX_TYPE; const serviceName = 'VertexAI'; const fullCode = `${service}/${code}`; - const fullMessage = `${serviceName}: ${message} (${fullCode}).`; - super(fullCode, fullMessage); + const fullMessage = `${serviceName}: ${message} (${fullCode})`; + super(code, fullMessage); // FirebaseError initializes a stack trace, but it assumes the error is created from the error // factory. Since we break this assumption, we set the stack trace to be originating from this @@ -56,6 +56,8 @@ export class VertexAIError extends FirebaseError { // Allows instanceof VertexAIError in ES5/ES6 // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + // TODO(dlarocque): Replace this with `new.target`: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget + // which we can now use since we no longer target ES5. Object.setPrototypeOf(this, VertexAIError.prototype); // Since Error is an interface, we don't inherit toString and so we define it ourselves. diff --git a/packages/vertexai/src/index.ts b/packages/vertexai/src/index.ts index c8f798ff3c5..5d646e8d9d0 100644 --- a/packages/vertexai/src/index.ts +++ b/packages/vertexai/src/index.ts @@ -49,7 +49,7 @@ function registerVertex(): void { ); registerVersion(name, version); - // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation + // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation registerVersion(name, version, '__BUILD_TARGET__'); } diff --git a/packages/functions-compat/src/index.node.ts b/packages/vertexai/src/logger.ts similarity index 70% rename from packages/functions-compat/src/index.node.ts rename to packages/vertexai/src/logger.ts index e7b3c108ac4..7664d6b4e31 100644 --- a/packages/functions-compat/src/index.node.ts +++ b/packages/vertexai/src/logger.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2020 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,6 @@ * limitations under the License. */ -import firebase from '@firebase/app-compat'; -import { name, version } from '../package.json'; -import { registerFunctions } from './register'; +import { Logger } from '@firebase/logger'; -registerFunctions(); -firebase.registerVersion(name, version, 'node'); +export const logger = new Logger('@firebase/vertexai'); diff --git a/packages/vertexai/src/methods/chat-session.test.ts b/packages/vertexai/src/methods/chat-session.test.ts index c8c92e046b9..7741c33ea0b 100644 --- a/packages/vertexai/src/methods/chat-session.test.ts +++ b/packages/vertexai/src/methods/chat-session.test.ts @@ -87,7 +87,7 @@ describe('ChatSession', () => { match.any ); await clock.runAllAsync(); - expect(consoleStub.args[0][0].toString()).to.include( + expect(consoleStub.args[0][1].toString()).to.include( // Firefox has different wording when a property is undefined 'undefined' ); diff --git a/packages/vertexai/src/methods/chat-session.ts b/packages/vertexai/src/methods/chat-session.ts index 0d1636c1cd8..dd22b29a7c8 100644 --- a/packages/vertexai/src/methods/chat-session.ts +++ b/packages/vertexai/src/methods/chat-session.ts @@ -29,6 +29,7 @@ import { formatBlockErrorMessage } from '../requests/response-helpers'; import { validateChatHistory } from './chat-session-helpers'; import { generateContent, generateContentStream } from './generate-content'; import { ApiSettings } from '../types/internal'; +import { logger } from '../logger'; /** * Do not log a message for this error. @@ -71,7 +72,7 @@ export class ChatSession { /** * Sends a chat message and receives a non-streaming - * {@link GenerateContentResult} + * {@link GenerateContentResult} */ async sendMessage( request: string | Array @@ -112,7 +113,7 @@ export class ChatSession { } else { const blockErrorMessage = formatBlockErrorMessage(result.response); if (blockErrorMessage) { - console.warn( + logger.warn( `sendMessage() was unsuccessful. ${blockErrorMessage}. Inspect response object for details.` ); } @@ -125,7 +126,7 @@ export class ChatSession { /** * Sends a chat message and receives the response as a - * {@link GenerateContentStreamResult} containing an iterable stream + * {@link GenerateContentStreamResult} containing an iterable stream * and a response promise. */ async sendMessageStream( @@ -169,7 +170,7 @@ export class ChatSession { } else { const blockErrorMessage = formatBlockErrorMessage(response); if (blockErrorMessage) { - console.warn( + logger.warn( `sendMessageStream() was unsuccessful. ${blockErrorMessage}. Inspect response object for details.` ); } @@ -182,7 +183,7 @@ export class ChatSession { if (e.message !== SILENT_ERROR) { // Users do not have access to _sendPromise to catch errors // downstream from streamPromise, so they should not throw. - console.error(e); + logger.error(e); } }); return streamPromise; diff --git a/packages/vertexai/src/methods/generate-content.test.ts b/packages/vertexai/src/methods/generate-content.test.ts index 51fa82dccc9..c5a1d9e1e91 100644 --- a/packages/vertexai/src/methods/generate-content.test.ts +++ b/packages/vertexai/src/methods/generate-content.test.ts @@ -220,4 +220,20 @@ describe('generateContent()', () => { ).to.be.rejectedWith(/400.*invalid argument/); expect(mockFetch).to.be.called; }); + it('api not enabled (403)', async () => { + const mockResponse = getMockResponse( + 'unary-failure-firebasevertexai-api-not-enabled.json' + ); + const mockFetch = stub(globalThis, 'fetch').resolves({ + ok: false, + status: 403, + json: mockResponse.json + } as Response); + await expect( + generateContent(fakeApiSettings, 'model', fakeRequestParams) + ).to.be.rejectedWith( + /firebasevertexai\.googleapis[\s\S]*my-project[\s\S]*api-not-enabled/ + ); + expect(mockFetch).to.be.called; + }); }); diff --git a/packages/vertexai/src/methods/generate-content.ts b/packages/vertexai/src/methods/generate-content.ts index 2dee91f12e8..0944b38016a 100644 --- a/packages/vertexai/src/methods/generate-content.ts +++ b/packages/vertexai/src/methods/generate-content.ts @@ -23,7 +23,7 @@ import { RequestOptions } from '../types'; import { Task, makeRequest } from '../requests/request'; -import { addHelpers } from '../requests/response-helpers'; +import { createEnhancedContentResponse } from '../requests/response-helpers'; import { processStream } from '../requests/stream-reader'; import { ApiSettings } from '../types/internal'; @@ -59,7 +59,7 @@ export async function generateContent( requestOptions ); const responseJson: GenerateContentResponse = await response.json(); - const enhancedResponse = addHelpers(responseJson); + const enhancedResponse = createEnhancedContentResponse(responseJson); return { response: enhancedResponse }; diff --git a/packages/vertexai/src/models/generative-model.test.ts b/packages/vertexai/src/models/generative-model.test.ts index 75d98eb6ec4..e03f39e8a83 100644 --- a/packages/vertexai/src/models/generative-model.test.ts +++ b/packages/vertexai/src/models/generative-model.test.ts @@ -62,12 +62,21 @@ describe('GenerativeModel', () => { it('passes params through to generateContent', async () => { const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model', - tools: [{ functionDeclarations: [{ name: 'myfunc' }] }], + tools: [ + { + functionDeclarations: [ + { + name: 'myfunc', + description: 'mydesc' + } + ] + } + ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } }); expect(genModel.tools?.length).to.equal(1); - expect(genModel.toolConfig?.functionCallingConfig.mode).to.equal( + expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); @@ -122,12 +131,21 @@ describe('GenerativeModel', () => { it('generateContent overrides model values', async () => { const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model', - tools: [{ functionDeclarations: [{ name: 'myfunc' }] }], + tools: [ + { + functionDeclarations: [ + { + name: 'myfunc', + description: 'mydesc' + } + ] + } + ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } }); expect(genModel.tools?.length).to.equal(1); - expect(genModel.toolConfig?.functionCallingConfig.mode).to.equal( + expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); @@ -139,7 +157,13 @@ describe('GenerativeModel', () => { ); await genModel.generateContent({ contents: [{ role: 'user', parts: [{ text: 'hello' }] }], - tools: [{ functionDeclarations: [{ name: 'otherfunc' }] }], + tools: [ + { + functionDeclarations: [ + { name: 'otherfunc', description: 'otherdesc' } + ] + } + ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.AUTO } }, systemInstruction: { role: 'system', parts: [{ text: 'be formal' }] } }); @@ -162,12 +186,14 @@ describe('GenerativeModel', () => { it('passes params through to chat.sendMessage', async () => { const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model', - tools: [{ functionDeclarations: [{ name: 'myfunc' }] }], + tools: [ + { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } + ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } }); expect(genModel.tools?.length).to.equal(1); - expect(genModel.toolConfig?.functionCallingConfig.mode).to.equal( + expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); @@ -222,12 +248,14 @@ describe('GenerativeModel', () => { it('startChat overrides model values', async () => { const genModel = new GenerativeModel(fakeVertexAI, { model: 'my-model', - tools: [{ functionDeclarations: [{ name: 'myfunc' }] }], + tools: [ + { functionDeclarations: [{ name: 'myfunc', description: 'mydesc' }] } + ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.NONE } }, systemInstruction: { role: 'system', parts: [{ text: 'be friendly' }] } }); expect(genModel.tools?.length).to.equal(1); - expect(genModel.toolConfig?.functionCallingConfig.mode).to.equal( + expect(genModel.toolConfig?.functionCallingConfig?.mode).to.equal( FunctionCallingMode.NONE ); expect(genModel.systemInstruction?.parts[0].text).to.equal('be friendly'); @@ -239,7 +267,13 @@ describe('GenerativeModel', () => { ); await genModel .startChat({ - tools: [{ functionDeclarations: [{ name: 'otherfunc' }] }], + tools: [ + { + functionDeclarations: [ + { name: 'otherfunc', description: 'otherdesc' } + ] + } + ], toolConfig: { functionCallingConfig: { mode: FunctionCallingMode.AUTO } }, diff --git a/packages/vertexai/src/models/generative-model.ts b/packages/vertexai/src/models/generative-model.ts index 88be3ee6436..e719529967c 100644 --- a/packages/vertexai/src/models/generative-model.ts +++ b/packages/vertexai/src/models/generative-model.ts @@ -116,7 +116,7 @@ export class GenerativeModel { /** * Makes a single non-streaming call to the model - * and returns an object containing a single {@link GenerateContentResponse}. + * and returns an object containing a single {@link GenerateContentResponse}. */ async generateContent( request: GenerateContentRequest | string | Array @@ -163,7 +163,7 @@ export class GenerativeModel { } /** - * Gets a new {@link ChatSession} instance which can be used for + * Gets a new {@link ChatSession} instance which can be used for * multi-turn chats. */ startChat(startChatParams?: StartChatParams): ChatSession { diff --git a/packages/vertexai/src/public-types.ts b/packages/vertexai/src/public-types.ts index fbc5d51084d..280fee9d1cd 100644 --- a/packages/vertexai/src/public-types.ts +++ b/packages/vertexai/src/public-types.ts @@ -25,7 +25,7 @@ export * from './types'; */ export interface VertexAI { /** - * The {@link @firebase/app#FirebaseApp} this {@link VertexAI} instance is associated with. + * The {@link @firebase/app#FirebaseApp} this {@link VertexAI} instance is associated with. */ app: FirebaseApp; location: string; diff --git a/packages/vertexai/src/requests/request.test.ts b/packages/vertexai/src/requests/request.test.ts index 16a1ece2c7e..b6d0ecb9b71 100644 --- a/packages/vertexai/src/requests/request.test.ts +++ b/packages/vertexai/src/requests/request.test.ts @@ -16,7 +16,7 @@ */ import { expect, use } from 'chai'; -import { restore, stub } from 'sinon'; +import { match, restore, stub } from 'sinon'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import { RequestUrl, Task, getHeaders, makeRequest } from './request'; @@ -24,6 +24,7 @@ import { ApiSettings } from '../types/internal'; import { DEFAULT_API_VERSION } from '../constants'; import { VertexAIErrorCode } from '../types'; import { VertexAIError } from '../errors'; +import { getMockResponse } from '../../test-utils/mock-response'; use(sinonChai); use(chaiAsPromised); @@ -168,13 +169,18 @@ describe('request methods', () => { project: 'myproject', location: 'moon', getAppCheckToken: () => - Promise.resolve({ token: 'token', error: Error('oops') }) + Promise.resolve({ token: 'dummytoken', error: Error('oops') }) }, true, {} ); + const warnStub = stub(console, 'warn'); const headers = await getHeaders(fakeUrl); - expect(headers.has('X-Firebase-AppCheck')).to.be.false; + expect(headers.get('X-Firebase-AppCheck')).to.equal('dummytoken'); + expect(warnStub).to.be.calledWith( + match(/vertexai/), + match(/App Check.*oops/) + ); }); it('adds auth token if it exists', async () => { const headers = await getHeaders(fakeUrl); @@ -243,7 +249,7 @@ describe('request methods', () => { false, '', { - timeout: 0 + timeout: 180000 } ); } catch (e) { @@ -357,4 +363,28 @@ describe('request methods', () => { expect(fetchStub).to.be.calledOnce; }); }); + it('Network error, API not enabled', async () => { + const mockResponse = getMockResponse( + 'unary-failure-firebasevertexai-api-not-enabled.json' + ); + const fetchStub = stub(globalThis, 'fetch').resolves( + mockResponse as Response + ); + try { + await makeRequest( + 'models/model-name', + Task.GENERATE_CONTENT, + fakeApiSettings, + false, + '' + ); + } catch (e) { + expect((e as VertexAIError).code).to.equal( + VertexAIErrorCode.API_NOT_ENABLED + ); + expect((e as VertexAIError).message).to.include('my-project'); + expect((e as VertexAIError).message).to.include('googleapis.com'); + } + expect(fetchStub).to.be.calledOnce; + }); }); diff --git a/packages/vertexai/src/requests/request.ts b/packages/vertexai/src/requests/request.ts index eac99a23038..411bad859f0 100644 --- a/packages/vertexai/src/requests/request.ts +++ b/packages/vertexai/src/requests/request.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { RequestOptions, VertexAIErrorCode } from '../types'; +import { ErrorDetails, RequestOptions, VertexAIErrorCode } from '../types'; import { VertexAIError } from '../errors'; import { ApiSettings } from '../types/internal'; import { @@ -24,6 +24,7 @@ import { LANGUAGE_TAG, PACKAGE_VERSION } from '../constants'; +import { logger } from '../logger'; export enum Task { GENERATE_CONTENT = 'generateContent', @@ -83,8 +84,13 @@ export async function getHeaders(url: RequestUrl): Promise { headers.append('x-goog-api-key', url.apiSettings.apiKey); if (url.apiSettings.getAppCheckToken) { const appCheckToken = await url.apiSettings.getAppCheckToken(); - if (appCheckToken && !appCheckToken.error) { + if (appCheckToken) { headers.append('X-Firebase-AppCheck', appCheckToken.token); + if (appCheckToken.error) { + logger.warn( + `Unable to obtain a valid App Check token: ${appCheckToken.error.message}` + ); + } } } @@ -151,6 +157,35 @@ export async function makeRequest( } catch (e) { // ignored } + if ( + response.status === 403 && + errorDetails.some( + (detail: ErrorDetails) => detail.reason === 'SERVICE_DISABLED' + ) && + errorDetails.some((detail: ErrorDetails) => + ( + detail.links as Array> + )?.[0]?.description.includes( + 'Google developers console API activation' + ) + ) + ) { + throw new VertexAIError( + VertexAIErrorCode.API_NOT_ENABLED, + `The Vertex AI in Firebase SDK requires the Vertex AI in Firebase ` + + `API ('firebasevertexai.googleapis.com') to be enabled in your ` + + `Firebase project. Enable this API by visiting the Firebase Console ` + + `at https://console.firebase.google.com/project/${url.apiSettings.project}/genai/ ` + + `and clicking "Get started". If you enabled this API recently, ` + + `wait a few minutes for the action to propagate to our systems and ` + + `then retry.`, + { + status: response.status, + statusText: response.statusText, + errorDetails + } + ); + } throw new VertexAIError( VertexAIErrorCode.FETCH_ERROR, `Error fetching from ${url}: [${response.status} ${response.statusText}] ${message}`, @@ -165,6 +200,7 @@ export async function makeRequest( let err = e as Error; if ( (e as VertexAIError).code !== VertexAIErrorCode.FETCH_ERROR && + (e as VertexAIError).code !== VertexAIErrorCode.API_NOT_ENABLED && e instanceof Error ) { err = new VertexAIError( @@ -186,11 +222,13 @@ export async function makeRequest( */ function buildFetchOptions(requestOptions?: RequestOptions): RequestInit { const fetchOptions = {} as RequestInit; + let timeoutMillis = 180 * 1000; // default: 180 s if (requestOptions?.timeout && requestOptions?.timeout >= 0) { - const abortController = new AbortController(); - const signal = abortController.signal; - setTimeout(() => abortController.abort(), requestOptions.timeout); - fetchOptions.signal = signal; + timeoutMillis = requestOptions.timeout; } + const abortController = new AbortController(); + const signal = abortController.signal; + setTimeout(() => abortController.abort(), timeoutMillis); + fetchOptions.signal = signal; return fetchOptions; } diff --git a/packages/vertexai/src/requests/response-helpers.ts b/packages/vertexai/src/requests/response-helpers.ts index 1b43602b0cb..27347d10f0d 100644 --- a/packages/vertexai/src/requests/response-helpers.ts +++ b/packages/vertexai/src/requests/response-helpers.ts @@ -24,6 +24,28 @@ import { VertexAIErrorCode } from '../types'; import { VertexAIError } from '../errors'; +import { logger } from '../logger'; + +/** + * Creates an EnhancedGenerateContentResponse object that has helper functions and + * other modifications that improve usability. + */ +export function createEnhancedContentResponse( + response: GenerateContentResponse +): EnhancedGenerateContentResponse { + /** + * The Vertex AI backend omits default values. + * This causes the `index` property to be omitted from the first candidate in the + * response, since it has index 0, and 0 is a default value. + * See: https://github.com/firebase/firebase-js-sdk/issues/8566 + */ + if (response.candidates && !response.candidates[0].hasOwnProperty('index')) { + response.candidates[0].index = 0; + } + + const responseWithHelpers = addHelpers(response); + return responseWithHelpers; +} /** * Adds convenience helper methods to a response object, including stream @@ -35,7 +57,7 @@ export function addHelpers( (response as EnhancedGenerateContentResponse).text = () => { if (response.candidates && response.candidates.length > 0) { if (response.candidates.length > 1) { - console.warn( + logger.warn( `This response had ${response.candidates.length} ` + `candidates. Returning text from the first candidate only. ` + `Access response.candidates directly to use the other candidates.` @@ -67,7 +89,7 @@ export function addHelpers( (response as EnhancedGenerateContentResponse).functionCalls = () => { if (response.candidates && response.candidates.length > 0) { if (response.candidates.length > 1) { - console.warn( + logger.warn( `This response had ${response.candidates.length} ` + `candidates. Returning function calls from the first candidate only. ` + `Access response.candidates directly to use the other candidates.` @@ -119,7 +141,7 @@ export function getText(response: GenerateContentResponse): string { } /** - * Returns {@link FunctionCall}s associated with first candidate. + * Returns {@link FunctionCall}s associated with first candidate. */ export function getFunctionCalls( response: GenerateContentResponse diff --git a/packages/vertexai/src/requests/schema-builder.test.ts b/packages/vertexai/src/requests/schema-builder.test.ts new file mode 100644 index 00000000000..b95acaae9f1 --- /dev/null +++ b/packages/vertexai/src/requests/schema-builder.test.ts @@ -0,0 +1,393 @@ +/** + * @license + * Copyright 2024 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, use } from 'chai'; +import sinonChai from 'sinon-chai'; +import { Schema } from './schema-builder'; +import { VertexAIErrorCode } from '../types'; + +use(sinonChai); + +describe('Schema builder', () => { + it('builds integer schema', () => { + const schema = Schema.integer(); + expect(schema.toJSON()).to.eql({ + type: 'integer', + nullable: false + }); + }); + it('builds integer schema with options and overrides', () => { + const schema = Schema.integer({ nullable: true, format: 'int32' }); + expect(schema.toJSON()).to.eql({ + type: 'integer', + format: 'int32', + nullable: true + }); + }); + it('builds number schema', () => { + const schema = Schema.number(); + expect(schema.toJSON()).to.eql({ + type: 'number', + nullable: false + }); + }); + it('builds number schema with options and unknown options', () => { + const schema = Schema.number({ format: 'float', futureOption: 'test' }); + expect(schema.toJSON()).to.eql({ + type: 'number', + format: 'float', + futureOption: 'test', + nullable: false + }); + }); + it('builds boolean schema', () => { + const schema = Schema.boolean(); + expect(schema.toJSON()).to.eql({ + type: 'boolean', + nullable: false + }); + }); + it('builds string schema', () => { + const schema = Schema.string({ description: 'hey' }); + expect(schema.toJSON()).to.eql({ + type: 'string', + description: 'hey', + nullable: false + }); + }); + it('builds enumString schema', () => { + const schema = Schema.enumString({ + example: 'east', + enum: ['east', 'west'] + }); + expect(schema.toJSON()).to.eql({ + type: 'string', + example: 'east', + enum: ['east', 'west'], + nullable: false + }); + }); + it('builds an object schema', () => { + const schema = Schema.object({ + properties: { + 'someInput': Schema.string() + } + }); + expect(schema.toJSON()).to.eql({ + type: 'object', + nullable: false, + properties: { + 'someInput': { + type: 'string', + nullable: false + } + }, + required: ['someInput'] + }); + }); + it('builds an object schema with optional properties', () => { + const schema = Schema.object({ + properties: { + 'someInput': Schema.string(), + 'someBool': Schema.boolean() + }, + optionalProperties: ['someBool'] + }); + expect(schema.toJSON()).to.eql({ + type: 'object', + nullable: false, + properties: { + 'someInput': { + type: 'string', + nullable: false + }, + 'someBool': { + type: 'boolean', + nullable: false + } + }, + required: ['someInput'] + }); + }); + it('builds layered schema - partially filled out', () => { + const schema = Schema.array({ + items: Schema.object({ + properties: { + country: Schema.string({ + description: 'A country name' + }), + population: Schema.integer(), + coordinates: Schema.object({ + properties: { + latitude: Schema.number({ format: 'float' }), + longitude: Schema.number({ format: 'double' }) + } + }), + hemisphere: Schema.object({ + properties: { + latitudinal: Schema.enumString({ enum: ['N', 'S'] }), + longitudinal: Schema.enumString({ enum: ['E', 'W'] }) + } + }), + isCapital: Schema.boolean() + } + }) + }); + expect(schema.toJSON()).to.eql(layeredSchemaOutputPartial); + }); + it('builds layered schema - fully filled out', () => { + const schema = Schema.array({ + items: Schema.object({ + description: 'A country profile', + nullable: false, + properties: { + country: Schema.string({ + nullable: false, + description: 'Country name', + format: undefined + }), + population: Schema.integer({ + nullable: false, + description: 'Number of people in country', + format: 'int64' + }), + coordinates: Schema.object({ + nullable: false, + description: 'Latitude and longitude', + properties: { + latitude: Schema.number({ + nullable: false, + description: 'Latitude of capital', + format: 'float' + }), + longitude: Schema.number({ + nullable: false, + description: 'Longitude of capital', + format: 'double' + }) + } + }), + hemisphere: Schema.object({ + nullable: false, + description: 'Hemisphere(s) country is in', + properties: { + latitudinal: Schema.enumString({ enum: ['N', 'S'] }), + longitudinal: Schema.enumString({ enum: ['E', 'W'] }) + } + }), + isCapital: Schema.boolean({ + nullable: false, + description: "This doesn't make a lot of sense but it's a demo" + }), + elevation: Schema.integer({ + nullable: false, + description: 'Average elevation', + format: 'float' + }) + }, + optionalProperties: [] + }) + }); + + expect(schema.toJSON()).to.eql(layeredSchemaOutput); + }); + it('can override "nullable" and set optional properties', () => { + const schema = Schema.object({ + properties: { + country: Schema.string(), + elevation: Schema.number(), + population: Schema.integer({ nullable: true }) + }, + optionalProperties: ['elevation'] + }); + expect(schema.toJSON()).to.eql({ + 'type': 'object', + 'nullable': false, + 'properties': { + 'country': { + 'type': 'string', + 'nullable': false + }, + 'elevation': { + 'type': 'number', + 'nullable': false + }, + 'population': { + 'type': 'integer', + 'nullable': true + } + }, + 'required': ['country', 'population'] + }); + }); + it('throws if an optionalProperties item does not exist', () => { + const schema = Schema.object({ + properties: { + country: Schema.string(), + elevation: Schema.number(), + population: Schema.integer({ nullable: true }) + }, + optionalProperties: ['cat'] + }); + expect(() => schema.toJSON()).to.throw(VertexAIErrorCode.INVALID_SCHEMA); + }); +}); + +const layeredSchemaOutputPartial = { + 'type': 'array', + 'nullable': false, + 'items': { + 'type': 'object', + 'nullable': false, + 'properties': { + 'country': { + 'type': 'string', + 'description': 'A country name', + 'nullable': false + }, + 'population': { + 'type': 'integer', + 'nullable': false + }, + 'coordinates': { + 'type': 'object', + 'nullable': false, + 'properties': { + 'latitude': { + 'type': 'number', + 'format': 'float', + 'nullable': false + }, + 'longitude': { + 'type': 'number', + 'format': 'double', + 'nullable': false + } + }, + 'required': ['latitude', 'longitude'] + }, + 'hemisphere': { + 'type': 'object', + 'nullable': false, + 'properties': { + 'latitudinal': { + 'type': 'string', + 'nullable': false, + 'enum': ['N', 'S'] + }, + 'longitudinal': { + 'type': 'string', + 'nullable': false, + 'enum': ['E', 'W'] + } + }, + 'required': ['latitudinal', 'longitudinal'] + }, + 'isCapital': { + 'type': 'boolean', + 'nullable': false + } + }, + 'required': [ + 'country', + 'population', + 'coordinates', + 'hemisphere', + 'isCapital' + ] + } +}; + +const layeredSchemaOutput = { + 'type': 'array', + 'nullable': false, + 'items': { + 'type': 'object', + 'description': 'A country profile', + 'nullable': false, + 'required': [ + 'country', + 'population', + 'coordinates', + 'hemisphere', + 'isCapital', + 'elevation' + ], + 'properties': { + 'country': { + 'type': 'string', + 'description': 'Country name', + 'nullable': false + }, + 'population': { + 'type': 'integer', + 'format': 'int64', + 'description': 'Number of people in country', + 'nullable': false + }, + 'coordinates': { + 'type': 'object', + 'description': 'Latitude and longitude', + 'nullable': false, + 'required': ['latitude', 'longitude'], + 'properties': { + 'latitude': { + 'type': 'number', + 'format': 'float', + 'description': 'Latitude of capital', + 'nullable': false + }, + 'longitude': { + 'type': 'number', + 'format': 'double', + 'description': 'Longitude of capital', + 'nullable': false + } + } + }, + 'hemisphere': { + 'type': 'object', + 'description': 'Hemisphere(s) country is in', + 'nullable': false, + 'required': ['latitudinal', 'longitudinal'], + 'properties': { + 'latitudinal': { + 'type': 'string', + 'nullable': false, + 'enum': ['N', 'S'] + }, + 'longitudinal': { + 'type': 'string', + 'nullable': false, + 'enum': ['E', 'W'] + } + } + }, + 'isCapital': { + 'type': 'boolean', + 'description': "This doesn't make a lot of sense but it's a demo", + 'nullable': false + }, + 'elevation': { + 'type': 'integer', + 'format': 'float', + 'description': 'Average elevation', + 'nullable': false + } + } + } +}; diff --git a/packages/vertexai/src/requests/schema-builder.ts b/packages/vertexai/src/requests/schema-builder.ts new file mode 100644 index 00000000000..3d219d58b13 --- /dev/null +++ b/packages/vertexai/src/requests/schema-builder.ts @@ -0,0 +1,292 @@ +/** + * @license + * Copyright 2024 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 { VertexAIError } from '../errors'; +import { VertexAIErrorCode } from '../types'; +import { + SchemaInterface, + SchemaType, + SchemaParams, + SchemaRequest, + ObjectSchemaInterface +} from '../types/schema'; + +/** + * Parent class encompassing all Schema types, with static methods that + * allow building specific Schema types. This class can be converted with + * `JSON.stringify()` into a JSON string accepted by Vertex AI REST endpoints. + * (This string conversion is automatically done when calling SDK methods.) + * @public + */ +export abstract class Schema implements SchemaInterface { + /** + * Optional. The type of the property. {@link + * SchemaType}. + */ + type: SchemaType; + /** Optional. The format of the property. + * Supported formats:
+ *
    + *
  • for NUMBER type: "float", "double"
  • + *
  • for INTEGER type: "int32", "int64"
  • + *
  • for STRING type: "email", "byte", etc
  • + *
+ */ + format?: string; + /** Optional. The description of the property. */ + description?: string; + /** Optional. Whether the property is nullable. Defaults to false. */ + nullable: boolean; + /** Optional. The example of the property. */ + example?: unknown; + /** + * Allows user to add other schema properties that have not yet + * been officially added to the SDK. + */ + [key: string]: unknown; + + constructor(schemaParams: SchemaInterface) { + // eslint-disable-next-line guard-for-in + for (const paramKey in schemaParams) { + this[paramKey] = schemaParams[paramKey]; + } + // Ensure these are explicitly set to avoid TS errors. + this.type = schemaParams.type; + this.nullable = schemaParams.hasOwnProperty('nullable') + ? !!schemaParams.nullable + : false; + } + + /** + * Defines how this Schema should be serialized as JSON. + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#tojson_behavior + * @internal + */ + toJSON(): SchemaRequest { + const obj: { type: SchemaType; [key: string]: unknown } = { + type: this.type + }; + for (const prop in this) { + if (this.hasOwnProperty(prop) && this[prop] !== undefined) { + if (prop !== 'required' || this.type === SchemaType.OBJECT) { + obj[prop] = this[prop]; + } + } + } + return obj as SchemaRequest; + } + + static array(arrayParams: SchemaParams & { items: Schema }): ArraySchema { + return new ArraySchema(arrayParams, arrayParams.items); + } + + static object( + objectParams: SchemaParams & { + properties: { + [k: string]: Schema; + }; + optionalProperties?: string[]; + } + ): ObjectSchema { + return new ObjectSchema( + objectParams, + objectParams.properties, + objectParams.optionalProperties + ); + } + + // eslint-disable-next-line id-blacklist + static string(stringParams?: SchemaParams): StringSchema { + return new StringSchema(stringParams); + } + + static enumString( + stringParams: SchemaParams & { enum: string[] } + ): StringSchema { + return new StringSchema(stringParams, stringParams.enum); + } + + static integer(integerParams?: SchemaParams): IntegerSchema { + return new IntegerSchema(integerParams); + } + + // eslint-disable-next-line id-blacklist + static number(numberParams?: SchemaParams): NumberSchema { + return new NumberSchema(numberParams); + } + + // eslint-disable-next-line id-blacklist + static boolean(booleanParams?: SchemaParams): BooleanSchema { + return new BooleanSchema(booleanParams); + } +} + +/** + * A type that includes all specific Schema types. + * @public + */ +export type TypedSchema = + | IntegerSchema + | NumberSchema + | StringSchema + | BooleanSchema + | ObjectSchema + | ArraySchema; + +/** + * Schema class for "integer" types. + * @public + */ +export class IntegerSchema extends Schema { + constructor(schemaParams?: SchemaParams) { + super({ + type: SchemaType.INTEGER, + ...schemaParams + }); + } +} + +/** + * Schema class for "number" types. + * @public + */ +export class NumberSchema extends Schema { + constructor(schemaParams?: SchemaParams) { + super({ + type: SchemaType.NUMBER, + ...schemaParams + }); + } +} + +/** + * Schema class for "boolean" types. + * @public + */ +export class BooleanSchema extends Schema { + constructor(schemaParams?: SchemaParams) { + super({ + type: SchemaType.BOOLEAN, + ...schemaParams + }); + } +} + +/** + * Schema class for "string" types. Can be used with or without + * enum values. + * @public + */ +export class StringSchema extends Schema { + enum?: string[]; + constructor(schemaParams?: SchemaParams, enumValues?: string[]) { + super({ + type: SchemaType.STRING, + ...schemaParams + }); + this.enum = enumValues; + } + + /** + * @internal + */ + toJSON(): SchemaRequest { + const obj = super.toJSON(); + if (this.enum) { + obj['enum'] = this.enum; + } + return obj as SchemaRequest; + } +} + +/** + * Schema class for "array" types. + * The `items` param should refer to the type of item that can be a member + * of the array. + * @public + */ +export class ArraySchema extends Schema { + constructor(schemaParams: SchemaParams, public items: TypedSchema) { + super({ + type: SchemaType.ARRAY, + ...schemaParams + }); + } + + /** + * @internal + */ + toJSON(): SchemaRequest { + const obj = super.toJSON(); + obj.items = this.items.toJSON(); + return obj; + } +} + +/** + * Schema class for "object" types. + * The `properties` param must be a map of `Schema` objects. + * @public + */ +export class ObjectSchema extends Schema { + constructor( + schemaParams: SchemaParams, + public properties: { + [k: string]: TypedSchema; + }, + public optionalProperties: string[] = [] + ) { + super({ + type: SchemaType.OBJECT, + ...schemaParams + }); + } + + /** + * @internal + */ + toJSON(): SchemaRequest { + const obj = super.toJSON(); + obj.properties = { ...this.properties }; + const required = []; + if (this.optionalProperties) { + for (const propertyKey of this.optionalProperties) { + if (!this.properties.hasOwnProperty(propertyKey)) { + throw new VertexAIError( + VertexAIErrorCode.INVALID_SCHEMA, + `Property "${propertyKey}" specified in "optionalProperties" does not exist.` + ); + } + } + } + for (const propertyKey in this.properties) { + if (this.properties.hasOwnProperty(propertyKey)) { + obj.properties[propertyKey] = this.properties[ + propertyKey + ].toJSON() as SchemaRequest; + if (!this.optionalProperties.includes(propertyKey)) { + required.push(propertyKey); + } + } + } + if (required.length > 0) { + obj.required = required; + } + delete (obj as ObjectSchemaInterface).optionalProperties; + return obj as SchemaRequest; + } +} diff --git a/packages/vertexai/src/requests/stream-reader.ts b/packages/vertexai/src/requests/stream-reader.ts index c4163d26b60..8162407d90b 100644 --- a/packages/vertexai/src/requests/stream-reader.ts +++ b/packages/vertexai/src/requests/stream-reader.ts @@ -24,7 +24,7 @@ import { VertexAIErrorCode } from '../types'; import { VertexAIError } from '../errors'; -import { addHelpers } from './response-helpers'; +import { createEnhancedContentResponse } from './response-helpers'; const responseLineRE = /^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/; @@ -57,7 +57,10 @@ async function getResponsePromise( while (true) { const { done, value } = await reader.read(); if (done) { - return addHelpers(aggregateResponses(allResponses)); + const enhancedResponse = createEnhancedContentResponse( + aggregateResponses(allResponses) + ); + return enhancedResponse; } allResponses.push(value); } @@ -72,7 +75,9 @@ async function* generateResponseSequence( if (done) { break; } - yield addHelpers(value); + + const enhancedResponse = createEnhancedContentResponse(value); + yield enhancedResponse; } } @@ -146,7 +151,9 @@ export function aggregateResponses( for (const response of responses) { if (response.candidates) { for (const candidate of response.candidates) { - const i = candidate.index; + // Index will be undefined if it's the first index (0), so we should use 0 if it's undefined. + // See: https://github.com/firebase/firebase-js-sdk/issues/8566 + const i = candidate.index || 0; if (!aggregatedResponse.candidates) { aggregatedResponse.candidates = []; } diff --git a/packages/vertexai/src/types/content.ts b/packages/vertexai/src/types/content.ts index ad2906671e4..abf5d29222a 100644 --- a/packages/vertexai/src/types/content.ts +++ b/packages/vertexai/src/types/content.ts @@ -82,7 +82,7 @@ export interface VideoMetadata { } /** - * Content part interface if the part represents a {@link FunctionCall}. + * Content part interface if the part represents a {@link FunctionCall}. * @public */ export interface FunctionCallPart { @@ -93,7 +93,7 @@ export interface FunctionCallPart { } /** - * Content part interface if the part represents {@link FunctionResponse}. + * Content part interface if the part represents {@link FunctionResponse}. * @public */ export interface FunctionResponsePart { @@ -104,7 +104,7 @@ export interface FunctionResponsePart { } /** - * Content part interface if the part represents {@link FileData} + * Content part interface if the part represents {@link FileData} * @public */ export interface FileDataPart { @@ -116,7 +116,7 @@ export interface FileDataPart { } /** - * A predicted {@link FunctionCall} returned from the model + * A predicted {@link FunctionCall} returned from the model * that contains a string representing the {@link FunctionDeclaration.name} * and a structured JSON object containing the parameters and their values. * @public @@ -127,11 +127,11 @@ export interface FunctionCall { } /** - * The result output from a {@link FunctionCall} that contains a string + * The result output from a {@link FunctionCall} that contains a string * representing the {@link FunctionDeclaration.name} * and a structured JSON object containing any output * from the function is used as context to the model. - * This should contain the result of a {@link FunctionCall} + * This should contain the result of a {@link FunctionCall} * made based on model prediction. * @public */ diff --git a/packages/vertexai/src/types/enums.ts b/packages/vertexai/src/types/enums.ts index fd901241250..3e66bacc612 100644 --- a/packages/vertexai/src/types/enums.ts +++ b/packages/vertexai/src/types/enums.ts @@ -32,7 +32,6 @@ export const POSSIBLE_ROLES = ['user', 'model', 'function', 'system'] as const; * @public */ export enum HarmCategory { - HARM_CATEGORY_UNSPECIFIED = 'HARM_CATEGORY_UNSPECIFIED', HARM_CATEGORY_HATE_SPEECH = 'HARM_CATEGORY_HATE_SPEECH', HARM_CATEGORY_SEXUALLY_EXPLICIT = 'HARM_CATEGORY_SEXUALLY_EXPLICIT', HARM_CATEGORY_HARASSMENT = 'HARM_CATEGORY_HARASSMENT', @@ -44,8 +43,6 @@ export enum HarmCategory { * @public */ export enum HarmBlockThreshold { - // Threshold is unspecified. - HARM_BLOCK_THRESHOLD_UNSPECIFIED = 'HARM_BLOCK_THRESHOLD_UNSPECIFIED', // Content with NEGLIGIBLE will be allowed. BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE', // Content with NEGLIGIBLE and LOW will be allowed. @@ -60,8 +57,6 @@ export enum HarmBlockThreshold { * @public */ export enum HarmBlockMethod { - // The harm block method is unspecified. - HARM_BLOCK_METHOD_UNSPECIFIED = 'HARM_BLOCK_METHOD_UNSPECIFIED', // The harm block method uses both probability and severity scores. SEVERITY = 'SEVERITY', // The harm block method uses the probability score. @@ -73,8 +68,6 @@ export enum HarmBlockMethod { * @public */ export enum HarmProbability { - // Probability is unspecified. - HARM_PROBABILITY_UNSPECIFIED = 'HARM_PROBABILITY_UNSPECIFIED', // Content has a negligible chance of being unsafe. NEGLIGIBLE = 'NEGLIGIBLE', // Content has a low chance of being unsafe. @@ -90,8 +83,6 @@ export enum HarmProbability { * @public */ export enum HarmSeverity { - // Harm severity unspecified. - HARM_SEVERITY_UNSPECIFIED = 'HARM_SEVERITY_UNSPECIFIED', // Negligible level of harm severity. HARM_SEVERITY_NEGLIGIBLE = 'HARM_SEVERITY_NEGLIGIBLE', // Low level of harm severity. @@ -107,8 +98,6 @@ export enum HarmSeverity { * @public */ export enum BlockReason { - // A blocked reason was not specified. - BLOCKED_REASON_UNSPECIFIED = 'BLOCKED_REASON_UNSPECIFIED', // Content was blocked by safety settings. SAFETY = 'SAFETY', // Content was blocked, but the reason is uncategorized. @@ -120,8 +109,6 @@ export enum BlockReason { * @public */ export enum FinishReason { - // Default value. This value is unused. - FINISH_REASON_UNSPECIFIED = 'FINISH_REASON_UNSPECIFIED', // Natural stop point of the model or provided stop sequence. STOP = 'STOP', // The maximum number of tokens as specified in the request was reached. @@ -138,8 +125,6 @@ export enum FinishReason { * @public */ export enum FunctionCallingMode { - // Unspecified function calling mode. This value should not be used. - MODE_UNSPECIFIED = 'MODE_UNSPECIFIED', // Default model behavior, model decides to predict either a function call // or a natural language response. AUTO = 'AUTO', diff --git a/packages/vertexai/src/types/error.ts b/packages/vertexai/src/types/error.ts index 5ba594013c2..8d83a52a0aa 100644 --- a/packages/vertexai/src/types/error.ts +++ b/packages/vertexai/src/types/error.ts @@ -50,7 +50,7 @@ export interface CustomErrorData { /** HTTP status text of the error response. */ statusText?: string; - /** Response from a {@link GenerateContentRequest} */ + /** Response from a {@link GenerateContentRequest} */ response?: GenerateContentResponse; /** Optional additional details about the error. */ @@ -58,7 +58,7 @@ export interface CustomErrorData { } /** - * Standardized error codes that {@link VertexAIError} can have. + * Standardized error codes that {@link VertexAIError} can have. * * @public */ @@ -78,6 +78,12 @@ export const enum VertexAIErrorCode { /** An error associated with a Content object. */ INVALID_CONTENT = 'invalid-content', + /** An error due to the Firebase API not being enabled in the Console. */ + API_NOT_ENABLED = 'api-not-enabled', + + /** An error due to invalid Schema input. */ + INVALID_SCHEMA = 'invalid-schema', + /** An error occurred due to a missing Firebase API key. */ NO_API_KEY = 'no-api-key', diff --git a/packages/vertexai/src/types/index.ts b/packages/vertexai/src/types/index.ts index 45365c39037..85133aa07c5 100644 --- a/packages/vertexai/src/types/index.ts +++ b/packages/vertexai/src/types/index.ts @@ -20,3 +20,4 @@ export * from './enums'; export * from './requests'; export * from './responses'; export * from './error'; +export * from './schema'; diff --git a/packages/vertexai/src/types/requests.ts b/packages/vertexai/src/types/requests.ts index 1e976b386b6..dc7576f232d 100644 --- a/packages/vertexai/src/types/requests.ts +++ b/packages/vertexai/src/types/requests.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { TypedSchema } from '../requests/schema-builder'; import { Content, Part } from './content'; import { FunctionCallingMode, @@ -22,6 +23,7 @@ import { HarmBlockThreshold, HarmCategory } from './enums'; +import { ObjectSchemaInterface, SchemaRequest } from './schema'; /** * Base parameters for a number of methods. @@ -33,7 +35,7 @@ export interface BaseParams { } /** - * Params passed to {@link getGenerativeModel}. + * Params passed to {@link getGenerativeModel}. * @public */ export interface ModelParams extends BaseParams { @@ -61,7 +63,7 @@ export interface GenerateContentRequest extends BaseParams { export interface SafetySetting { category: HarmCategory; threshold: HarmBlockThreshold; - method: HarmBlockMethod; + method?: HarmBlockMethod; } /** @@ -78,14 +80,21 @@ export interface GenerationConfig { presencePenalty?: number; frequencyPenalty?: number; /** - * Output response mimetype of the generated candidate text. - * Supported mimetypes are `text/plain` (default, text output) and `application/json` - * (JSON response in the candidates). - * The model needs to be prompted to output the appropriate response type, - * otherwise the behavior is undefined. - * This is a preview feature. + * Output response MIME type of the generated candidate text. + * Supported MIME types are `text/plain` (default, text output), + * `application/json` (JSON response in the candidates), and + * `text/x.enum`. */ responseMimeType?: string; + /** + * Output response schema of the generated candidate text. This + * value can be a class generated with a {@link Schema} static method + * like `Schema.string()` or `Schema.object()` or it can be a plain + * JS object matching the {@link SchemaRequest} interface. + *
Note: This only applies when the specified `responseMIMEType` supports a schema; currently + * this is limited to `application/json` and `text/x.enum`. + */ + responseSchema?: TypedSchema | SchemaRequest; } /** @@ -108,16 +117,16 @@ export interface CountTokensRequest { } /** - * Params passed to {@link getGenerativeModel}. + * Params passed to {@link getGenerativeModel}. * @public */ export interface RequestOptions { /** - * Request timeout in milliseconds. + * Request timeout in milliseconds. Defaults to 180 seconds (180000ms). */ timeout?: number; /** - * Base url for endpoint. Defaults to https://firebaseml.googleapis.com + * Base url for endpoint. Defaults to https://firebasevertexai.googleapis.com */ baseUrl?: string; } @@ -145,16 +154,16 @@ export declare interface FunctionDeclaration { */ name: string; /** - * Optional. Description and purpose of the function. Model uses it to decide + * Description and purpose of the function. Model uses it to decide * how and whether to call the function. */ - description?: string; + description: string; /** * Optional. Describes the parameters to this function in JSON Schema Object * format. Reflects the Open API 3.03 Parameter Object. Parameter names are * case-sensitive. For a function with no parameters, this can be left unset. */ - parameters?: FunctionDeclarationSchema; + parameters?: ObjectSchemaInterface; } /** @@ -168,8 +177,8 @@ export declare interface FunctionDeclarationsTool { * Optional. One or more function declarations * to be passed to the model along with the current user query. Model may * decide to call a subset of these functions by populating - * {@link FunctionCall} in the response. User should - * provide a {@link FunctionResponse} for each + * {@link FunctionCall} in the response. User should + * provide a {@link FunctionResponse} for each * function call in the next turn. Based on the function responses, the model will * generate the final response back to the user. Maximum 64 function * declarations can be provided. @@ -177,77 +186,12 @@ export declare interface FunctionDeclarationsTool { functionDeclarations?: FunctionDeclaration[]; } -/** - * Contains the list of OpenAPI data types - * as defined by https://swagger.io/docs/specification/data-models/data-types/ - * @public - */ -export enum FunctionDeclarationSchemaType { - /** String type. */ - STRING = 'STRING', - /** Number type. */ - NUMBER = 'NUMBER', - /** Integer type. */ - INTEGER = 'INTEGER', - /** Boolean type. */ - BOOLEAN = 'BOOLEAN', - /** Array type. */ - ARRAY = 'ARRAY', - /** Object type. */ - OBJECT = 'OBJECT' -} - -/** - * Schema for parameters passed to {@link FunctionDeclaration.parameters}. - * @public - */ -export interface FunctionDeclarationSchema { - /** The type of the parameter. */ - type: FunctionDeclarationSchemaType; - /** The format of the parameter. */ - properties: { [k: string]: FunctionDeclarationSchemaProperty }; - /** Optional. Description of the parameter. */ - description?: string; - /** Optional. Array of required parameters. */ - required?: string[]; -} - -/** - * Schema is used to define the format of input/output data. - * Represents a select subset of an OpenAPI 3.0 schema object. - * More fields may be added in the future as needed. - * @public - */ -export interface FunctionDeclarationSchemaProperty { - /** - * Optional. The type of the property. {@link - * FunctionDeclarationSchemaType}. - */ - type?: FunctionDeclarationSchemaType; - /** Optional. The format of the property. */ - format?: string; - /** Optional. The description of the property. */ - description?: string; - /** Optional. Whether the property is nullable. */ - nullable?: boolean; - /** Optional. The items of the property. {@link FunctionDeclarationSchema} */ - items?: FunctionDeclarationSchema; - /** Optional. The enum of the property. */ - enum?: string[]; - /** Optional. Map of {@link FunctionDeclarationSchema}. */ - properties?: { [k: string]: FunctionDeclarationSchema }; - /** Optional. Array of required property. */ - required?: string[]; - /** Optional. The example of the property. */ - example?: unknown; -} - /** * Tool config. This config is shared for all tools provided in the request. * @public */ export interface ToolConfig { - functionCallingConfig: FunctionCallingConfig; + functionCallingConfig?: FunctionCallingConfig; } /** diff --git a/packages/vertexai/src/types/responses.ts b/packages/vertexai/src/types/responses.ts index 0a4557fb055..83cd4366f12 100644 --- a/packages/vertexai/src/types/responses.ts +++ b/packages/vertexai/src/types/responses.ts @@ -75,7 +75,7 @@ export interface GenerateContentResponse { } /** - * Usage metadata about a {@link GenerateContentResponse}. + * Usage metadata about a {@link GenerateContentResponse}. * * @public */ @@ -91,13 +91,13 @@ export interface UsageMetadata { * @public */ export interface PromptFeedback { - blockReason: BlockReason; + blockReason?: BlockReason; safetyRatings: SafetyRating[]; blockReasonMessage?: string; } /** - * A candidate returned as part of a {@link GenerateContentResponse}. + * A candidate returned as part of a {@link GenerateContentResponse}. * @public */ export interface GenerateContentCandidate { @@ -111,7 +111,7 @@ export interface GenerateContentCandidate { } /** - * Citation metadata that may be found on a {@link GenerateContentCandidate}. + * Citation metadata that may be found on a {@link GenerateContentCandidate}. * @public */ export interface CitationMetadata { @@ -187,7 +187,7 @@ export interface Date { } /** - * A safety rating associated with a {@link GenerateContentCandidate} + * A safety rating associated with a {@link GenerateContentCandidate} * @public */ export interface SafetyRating { diff --git a/packages/vertexai/src/types/schema.ts b/packages/vertexai/src/types/schema.ts new file mode 100644 index 00000000000..fca213431ad --- /dev/null +++ b/packages/vertexai/src/types/schema.ts @@ -0,0 +1,104 @@ +/** + * @license + * Copyright 2024 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. + */ + +/** + * Contains the list of OpenAPI data types + * as defined by the + * {@link https://swagger.io/docs/specification/data-models/data-types/ | OpenAPI specification} + * @public + */ +export enum SchemaType { + /** String type. */ + STRING = 'string', + /** Number type. */ + NUMBER = 'number', + /** Integer type. */ + INTEGER = 'integer', + /** Boolean type. */ + BOOLEAN = 'boolean', + /** Array type. */ + ARRAY = 'array', + /** Object type. */ + OBJECT = 'object' +} + +/** + * Basic {@link Schema} properties shared across several Schema-related + * types. + * @public + */ +export interface SchemaShared { + /** Optional. The format of the property. */ + format?: string; + /** Optional. The description of the property. */ + description?: string; + /** Optional. The items of the property. */ + items?: T; + /** Optional. Map of `Schema` objects. */ + properties?: { + [k: string]: T; + }; + /** Optional. The enum of the property. */ + enum?: string[]; + /** Optional. The example of the property. */ + example?: unknown; + /** Optional. Whether the property is nullable. */ + nullable?: boolean; + [key: string]: unknown; +} + +/** + * Params passed to {@link Schema} static methods to create specific + * {@link Schema} classes. + * @public + */ +export interface SchemaParams extends SchemaShared {} + +/** + * Final format for {@link Schema} params passed to backend requests. + * @public + */ +export interface SchemaRequest extends SchemaShared { + /** + * The type of the property. {@link + * SchemaType}. + */ + type: SchemaType; + /** Optional. Array of required property. */ + required?: string[]; +} + +/** + * Interface for {@link Schema} class. + * @public + */ +export interface SchemaInterface extends SchemaShared { + /** + * The type of the property. {@link + * SchemaType}. + */ + type: SchemaType; +} + +/** + * Interface for {@link ObjectSchema} class. + * @public + */ +export interface ObjectSchemaInterface extends SchemaInterface { + type: SchemaType.OBJECT; + optionalProperties?: string[]; +} diff --git a/packages/webchannel-wrapper/CHANGELOG.md b/packages/webchannel-wrapper/CHANGELOG.md index df085028b60..190c26c97d6 100644 --- a/packages/webchannel-wrapper/CHANGELOG.md +++ b/packages/webchannel-wrapper/CHANGELOG.md @@ -1,5 +1,11 @@ # @firebase/webchannel-wrapper +## 1.0.2 + +### Patch Changes + +- [`479226bf3`](https://github.com/firebase/firebase-js-sdk/commit/479226bf3ebd99017bb12fa21440c75715658702) [#8475](https://github.com/firebase/firebase-js-sdk/pull/8475) - Remove ES5 bundles. The minimum required ES version is now ES2017. + ## 1.0.1 ### Patch Changes diff --git a/packages/webchannel-wrapper/bloom-blob/package.json b/packages/webchannel-wrapper/bloom-blob/package.json index 956333e7cf2..21b0b0e4800 100644 --- a/packages/webchannel-wrapper/bloom-blob/package.json +++ b/packages/webchannel-wrapper/bloom-blob/package.json @@ -4,6 +4,5 @@ "main": "../dist/bloom-blob/bloom_blob_es2018.js", "browser": "../dist/bloom-blob/esm/bloom_blob_es2018.js", "module": "../dist/bloom-blob/esm/bloom_blob_es2018.js", - "esm5": "../dist/bloom-blob/bloom_blob_es5.js", "typings": "../dist/bloom-blob/bloom_blob_types.d.ts" } diff --git a/packages/webchannel-wrapper/package.json b/packages/webchannel-wrapper/package.json index ddc849bcce6..7fb4fa5501c 100644 --- a/packages/webchannel-wrapper/package.json +++ b/packages/webchannel-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@firebase/webchannel-wrapper", - "version": "1.0.1", + "version": "1.0.2", "description": "A wrapper of the webchannel packages from closure-library for use outside of a closure compiled application", "author": "Firebase (https://firebase.google.com/)", "main": "empty.js", @@ -8,13 +8,11 @@ "./webchannel-blob": { "types": "./dist/webchannel-blob/webchannel_blob_types.d.ts", "require": "./dist/webchannel-blob/webchannel_blob_es2018.js", - "esm5": "./dist/webchannel-blob/webchannel_blob_es5.js", "default": "./dist/webchannel-blob/esm/webchannel_blob_es2018.js" }, "./bloom-blob": { "types": "./dist/bloom-blob/bloom_blob_types.d.ts", "require": "./dist/bloom-blob/bloom_blob_es2018.js", - "esm5": "./dist/bloom-blob/bloom_blob_es5.js", "default": "./dist/bloom-blob/esm/bloom_blob_es2018.js" }, "./package.json": "./package.json" @@ -39,7 +37,7 @@ "rollup-plugin-copy": "3.5.0", "rollup-plugin-sourcemaps": "0.6.3", "rollup-plugin-typescript2": "0.31.2", - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "packages/webchannel-wrapper", diff --git a/packages/webchannel-wrapper/rollup.config.js b/packages/webchannel-wrapper/rollup.config.js index 77c29ecb4ac..ae80c831396 100644 --- a/packages/webchannel-wrapper/rollup.config.js +++ b/packages/webchannel-wrapper/rollup.config.js @@ -25,7 +25,7 @@ import pkg from './package.json'; const closureBlobsDir = '../../node_modules/closure-net/firebase/'; -const es2017BuildPlugins = [ +const buildPlugins = [ copy({ targets: [ { @@ -57,7 +57,7 @@ const esm2017Builds = [ format: 'es', sourcemap: true }, - plugins: [...es2017BuildPlugins, emitModulePackageFile()] + plugins: [...buildPlugins, emitModulePackageFile()] }, { input: join(closureBlobsDir, 'bloom_blob_es2018.js'), @@ -66,7 +66,7 @@ const esm2017Builds = [ format: 'es', sourcemap: true }, - plugins: [...es2017BuildPlugins, emitModulePackageFile()] + plugins: [...buildPlugins, emitModulePackageFile()] } ]; diff --git a/packages/webchannel-wrapper/webchannel-blob/package.json b/packages/webchannel-wrapper/webchannel-blob/package.json index cb339b82557..312b9d9f2a2 100644 --- a/packages/webchannel-wrapper/webchannel-blob/package.json +++ b/packages/webchannel-wrapper/webchannel-blob/package.json @@ -4,6 +4,5 @@ "main": "../dist/webchannel-blob/webchannel_blob_es2018.js", "browser": "../dist/webchannel-blob/esm/webchannel_blob_es2018.js", "module": "../dist/webchannel-blob/esm/webchannel_blob_es2018.js", - "esm5": "../dist/webchannel-blob/webchannel_blob_es5.js", "typings": "../dist/webchannel-blob/webchannel_blob_types.d.ts" } diff --git a/renovate.json b/renovate.json index c8b64a1df38..4c91e21a94c 100644 --- a/renovate.json +++ b/renovate.json @@ -13,13 +13,12 @@ } ], "ignoreDeps": [ - "karma-sauce-launcher", "protractor", "long", "rollup-plugin-copy-assets", - "whatwg-fetch", "typedoc", - "@microsoft/tsdoc" + "@microsoft/tsdoc", + "idb" ], "ignorePaths": [ "auth/demo", diff --git a/repo-scripts/api-documenter/package.json b/repo-scripts/api-documenter/package.json index 1e6b1a9ac21..b824be66e65 100644 --- a/repo-scripts/api-documenter/package.json +++ b/repo-scripts/api-documenter/package.json @@ -34,5 +34,8 @@ "@types/js-yaml": "4.0.9", "@types/resolve": "1.20.6", "mocha-chai-jest-snapshot": "1.1.3" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/repo-scripts/changelog-generator/index.ts b/repo-scripts/changelog-generator/index.ts index 20f3de482f1..3570c8a96a5 100644 --- a/repo-scripts/changelog-generator/index.ts +++ b/repo-scripts/changelog-generator/index.ts @@ -17,7 +17,6 @@ import { ChangelogFunctions } from '@changesets/types'; import { getInfo } from '@changesets/get-github-info'; -import { fetch as undiciFetch, Response as undiciResponse } from 'undici'; const changelogFunctions: ChangelogFunctions = { getDependencyReleaseLine: async ( @@ -95,7 +94,7 @@ async function getFixedIssueLink( prNumber: number, repo: string ): Promise { - const response = await undiciFetch( + const response = await fetch( `https://api.github.com/repos/${repo}/pulls/${prNumber}`, { method: 'GET', @@ -105,7 +104,7 @@ async function getFixedIssueLink( } ).then(data => data.json()); - const body = (response as undiciResponse).body; + const body = (response as Response).body; if (!body) { return ''; } diff --git a/repo-scripts/changelog-generator/package.json b/repo-scripts/changelog-generator/package.json index f4afc131d1f..14986d98c33 100644 --- a/repo-scripts/changelog-generator/package.json +++ b/repo-scripts/changelog-generator/package.json @@ -19,12 +19,11 @@ "dependencies": { "@changesets/types": "3.3.0", "@changesets/get-github-info": "0.5.2", - "@types/node": "20.8.10", - "undici": "6.19.7" + "@types/node": "18.19.57" }, "license": "Apache-2.0", "devDependencies": { - "typescript": "4.7.4" + "typescript": "5.5.4" }, "repository": { "directory": "repo-scripts/changelog-generator", @@ -39,5 +38,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/repo-scripts/changelog-generator/tsconfig.json b/repo-scripts/changelog-generator/tsconfig.json index 5c910fcca64..38bdb7035e4 100644 --- a/repo-scripts/changelog-generator/tsconfig.json +++ b/repo-scripts/changelog-generator/tsconfig.json @@ -9,6 +9,6 @@ "moduleResolution": "node", "esModuleInterop": true, "resolveJsonModule": true, - "target": "es5" + "target": "es2017" } } \ No newline at end of file diff --git a/repo-scripts/prune-dts/package.json b/repo-scripts/prune-dts/package.json index d8d4ab6391b..8b1128b29b0 100644 --- a/repo-scripts/prune-dts/package.json +++ b/repo-scripts/prune-dts/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "engines": { - "node": "^8.13.0 || >=10.10.0" + "node": ">=18.0.0" }, "description": "A script to prune non-exported types from a d.ts.", "author": "Firebase (https://firebase.google.com/)", diff --git a/repo-scripts/prune-dts/prune-dts.ts b/repo-scripts/prune-dts/prune-dts.ts index dfd83a62a91..1654e0fa6cc 100644 --- a/repo-scripts/prune-dts/prune-dts.ts +++ b/repo-scripts/prune-dts/prune-dts.ts @@ -155,16 +155,15 @@ function maybeHideConstructor( ?.find(t => t.tagName.escapedText === 'hideconstructor'); if (hideConstructorTag) { - const modifier = ts.createModifier( + const hideConstructorModifier = ts.factory.createModifier( hideConstructorTag.comment === 'protected' ? ts.SyntaxKind.ProtectedKeyword : ts.SyntaxKind.PrivateKeyword ); - return ts.createConstructor( - node.decorators, - [modifier], - /*parameters=*/ [], - /* body= */ undefined + return ts.factory.createConstructorDeclaration( + [...(ts.getModifiers(node) ?? []), hideConstructorModifier], + [], + undefined ); } else { return node; @@ -192,7 +191,6 @@ function maybeHideConstructor( function prunePrivateImports< T extends ts.InterfaceDeclaration | ts.ClassDeclaration >( - factory: ts.NodeFactory, program: ts.Program, host: ts.CompilerHost, sourceFile: ts.SourceFile, @@ -204,8 +202,8 @@ function prunePrivateImports< const prunedHeritageClauses: ts.HeritageClause[] = []; // Additional members that are copied from the private symbols into the public // symbols - const additionalMembers: ts.Node[] = []; - + const inheritedInterfaceProperties: ts.TypeElement[] = []; + const inheritedClassMembers: ts.ClassElement[] = []; for (const heritageClause of node.heritageClauses || []) { const exportedTypes: ts.ExpressionWithTypeArguments[] = []; for (const type of heritageClause.types) { @@ -217,53 +215,53 @@ function prunePrivateImports< } else { // Hide the type we are inheriting from and merge its declarations // into the current class. - // TODO: We really only need to do this when the type that is extended - // is a class. We should skip this for interfaces. const privateType = typeChecker.getTypeAtLocation(type); - additionalMembers.push( - ...convertPropertiesForEnclosingClass( - program, - host, - sourceFile, - privateType.getProperties(), - node - ) - ); + if (ts.isClassDeclaration(node)) { + inheritedClassMembers.push( + ...convertPropertiesForEnclosingDeclaration< + ts.ClassDeclaration, + ts.ClassElement + >(program, host, sourceFile, privateType.getProperties(), node) + ); + } else if (ts.isInterfaceDeclaration(node)) { + inheritedInterfaceProperties.push( + ...convertPropertiesForEnclosingDeclaration< + ts.InterfaceDeclaration, + ts.TypeElement + >(program, host, sourceFile, privateType.getProperties(), node) + ); + } } } if (exportedTypes.length > 0) { prunedHeritageClauses.push( - factory.updateHeritageClause(heritageClause, exportedTypes) + ts.factory.updateHeritageClause(heritageClause, exportedTypes) ); } } if (ts.isClassDeclaration(node)) { - return factory.updateClassDeclaration( + const modifiersAndDecorators = [ + ...(ts.getModifiers(node) ?? []), + ...(ts.getDecorators(node) ?? []) + ]; + return ts.factory.updateClassDeclaration( node, - node.decorators, - node.modifiers, + modifiersAndDecorators, node.name, node.typeParameters, prunedHeritageClauses, - [ - ...(node.members as ts.NodeArray), - ...(additionalMembers as ts.ClassElement[]) - ] + [...node.members, ...inheritedClassMembers] ) as T; } else if (ts.isInterfaceDeclaration(node)) { - return factory.updateInterfaceDeclaration( + return ts.factory.updateInterfaceDeclaration( node, - node.decorators, node.modifiers, node.name, node.typeParameters, prunedHeritageClauses, - [ - ...(node.members as ts.NodeArray), - ...(additionalMembers as ts.TypeElement[]) - ] + [...node.members, ...inheritedInterfaceProperties] ) as T; } else { throw new Error('Only classes or interfaces are supported'); @@ -271,7 +269,7 @@ function prunePrivateImports< } /** - * Iterates the provided symbols and returns named declarations for these + * Iterates over the provided symbols and returns named declarations for these * symbols if they are missing from `currentClass`. This allows us to merge * class hierarchies for classes whose inherited types are not part of the * public API. @@ -283,9 +281,9 @@ function convertPropertiesForEnclosingClass( host: ts.CompilerHost, sourceFile: ts.SourceFile, parentClassSymbols: ts.Symbol[], - currentClass: ts.ClassDeclaration | ts.InterfaceDeclaration -): ts.Node[] { - const newMembers: ts.Node[] = []; + currentClass: ts.ClassDeclaration +): ts.ClassElement[] { + const newMembers: ts.ClassElement[] = []; // The `codefix` package is not public but it does exactly what we want. It's // the same package that is used by VSCode to fill in missing members, which // is what we are using it for in this script. `codefix` handles missing @@ -304,12 +302,78 @@ function convertPropertiesForEnclosingClass( symbol.escapedName == (missingMember.name as ts.Identifier).escapedText ); - const jsDocComment = originalSymbol - ? extractJSDocComment(originalSymbol, newMembers) - : undefined; - if (jsDocComment) { - newMembers.push(jsDocComment, missingMember); - } else { + if (originalSymbol) { + const jsDocComment = extractJSDocComment(originalSymbol, newMembers); + if (jsDocComment) { + ts.setSyntheticLeadingComments(missingMember, [ + { + kind: ts.SyntaxKind.MultiLineCommentTrivia, + text: `*\n${jsDocComment}\n`, + hasTrailingNewLine: true, + pos: -1, + end: -1 + } + ]); + } + + newMembers.push(missingMember); + } + } + ); + return newMembers; +} + +/** + * Iterates over the provided symbols and returns named declarations for these + * symbols if they are missing from `currentInterface`. This allows us to merge + * interface hierarchies for interfaces whose inherited properties are not part of the + * public API. + * + * This method relies on a private API in TypeScript's `codefix` package. + */ +function convertPropertiesForEnclosingDeclaration< + T extends ts.ClassDeclaration | ts.InterfaceDeclaration, + U extends ts.ClassElement | ts.TypeElement +>( + program: ts.Program, + host: ts.CompilerHost, + sourceFile: ts.SourceFile, + parentClassSymbols: ts.Symbol[], + currentDeclaration: T +): U[] { + const newMembers: U[] = []; + // The `codefix` package is not public but it does exactly what we want. It's + // the same package that is used by VSCode to fill in missing members, which + // is what we are using it for in this script. `codefix` handles missing + // properties, methods and correctly deduces generics. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (ts as any).codefix.createMissingMemberNodes( + currentDeclaration, + parentClassSymbols, + sourceFile, + { program, host }, + /* userPreferences= */ {}, + /* importAdder= */ undefined, + (missingMember: U) => { + const originalSymbol = parentClassSymbols.find( + symbol => + symbol.escapedName == + (missingMember.name as ts.Identifier).escapedText + ); + if (originalSymbol) { + const jsDocComment = extractJSDocComment(originalSymbol, newMembers); + if (jsDocComment) { + ts.setSyntheticLeadingComments(missingMember, [ + { + kind: ts.SyntaxKind.MultiLineCommentTrivia, + text: `*\n${jsDocComment}\n`, + hasTrailingNewLine: true, + pos: -1, + end: -1 + } + ]); + } + newMembers.push(missingMember); } } @@ -321,7 +385,7 @@ function convertPropertiesForEnclosingClass( function extractJSDocComment( symbol: ts.Symbol, alreadyAddedMembers: ts.Node[] -): ts.Node | null { +): string | null { const overloadCount = alreadyAddedMembers.filter( node => ts.isClassElement(node) && @@ -330,37 +394,69 @@ function extractJSDocComment( // Extract the comment from the overload that we are currently processing. let targetIndex = 0; - const comments = symbol.getDocumentationComment(undefined).filter(symbol => { - // Overload comments are separated by line breaks. - if (symbol.kind == 'lineBreak') { - ++targetIndex; - return false; - } else { - return overloadCount == targetIndex; - } - }); + const commentParts = symbol + .getDocumentationComment(undefined) + .filter(symbol => { + // Overload comments are separated by line breaks. + if (symbol.kind == 'lineBreak') { + ++targetIndex; + return false; + } else { + return overloadCount == targetIndex; + } + }); + + const comment = commentParts + .map(commentPart => { + if (commentPart.kind === 'linkText') { + /** + * Some links will be spread across more than one line. For example: + * {@link + * DocumentReference} + * In this case, we want to remove the leading ' * ' without removing the newline. + */ + const leadingStar = /(?!\n)\s*\* /; + /** + * For some reason, this text will also have a trailing space (the above example would give + * us 'DocumentReference '), so we trim that from the end of the string. + */ + const trailingSpaces = / *$/; + + return commentPart.text + .replace(leadingStar, '\n') + .replace(trailingSpaces, ''); + } else { + return commentPart.text; + } + }) + .join(''); - if (comments.length > 0 && symbol.declarations) { - const jsDocTags = ts.getJSDocTags(symbol.declarations[overloadCount]); - const maybeNewline = jsDocTags?.length > 0 ? '\n' : ''; - const joinedComments = comments - .map(comment => { - if (comment.kind === 'linkText') { - return comment.text.trim(); - } - return comment.text; - }) - .join(''); - const formattedComments = joinedComments - .replace('*', '\n') - .replace(' \n', '\n') - .replace('\n ', '\n'); - return ts.factory.createJSDocComment( - formattedComments + maybeNewline, - jsDocTags - ); + if (!comment || !symbol.declarations) { + return null; } - return null; + + const declaration = symbol.declarations[overloadCount]; + const jsDocTags = ts + .getJSDocTags(declaration) + .map(tag => + tag + .getFullText() + .split('\n') + .map(line => line.replace('*', '').trim()) + .filter(line => line !== '') // Remove empty lines + .map(text => text.replace(/s*\* /, '')) // Remove the '*' prefix from all lines + .join('\n') + ) + .join('\n'); + const maybeNewline = jsDocTags?.length > 0 ? '\n' : ''; + + const commentAndTags = `${comment}\n${maybeNewline}${jsDocTags}`.trim(); + const formattedJSDocComment = commentAndTags + .split('\n') + .map(line => ` * ${line.trim()}`) + .join('\n'); + + return formattedJSDocComment; } /** @@ -468,7 +564,6 @@ function dropPrivateApiTransformer( context: ts.TransformationContext ): ts.Transformer { const typeChecker = program.getTypeChecker(); - const { factory } = context; return (sourceFile: ts.SourceFile) => { function visit(node: ts.Node): ts.Node { @@ -483,9 +578,11 @@ function dropPrivateApiTransformer( ) { // Remove any types that are not exported. if ( - !node.modifiers?.find(m => m.kind === ts.SyntaxKind.ExportKeyword) + !ts + .getModifiers(node) + ?.find(m => m.kind === ts.SyntaxKind.ExportKeyword) ) { - return factory.createNotEmittedStatement(node); + return ts.factory.createNotEmittedStatement(node); } } @@ -498,7 +595,7 @@ function dropPrivateApiTransformer( ) { // Remove any imports that reference internal APIs, while retaining // their public members. - return prunePrivateImports(factory, program, host, sourceFile, node); + return prunePrivateImports(program, host, sourceFile, node); } else if ( ts.isPropertyDeclaration(node) || ts.isMethodDeclaration(node) || @@ -507,7 +604,9 @@ function dropPrivateApiTransformer( // Remove any class and interface members that are prefixed with // underscores. if (hasPrivatePrefix(node.name as ts.Identifier)) { - return factory.createNotEmittedStatement(node); + const notEmittedStatement = + ts.factory.createNotEmittedStatement(node); + return notEmittedStatement; } } else if (ts.isTypeReferenceNode(node)) { // For public types that refer internal types, find a public type that @@ -518,9 +617,9 @@ function dropPrivateApiTransformer( node.typeName ); return publicName - ? factory.updateTypeReferenceNode( + ? ts.factory.updateTypeReferenceNode( node, - factory.createIdentifier(publicName.name), + ts.factory.createIdentifier(publicName.name), node.typeArguments ) : node; diff --git a/repo-scripts/prune-dts/tests/data-connect.input.d.ts b/repo-scripts/prune-dts/tests/data-connect.input.d.ts new file mode 100644 index 00000000000..cdf53da36c3 --- /dev/null +++ b/repo-scripts/prune-dts/tests/data-connect.input.d.ts @@ -0,0 +1,455 @@ +/** + * @license + * Copyright 2024 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. + */ + +/** + * Firebase Data Connect + * + * @packageDocumentation + */ + +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { AppCheckTokenListener } from '@firebase/app-check-interop-types'; +import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; +import { FirebaseApp } from '@firebase/app'; +import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; +import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; +import { FirebaseError } from '@firebase/util'; +import { LogLevelString } from '@firebase/logger'; +import { Provider } from '@firebase/component'; + +/* Excluded from this release type: AppCheckTokenProvider */ + +declare type AuthTokenListener = (token: string | null) => void; + +declare interface AuthTokenProvider { + getToken(forceRefresh: boolean): Promise; + addTokenChangeListener(listener: AuthTokenListener): void; +} + +export declare interface CancellableOperation + extends PromiseLike<{ + data: T; + }> { + cancel: () => void; +} + +/** + * Connect to the DataConnect Emulator + * @param dc Data Connect instance + * @param host host of emulator server + * @param port port of emulator server + * @param sslEnabled use https + */ +export declare function connectDataConnectEmulator( + dc: DataConnect, + host: string, + port?: number, + sslEnabled?: boolean +): void; + +/** + * Connector Config for calling Data Connect backend. + */ +export declare interface ConnectorConfig { + location: string; + connector: string; + service: string; +} + +/** + * Class representing Firebase Data Connect + */ +export declare class DataConnect { + readonly app: FirebaseApp; + private readonly dataConnectOptions; + private readonly _authProvider; + private readonly _appCheckProvider; + _queryManager: QueryManager; + _mutationManager: MutationManager; + isEmulator: boolean; + _initialized: boolean; + private _transport; + private _transportClass; + private _transportOptions?; + private _authTokenProvider?; + _isUsingGeneratedSdk: boolean; + private _appCheckTokenProvider?; + constructor( + app: FirebaseApp, + dataConnectOptions: DataConnectOptions, + _authProvider: Provider, + _appCheckProvider: Provider + ); + _useGeneratedSdk(): void; + _delete(): Promise; + getSettings(): ConnectorConfig; + setInitialized(): void; + enableEmulator(transportOptions: TransportOptions): void; +} + +/** An error returned by a DataConnect operation. */ +declare class DataConnectError extends FirebaseError { + /** + * The backend error code associated with this error. + */ + readonly code: DataConnectErrorCode; + /** + * A custom error description. + */ + readonly message: string; + /** The stack of the error. */ + readonly stack?: string; + /** @hideconstructor */ + constructor( + /** + * The backend error code associated with this error. + */ + code: DataConnectErrorCode, + /** + * A custom error description. + */ + message: string + ); +} + +declare type DataConnectErrorCode = + | 'other' + | 'already-initialized' + | 'not-initialized' + | 'not-supported' + | 'invalid-argument' + | 'partial-error' + | 'unauthorized'; + +/** + * DataConnectOptions including project id + */ +export declare interface DataConnectOptions extends ConnectorConfig { + projectId: string; +} + +export declare interface DataConnectResult + extends OpResult { + ref: OperationRef; +} + +/** + * Representation of user provided subscription options. + */ +export declare interface DataConnectSubscription { + userCallback: OnResultSubscription; + errCallback?: (e?: DataConnectError) => void; + unsubscribe: () => void; +} + +/* Excluded from this release type: DataConnectTransport */ + +export declare type DataSource = typeof SOURCE_CACHE | typeof SOURCE_SERVER; + +/** + * Execute Mutation + * @param mutationRef mutation to execute + * @returns `MutationRef` + */ +export declare function executeMutation( + mutationRef: MutationRef +): MutationPromise; + +/** + * Execute Query + * @param queryRef query to execute. + * @returns `QueryPromise` + */ +export declare function executeQuery( + queryRef: QueryRef +): QueryPromise; + +/** + * Initialize DataConnect instance + * @param options ConnectorConfig + */ +export declare function getDataConnect(options: ConnectorConfig): DataConnect; + +/** + * Initialize DataConnect instance + * @param app FirebaseApp to initialize to. + * @param options ConnectorConfig + */ +export declare function getDataConnect( + app: FirebaseApp, + options: ConnectorConfig +): DataConnect; + +export declare const MUTATION_STR = 'mutation'; + +/* Excluded from this release type: MutationManager */ + +/** + * Mutation return value from `executeMutation` + */ +export declare interface MutationPromise + extends PromiseLike> {} + +export declare interface MutationRef + extends OperationRef { + refType: typeof MUTATION_STR; +} + +/** + * Creates a `MutationRef` + * @param dcInstance Data Connect instance + * @param mutationName name of mutation + */ +export declare function mutationRef( + dcInstance: DataConnect, + mutationName: string +): MutationRef; + +/** + * + * @param dcInstance Data Connect instance + * @param mutationName name of mutation + * @param variables variables to send with mutation + */ +export declare function mutationRef( + dcInstance: DataConnect, + mutationName: string, + variables: Variables +): MutationRef; + +/** + * Mutation Result from `executeMutation` + */ +export declare interface MutationResult + extends DataConnectResult { + ref: MutationRef; +} + +/** + * `OnCompleteSubscription` + */ +export declare type OnCompleteSubscription = () => void; + +/** + * Signature for `OnErrorSubscription` for `subscribe` + */ +export declare type OnErrorSubscription = (err?: DataConnectError) => void; + +/** + * Signature for `OnResultSubscription` for `subscribe` + */ +export declare type OnResultSubscription = ( + res: QueryResult +) => void; + +export declare interface OperationRef<_Data, Variables> { + name: string; + variables: Variables; + refType: ReferenceType; + dataConnect: DataConnect; +} + +export declare interface OpResult { + data: Data; + source: DataSource; + fetchTime: string; +} + +declare interface ParsedArgs { + dc: DataConnect; + vars: Variables; +} + +/* Excluded from this release type: parseOptions */ + +export declare const QUERY_STR = 'query'; + +declare class QueryManager { + private transport; + _queries: Map>; + constructor(transport: DataConnectTransport); + track( + queryName: string, + variables: Variables, + initialCache?: OpResult + ): TrackedQuery; + addSubscription( + queryRef: OperationRef, + onResultCallback: OnResultSubscription, + onErrorCallback?: OnErrorSubscription, + initialCache?: OpResult + ): () => void; + executeQuery( + queryRef: QueryRef + ): QueryPromise; + enableEmulator(host: string, port: number): void; +} + +/** + * Promise returned from `executeQuery` + */ +export declare interface QueryPromise + extends PromiseLike> {} + +/** + * QueryRef object + */ +export declare interface QueryRef + extends OperationRef { + refType: typeof QUERY_STR; +} + +/** + * Execute Query + * @param dcInstance Data Connect instance to use. + * @param queryName Query to execute + * @returns `QueryRef` + */ +export declare function queryRef( + dcInstance: DataConnect, + queryName: string +): QueryRef; + +/** + * Execute Query + * @param dcInstance Data Connect instance to use. + * @param queryName Query to execute + * @param variables Variables to execute with + * @returns `QueryRef` + */ +export declare function queryRef( + dcInstance: DataConnect, + queryName: string, + variables: Variables +): QueryRef; + +/** + * Result of `executeQuery` + */ +export declare interface QueryResult + extends DataConnectResult { + ref: QueryRef; + toJSON: () => SerializedRef; +} + +/** + * Signature for unsubscribe from `subscribe` + */ +export declare type QueryUnsubscribe = () => void; + +export declare type ReferenceType = typeof QUERY_STR | typeof MUTATION_STR; + +/** + * Serialized RefInfo as a result of `QueryResult.toJSON().refInfo` + */ +export declare interface RefInfo { + name: string; + variables: Variables; + connectorConfig: DataConnectOptions; +} + +/** + * Serialized Ref as a result of `QueryResult.toJSON()` + */ +export declare interface SerializedRef extends OpResult { + refInfo: RefInfo; +} + +export declare function setLogLevel(logLevel: LogLevelString): void; + +export declare const SOURCE_CACHE = 'CACHE'; + +export declare const SOURCE_SERVER = 'SERVER'; + +/** + * Subscribe to a `QueryRef` + * @param queryRefOrSerializedResult query ref or serialized result. + * @param observer observer object to use for subscribing. + * @returns `SubscriptionOptions` + */ +export declare function subscribe( + queryRefOrSerializedResult: + | QueryRef + | SerializedRef, + observer: SubscriptionOptions +): QueryUnsubscribe; + +/** + * Subscribe to a `QueryRef` + * @param queryRefOrSerializedResult query ref or serialized result. + * @param onNext Callback to call when result comes back. + * @param onError Callback to call when error gets thrown. + * @param onComplete Called when subscription completes. + * @returns `SubscriptionOptions` + */ +export declare function subscribe( + queryRefOrSerializedResult: + | QueryRef + | SerializedRef, + onNext: OnResultSubscription, + onError?: OnErrorSubscription, + onComplete?: OnCompleteSubscription +): QueryUnsubscribe; + +/** + * Representation of full observer options in `subscribe` + */ +export declare interface SubscriptionOptions { + onNext?: OnResultSubscription; + onErr?: OnErrorSubscription; + onComplete?: OnCompleteSubscription; +} + +/** + * Delete DataConnect instance + * @param dataConnect DataConnect instance + * @returns + */ +export declare function terminate(dataConnect: DataConnect): Promise; + +/** + * Converts serialized ref to query ref + * @param serializedRef ref to convert to `QueryRef` + * @returns `QueryRef` + */ +export declare function toQueryRef( + serializedRef: SerializedRef +): QueryRef; + +declare interface TrackedQuery { + ref: Omit, 'dataConnect'>; + subscriptions: Array>; + currentCache: OpResult | null; + lastError: DataConnectError | null; +} + +/* Excluded from this release type: TransportClass */ + +/** + * Options to connect to emulator + */ +export declare interface TransportOptions { + host: string; + sslEnabled?: boolean; + port?: number; +} + +/* Excluded from this release type: validateArgs */ + +/* Excluded from this release type: validateDCOptions */ + +export {}; diff --git a/repo-scripts/prune-dts/tests/data-connect.output.d.ts b/repo-scripts/prune-dts/tests/data-connect.output.d.ts new file mode 100644 index 00000000000..de070520b03 --- /dev/null +++ b/repo-scripts/prune-dts/tests/data-connect.output.d.ts @@ -0,0 +1,315 @@ +/** + * @license + * Copyright 2024 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. + */ +/** + * Firebase Data Connect + * + * @packageDocumentation + */ +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { AppCheckTokenListener } from '@firebase/app-check-interop-types'; +import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; +import { FirebaseApp } from '@firebase/app'; +import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; +import { FirebaseAuthTokenData } from '@firebase/auth-interop-types'; +import { FirebaseError } from '@firebase/util'; +import { LogLevelString } from '@firebase/logger'; +import { Provider } from '@firebase/component'; +export declare interface CancellableOperation + extends PromiseLike<{ + data: T; + }> { + cancel: () => void; +} +/** + * Connect to the DataConnect Emulator + * @param dc Data Connect instance + * @param host host of emulator server + * @param port port of emulator server + * @param sslEnabled use https + */ +export declare function connectDataConnectEmulator( + dc: DataConnect, + host: string, + port?: number, + sslEnabled?: boolean +): void; +/** + * Connector Config for calling Data Connect backend. + */ +export declare interface ConnectorConfig { + location: string; + connector: string; + service: string; +} +/** + * Class representing Firebase Data Connect + */ +export declare class DataConnect { + readonly app: FirebaseApp; + private readonly dataConnectOptions; + isEmulator: boolean; + constructor( + app: FirebaseApp, + dataConnectOptions: DataConnectOptions, + _authProvider: Provider, + _appCheckProvider: Provider + ); + getSettings(): ConnectorConfig; + setInitialized(): void; + enableEmulator(transportOptions: TransportOptions): void; +} +/** + * DataConnectOptions including project id + */ +export declare interface DataConnectOptions extends ConnectorConfig { + projectId: string; +} +export declare interface DataConnectResult + extends OpResult { + ref: OperationRef; +} +/** + * Representation of user provided subscription options. + */ +export declare interface DataConnectSubscription { + userCallback: OnResultSubscription; + errCallback?: (e?: FirebaseError) => void; + unsubscribe: () => void; +} +/* Excluded from this release type: DataConnectTransport */ +export declare type DataSource = typeof SOURCE_CACHE | typeof SOURCE_SERVER; +/** + * Execute Mutation + * @param mutationRef mutation to execute + * @returns `MutationRef` + */ +export declare function executeMutation( + mutationRef: MutationRef +): MutationPromise; +/** + * Execute Query + * @param queryRef query to execute. + * @returns `QueryPromise` + */ +export declare function executeQuery( + queryRef: QueryRef +): QueryPromise; +/** + * Initialize DataConnect instance + * @param options ConnectorConfig + */ +export declare function getDataConnect(options: ConnectorConfig): DataConnect; +/** + * Initialize DataConnect instance + * @param app FirebaseApp to initialize to. + * @param options ConnectorConfig + */ +export declare function getDataConnect( + app: FirebaseApp, + options: ConnectorConfig +): DataConnect; +export declare const MUTATION_STR = 'mutation'; +/* Excluded from this release type: MutationManager */ +/** + * Mutation return value from `executeMutation` + */ +export declare interface MutationPromise + extends PromiseLike> {} +export declare interface MutationRef + extends OperationRef { + refType: typeof MUTATION_STR; +} +/** + * Creates a `MutationRef` + * @param dcInstance Data Connect instance + * @param mutationName name of mutation + */ +export declare function mutationRef( + dcInstance: DataConnect, + mutationName: string +): MutationRef; +/** + * + * @param dcInstance Data Connect instance + * @param mutationName name of mutation + * @param variables variables to send with mutation + */ +export declare function mutationRef( + dcInstance: DataConnect, + mutationName: string, + variables: Variables +): MutationRef; +/** + * Mutation Result from `executeMutation` + */ +export declare interface MutationResult + extends DataConnectResult { + ref: MutationRef; +} +/** + * `OnCompleteSubscription` + */ +export declare type OnCompleteSubscription = () => void; +/** + * Signature for `OnErrorSubscription` for `subscribe` + */ +export declare type OnErrorSubscription = (err?: FirebaseError) => void; +/** + * Signature for `OnResultSubscription` for `subscribe` + */ +export declare type OnResultSubscription = ( + res: QueryResult +) => void; +export declare interface OperationRef<_Data, Variables> { + name: string; + variables: Variables; + refType: ReferenceType; + dataConnect: DataConnect; +} +export declare interface OpResult { + data: Data; + source: DataSource; + fetchTime: string; +} +/* Excluded from this release type: parseOptions */ +export declare const QUERY_STR = 'query'; +/** + * Promise returned from `executeQuery` + */ +export declare interface QueryPromise + extends PromiseLike> {} +/** + * QueryRef object + */ +export declare interface QueryRef + extends OperationRef { + refType: typeof QUERY_STR; +} +/** + * Execute Query + * @param dcInstance Data Connect instance to use. + * @param queryName Query to execute + * @returns `QueryRef` + */ +export declare function queryRef( + dcInstance: DataConnect, + queryName: string +): QueryRef; +/** + * Execute Query + * @param dcInstance Data Connect instance to use. + * @param queryName Query to execute + * @param variables Variables to execute with + * @returns `QueryRef` + */ +export declare function queryRef( + dcInstance: DataConnect, + queryName: string, + variables: Variables +): QueryRef; +/** + * Result of `executeQuery` + */ +export declare interface QueryResult + extends DataConnectResult { + ref: QueryRef; + toJSON: () => SerializedRef; +} +/** + * Signature for unsubscribe from `subscribe` + */ +export declare type QueryUnsubscribe = () => void; +export declare type ReferenceType = typeof QUERY_STR | typeof MUTATION_STR; +/** + * Serialized RefInfo as a result of `QueryResult.toJSON().refInfo` + */ +export declare interface RefInfo { + name: string; + variables: Variables; + connectorConfig: DataConnectOptions; +} +/** + * Serialized Ref as a result of `QueryResult.toJSON()` + */ +export declare interface SerializedRef extends OpResult { + refInfo: RefInfo; +} +export declare function setLogLevel(logLevel: LogLevelString): void; +export declare const SOURCE_CACHE = 'CACHE'; +export declare const SOURCE_SERVER = 'SERVER'; +/** + * Subscribe to a `QueryRef` + * @param queryRefOrSerializedResult query ref or serialized result. + * @param observer observer object to use for subscribing. + * @returns `SubscriptionOptions` + */ +export declare function subscribe( + queryRefOrSerializedResult: + | QueryRef + | SerializedRef, + observer: SubscriptionOptions +): QueryUnsubscribe; +/** + * Subscribe to a `QueryRef` + * @param queryRefOrSerializedResult query ref or serialized result. + * @param onNext Callback to call when result comes back. + * @param onError Callback to call when error gets thrown. + * @param onComplete Called when subscription completes. + * @returns `SubscriptionOptions` + */ +export declare function subscribe( + queryRefOrSerializedResult: + | QueryRef + | SerializedRef, + onNext: OnResultSubscription, + onError?: OnErrorSubscription, + onComplete?: OnCompleteSubscription +): QueryUnsubscribe; +/** + * Representation of full observer options in `subscribe` + */ +export declare interface SubscriptionOptions { + onNext?: OnResultSubscription; + onErr?: OnErrorSubscription; + onComplete?: OnCompleteSubscription; +} +/** + * Delete DataConnect instance + * @param dataConnect DataConnect instance + * @returns + */ +export declare function terminate(dataConnect: DataConnect): Promise; +/** + * Converts serialized ref to query ref + * @param serializedRef ref to convert to `QueryRef` + * @returns `QueryRef` + */ +export declare function toQueryRef( + serializedRef: SerializedRef +): QueryRef; +/* Excluded from this release type: TransportClass */ +/** + * Options to connect to emulator + */ +export declare interface TransportOptions { + host: string; + sslEnabled?: boolean; + port?: number; +} +/* Excluded from this release type: validateArgs */ +/* Excluded from this release type: validateDCOptions */ +export {}; diff --git a/repo-scripts/prune-dts/tests/database.input.d.ts b/repo-scripts/prune-dts/tests/database.input.d.ts new file mode 100644 index 00000000000..6ea85f3e7da --- /dev/null +++ b/repo-scripts/prune-dts/tests/database.input.d.ts @@ -0,0 +1,3207 @@ +/** + * Firebase Realtime Database + * + * @packageDocumentation + */ + +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { AppCheckTokenListener } from '@firebase/app-check-interop-types'; +import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; +import { EmulatorMockTokenOptions } from '@firebase/util'; +import { FirebaseApp } from '@firebase/app'; +import { FirebaseApp as FirebaseApp_2 } from '@firebase/app-types'; +import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; +import { FirebaseAuthInternal } from '@firebase/auth-interop-types'; +import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; +import { FirebaseAuthTokenData } from '@firebase/app-types/private'; +import { Provider } from '@firebase/component'; + +/** + * Abstraction around AppCheck's token fetching capabilities. + */ +declare class AppCheckTokenProvider { + private appName_; + private appCheckProvider?; + private appCheck?; + constructor( + appName_: string, + appCheckProvider?: Provider + ); + getToken(forceRefresh?: boolean): Promise; + addTokenChangeListener(listener: AppCheckTokenListener): void; + notifyForInvalidToken(): void; +} + +declare interface AuthTokenProvider { + getToken(forceRefresh: boolean): Promise; + addTokenChangeListener(listener: (token: string | null) => void): void; + removeTokenChangeListener(listener: (token: string | null) => void): void; + notifyForInvalidToken(): void; +} + +/** + * A cache node only stores complete children. Additionally it holds a flag whether the node can be considered fully + * initialized in the sense that we know at one point in time this represented a valid state of the world, e.g. + * initialized with data from the server, or a complete overwrite by the client. The filtered flag also tracks + * whether a node potentially had children removed due to a filter. + */ +declare class CacheNode { + private node_; + private fullyInitialized_; + private filtered_; + constructor(node_: Node_2, fullyInitialized_: boolean, filtered_: boolean); + /** + * Returns whether this node was fully initialized with either server data or a complete overwrite by the client + */ + isFullyInitialized(): boolean; + /** + * Returns whether this node is potentially missing children due to a filter applied to the node + */ + isFiltered(): boolean; + isCompleteForPath(path: Path): boolean; + isCompleteForChild(key: string): boolean; + getNode(): Node_2; +} + +declare class CancelEvent implements Event_2 { + eventRegistration: EventRegistration; + error: Error; + path: Path; + constructor(eventRegistration: EventRegistration, error: Error, path: Path); + getPath(): Path; + getEventType(): string; + getEventRunner(): () => void; + toString(): string; +} + +declare interface Change { + /** @param type - The event type */ + type: ChangeType; + /** @param snapshotNode - The data */ + snapshotNode: Node_2; + /** @param childName - The name for this child, if it's a child even */ + childName?: string; + /** @param oldSnap - Used for intermediate processing of child changed events */ + oldSnap?: Node_2; + /** * @param prevName - The name for the previous child, if applicable */ + prevName?: string | null; +} + +declare const enum ChangeType { + /** Event type for a child added */ + CHILD_ADDED = 'child_added', + /** Event type for a child removed */ + CHILD_REMOVED = 'child_removed', + /** Event type for a child changed */ + CHILD_CHANGED = 'child_changed', + /** Event type for a child moved */ + CHILD_MOVED = 'child_moved', + /** Event type for a value change */ + VALUE = 'value' +} + +/** + * Gets a `Reference` for the location at the specified relative path. + * + * The relative path can either be a simple child name (for example, "ada") or + * a deeper slash-separated path (for example, "ada/name/first"). + * + * @param parent - The parent location. + * @param path - A relative path from this location to the desired child + * location. + * @returns The specified child location. + */ +export declare function child( + parent: DatabaseReference, + path: string +): DatabaseReference; + +declare class ChildChangeAccumulator { + private readonly changeMap; + trackChildChange(change: Change): void; + getChanges(): Change[]; +} + +/** + * @license + * Copyright 2017 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. + */ +/** + * @fileoverview Implementation of an immutable SortedMap using a Left-leaning + * Red-Black Tree, adapted from the implementation in Mugs + * (http://mads379.github.com/mugs/) by Mads Hartmann Jensen + * (mads379\@gmail.com). + * + * Original paper on Left-leaning Red-Black Trees: + * http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf + * + * Invariant 1: No red node has a red child + * Invariant 2: Every leaf path has the same number of black nodes + * Invariant 3: Only the left child can be red (left leaning) + */ +declare type Comparator = (key1: K, key2: K) => number; + +/** + * Since updates to filtered nodes might require nodes to be pulled in from "outside" the node, this interface + * can help to get complete children that can be pulled in. + * A class implementing this interface takes potentially multiple sources (e.g. user writes, server data from + * other views etc.) to try it's best to get a complete child that might be useful in pulling into the view. + * + * @interface + */ +declare interface CompleteChildSource { + getCompleteChild(childKey: string): Node_2 | null; + getChildAfterChild( + index: Index, + child: NamedNode, + reverse: boolean + ): NamedNode | null; +} + +/** + * This class holds a collection of writes that can be applied to nodes in unison. It abstracts away the logic with + * dealing with priority writes and multiple nested writes. At any given path there is only allowed to be one write + * modifying that path. Any write to an existing path or shadowing an existing path will modify that existing write + * to reflect the write added. + */ +declare class CompoundWrite { + writeTree_: ImmutableTree; + constructor(writeTree_: ImmutableTree); + static empty(): CompoundWrite; +} + +/** + * Modify the provided instance to communicate with the Realtime Database + * emulator. + * + *

Note: This method must be called before performing any other operation. + * + * @param db - The instance to modify. + * @param host - The emulator host (ex: localhost) + * @param port - The emulator port (ex: 8080) + * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules + */ +export declare function connectDatabaseEmulator( + db: Database, + host: string, + port: number, + options?: { + mockUserToken?: EmulatorMockTokenOptions | string; + } +): void; + +/** + * Class representing a Firebase Realtime Database. + */ +export declare class Database implements _FirebaseService { + _repoInternal: Repo; + /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ + readonly app: FirebaseApp; + /** Represents a `Database` instance. */ + readonly 'type' = 'database'; + /** Track if the instance has been used (root or repo accessed) */ + _instanceStarted: boolean; + /** Backing state for root_ */ + private _rootInternal?; + /** @hideconstructor */ + constructor( + _repoInternal: Repo, + /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ + app: FirebaseApp + ); + get _repo(): Repo; + get _root(): _ReferenceImpl; + _delete(): Promise; + _checkNotDeleted(apiName: string): void; +} + +/** + * A `DatabaseReference` represents a specific location in your Database and can be used + * for reading or writing data to that Database location. + * + * You can reference the root or child location in your Database by calling + * `ref()` or `ref("child/path")`. + * + * Writing is done with the `set()` method and reading can be done with the + * `on*()` method. See {@link + * https://firebase.google.com/docs/database/web/read-and-write} + */ +export declare interface DatabaseReference extends Query { + /** + * The last part of the `DatabaseReference`'s path. + * + * For example, `"ada"` is the key for + * `https://.firebaseio.com/users/ada`. + * + * The key of a root `DatabaseReference` is `null`. + */ + readonly key: string | null; + /** + * The parent location of a `DatabaseReference`. + * + * The parent of a root `DatabaseReference` is `null`. + */ + readonly parent: DatabaseReference | null; + /** The root `DatabaseReference` of the Database. */ + readonly root: DatabaseReference; +} + +/** + * A `DataSnapshot` contains data from a Database location. + * + * Any time you read data from the Database, you receive the data as a + * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach + * with `on()` or `once()`. You can extract the contents of the snapshot as a + * JavaScript object by calling the `val()` method. Alternatively, you can + * traverse into the snapshot by calling `child()` to return child snapshots + * (which you could then call `val()` on). + * + * A `DataSnapshot` is an efficiently generated, immutable copy of the data at + * a Database location. It cannot be modified and will never change (to modify + * data, you always call the `set()` method on a `Reference` directly). + */ +export declare class DataSnapshot { + readonly _node: Node_2; + /** + * The location of this DataSnapshot. + */ + readonly ref: DatabaseReference; + readonly _index: Index; + /** + * @param _node - A SnapshotNode to wrap. + * @param ref - The location this snapshot came from. + * @param _index - The iteration order for this snapshot + * @hideconstructor + */ + constructor( + _node: Node_2, + /** + * The location of this DataSnapshot. + */ + ref: DatabaseReference, + _index: Index + ); + /** + * Gets the priority value of the data in this `DataSnapshot`. + * + * Applications need not use priority but can order collections by + * ordinary properties (see + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} + * ). + */ + get priority(): string | number | null; + /** + * The key (last part of the path) of the location of this `DataSnapshot`. + * + * The last token in a Database location is considered its key. For example, + * "ada" is the key for the /users/ada/ node. Accessing the key on any + * `DataSnapshot` will return the key for the location that generated it. + * However, accessing the key on the root URL of a Database will return + * `null`. + */ + get key(): string | null; + /** Returns the number of child properties of this `DataSnapshot`. */ + get size(): number; + /** + * Gets another `DataSnapshot` for the location at the specified relative path. + * + * Passing a relative path to the `child()` method of a DataSnapshot returns + * another `DataSnapshot` for the location at the specified relative path. The + * relative path can either be a simple child name (for example, "ada") or a + * deeper, slash-separated path (for example, "ada/name/first"). If the child + * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` + * whose value is `null`) is returned. + * + * @param path - A relative path to the location of child data. + */ + child(path: string): DataSnapshot; + /** + * Returns true if this `DataSnapshot` contains any data. It is slightly more + * efficient than using `snapshot.val() !== null`. + */ + exists(): boolean; + /** + * Exports the entire contents of the DataSnapshot as a JavaScript object. + * + * The `exportVal()` method is similar to `val()`, except priority information + * is included (if available), making it suitable for backing up your data. + * + * @returns The DataSnapshot's contents as a JavaScript value (Object, + * Array, string, number, boolean, or `null`). + */ + exportVal(): any; + /** + * Enumerates the top-level children in the `IteratedDataSnapshot`. + * + * Because of the way JavaScript objects work, the ordering of data in the + * JavaScript object returned by `val()` is not guaranteed to match the + * ordering on the server nor the ordering of `onChildAdded()` events. That is + * where `forEach()` comes in handy. It guarantees the children of a + * `DataSnapshot` will be iterated in their query order. + * + * If no explicit `orderBy*()` method is used, results are returned + * ordered by key (unless priorities are used, in which case, results are + * returned by priority). + * + * @param action - A function that will be called for each child DataSnapshot. + * The callback can return true to cancel further enumeration. + * @returns true if enumeration was canceled due to your callback returning + * true. + */ + forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean; + /** + * Returns true if the specified child path has (non-null) data. + * + * @param path - A relative path to the location of a potential child. + * @returns `true` if data exists at the specified child path; else + * `false`. + */ + hasChild(path: string): boolean; + /** + * Returns whether or not the `DataSnapshot` has any non-`null` child + * properties. + * + * You can use `hasChildren()` to determine if a `DataSnapshot` has any + * children. If it does, you can enumerate them using `forEach()`. If it + * doesn't, then either this snapshot contains a primitive value (which can be + * retrieved with `val()`) or it is empty (in which case, `val()` will return + * `null`). + * + * @returns true if this snapshot has any children; else false. + */ + hasChildren(): boolean; + /** + * Returns a JSON-serializable representation of this object. + */ + toJSON(): object | null; + /** + * Extracts a JavaScript value from a `DataSnapshot`. + * + * Depending on the data in a `DataSnapshot`, the `val()` method may return a + * scalar type (string, number, or boolean), an array, or an object. It may + * also return null, indicating that the `DataSnapshot` is empty (contains no + * data). + * + * @returns The DataSnapshot's contents as a JavaScript value (Object, + * Array, string, number, boolean, or `null`). + */ + val(): any; +} +export { EmulatorMockTokenOptions }; + +/** + * Logs debugging information to the console. + * + * @param enabled - Enables logging if `true`, disables logging if `false`. + * @param persistent - Remembers the logging state between page refreshes if + * `true`. + */ +export declare function enableLogging( + enabled: boolean, + persistent?: boolean +): any; + +/** + * Logs debugging information to the console. + * + * @param logger - A custom logger function to control how things get logged. + */ +export declare function enableLogging( + logger: (message: string) => unknown +): any; + +/** + * Creates a `QueryConstraint` with the specified ending point. + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The ending point is inclusive, so children with exactly the specified value + * will be included in the query. The optional key argument can be used to + * further limit the range of the query. If it is specified, then children that + * have exactly the specified value must also have a key name less than or equal + * to the specified key. + * + * You can read more about `endAt()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param value - The value to end at. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to end at, among the children with the previously + * specified priority. This argument is only allowed if ordering by child, + * value, or priority. + */ +export declare function endAt( + value: number | string | boolean | null, + key?: string +): QueryConstraint; + +/** + * Creates a `QueryConstraint` with the specified ending point (exclusive). + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The ending point is exclusive. If only a value is provided, children + * with a value less than the specified value will be included in the query. + * If a key is specified, then children must have a value less than or equal + * to the specified value and a key name less than the specified key. + * + * @param value - The value to end before. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to end before, among the children with the + * previously specified priority. This argument is only allowed if ordering by + * child, value, or priority. + */ +export declare function endBefore( + value: number | string | boolean | null, + key?: string +): QueryConstraint; + +/** + * Creates a `QueryConstraint` that includes children that match the specified + * value. + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The optional key argument can be used to further limit the range of the + * query. If it is specified, then children that have exactly the specified + * value must also have exactly the specified key as their key name. This can be + * used to filter result sets with many matches for the same value. + * + * You can read more about `equalTo()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param value - The value to match for. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to start at, among the children with the + * previously specified priority. This argument is only allowed if ordering by + * child, value, or priority. + */ +export declare function equalTo( + value: number | string | boolean | null, + key?: string +): QueryConstraint; + +/** + * Encapsulates the data needed to raise an event + * @interface + */ +declare interface Event_2 { + getPath(): Path; + getEventType(): string; + getEventRunner(): () => void; + toString(): string; +} + +/** + * An EventGenerator is used to convert "raw" changes (Change) as computed by the + * CacheDiffer into actual events (Event) that can be raised. See generateEventsForChanges() + * for details. + * + */ +declare class EventGenerator { + query_: QueryContext; + index_: Index; + constructor(query_: QueryContext); +} + +declare interface EventList { + events: Event_2[]; + path: Path; +} + +/** + * The event queue serves a few purposes: + * 1. It ensures we maintain event order in the face of event callbacks doing operations that result in more + * events being queued. + * 2. raiseQueuedEvents() handles being called reentrantly nicely. That is, if in the course of raising events, + * raiseQueuedEvents() is called again, the "inner" call will pick up raising events where the "outer" call + * left off, ensuring that the events are still raised synchronously and in order. + * 3. You can use raiseEventsAtPath and raiseEventsForChangedPath to ensure only relevant previously-queued + * events are raised synchronously. + * + * NOTE: This can all go away if/when we move to async events. + * + */ +declare class EventQueue { + eventLists_: EventList[]; + /** + * Tracks recursion depth of raiseQueuedEvents_, for debugging purposes. + */ + recursionDepth_: number; +} + +/** + * An EventRegistration is basically an event type ('value', 'child_added', etc.) and a callback + * to be notified of that type of event. + * + * That said, it can also contain a cancel callback to be notified if the event is canceled. And + * currently, this code is organized around the idea that you would register multiple child_ callbacks + * together, as a single EventRegistration. Though currently we don't do that. + */ +declare interface EventRegistration { + /** + * True if this container has a callback to trigger for this event type + */ + respondsTo(eventType: string): boolean; + createEvent(change: Change, query: QueryContext): Event_2; + /** + * Given event data, return a function to trigger the user's callback + */ + getEventRunner(eventData: Event_2): () => void; + createCancelEvent(error: Error, path: Path): CancelEvent | null; + matches(other: EventRegistration): boolean; + /** + * False basically means this is a "dummy" callback container being used as a sentinel + * to remove all callback containers of a particular type. (e.g. if the user does + * ref.off('value') without specifying a specific callback). + * + * (TODO: Rework this, since it's hacky) + * + */ + hasAnyCallback(): boolean; +} + +/** + * One of the following strings: "value", "child_added", "child_changed", + * "child_removed", or "child_moved." + */ +export declare type EventType = + | 'value' + | 'child_added' + | 'child_changed' + | 'child_moved' + | 'child_removed'; + +/* Excluded from this release type: _FirebaseService */ + +/** + * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. + */ +export declare function forceLongPolling(): void; + +/** + * Force the use of websockets instead of longPolling. + */ +export declare function forceWebSockets(): void; + +/** + * Gets the most up-to-date result for this query. + * + * @param query - The query to run. + * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is + * available, or rejects if the client is unable to return a value (e.g., if the + * server is unreachable and there is nothing cached). + */ +export declare function get(query: Query): Promise; + +/** + * Returns the instance of the Realtime Database SDK that is associated with the provided + * {@link @firebase/app#FirebaseApp}. Initializes a new instance with default settings if + * no instance exists or if the existing instance uses a custom database URL. + * + * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime + * Database instance is associated with. + * @param url - The URL of the Realtime Database instance to connect to. If not + * provided, the SDK connects to the default instance of the Firebase App. + * @returns The `Database` instance of the provided app. + */ +export declare function getDatabase(app?: FirebaseApp, url?: string): Database; + +/** + * Disconnects from the server (all Database operations will be completed + * offline). + * + * The client automatically maintains a persistent connection to the Database + * server, which will remain active indefinitely and reconnect when + * disconnected. However, the `goOffline()` and `goOnline()` methods may be used + * to control the client connection in cases where a persistent connection is + * undesirable. + * + * While offline, the client will no longer receive data updates from the + * Database. However, all Database operations performed locally will continue to + * immediately fire events, allowing your application to continue behaving + * normally. Additionally, each operation performed locally will automatically + * be queued and retried upon reconnection to the Database server. + * + * To reconnect to the Database and begin receiving remote events, see + * `goOnline()`. + * + * @param db - The instance to disconnect. + */ +export declare function goOffline(db: Database): void; + +/** + * Reconnects to the server and synchronizes the offline Database state + * with the server state. + * + * This method should be used after disabling the active connection with + * `goOffline()`. Once reconnected, the client will transmit the proper data + * and fire the appropriate events so that your client "catches up" + * automatically. + * + * @param db - The instance to reconnect. + */ +export declare function goOnline(db: Database): void; + +/** + * A tree with immutable elements. + */ +declare class ImmutableTree { + readonly value: T | null; + readonly children: SortedMap>; + static fromObject(obj: { [k: string]: T }): ImmutableTree; + constructor(value: T | null, children?: SortedMap>); + /** + * True if the value is empty and there are no children + */ + isEmpty(): boolean; + /** + * Given a path and predicate, return the first node and the path to that node + * where the predicate returns true. + * + * TODO Do a perf test -- If we're creating a bunch of `{path: value:}` + * objects on the way back out, it may be better to pass down a pathSoFar obj. + * + * @param relativePath - The remainder of the path + * @param predicate - The predicate to satisfy to return a node + */ + findRootMostMatchingPathAndValue( + relativePath: Path, + predicate: (a: T) => boolean + ): { + path: Path; + value: T; + } | null; + /** + * Find, if it exists, the shortest subpath of the given path that points a defined + * value in the tree + */ + findRootMostValueAndPath(relativePath: Path): { + path: Path; + value: T; + } | null; + /** + * @returns The subtree at the given path + */ + subtree(relativePath: Path): ImmutableTree; + /** + * Sets a value at the specified path. + * + * @param relativePath - Path to set value at. + * @param toSet - Value to set. + * @returns Resulting tree. + */ + set(relativePath: Path, toSet: T | null): ImmutableTree; + /** + * Removes the value at the specified path. + * + * @param relativePath - Path to value to remove. + * @returns Resulting tree. + */ + remove(relativePath: Path): ImmutableTree; + /** + * Gets a value from the tree. + * + * @param relativePath - Path to get value for. + * @returns Value at path, or null. + */ + get(relativePath: Path): T | null; + /** + * Replace the subtree at the specified path with the given new tree. + * + * @param relativePath - Path to replace subtree for. + * @param newTree - New tree. + * @returns Resulting tree. + */ + setTree(relativePath: Path, newTree: ImmutableTree): ImmutableTree; + /** + * Performs a depth first fold on this tree. Transforms a tree into a single + * value, given a function that operates on the path to a node, an optional + * current value, and a map of child names to folded subtrees + */ + fold( + fn: ( + path: Path, + value: T, + children: { + [k: string]: V; + } + ) => V + ): V; + /** + * Recursive helper for public-facing fold() method + */ + private fold_; + /** + * Find the first matching value on the given path. Return the result of applying f to it. + */ + findOnPath(path: Path, f: (path: Path, value: T) => V | null): V | null; + private findOnPath_; + foreachOnPath( + path: Path, + f: (path: Path, value: T) => void + ): ImmutableTree; + private foreachOnPath_; + /** + * Calls the given function for each node in the tree that has a value. + * + * @param f - A function to be called with the path from the root of the tree to + * a node, and the value at that node. Called in depth-first order. + */ + foreach(f: (path: Path, value: T) => void): void; + private foreach_; + foreachChild(f: (name: string, value: T) => void): void; +} + +/** + * Returns a placeholder value that can be used to atomically increment the + * current database value by the provided delta. + * + * @param delta - the amount to modify the current value atomically. + * @returns A placeholder value for modifying data atomically server-side. + */ +export declare function increment(delta: number): object; + +declare abstract class Index { + abstract compare(a: NamedNode, b: NamedNode): number; + abstract isDefinedOn(node: Node_2): boolean; + /** + * @returns A standalone comparison function for + * this index + */ + getCompare(): Comparator; + /** + * Given a before and after value for a node, determine if the indexed value has changed. Even if they are different, + * it's possible that the changes are isolated to parts of the snapshot that are not indexed. + * + * + * @returns True if the portion of the snapshot being indexed changed between oldNode and newNode + */ + indexedValueChanged(oldNode: Node_2, newNode: Node_2): boolean; + /** + * @returns a node wrapper that will sort equal to or less than + * any other node wrapper, using this index + */ + minPost(): NamedNode; + /** + * @returns a node wrapper that will sort greater than or equal to + * any other node wrapper, using this index + */ + abstract maxPost(): NamedNode; + abstract makePost(indexValue: unknown, name: string): NamedNode; + /** + * @returns String representation for inclusion in a query spec + */ + abstract toString(): string; +} + +/* Excluded from this release type: _initStandalone */ + +/** + * Represents a child snapshot of a `Reference` that is being iterated over. The key will never be undefined. + */ +export declare interface IteratedDataSnapshot extends DataSnapshot { + key: string; +} + +/** + * Creates a new `QueryConstraint` that if limited to the first specific number + * of children. + * + * The `limitToFirst()` method is used to set a maximum number of children to be + * synced for a given callback. If we set a limit of 100, we will initially only + * receive up to 100 `child_added` events. If we have fewer than 100 messages + * stored in our Database, a `child_added` event will fire for each message. + * However, if we have over 100 messages, we will only receive a `child_added` + * event for the first 100 ordered messages. As items change, we will receive + * `child_removed` events for each item that drops out of the active list so + * that the total number stays at 100. + * + * You can read more about `limitToFirst()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param limit - The maximum number of nodes to include in this query. + */ +export declare function limitToFirst(limit: number): QueryConstraint; + +/** + * Creates a new `QueryConstraint` that is limited to return only the last + * specified number of children. + * + * The `limitToLast()` method is used to set a maximum number of children to be + * synced for a given callback. If we set a limit of 100, we will initially only + * receive up to 100 `child_added` events. If we have fewer than 100 messages + * stored in our Database, a `child_added` event will fire for each message. + * However, if we have over 100 messages, we will only receive a `child_added` + * event for the last 100 ordered messages. As items change, we will receive + * `child_removed` events for each item that drops out of the active list so + * that the total number stays at 100. + * + * You can read more about `limitToLast()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param limit - The maximum number of nodes to include in this query. + */ +export declare function limitToLast(limit: number): QueryConstraint; + +/** An options objects that can be used to customize a listener. */ +export declare interface ListenOptions { + /** Whether to remove the listener after its first invocation. */ + readonly onlyOnce?: boolean; +} + +declare interface ListenProvider { + startListening( + query: QueryContext, + tag: number | null, + hashFn: () => string, + onComplete: (a: string, b?: unknown) => Event_2[] + ): Event_2[]; + stopListening(a: QueryContext, b: number | null): void; +} + +/** + * Represents an empty node (a leaf node in the Red-Black Tree). + */ +declare class LLRBEmptyNode { + key: K; + value: V; + left: LLRBNode | LLRBEmptyNode; + right: LLRBNode | LLRBEmptyNode; + color: boolean; + /** + * Returns a copy of the current node. + * + * @returns The node copy. + */ + copy( + key: K | null, + value: V | null, + color: boolean | null, + left: LLRBNode | LLRBEmptyNode | null, + right: LLRBNode | LLRBEmptyNode | null + ): LLRBEmptyNode; + /** + * Returns a copy of the tree, with the specified key/value added. + * + * @param key - Key to be added. + * @param value - Value to be added. + * @param comparator - Comparator. + * @returns New tree, with item added. + */ + insert(key: K, value: V, comparator: Comparator): LLRBNode; + /** + * Returns a copy of the tree, with the specified key removed. + * + * @param key - The key to remove. + * @param comparator - Comparator. + * @returns New tree, with item removed. + */ + remove(key: K, comparator: Comparator): LLRBEmptyNode; + /** + * @returns The total number of nodes in the tree. + */ + count(): number; + /** + * @returns True if the tree is empty. + */ + isEmpty(): boolean; + /** + * Traverses the tree in key order and calls the specified action function + * for each node. + * + * @param action - Callback function to be called for each + * node. If it returns true, traversal is aborted. + * @returns True if traversal was aborted. + */ + inorderTraversal(action: (k: K, v: V) => unknown): boolean; + /** + * Traverses the tree in reverse key order and calls the specified action function + * for each node. + * + * @param action - Callback function to be called for each + * node. If it returns true, traversal is aborted. + * @returns True if traversal was aborted. + */ + reverseTraversal(action: (k: K, v: V) => void): boolean; + minKey(): null; + maxKey(): null; + check_(): number; + /** + * @returns Whether this node is red. + */ + isRed_(): boolean; +} + +/** + * Represents a node in a Left-leaning Red-Black tree. + */ +declare class LLRBNode { + key: K; + value: V; + color: boolean; + left: LLRBNode | LLRBEmptyNode; + right: LLRBNode | LLRBEmptyNode; + /** + * @param key - Key associated with this node. + * @param value - Value associated with this node. + * @param color - Whether this node is red. + * @param left - Left child. + * @param right - Right child. + */ + constructor( + key: K, + value: V, + color: boolean | null, + left?: LLRBNode | LLRBEmptyNode | null, + right?: LLRBNode | LLRBEmptyNode | null + ); + static RED: boolean; + static BLACK: boolean; + /** + * Returns a copy of the current node, optionally replacing pieces of it. + * + * @param key - New key for the node, or null. + * @param value - New value for the node, or null. + * @param color - New color for the node, or null. + * @param left - New left child for the node, or null. + * @param right - New right child for the node, or null. + * @returns The node copy. + */ + copy( + key: K | null, + value: V | null, + color: boolean | null, + left: LLRBNode | LLRBEmptyNode | null, + right: LLRBNode | LLRBEmptyNode | null + ): LLRBNode; + /** + * @returns The total number of nodes in the tree. + */ + count(): number; + /** + * @returns True if the tree is empty. + */ + isEmpty(): boolean; + /** + * Traverses the tree in key order and calls the specified action function + * for each node. + * + * @param action - Callback function to be called for each + * node. If it returns true, traversal is aborted. + * @returns The first truthy value returned by action, or the last falsey + * value returned by action + */ + inorderTraversal(action: (k: K, v: V) => unknown): boolean; + /** + * Traverses the tree in reverse key order and calls the specified action function + * for each node. + * + * @param action - Callback function to be called for each + * node. If it returns true, traversal is aborted. + * @returns True if traversal was aborted. + */ + reverseTraversal(action: (k: K, v: V) => void): boolean; + /** + * @returns The minimum node in the tree. + */ + private min_; + /** + * @returns The maximum key in the tree. + */ + minKey(): K; + /** + * @returns The maximum key in the tree. + */ + maxKey(): K; + /** + * @param key - Key to insert. + * @param value - Value to insert. + * @param comparator - Comparator. + * @returns New tree, with the key/value added. + */ + insert(key: K, value: V, comparator: Comparator): LLRBNode; + /** + * @returns New tree, with the minimum key removed. + */ + private removeMin_; + /** + * @param key - The key of the item to remove. + * @param comparator - Comparator. + * @returns New tree, with the specified item removed. + */ + remove( + key: K, + comparator: Comparator + ): LLRBNode | LLRBEmptyNode; + /** + * @returns Whether this is a RED node. + */ + isRed_(): boolean; + /** + * @returns New tree after performing any needed rotations. + */ + private fixUp_; + /** + * @returns New tree, after moveRedLeft. + */ + private moveRedLeft_; + /** + * @returns New tree, after moveRedRight. + */ + private moveRedRight_; + /** + * @returns New tree, after rotateLeft. + */ + private rotateLeft_; + /** + * @returns New tree, after rotateRight. + */ + private rotateRight_; + /** + * @returns Newt ree, after colorFlip. + */ + private colorFlip_; + /** + * For testing. + * + * @returns True if all is well. + */ + private checkMaxDepth_; + check_(): number; +} + +declare class NamedNode { + name: string; + node: Node_2; + constructor(name: string, node: Node_2); + static Wrap(name: string, node: Node_2): NamedNode; +} + +/** + * Node is an interface defining the common functionality for nodes in + * a DataSnapshot. + * + * @interface + */ +declare interface Node_2 { + /** + * Whether this node is a leaf node. + * @returns Whether this is a leaf node. + */ + isLeafNode(): boolean; + /** + * Gets the priority of the node. + * @returns The priority of the node. + */ + getPriority(): Node_2; + /** + * Returns a duplicate node with the new priority. + * @param newPriorityNode - New priority to set for the node. + * @returns Node with new priority. + */ + updatePriority(newPriorityNode: Node_2): Node_2; + /** + * Returns the specified immediate child, or null if it doesn't exist. + * @param childName - The name of the child to retrieve. + * @returns The retrieved child, or an empty node. + */ + getImmediateChild(childName: string): Node_2; + /** + * Returns a child by path, or null if it doesn't exist. + * @param path - The path of the child to retrieve. + * @returns The retrieved child or an empty node. + */ + getChild(path: Path): Node_2; + /** + * Returns the name of the child immediately prior to the specified childNode, or null. + * @param childName - The name of the child to find the predecessor of. + * @param childNode - The node to find the predecessor of. + * @param index - The index to use to determine the predecessor + * @returns The name of the predecessor child, or null if childNode is the first child. + */ + getPredecessorChildName( + childName: string, + childNode: Node_2, + index: Index + ): string | null; + /** + * Returns a duplicate node, with the specified immediate child updated. + * Any value in the node will be removed. + * @param childName - The name of the child to update. + * @param newChildNode - The new child node + * @returns The updated node. + */ + updateImmediateChild(childName: string, newChildNode: Node_2): Node_2; + /** + * Returns a duplicate node, with the specified child updated. Any value will + * be removed. + * @param path - The path of the child to update. + * @param newChildNode - The new child node, which may be an empty node + * @returns The updated node. + */ + updateChild(path: Path, newChildNode: Node_2): Node_2; + /** + * True if the immediate child specified exists + */ + hasChild(childName: string): boolean; + /** + * @returns True if this node has no value or children. + */ + isEmpty(): boolean; + /** + * @returns The number of children of this node. + */ + numChildren(): number; + /** + * Calls action for each child. + * @param action - Action to be called for + * each child. It's passed the child name and the child node. + * @returns The first truthy value return by action, or the last falsey one + */ + forEachChild(index: Index, action: (a: string, b: Node_2) => void): unknown; + /** + * @param exportFormat - True for export format (also wire protocol format). + * @returns Value of this node as JSON. + */ + val(exportFormat?: boolean): unknown; + /** + * @returns hash representing the node contents. + */ + hash(): string; + /** + * @param other - Another node + * @returns -1 for less than, 0 for equal, 1 for greater than other + */ + compareTo(other: Node_2): number; + /** + * @returns Whether or not this snapshot equals other + */ + equals(other: Node_2): boolean; + /** + * @returns This node, with the specified index now available + */ + withIndex(indexDefinition: Index): Node_2; + isIndexed(indexDefinition: Index): boolean; +} + +/** + * NodeFilter is used to update nodes and complete children of nodes while applying queries on the fly and keeping + * track of any child changes. This class does not track value changes as value changes depend on more + * than just the node itself. Different kind of queries require different kind of implementations of this interface. + * @interface + */ +declare interface NodeFilter_2 { + /** + * Update a single complete child in the snap. If the child equals the old child in the snap, this is a no-op. + * The method expects an indexed snap. + */ + updateChild( + snap: Node_2, + key: string, + newChild: Node_2, + affectedPath: Path, + source: CompleteChildSource, + optChangeAccumulator: ChildChangeAccumulator | null + ): Node_2; + /** + * Update a node in full and output any resulting change from this complete update. + */ + updateFullNode( + oldSnap: Node_2, + newSnap: Node_2, + optChangeAccumulator: ChildChangeAccumulator | null + ): Node_2; + /** + * Update the priority of the root node + */ + updatePriority(oldSnap: Node_2, newPriority: Node_2): Node_2; + /** + * Returns true if children might be filtered due to query criteria + */ + filtersNodes(): boolean; + /** + * Returns the index filter that this filter uses to get a NodeFilter that doesn't filter any children. + */ + getIndexedFilter(): NodeFilter_2; + /** + * Returns the index that this filter uses + */ + getIndex(): Index; +} + +/** + * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. + * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from + * the respective `on*` callbacks. + * + * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener + * will not automatically remove listeners registered on child nodes, `off()` + * must also be called on any child listeners to remove the callback. + * + * If a callback is not specified, all callbacks for the specified eventType + * will be removed. Similarly, if no eventType is specified, all callbacks + * for the `Reference` will be removed. + * + * Individual listeners can also be removed by invoking their unsubscribe + * callbacks. + * + * @param query - The query that the listener was registered with. + * @param eventType - One of the following strings: "value", "child_added", + * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks + * for the `Reference` will be removed. + * @param callback - The callback function that was passed to `on()` or + * `undefined` to remove all callbacks. + */ +export declare function off( + query: Query, + eventType?: EventType, + callback?: ( + snapshot: DataSnapshot, + previousChildName?: string | null + ) => unknown +): void; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildAdded` event will be triggered once for each initial child at this + * location, and it will be triggered again every time a new child is added. The + * `DataSnapshot` passed into the callback will reflect the data for the + * relevant child. For ordering purposes, it is passed a second argument which + * is a string containing the key of the previous sibling child by sort order, + * or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildAdded( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName?: string | null + ) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildAdded` event will be triggered once for each initial child at this + * location, and it will be triggered again every time a new child is added. The + * `DataSnapshot` passed into the callback will reflect the data for the + * relevant child. For ordering purposes, it is passed a second argument which + * is a string containing the key of the previous sibling child by sort order, + * or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildAdded( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildAdded` event will be triggered once for each initial child at this + * location, and it will be triggered again every time a new child is added. The + * `DataSnapshot` passed into the callback will reflect the data for the + * relevant child. For ordering purposes, it is passed a second argument which + * is a string containing the key of the previous sibling child by sort order, + * or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildAdded( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildChanged` event will be triggered when the data stored in a child + * (or any of its descendants) changes. Note that a single `child_changed` event + * may represent multiple changes to the child. The `DataSnapshot` passed to the + * callback will contain the new child contents. For ordering purposes, the + * callback is also passed a second argument which is a string containing the + * key of the previous sibling child by sort order, or `null` if it is the first + * child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildChanged( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildChanged` event will be triggered when the data stored in a child + * (or any of its descendants) changes. Note that a single `child_changed` event + * may represent multiple changes to the child. The `DataSnapshot` passed to the + * callback will contain the new child contents. For ordering purposes, the + * callback is also passed a second argument which is a string containing the + * key of the previous sibling child by sort order, or `null` if it is the first + * child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildChanged( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildChanged` event will be triggered when the data stored in a child + * (or any of its descendants) changes. Note that a single `child_changed` event + * may represent multiple changes to the child. The `DataSnapshot` passed to the + * callback will contain the new child contents. For ordering purposes, the + * callback is also passed a second argument which is a string containing the + * key of the previous sibling child by sort order, or `null` if it is the first + * child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildChanged( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildMoved` event will be triggered when a child's sort order changes + * such that its position relative to its siblings changes. The `DataSnapshot` + * passed to the callback will be for the data of the child that has moved. It + * is also passed a second argument which is a string containing the key of the + * previous sibling child by sort order, or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildMoved( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildMoved` event will be triggered when a child's sort order changes + * such that its position relative to its siblings changes. The `DataSnapshot` + * passed to the callback will be for the data of the child that has moved. It + * is also passed a second argument which is a string containing the key of the + * previous sibling child by sort order, or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildMoved( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildMoved` event will be triggered when a child's sort order changes + * such that its position relative to its siblings changes. The `DataSnapshot` + * passed to the callback will be for the data of the child that has moved. It + * is also passed a second argument which is a string containing the key of the + * previous sibling child by sort order, or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildMoved( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildRemoved` event will be triggered once every time a child is + * removed. The `DataSnapshot` passed into the callback will be the old data for + * the child that was removed. A child will get removed when either: + * + * - a client explicitly calls `remove()` on that child or one of its ancestors + * - a client calls `set(null)` on that child or one of its ancestors + * - that child has all of its children removed + * - there is a query in effect which now filters out the child (because it's + * sort order changed or the max limit was hit) + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildRemoved( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildRemoved` event will be triggered once every time a child is + * removed. The `DataSnapshot` passed into the callback will be the old data for + * the child that was removed. A child will get removed when either: + * + * - a client explicitly calls `remove()` on that child or one of its ancestors + * - a client calls `set(null)` on that child or one of its ancestors + * - that child has all of its children removed + * - there is a query in effect which now filters out the child (because it's + * sort order changed or the max limit was hit) + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildRemoved( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildRemoved` event will be triggered once every time a child is + * removed. The `DataSnapshot` passed into the callback will be the old data for + * the child that was removed. A child will get removed when either: + * + * - a client explicitly calls `remove()` on that child or one of its ancestors + * - a client calls `set(null)` on that child or one of its ancestors + * - that child has all of its children removed + * - there is a query in effect which now filters out the child (because it's + * sort order changed or the max limit was hit) + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildRemoved( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * The `onDisconnect` class allows you to write or clear data when your client + * disconnects from the Database server. These updates occur whether your + * client disconnects cleanly or not, so you can rely on them to clean up data + * even if a connection is dropped or a client crashes. + * + * The `onDisconnect` class is most commonly used to manage presence in + * applications where it is useful to detect how many clients are connected and + * when other clients disconnect. See + * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} + * for more information. + * + * To avoid problems when a connection is dropped before the requests can be + * transferred to the Database server, these functions should be called before + * writing any data. + * + * Note that `onDisconnect` operations are only triggered once. If you want an + * operation to occur each time a disconnect occurs, you'll need to re-establish + * the `onDisconnect` operations each time you reconnect. + */ +export declare class OnDisconnect { + private _repo; + private _path; + /** @hideconstructor */ + constructor(_repo: Repo, _path: Path); + /** + * Cancels all previously queued `onDisconnect()` set or update events for this + * location and all children. + * + * If a write has been queued for this location via a `set()` or `update()` at a + * parent location, the write at this location will be canceled, though writes + * to sibling locations will still occur. + * + * @returns Resolves when synchronization to the server is complete. + */ + cancel(): Promise; + /** + * Ensures the data at this location is deleted when the client is disconnected + * (due to closing the browser, navigating to a new page, or network issues). + * + * @returns Resolves when synchronization to the server is complete. + */ + remove(): Promise; + /** + * Ensures the data at this location is set to the specified value when the + * client is disconnected (due to closing the browser, navigating to a new page, + * or network issues). + * + * `set()` is especially useful for implementing "presence" systems, where a + * value should be changed or cleared when a user disconnects so that they + * appear "offline" to other users. See + * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} + * for more information. + * + * Note that `onDisconnect` operations are only triggered once. If you want an + * operation to occur each time a disconnect occurs, you'll need to re-establish + * the `onDisconnect` operations each time. + * + * @param value - The value to be written to this location on disconnect (can + * be an object, array, string, number, boolean, or null). + * @returns Resolves when synchronization to the Database is complete. + */ + set(value: unknown): Promise; + /** + * Ensures the data at this location is set to the specified value and priority + * when the client is disconnected (due to closing the browser, navigating to a + * new page, or network issues). + * + * @param value - The value to be written to this location on disconnect (can + * be an object, array, string, number, boolean, or null). + * @param priority - The priority to be written (string, number, or null). + * @returns Resolves when synchronization to the Database is complete. + */ + setWithPriority( + value: unknown, + priority: number | string | null + ): Promise; + /** + * Writes multiple values at this location when the client is disconnected (due + * to closing the browser, navigating to a new page, or network issues). + * + * The `values` argument contains multiple property-value pairs that will be + * written to the Database together. Each child property can either be a simple + * property (for example, "name") or a relative path (for example, "name/first") + * from the current location to the data to update. + * + * As opposed to the `set()` method, `update()` can be use to selectively update + * only the referenced properties at the current location (instead of replacing + * all the child properties at the current location). + * + * @param values - Object containing multiple values. + * @returns Resolves when synchronization to the Database is complete. + */ + update(values: object): Promise; +} + +/** + * Returns an `OnDisconnect` object - see + * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} + * for more information on how to use it. + * + * @param ref - The reference to add OnDisconnect triggers for. + */ +export declare function onDisconnect(ref: DatabaseReference): OnDisconnect; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onValue` event will trigger once with the initial data stored at this + * location, and then trigger again each time the data changes. The + * `DataSnapshot` passed to the callback will be for the location at which + * `on()` was called. It won't trigger until the entire contents has been + * synchronized. If the location has no data, it will be triggered with an empty + * `DataSnapshot` (`val()` will return `null`). + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. The + * callback will be passed a DataSnapshot. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onValue( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onValue` event will trigger once with the initial data stored at this + * location, and then trigger again each time the data changes. The + * `DataSnapshot` passed to the callback will be for the location at which + * `on()` was called. It won't trigger until the entire contents has been + * synchronized. If the location has no data, it will be triggered with an empty + * `DataSnapshot` (`val()` will return `null`). + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. The + * callback will be passed a DataSnapshot. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onValue( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onValue` event will trigger once with the initial data stored at this + * location, and then trigger again each time the data changes. The + * `DataSnapshot` passed to the callback will be for the location at which + * `on()` was called. It won't trigger until the entire contents has been + * synchronized. If the location has no data, it will be triggered with an empty + * `DataSnapshot` (`val()` will return `null`). + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. The + * callback will be passed a DataSnapshot. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onValue( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; + +/** + * Creates a new `QueryConstraint` that orders by the specified child key. + * + * Queries can only order by one key at a time. Calling `orderByChild()` + * multiple times on the same query is an error. + * + * Firebase queries allow you to order your data by any child key on the fly. + * However, if you know in advance what your indexes will be, you can define + * them via the .indexOn rule in your Security Rules for better performance. See + * the{@link https://firebase.google.com/docs/database/security/indexing-data} + * rule for more information. + * + * You can read more about `orderByChild()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. + * + * @param path - The path to order by. + */ +export declare function orderByChild(path: string): QueryConstraint; + +/** + * Creates a new `QueryConstraint` that orders by the key. + * + * Sorts the results of a query by their (ascending) key values. + * + * You can read more about `orderByKey()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. + */ +export declare function orderByKey(): QueryConstraint; + +/** + * Creates a new `QueryConstraint` that orders by priority. + * + * Applications need not use priority but can order collections by + * ordinary properties (see + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} + * for alternatives to priority. + */ +export declare function orderByPriority(): QueryConstraint; + +/** + * Creates a new `QueryConstraint` that orders by value. + * + * If the children of a query are all scalar values (string, number, or + * boolean), you can order the results by their (ascending) values. + * + * You can read more about `orderByValue()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. + */ +export declare function orderByValue(): QueryConstraint; + +/** + * @license + * Copyright 2017 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. + */ +/** + * An immutable object representing a parsed path. It's immutable so that you + * can pass them around to other functions without worrying about them changing + * it. + */ +declare class Path { + pieces_: string[]; + pieceNum_: number; + /** + * @param pathOrString - Path string to parse, or another path, or the raw + * tokens array + */ + constructor(pathOrString: string | string[], pieceNum?: number); + toString(): string; +} + +/** + * Firebase connection. Abstracts wire protocol and handles reconnecting. + * + * NOTE: All JSON objects sent to the realtime connection must have property names enclosed + * in quotes to make sure the closure compiler does not minify them. + */ +declare class PersistentConnection extends ServerActions { + private repoInfo_; + private applicationId_; + private onDataUpdate_; + private onConnectStatus_; + private onServerInfoUpdate_; + private authTokenProvider_; + private appCheckTokenProvider_; + private authOverride_?; + id: number; + private log_; + private interruptReasons_; + private readonly listens; + private outstandingPuts_; + private outstandingGets_; + private outstandingPutCount_; + private outstandingGetCount_; + private onDisconnectRequestQueue_; + private connected_; + private reconnectDelay_; + private maxReconnectDelay_; + private securityDebugCallback_; + lastSessionId: string | null; + private establishConnectionTimer_; + private visible_; + private requestCBHash_; + private requestNumber_; + private realtime_; + private authToken_; + private appCheckToken_; + private forceTokenRefresh_; + private invalidAuthTokenCount_; + private invalidAppCheckTokenCount_; + private firstConnection_; + private lastConnectionAttemptTime_; + private lastConnectionEstablishedTime_; + private static nextPersistentConnectionId_; + /** + * Counter for number of connections created. Mainly used for tagging in the logs + */ + private static nextConnectionId_; + /** + * @param repoInfo_ - Data about the namespace we are connecting to + * @param applicationId_ - The Firebase App ID for this project + * @param onDataUpdate_ - A callback for new data from the server + */ + constructor( + repoInfo_: RepoInfo, + applicationId_: string, + onDataUpdate_: ( + a: string, + b: unknown, + c: boolean, + d: number | null + ) => void, + onConnectStatus_: (a: boolean) => void, + onServerInfoUpdate_: (a: unknown) => void, + authTokenProvider_: AuthTokenProvider, + appCheckTokenProvider_: AppCheckTokenProvider, + authOverride_?: object | null + ); + protected sendRequest( + action: string, + body: unknown, + onResponse?: (a: unknown) => void + ): void; + get(query: QueryContext): Promise; + listen( + query: QueryContext, + currentHashFn: () => string, + tag: number | null, + onComplete: (a: string, b: unknown) => void + ): void; + private sendGet_; + private sendListen_; + private static warnOnListenWarnings_; + refreshAuthToken(token: string): void; + private reduceReconnectDelayIfAdminCredential_; + refreshAppCheckToken(token: string | null): void; + /** + * Attempts to authenticate with the given credentials. If the authentication attempt fails, it's triggered like + * a auth revoked (the connection is closed). + */ + tryAuth(): void; + /** + * Attempts to authenticate with the given token. If the authentication + * attempt fails, it's triggered like the token was revoked (the connection is + * closed). + */ + tryAppCheck(): void; + /** + * @inheritDoc + */ + unlisten(query: QueryContext, tag: number | null): void; + private sendUnlisten_; + onDisconnectPut( + pathString: string, + data: unknown, + onComplete?: (a: string, b: string) => void + ): void; + onDisconnectMerge( + pathString: string, + data: unknown, + onComplete?: (a: string, b: string) => void + ): void; + onDisconnectCancel( + pathString: string, + onComplete?: (a: string, b: string) => void + ): void; + private sendOnDisconnect_; + put( + pathString: string, + data: unknown, + onComplete?: (a: string, b: string) => void, + hash?: string + ): void; + merge( + pathString: string, + data: unknown, + onComplete: (a: string, b: string | null) => void, + hash?: string + ): void; + putInternal( + action: string, + pathString: string, + data: unknown, + onComplete: (a: string, b: string | null) => void, + hash?: string + ): void; + private sendPut_; + reportStats(stats: { [k: string]: unknown }): void; + private onDataMessage_; + private onDataPush_; + private onReady_; + private scheduleConnect_; + private initConnection_; + private onVisible_; + private onOnline_; + private onRealtimeDisconnect_; + private establishConnection_; + interrupt(reason: string): void; + resume(reason: string): void; + private handleTimestamp_; + private cancelSentTransactions_; + private onListenRevoked_; + private removeListen_; + private onAuthRevoked_; + private onAppCheckRevoked_; + private onSecurityDebugPacket_; + private restoreState_; + /** + * Sends client stats for first connection + */ + private sendConnectStats_; + private shouldReconnect_; +} + +declare class PriorityIndex extends Index { + compare(a: NamedNode, b: NamedNode): number; + isDefinedOn(node: Node_2): boolean; + indexedValueChanged(oldNode: Node_2, newNode: Node_2): boolean; + minPost(): NamedNode; + maxPost(): NamedNode; + makePost(indexValue: unknown, name: string): NamedNode; + /** + * @returns String representation for inclusion in a query spec + */ + toString(): string; +} + +/** + * Generates a new child location using a unique key and returns its + * `Reference`. + * + * This is the most common pattern for adding data to a collection of items. + * + * If you provide a value to `push()`, the value is written to the + * generated location. If you don't pass a value, nothing is written to the + * database and the child remains empty (but you can use the `Reference` + * elsewhere). + * + * The unique keys generated by `push()` are ordered by the current time, so the + * resulting list of items is chronologically sorted. The keys are also + * designed to be unguessable (they contain 72 random bits of entropy). + * + * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. + * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. + * + * @param parent - The parent location. + * @param value - Optional value to be written at the generated location. + * @returns Combined `Promise` and `Reference`; resolves when write is complete, + * but can be used immediately as the `Reference` to the child location. + */ +export declare function push( + parent: DatabaseReference, + value?: unknown +): ThenableReference; + +/** + * @license + * Copyright 2021 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. + */ +/** + * A `Query` sorts and filters the data at a Database location so only a subset + * of the child data is included. This can be used to order a collection of + * data by some attribute (for example, height of dinosaurs) as well as to + * restrict a large list of items (for example, chat messages) down to a number + * suitable for synchronizing to the client. Queries are created by chaining + * together one or more of the filter methods defined here. + * + * Just as with a `DatabaseReference`, you can receive data from a `Query` by using the + * `on*()` methods. You will only receive events and `DataSnapshot`s for the + * subset of the data that matches your query. + * + * See {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data} + * for more information. + */ +export declare interface Query extends QueryContext { + /** The `DatabaseReference` for the `Query`'s location. */ + readonly ref: DatabaseReference; + /** + * Returns whether or not the current and provided queries represent the same + * location, have the same query parameters, and are from the same instance of + * `FirebaseApp`. + * + * Two `DatabaseReference` objects are equivalent if they represent the same location + * and are from the same instance of `FirebaseApp`. + * + * Two `Query` objects are equivalent if they represent the same location, + * have the same query parameters, and are from the same instance of + * `FirebaseApp`. Equivalent queries share the same sort order, limits, and + * starting and ending points. + * + * @param other - The query to compare against. + * @returns Whether or not the current and provided queries are equivalent. + */ + isEqual(other: Query | null): boolean; + /** + * Returns a JSON-serializable representation of this object. + * + * @returns A JSON-serializable representation of this object. + */ + toJSON(): string; + /** + * Gets the absolute URL for this location. + * + * The `toString()` method returns a URL that is ready to be put into a + * browser, curl command, or a `refFromURL()` call. Since all of those expect + * the URL to be url-encoded, `toString()` returns an encoded URL. + * + * Append '.json' to the returned URL when typed into a browser to download + * JSON-formatted data. If the location is secured (that is, not publicly + * readable), you will get a permission-denied error. + * + * @returns The absolute URL for this location. + */ + toString(): string; +} + +/** + * Creates a new immutable instance of `Query` that is extended to also include + * additional query constraints. + * + * @param query - The Query instance to use as a base for the new constraints. + * @param queryConstraints - The list of `QueryConstraint`s to apply. + * @throws if any of the provided query constraints cannot be combined with the + * existing or new constraints. + */ +export declare function query( + query: Query, + ...queryConstraints: QueryConstraint[] +): Query; + +/** + * A `QueryConstraint` is used to narrow the set of documents returned by a + * Database query. `QueryConstraint`s are created by invoking {@link endAt}, + * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link + * limitToFirst}, {@link limitToLast}, {@link orderByChild}, + * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , + * {@link orderByValue} or {@link equalTo} and + * can then be passed to {@link query} to create a new query instance that + * also contains this `QueryConstraint`. + */ +export declare abstract class QueryConstraint { + /** The type of this query constraints */ + abstract readonly type: QueryConstraintType; + /** + * Takes the provided `Query` and returns a copy of the `Query` with this + * `QueryConstraint` applied. + */ + abstract _apply(query: _QueryImpl): _QueryImpl; +} + +/** Describes the different query constraints available in this SDK. */ +export declare type QueryConstraintType = + | 'endAt' + | 'endBefore' + | 'startAt' + | 'startAfter' + | 'limitToFirst' + | 'limitToLast' + | 'orderByChild' + | 'orderByKey' + | 'orderByPriority' + | 'orderByValue' + | 'equalTo'; + +declare interface QueryContext { + readonly _queryIdentifier: string; + readonly _queryObject: object; + readonly _repo: Repo; + readonly _path: Path; + readonly _queryParams: _QueryParams; +} + +/* Excluded from this release type: _QueryImpl */ + +/* Excluded from this release type: _QueryParams */ + +/** + * + * Returns a `Reference` representing the location in the Database + * corresponding to the provided path. If no path is provided, the `Reference` + * will point to the root of the Database. + * + * @param db - The database instance to obtain a reference for. + * @param path - Optional path representing the location the returned + * `Reference` will point. If not provided, the returned `Reference` will + * point to the root of the Database. + * @returns If a path is provided, a `Reference` + * pointing to the provided path. Otherwise, a `Reference` pointing to the + * root of the Database. + */ +export declare function ref(db: Database, path?: string): DatabaseReference; + +/* Excluded from this release type: _ReferenceImpl */ + +/** + * Returns a `Reference` representing the location in the Database + * corresponding to the provided Firebase URL. + * + * An exception is thrown if the URL is not a valid Firebase Database URL or it + * has a different domain than the current `Database` instance. + * + * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored + * and are not applied to the returned `Reference`. + * + * @param db - The database instance to obtain a reference for. + * @param url - The Firebase URL at which the returned `Reference` will + * point. + * @returns A `Reference` pointing to the provided + * Firebase URL. + */ +export declare function refFromURL( + db: Database, + url: string +): DatabaseReference; + +/** + * Removes the data at this Database location. + * + * Any data at child locations will also be deleted. + * + * The effect of the remove will be visible immediately and the corresponding + * event 'value' will be triggered. Synchronization of the remove to the + * Firebase servers will also be started, and the returned Promise will resolve + * when complete. If provided, the onComplete callback will be called + * asynchronously after synchronization has finished. + * + * @param ref - The location to remove. + * @returns Resolves when remove on server is complete. + */ +export declare function remove(ref: DatabaseReference): Promise; + +/** + * A connection to a single data repository. + */ +declare class Repo { + repoInfo_: RepoInfo; + forceRestClient_: boolean; + authTokenProvider_: AuthTokenProvider; + appCheckProvider_: AppCheckTokenProvider; + /** Key for uniquely identifying this repo, used in RepoManager */ + readonly key: string; + dataUpdateCount: number; + infoSyncTree_: SyncTree; + serverSyncTree_: SyncTree; + stats_: StatsCollection; + statsListener_: StatsListener | null; + eventQueue_: EventQueue; + nextWriteId_: number; + server_: ServerActions; + statsReporter_: StatsReporter; + infoData_: SnapshotHolder; + interceptServerDataCallback_: ((a: string, b: unknown) => void) | null; + /** A list of data pieces and paths to be set when this client disconnects. */ + onDisconnect_: SparseSnapshotTree; + /** Stores queues of outstanding transactions for Firebase locations. */ + transactionQueueTree_: Tree; + persistentConnection_: PersistentConnection | null; + constructor( + repoInfo_: RepoInfo, + forceRestClient_: boolean, + authTokenProvider_: AuthTokenProvider, + appCheckProvider_: AppCheckTokenProvider + ); + /** + * @returns The URL corresponding to the root of this Firebase. + */ + toString(): string; +} + +/** + * @license + * Copyright 2017 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. + */ +/** + * A class that holds metadata about a Repo object + */ +declare class RepoInfo { + readonly secure: boolean; + readonly namespace: string; + readonly webSocketOnly: boolean; + readonly nodeAdmin: boolean; + readonly persistenceKey: string; + readonly includeNamespaceInQueryParams: boolean; + readonly isUsingEmulator: boolean; + private _host; + private _domain; + internalHost: string; + /** + * @param host - Hostname portion of the url for the repo + * @param secure - Whether or not this repo is accessed over ssl + * @param namespace - The namespace represented by the repo + * @param webSocketOnly - Whether to prefer websockets over all other transports (used by Nest). + * @param nodeAdmin - Whether this instance uses Admin SDK credentials + * @param persistenceKey - Override the default session persistence storage key + */ + constructor( + host: string, + secure: boolean, + namespace: string, + webSocketOnly: boolean, + nodeAdmin?: boolean, + persistenceKey?: string, + includeNamespaceInQueryParams?: boolean, + isUsingEmulator?: boolean + ); + isCacheableHost(): boolean; + isCustomHost(): boolean; + get host(): string; + set host(newHost: string); + toString(): string; + toURLString(): string; +} + +/* Excluded from this release type: _repoManagerDatabaseFromApp */ + +/** + * Atomically modifies the data at this location. + * + * Atomically modify the data at this location. Unlike a normal `set()`, which + * just overwrites the data regardless of its previous value, `runTransaction()` is + * used to modify the existing value to a new value, ensuring there are no + * conflicts with other clients writing to the same location at the same time. + * + * To accomplish this, you pass `runTransaction()` an update function which is + * used to transform the current value into a new value. If another client + * writes to the location before your new value is successfully written, your + * update function will be called again with the new current value, and the + * write will be retried. This will happen repeatedly until your write succeeds + * without conflict or you abort the transaction by not returning a value from + * your update function. + * + * Note: Modifying data with `set()` will cancel any pending transactions at + * that location, so extreme care should be taken if mixing `set()` and + * `runTransaction()` to update the same data. + * + * Note: When using transactions with Security and Firebase Rules in place, be + * aware that a client needs `.read` access in addition to `.write` access in + * order to perform a transaction. This is because the client-side nature of + * transactions requires the client to read the data in order to transactionally + * update it. + * + * @param ref - The location to atomically modify. + * @param transactionUpdate - A developer-supplied function which will be passed + * the current data stored at this location (as a JavaScript object). The + * function should return the new value it would like written (as a JavaScript + * object). If `undefined` is returned (i.e. you return with no arguments) the + * transaction will be aborted and the data at this location will not be + * modified. + * @param options - An options object to configure transactions. + * @returns A `Promise` that can optionally be used instead of the `onComplete` + * callback to handle success and failure. + */ +export declare function runTransaction( + ref: DatabaseReference, + transactionUpdate: (currentData: any) => unknown, + options?: TransactionOptions +): Promise; + +/** + * Interface defining the set of actions that can be performed against the Firebase server + * (basically corresponds to our wire protocol). + * + * @interface + */ +declare abstract class ServerActions { + abstract listen( + query: QueryContext, + currentHashFn: () => string, + tag: number | null, + onComplete: (a: string, b: unknown) => void + ): void; + /** + * Remove a listen. + */ + abstract unlisten(query: QueryContext, tag: number | null): void; + /** + * Get the server value satisfying this query. + */ + abstract get(query: QueryContext): Promise; + put( + pathString: string, + data: unknown, + onComplete?: (a: string, b: string) => void, + hash?: string + ): void; + merge( + pathString: string, + data: unknown, + onComplete: (a: string, b: string | null) => void, + hash?: string + ): void; + /** + * Refreshes the auth token for the current connection. + * @param token - The authentication token + */ + refreshAuthToken(token: string): void; + /** + * Refreshes the app check token for the current connection. + * @param token The app check token + */ + refreshAppCheckToken(token: string): void; + onDisconnectPut( + pathString: string, + data: unknown, + onComplete?: (a: string, b: string) => void + ): void; + onDisconnectMerge( + pathString: string, + data: unknown, + onComplete?: (a: string, b: string) => void + ): void; + onDisconnectCancel( + pathString: string, + onComplete?: (a: string, b: string) => void + ): void; + reportStats(stats: { [k: string]: unknown }): void; +} + +/** + * @license + * Copyright 2020 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. + */ +/** + * Returns a placeholder value for auto-populating the current timestamp (time + * since the Unix epoch, in milliseconds) as determined by the Firebase + * servers. + */ +export declare function serverTimestamp(): object; + +/** + * Writes data to this Database location. + * + * This will overwrite any data at this location and all child locations. + * + * The effect of the write will be visible immediately, and the corresponding + * events ("value", "child_added", etc.) will be triggered. Synchronization of + * the data to the Firebase servers will also be started, and the returned + * Promise will resolve when complete. If provided, the `onComplete` callback + * will be called asynchronously after synchronization has finished. + * + * Passing `null` for the new value is equivalent to calling `remove()`; namely, + * all data at this location and all child locations will be deleted. + * + * `set()` will remove any priority stored at this location, so if priority is + * meant to be preserved, you need to use `setWithPriority()` instead. + * + * Note that modifying data with `set()` will cancel any pending transactions + * at that location, so extreme care should be taken if mixing `set()` and + * `transaction()` to modify the same data. + * + * A single `set()` will generate a single "value" event at the location where + * the `set()` was performed. + * + * @param ref - The location to write to. + * @param value - The value to be written (string, number, boolean, object, + * array, or null). + * @returns Resolves when write to server is complete. + */ +export declare function set( + ref: DatabaseReference, + value: unknown +): Promise; + +/** + * Sets a priority for the data at this Database location. + * + * Applications need not use priority but can order collections by + * ordinary properties (see + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} + * ). + * + * @param ref - The location to write to. + * @param priority - The priority to be written (string, number, or null). + * @returns Resolves when write to server is complete. + */ +export declare function setPriority( + ref: DatabaseReference, + priority: string | number | null +): Promise; + +/* Excluded from this release type: _setSDKVersion */ + +/** + * Writes data the Database location. Like `set()` but also specifies the + * priority for that data. + * + * Applications need not use priority but can order collections by + * ordinary properties (see + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} + * ). + * + * @param ref - The location to write to. + * @param value - The value to be written (string, number, boolean, object, + * array, or null). + * @param priority - The priority to be written (string, number, or null). + * @returns Resolves when write to server is complete. + */ +export declare function setWithPriority( + ref: DatabaseReference, + value: unknown, + priority: string | number | null +): Promise; + +/** + * Mutable object which basically just stores a reference to the "latest" immutable snapshot. + */ +declare class SnapshotHolder { + private rootNode_; + getNode(path: Path): Node_2; + updateSnapshot(path: Path, newSnapshotNode: Node_2): void; +} + +/** + * An immutable sorted map implementation, based on a Left-leaning Red-Black + * tree. + */ +declare class SortedMap { + private comparator_; + private root_; + /** + * Always use the same empty node, to reduce memory. + */ + static EMPTY_NODE: LLRBEmptyNode; + /** + * @param comparator_ - Key comparator. + * @param root_ - Optional root node for the map. + */ + constructor( + comparator_: Comparator, + root_?: LLRBNode | LLRBEmptyNode + ); + /** + * Returns a copy of the map, with the specified key/value added or replaced. + * (TODO: We should perhaps rename this method to 'put') + * + * @param key - Key to be added. + * @param value - Value to be added. + * @returns New map, with item added. + */ + insert(key: K, value: V): SortedMap; + /** + * Returns a copy of the map, with the specified key removed. + * + * @param key - The key to remove. + * @returns New map, with item removed. + */ + remove(key: K): SortedMap; + /** + * Returns the value of the node with the given key, or null. + * + * @param key - The key to look up. + * @returns The value of the node with the given key, or null if the + * key doesn't exist. + */ + get(key: K): V | null; + /** + * Returns the key of the item *before* the specified key, or null if key is the first item. + * @param key - The key to find the predecessor of + * @returns The predecessor key. + */ + getPredecessorKey(key: K): K | null; + /** + * @returns True if the map is empty. + */ + isEmpty(): boolean; + /** + * @returns The total number of nodes in the map. + */ + count(): number; + /** + * @returns The minimum key in the map. + */ + minKey(): K | null; + /** + * @returns The maximum key in the map. + */ + maxKey(): K | null; + /** + * Traverses the map in key order and calls the specified action function + * for each key/value pair. + * + * @param action - Callback function to be called + * for each key/value pair. If action returns true, traversal is aborted. + * @returns The first truthy value returned by action, or the last falsey + * value returned by action + */ + inorderTraversal(action: (k: K, v: V) => unknown): boolean; + /** + * Traverses the map in reverse key order and calls the specified action function + * for each key/value pair. + * + * @param action - Callback function to be called + * for each key/value pair. If action returns true, traversal is aborted. + * @returns True if the traversal was aborted. + */ + reverseTraversal(action: (k: K, v: V) => void): boolean; + /** + * Returns an iterator over the SortedMap. + * @returns The iterator. + */ + getIterator( + resultGenerator?: (k: K, v: V) => T + ): SortedMapIterator; + getIteratorFrom( + key: K, + resultGenerator?: (k: K, v: V) => T + ): SortedMapIterator; + getReverseIteratorFrom( + key: K, + resultGenerator?: (k: K, v: V) => T + ): SortedMapIterator; + getReverseIterator( + resultGenerator?: (k: K, v: V) => T + ): SortedMapIterator; +} + +/** + * An iterator over an LLRBNode. + */ +declare class SortedMapIterator { + private isReverse_; + private resultGenerator_; + private nodeStack_; + /** + * @param node - Node to iterate. + * @param isReverse_ - Whether or not to iterate in reverse + */ + constructor( + node: LLRBNode | LLRBEmptyNode, + startKey: K | null, + comparator: Comparator, + isReverse_: boolean, + resultGenerator_?: ((k: K, v: V) => T) | null + ); + getNext(): T; + hasNext(): boolean; + peek(): T; +} + +/** + * Helper class to store a sparse set of snapshots. + */ +declare interface SparseSnapshotTree { + value: Node_2 | null; + readonly children: Map; +} + +/** + * Creates a `QueryConstraint` with the specified starting point (exclusive). + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The starting point is exclusive. If only a value is provided, children + * with a value greater than the specified value will be included in the query. + * If a key is specified, then children must have a value greater than or equal + * to the specified value and a a key name greater than the specified key. + * + * @param value - The value to start after. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to start after. This argument is only allowed if + * ordering by child, value, or priority. + */ +export declare function startAfter( + value: number | string | boolean | null, + key?: string +): QueryConstraint; + +/** + * Creates a `QueryConstraint` with the specified starting point. + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The starting point is inclusive, so children with exactly the specified value + * will be included in the query. The optional key argument can be used to + * further limit the range of the query. If it is specified, then children that + * have exactly the specified value must also have a key name greater than or + * equal to the specified key. + * + * You can read more about `startAt()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param value - The value to start at. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to start at. This argument is only allowed if + * ordering by child, value, or priority. + */ +export declare function startAt( + value?: number | string | boolean | null, + key?: string +): QueryConstraint; + +/** + * @license + * Copyright 2017 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. + */ +/** + * Tracks a collection of stats. + */ +declare class StatsCollection { + private counters_; + incrementCounter(name: string, amount?: number): void; + get(): { + [k: string]: number; + }; +} + +/** + * Returns the delta from the previous call to get stats. + * + * @param collection_ - The collection to "listen" to. + */ +declare class StatsListener { + private collection_; + private last_; + constructor(collection_: StatsCollection); + get(): { + [k: string]: number; + }; +} + +declare class StatsReporter { + private server_; + private statsListener_; + statsToReport_: { + [k: string]: boolean; + }; + constructor(collection: StatsCollection, server_: ServerActions); + private reportStats_; +} + +/** + * SyncPoint represents a single location in a SyncTree with 1 or more event registrations, meaning we need to + * maintain 1 or more Views at this location to cache server data and raise appropriate events for server changes + * and user writes (set, transaction, update). + * + * It's responsible for: + * - Maintaining the set of 1 or more views necessary at this location (a SyncPoint with 0 views should be removed). + * - Proxying user / server operations to the views as appropriate (i.e. applyServerOverwrite, + * applyUserOverwrite, etc.) + */ +declare class SyncPoint { + /** + * The Views being tracked at this location in the tree, stored as a map where the key is a + * queryId and the value is the View for that query. + * + * NOTE: This list will be quite small (usually 1, but perhaps 2 or 3; any more is an odd use case). + */ + readonly views: Map; +} + +/** + * SyncTree is the central class for managing event callback registration, data caching, views + * (query processing), and event generation. There are typically two SyncTree instances for + * each Repo, one for the normal Firebase data, and one for the .info data. + * + * It has a number of responsibilities, including: + * - Tracking all user event callbacks (registered via addEventRegistration() and removeEventRegistration()). + * - Applying and caching data changes for user set(), transaction(), and update() calls + * (applyUserOverwrite(), applyUserMerge()). + * - Applying and caching data changes for server data changes (applyServerOverwrite(), + * applyServerMerge()). + * - Generating user-facing events for server and user changes (all of the apply* methods + * return the set of events that need to be raised as a result). + * - Maintaining the appropriate set of server listens to ensure we are always subscribed + * to the correct set of paths and queries to satisfy the current set of user event + * callbacks (listens are started/stopped using the provided listenProvider). + * + * NOTE: Although SyncTree tracks event callbacks and calculates events to raise, the actual + * events are returned to the caller rather than raised synchronously. + * + */ +declare class SyncTree { + listenProvider_: ListenProvider; + /** + * Tree of SyncPoints. There's a SyncPoint at any location that has 1 or more views. + */ + syncPointTree_: ImmutableTree; + /** + * A tree of all pending user writes (user-initiated set()'s, transaction()'s, update()'s, etc.). + */ + pendingWriteTree_: WriteTree; + readonly tagToQueryMap: Map; + readonly queryToTagMap: Map; + /** + * @param listenProvider_ - Used by SyncTree to start / stop listening + * to server data. + */ + constructor(listenProvider_: ListenProvider); +} + +/* Excluded from this release type: _TEST_ACCESS_forceRestClient */ + +/* Excluded from this release type: _TEST_ACCESS_hijackHash */ + +/** + * A `Promise` that can also act as a `DatabaseReference` when returned by + * {@link push}. The reference is available immediately and the `Promise` resolves + * as the write to the backend completes. + */ +export declare interface ThenableReference + extends DatabaseReference, + Pick, 'then' | 'catch'> {} + +declare interface Transaction { + path: Path; + update: (a: unknown) => unknown; + onComplete: ( + error: Error | null, + committed: boolean, + node: Node_2 | null + ) => void; + status: TransactionStatus; + order: number; + applyLocally: boolean; + retryCount: number; + unwatcher: () => void; + abortReason: string | null; + currentWriteId: number; + currentInputSnapshot: Node_2 | null; + currentOutputSnapshotRaw: Node_2 | null; + currentOutputSnapshotResolved: Node_2 | null; +} + +/** An options object to configure transactions. */ +export declare interface TransactionOptions { + /** + * By default, events are raised each time the transaction update function + * runs. So if it is run multiple times, you may see intermediate states. You + * can set this to false to suppress these intermediate states and instead + * wait until the transaction has completed before events are raised. + */ + readonly applyLocally?: boolean; +} + +/** + * A type for the resolve value of {@link runTransaction}. + */ +export declare class TransactionResult { + /** Whether the transaction was successfully committed. */ + readonly committed: boolean; + /** The resulting data snapshot. */ + readonly snapshot: DataSnapshot; + /** @hideconstructor */ + constructor( + /** Whether the transaction was successfully committed. */ + committed: boolean, + /** The resulting data snapshot. */ + snapshot: DataSnapshot + ); + /** Returns a JSON-serializable representation of this object. */ + toJSON(): object; +} + +declare const enum TransactionStatus { + RUN = 0, + SENT = 1, + COMPLETED = 2, + SENT_NEEDS_ABORT = 3, + NEEDS_ABORT = 4 +} + +/** + * A light-weight tree, traversable by path. Nodes can have both values and children. + * Nodes are not enumerated (by forEachChild) unless they have a value or non-empty + * children. + */ +declare class Tree { + readonly name: string; + readonly parent: Tree | null; + node: TreeNode; + /** + * @param name - Optional name of the node. + * @param parent - Optional parent node. + * @param node - Optional node to wrap. + */ + constructor(name?: string, parent?: Tree | null, node?: TreeNode); +} + +/** + * Node in a Tree. + */ +declare interface TreeNode { + children: Record>; + childCount: number; + value?: T; +} + +/** A callback that can invoked to remove a listener. */ +export declare type Unsubscribe = () => void; + +/** + * Writes multiple values to the Database at once. + * + * The `values` argument contains multiple property-value pairs that will be + * written to the Database together. Each child property can either be a simple + * property (for example, "name") or a relative path (for example, + * "name/first") from the current location to the data to update. + * + * As opposed to the `set()` method, `update()` can be use to selectively update + * only the referenced properties at the current location (instead of replacing + * all the child properties at the current location). + * + * The effect of the write will be visible immediately, and the corresponding + * events ('value', 'child_added', etc.) will be triggered. Synchronization of + * the data to the Firebase servers will also be started, and the returned + * Promise will resolve when complete. If provided, the `onComplete` callback + * will be called asynchronously after synchronization has finished. + * + * A single `update()` will generate a single "value" event at the location + * where the `update()` was performed, regardless of how many children were + * modified. + * + * Note that modifying data with `update()` will cancel any pending + * transactions at that location, so extreme care should be taken if mixing + * `update()` and `transaction()` to modify the same data. + * + * Passing `null` to `update()` will remove the data at this location. + * + * See + * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. + * + * @param ref - The location to write to. + * @param values - Object containing multiple values. + * @returns Resolves when update on server is complete. + */ +export declare function update( + ref: DatabaseReference, + values: object +): Promise; + +/* Excluded from this release type: _UserCallback */ + +/* Excluded from this release type: _validatePathString */ + +/* Excluded from this release type: _validateWritablePath */ + +/** + * A view represents a specific location and query that has 1 or more event registrations. + * + * It does several things: + * - Maintains the list of event registrations for this location/query. + * - Maintains a cache of the data visible for this location/query. + * - Applies new operations (via applyOperation), updates the cache, and based on the event + * registrations returns the set of events to be raised. + */ +declare class View { + private query_; + processor_: ViewProcessor; + viewCache_: ViewCache; + eventRegistrations_: EventRegistration[]; + eventGenerator_: EventGenerator; + constructor(query_: QueryContext, initialViewCache: ViewCache); + get query(): QueryContext; +} + +/** + * Stores the data we have cached for a view. + * + * serverSnap is the cached server data, eventSnap is the cached event data (server data plus any local writes). + */ +declare interface ViewCache { + readonly eventCache: CacheNode; + readonly serverCache: CacheNode; +} + +declare interface ViewProcessor { + readonly filter: NodeFilter_2; +} + +/** + * Defines a single user-initiated write operation. May be the result of a set(), transaction(), or update() call. In + * the case of a set() or transaction, snap will be non-null. In the case of an update(), children will be non-null. + */ +declare interface WriteRecord { + writeId: number; + path: Path; + snap?: Node_2 | null; + children?: { + [k: string]: Node_2; + } | null; + visible: boolean; +} + +/** + * WriteTree tracks all pending user-initiated writes and has methods to calculate the result of merging them + * with underlying server data (to create "event cache" data). Pending writes are added with addOverwrite() + * and addMerge(), and removed with removeWrite(). + */ +declare interface WriteTree { + /** + * A tree tracking the result of applying all visible writes. This does not include transactions with + * applyLocally=false or writes that are completely shadowed by other writes. + */ + visibleWrites: CompoundWrite; + /** + * A list of all pending writes, regardless of visibility and shadowed-ness. Used to calculate arbitrary + * sets of the changed data, such as hidden writes (from transactions) or changes with certain writes excluded (also + * used by transactions). + */ + allWrites: WriteRecord[]; + lastWriteId: number; +} + +export {}; diff --git a/repo-scripts/prune-dts/tests/database.output.d.ts b/repo-scripts/prune-dts/tests/database.output.d.ts new file mode 100644 index 00000000000..8c0d0bd4f77 --- /dev/null +++ b/repo-scripts/prune-dts/tests/database.output.d.ts @@ -0,0 +1,1584 @@ +/** + * Firebase Realtime Database + * + * @packageDocumentation + */ +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { AppCheckTokenListener } from '@firebase/app-check-interop-types'; +import { AppCheckTokenResult } from '@firebase/app-check-interop-types'; +import { EmulatorMockTokenOptions } from '@firebase/util'; +import { FirebaseApp } from '@firebase/app'; +import { FirebaseApp as FirebaseApp_2 } from '@firebase/app-types'; +import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; +import { FirebaseAuthInternal } from '@firebase/auth-interop-types'; +import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; +import { FirebaseAuthTokenData } from '@firebase/app-types/private'; +import { Provider } from '@firebase/component'; +/** + * Gets a `Reference` for the location at the specified relative path. + * + * The relative path can either be a simple child name (for example, "ada") or + * a deeper slash-separated path (for example, "ada/name/first"). + * + * @param parent - The parent location. + * @param path - A relative path from this location to the desired child + * location. + * @returns The specified child location. + */ +export declare function child( + parent: DatabaseReference, + path: string +): DatabaseReference; +/** + * Modify the provided instance to communicate with the Realtime Database + * emulator. + * + *

Note: This method must be called before performing any other operation. + * + * @param db - The instance to modify. + * @param host - The emulator host (ex: localhost) + * @param port - The emulator port (ex: 8080) + * @param options.mockUserToken - the mock auth token to use for unit testing Security Rules + */ +export declare function connectDatabaseEmulator( + db: Database, + host: string, + port: number, + options?: { + mockUserToken?: EmulatorMockTokenOptions | string; + } +): void; +/** + * Class representing a Firebase Realtime Database. + */ +export declare class Database { + /** The {@link @firebase/app#FirebaseApp} associated with this Realtime Database instance. */ + readonly app: FirebaseApp; + /** Represents a `Database` instance. */ + readonly 'type' = 'database'; + private constructor(); +} +/** + * A `DatabaseReference` represents a specific location in your Database and can be used + * for reading or writing data to that Database location. + * + * You can reference the root or child location in your Database by calling + * `ref()` or `ref("child/path")`. + * + * Writing is done with the `set()` method and reading can be done with the + * `on*()` method. See {@link + * https://firebase.google.com/docs/database/web/read-and-write} + */ +export declare interface DatabaseReference extends Query { + /** + * The last part of the `DatabaseReference`'s path. + * + * For example, `"ada"` is the key for + * `https://.firebaseio.com/users/ada`. + * + * The key of a root `DatabaseReference` is `null`. + */ + readonly key: string | null; + /** + * The parent location of a `DatabaseReference`. + * + * The parent of a root `DatabaseReference` is `null`. + */ + readonly parent: DatabaseReference | null; + /** The root `DatabaseReference` of the Database. */ + readonly root: DatabaseReference; +} +/** + * A `DataSnapshot` contains data from a Database location. + * + * Any time you read data from the Database, you receive the data as a + * `DataSnapshot`. A `DataSnapshot` is passed to the event callbacks you attach + * with `on()` or `once()`. You can extract the contents of the snapshot as a + * JavaScript object by calling the `val()` method. Alternatively, you can + * traverse into the snapshot by calling `child()` to return child snapshots + * (which you could then call `val()` on). + * + * A `DataSnapshot` is an efficiently generated, immutable copy of the data at + * a Database location. It cannot be modified and will never change (to modify + * data, you always call the `set()` method on a `Reference` directly). + */ +export declare class DataSnapshot { + /** + * The location of this DataSnapshot. + */ + readonly ref: DatabaseReference; + private constructor(); + /** + * Gets the priority value of the data in this `DataSnapshot`. + * + * Applications need not use priority but can order collections by + * ordinary properties (see + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data |Sorting and filtering data} + * ). + */ + get priority(): string | number | null; + /** + * The key (last part of the path) of the location of this `DataSnapshot`. + * + * The last token in a Database location is considered its key. For example, + * "ada" is the key for the /users/ada/ node. Accessing the key on any + * `DataSnapshot` will return the key for the location that generated it. + * However, accessing the key on the root URL of a Database will return + * `null`. + */ + get key(): string | null; + /** Returns the number of child properties of this `DataSnapshot`. */ + get size(): number; + /** + * Gets another `DataSnapshot` for the location at the specified relative path. + * + * Passing a relative path to the `child()` method of a DataSnapshot returns + * another `DataSnapshot` for the location at the specified relative path. The + * relative path can either be a simple child name (for example, "ada") or a + * deeper, slash-separated path (for example, "ada/name/first"). If the child + * location has no data, an empty `DataSnapshot` (that is, a `DataSnapshot` + * whose value is `null`) is returned. + * + * @param path - A relative path to the location of child data. + */ + child(path: string): DataSnapshot; + /** + * Returns true if this `DataSnapshot` contains any data. It is slightly more + * efficient than using `snapshot.val() !== null`. + */ + exists(): boolean; + /** + * Exports the entire contents of the DataSnapshot as a JavaScript object. + * + * The `exportVal()` method is similar to `val()`, except priority information + * is included (if available), making it suitable for backing up your data. + * + * @returns The DataSnapshot's contents as a JavaScript value (Object, + * Array, string, number, boolean, or `null`). + */ + exportVal(): any; + /** + * Enumerates the top-level children in the `IteratedDataSnapshot`. + * + * Because of the way JavaScript objects work, the ordering of data in the + * JavaScript object returned by `val()` is not guaranteed to match the + * ordering on the server nor the ordering of `onChildAdded()` events. That is + * where `forEach()` comes in handy. It guarantees the children of a + * `DataSnapshot` will be iterated in their query order. + * + * If no explicit `orderBy*()` method is used, results are returned + * ordered by key (unless priorities are used, in which case, results are + * returned by priority). + * + * @param action - A function that will be called for each child DataSnapshot. + * The callback can return true to cancel further enumeration. + * @returns true if enumeration was canceled due to your callback returning + * true. + */ + forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean; + /** + * Returns true if the specified child path has (non-null) data. + * + * @param path - A relative path to the location of a potential child. + * @returns `true` if data exists at the specified child path; else + * `false`. + */ + hasChild(path: string): boolean; + /** + * Returns whether or not the `DataSnapshot` has any non-`null` child + * properties. + * + * You can use `hasChildren()` to determine if a `DataSnapshot` has any + * children. If it does, you can enumerate them using `forEach()`. If it + * doesn't, then either this snapshot contains a primitive value (which can be + * retrieved with `val()`) or it is empty (in which case, `val()` will return + * `null`). + * + * @returns true if this snapshot has any children; else false. + */ + hasChildren(): boolean; + /** + * Returns a JSON-serializable representation of this object. + */ + toJSON(): object | null; + /** + * Extracts a JavaScript value from a `DataSnapshot`. + * + * Depending on the data in a `DataSnapshot`, the `val()` method may return a + * scalar type (string, number, or boolean), an array, or an object. It may + * also return null, indicating that the `DataSnapshot` is empty (contains no + * data). + * + * @returns The DataSnapshot's contents as a JavaScript value (Object, + * Array, string, number, boolean, or `null`). + */ + val(): any; +} +export { EmulatorMockTokenOptions }; +/** + * Logs debugging information to the console. + * + * @param enabled - Enables logging if `true`, disables logging if `false`. + * @param persistent - Remembers the logging state between page refreshes if + * `true`. + */ +export declare function enableLogging( + enabled: boolean, + persistent?: boolean +): any; +/** + * Logs debugging information to the console. + * + * @param logger - A custom logger function to control how things get logged. + */ +export declare function enableLogging( + logger: (message: string) => unknown +): any; +/** + * Creates a `QueryConstraint` with the specified ending point. + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The ending point is inclusive, so children with exactly the specified value + * will be included in the query. The optional key argument can be used to + * further limit the range of the query. If it is specified, then children that + * have exactly the specified value must also have a key name less than or equal + * to the specified key. + * + * You can read more about `endAt()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param value - The value to end at. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to end at, among the children with the previously + * specified priority. This argument is only allowed if ordering by child, + * value, or priority. + */ +export declare function endAt( + value: number | string | boolean | null, + key?: string +): QueryConstraint; +/** + * Creates a `QueryConstraint` with the specified ending point (exclusive). + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The ending point is exclusive. If only a value is provided, children + * with a value less than the specified value will be included in the query. + * If a key is specified, then children must have a value less than or equal + * to the specified value and a key name less than the specified key. + * + * @param value - The value to end before. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to end before, among the children with the + * previously specified priority. This argument is only allowed if ordering by + * child, value, or priority. + */ +export declare function endBefore( + value: number | string | boolean | null, + key?: string +): QueryConstraint; +/** + * Creates a `QueryConstraint` that includes children that match the specified + * value. + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The optional key argument can be used to further limit the range of the + * query. If it is specified, then children that have exactly the specified + * value must also have exactly the specified key as their key name. This can be + * used to filter result sets with many matches for the same value. + * + * You can read more about `equalTo()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param value - The value to match for. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to start at, among the children with the + * previously specified priority. This argument is only allowed if ordering by + * child, value, or priority. + */ +export declare function equalTo( + value: number | string | boolean | null, + key?: string +): QueryConstraint; +/** + * One of the following strings: "value", "child_added", "child_changed", + * "child_removed", or "child_moved." + */ +export declare type EventType = + | 'value' + | 'child_added' + | 'child_changed' + | 'child_moved' + | 'child_removed'; +/* Excluded from this release type: _FirebaseService */ +/** + * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL. + */ +export declare function forceLongPolling(): void; +/** + * Force the use of websockets instead of longPolling. + */ +export declare function forceWebSockets(): void; +/** + * Gets the most up-to-date result for this query. + * + * @param query - The query to run. + * @returns A `Promise` which resolves to the resulting DataSnapshot if a value is + * available, or rejects if the client is unable to return a value (e.g., if the + * server is unreachable and there is nothing cached). + */ +export declare function get(query: Query): Promise; +/** + * Returns the instance of the Realtime Database SDK that is associated with the provided + * {@link @firebase/app#FirebaseApp}. Initializes a new instance with default settings if + * no instance exists or if the existing instance uses a custom database URL. + * + * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime + * Database instance is associated with. + * @param url - The URL of the Realtime Database instance to connect to. If not + * provided, the SDK connects to the default instance of the Firebase App. + * @returns The `Database` instance of the provided app. + */ +export declare function getDatabase(app?: FirebaseApp, url?: string): Database; +/** + * Disconnects from the server (all Database operations will be completed + * offline). + * + * The client automatically maintains a persistent connection to the Database + * server, which will remain active indefinitely and reconnect when + * disconnected. However, the `goOffline()` and `goOnline()` methods may be used + * to control the client connection in cases where a persistent connection is + * undesirable. + * + * While offline, the client will no longer receive data updates from the + * Database. However, all Database operations performed locally will continue to + * immediately fire events, allowing your application to continue behaving + * normally. Additionally, each operation performed locally will automatically + * be queued and retried upon reconnection to the Database server. + * + * To reconnect to the Database and begin receiving remote events, see + * `goOnline()`. + * + * @param db - The instance to disconnect. + */ +export declare function goOffline(db: Database): void; +/** + * Reconnects to the server and synchronizes the offline Database state + * with the server state. + * + * This method should be used after disabling the active connection with + * `goOffline()`. Once reconnected, the client will transmit the proper data + * and fire the appropriate events so that your client "catches up" + * automatically. + * + * @param db - The instance to reconnect. + */ +export declare function goOnline(db: Database): void; +/** + * Returns a placeholder value that can be used to atomically increment the + * current database value by the provided delta. + * + * @param delta - the amount to modify the current value atomically. + * @returns A placeholder value for modifying data atomically server-side. + */ +export declare function increment(delta: number): object; +/* Excluded from this release type: _initStandalone */ +/** + * Represents a child snapshot of a `Reference` that is being iterated over. The key will never be undefined. + */ +export declare interface IteratedDataSnapshot extends DataSnapshot { + key: string; +} +/** + * Creates a new `QueryConstraint` that if limited to the first specific number + * of children. + * + * The `limitToFirst()` method is used to set a maximum number of children to be + * synced for a given callback. If we set a limit of 100, we will initially only + * receive up to 100 `child_added` events. If we have fewer than 100 messages + * stored in our Database, a `child_added` event will fire for each message. + * However, if we have over 100 messages, we will only receive a `child_added` + * event for the first 100 ordered messages. As items change, we will receive + * `child_removed` events for each item that drops out of the active list so + * that the total number stays at 100. + * + * You can read more about `limitToFirst()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param limit - The maximum number of nodes to include in this query. + */ +export declare function limitToFirst(limit: number): QueryConstraint; +/** + * Creates a new `QueryConstraint` that is limited to return only the last + * specified number of children. + * + * The `limitToLast()` method is used to set a maximum number of children to be + * synced for a given callback. If we set a limit of 100, we will initially only + * receive up to 100 `child_added` events. If we have fewer than 100 messages + * stored in our Database, a `child_added` event will fire for each message. + * However, if we have over 100 messages, we will only receive a `child_added` + * event for the last 100 ordered messages. As items change, we will receive + * `child_removed` events for each item that drops out of the active list so + * that the total number stays at 100. + * + * You can read more about `limitToLast()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param limit - The maximum number of nodes to include in this query. + */ +export declare function limitToLast(limit: number): QueryConstraint; +/** An options objects that can be used to customize a listener. */ +export declare interface ListenOptions { + /** Whether to remove the listener after its first invocation. */ + readonly onlyOnce?: boolean; +} +/** + * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener. + * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from + * the respective `on*` callbacks. + * + * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener + * will not automatically remove listeners registered on child nodes, `off()` + * must also be called on any child listeners to remove the callback. + * + * If a callback is not specified, all callbacks for the specified eventType + * will be removed. Similarly, if no eventType is specified, all callbacks + * for the `Reference` will be removed. + * + * Individual listeners can also be removed by invoking their unsubscribe + * callbacks. + * + * @param query - The query that the listener was registered with. + * @param eventType - One of the following strings: "value", "child_added", + * "child_changed", "child_removed", or "child_moved." If omitted, all callbacks + * for the `Reference` will be removed. + * @param callback - The callback function that was passed to `on()` or + * `undefined` to remove all callbacks. + */ +export declare function off( + query: Query, + eventType?: EventType, + callback?: ( + snapshot: DataSnapshot, + previousChildName?: string | null + ) => unknown +): void; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildAdded` event will be triggered once for each initial child at this + * location, and it will be triggered again every time a new child is added. The + * `DataSnapshot` passed into the callback will reflect the data for the + * relevant child. For ordering purposes, it is passed a second argument which + * is a string containing the key of the previous sibling child by sort order, + * or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildAdded( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName?: string | null + ) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildAdded` event will be triggered once for each initial child at this + * location, and it will be triggered again every time a new child is added. The + * `DataSnapshot` passed into the callback will reflect the data for the + * relevant child. For ordering purposes, it is passed a second argument which + * is a string containing the key of the previous sibling child by sort order, + * or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildAdded( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildAdded` event will be triggered once for each initial child at this + * location, and it will be triggered again every time a new child is added. The + * `DataSnapshot` passed into the callback will reflect the data for the + * relevant child. For ordering purposes, it is passed a second argument which + * is a string containing the key of the previous sibling child by sort order, + * or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildAdded( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildChanged` event will be triggered when the data stored in a child + * (or any of its descendants) changes. Note that a single `child_changed` event + * may represent multiple changes to the child. The `DataSnapshot` passed to the + * callback will contain the new child contents. For ordering purposes, the + * callback is also passed a second argument which is a string containing the + * key of the previous sibling child by sort order, or `null` if it is the first + * child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildChanged( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildChanged` event will be triggered when the data stored in a child + * (or any of its descendants) changes. Note that a single `child_changed` event + * may represent multiple changes to the child. The `DataSnapshot` passed to the + * callback will contain the new child contents. For ordering purposes, the + * callback is also passed a second argument which is a string containing the + * key of the previous sibling child by sort order, or `null` if it is the first + * child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildChanged( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildChanged` event will be triggered when the data stored in a child + * (or any of its descendants) changes. Note that a single `child_changed` event + * may represent multiple changes to the child. The `DataSnapshot` passed to the + * callback will contain the new child contents. For ordering purposes, the + * callback is also passed a second argument which is a string containing the + * key of the previous sibling child by sort order, or `null` if it is the first + * child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildChanged( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildMoved` event will be triggered when a child's sort order changes + * such that its position relative to its siblings changes. The `DataSnapshot` + * passed to the callback will be for the data of the child that has moved. It + * is also passed a second argument which is a string containing the key of the + * previous sibling child by sort order, or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildMoved( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildMoved` event will be triggered when a child's sort order changes + * such that its position relative to its siblings changes. The `DataSnapshot` + * passed to the callback will be for the data of the child that has moved. It + * is also passed a second argument which is a string containing the key of the + * previous sibling child by sort order, or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildMoved( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildMoved` event will be triggered when a child's sort order changes + * such that its position relative to its siblings changes. The `DataSnapshot` + * passed to the callback will be for the data of the child that has moved. It + * is also passed a second argument which is a string containing the key of the + * previous sibling child by sort order, or `null` if it is the first child. + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildMoved( + query: Query, + callback: ( + snapshot: DataSnapshot, + previousChildName: string | null + ) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildRemoved` event will be triggered once every time a child is + * removed. The `DataSnapshot` passed into the callback will be the old data for + * the child that was removed. A child will get removed when either: + * + * - a client explicitly calls `remove()` on that child or one of its ancestors + * - a client calls `set(null)` on that child or one of its ancestors + * - that child has all of its children removed + * - there is a query in effect which now filters out the child (because it's + * sort order changed or the max limit was hit) + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildRemoved( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildRemoved` event will be triggered once every time a child is + * removed. The `DataSnapshot` passed into the callback will be the old data for + * the child that was removed. A child will get removed when either: + * + * - a client explicitly calls `remove()` on that child or one of its ancestors + * - a client calls `set(null)` on that child or one of its ancestors + * - that child has all of its children removed + * - there is a query in effect which now filters out the child (because it's + * sort order changed or the max limit was hit) + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildRemoved( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onChildRemoved` event will be triggered once every time a child is + * removed. The `DataSnapshot` passed into the callback will be the old data for + * the child that was removed. A child will get removed when either: + * + * - a client explicitly calls `remove()` on that child or one of its ancestors + * - a client calls `set(null)` on that child or one of its ancestors + * - that child has all of its children removed + * - there is a query in effect which now filters out the child (because it's + * sort order changed or the max limit was hit) + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. + * The callback will be passed a DataSnapshot and a string containing the key of + * the previous child, by sort order, or `null` if it is the first child. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onChildRemoved( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * The `onDisconnect` class allows you to write or clear data when your client + * disconnects from the Database server. These updates occur whether your + * client disconnects cleanly or not, so you can rely on them to clean up data + * even if a connection is dropped or a client crashes. + * + * The `onDisconnect` class is most commonly used to manage presence in + * applications where it is useful to detect how many clients are connected and + * when other clients disconnect. See + * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} + * for more information. + * + * To avoid problems when a connection is dropped before the requests can be + * transferred to the Database server, these functions should be called before + * writing any data. + * + * Note that `onDisconnect` operations are only triggered once. If you want an + * operation to occur each time a disconnect occurs, you'll need to re-establish + * the `onDisconnect` operations each time you reconnect. + */ +export declare class OnDisconnect { + private constructor(); + /** + * Cancels all previously queued `onDisconnect()` set or update events for this + * location and all children. + * + * If a write has been queued for this location via a `set()` or `update()` at a + * parent location, the write at this location will be canceled, though writes + * to sibling locations will still occur. + * + * @returns Resolves when synchronization to the server is complete. + */ + cancel(): Promise; + /** + * Ensures the data at this location is deleted when the client is disconnected + * (due to closing the browser, navigating to a new page, or network issues). + * + * @returns Resolves when synchronization to the server is complete. + */ + remove(): Promise; + /** + * Ensures the data at this location is set to the specified value when the + * client is disconnected (due to closing the browser, navigating to a new page, + * or network issues). + * + * `set()` is especially useful for implementing "presence" systems, where a + * value should be changed or cleared when a user disconnects so that they + * appear "offline" to other users. See + * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} + * for more information. + * + * Note that `onDisconnect` operations are only triggered once. If you want an + * operation to occur each time a disconnect occurs, you'll need to re-establish + * the `onDisconnect` operations each time. + * + * @param value - The value to be written to this location on disconnect (can + * be an object, array, string, number, boolean, or null). + * @returns Resolves when synchronization to the Database is complete. + */ + set(value: unknown): Promise; + /** + * Ensures the data at this location is set to the specified value and priority + * when the client is disconnected (due to closing the browser, navigating to a + * new page, or network issues). + * + * @param value - The value to be written to this location on disconnect (can + * be an object, array, string, number, boolean, or null). + * @param priority - The priority to be written (string, number, or null). + * @returns Resolves when synchronization to the Database is complete. + */ + setWithPriority( + value: unknown, + priority: number | string | null + ): Promise; + /** + * Writes multiple values at this location when the client is disconnected (due + * to closing the browser, navigating to a new page, or network issues). + * + * The `values` argument contains multiple property-value pairs that will be + * written to the Database together. Each child property can either be a simple + * property (for example, "name") or a relative path (for example, "name/first") + * from the current location to the data to update. + * + * As opposed to the `set()` method, `update()` can be use to selectively update + * only the referenced properties at the current location (instead of replacing + * all the child properties at the current location). + * + * @param values - Object containing multiple values. + * @returns Resolves when synchronization to the Database is complete. + */ + update(values: object): Promise; +} +/** + * Returns an `OnDisconnect` object - see + * {@link https://firebase.google.com/docs/database/web/offline-capabilities | Enabling Offline Capabilities in JavaScript} + * for more information on how to use it. + * + * @param ref - The reference to add OnDisconnect triggers for. + */ +export declare function onDisconnect(ref: DatabaseReference): OnDisconnect; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onValue` event will trigger once with the initial data stored at this + * location, and then trigger again each time the data changes. The + * `DataSnapshot` passed to the callback will be for the location at which + * `on()` was called. It won't trigger until the entire contents has been + * synchronized. If the location has no data, it will be triggered with an empty + * `DataSnapshot` (`val()` will return `null`). + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. The + * callback will be passed a DataSnapshot. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onValue( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + cancelCallback?: (error: Error) => unknown +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onValue` event will trigger once with the initial data stored at this + * location, and then trigger again each time the data changes. The + * `DataSnapshot` passed to the callback will be for the location at which + * `on()` was called. It won't trigger until the entire contents has been + * synchronized. If the location has no data, it will be triggered with an empty + * `DataSnapshot` (`val()` will return `null`). + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. The + * callback will be passed a DataSnapshot. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onValue( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Listens for data changes at a particular location. + * + * This is the primary way to read data from a Database. Your callback + * will be triggered for the initial data and again whenever the data changes. + * Invoke the returned unsubscribe callback to stop receiving updates. See + * {@link https://firebase.google.com/docs/database/web/retrieve-data | Retrieve Data on the Web} + * for more details. + * + * An `onValue` event will trigger once with the initial data stored at this + * location, and then trigger again each time the data changes. The + * `DataSnapshot` passed to the callback will be for the location at which + * `on()` was called. It won't trigger until the entire contents has been + * synchronized. If the location has no data, it will be triggered with an empty + * `DataSnapshot` (`val()` will return `null`). + * + * @param query - The query to run. + * @param callback - A callback that fires when the specified event occurs. The + * callback will be passed a DataSnapshot. + * @param cancelCallback - An optional callback that will be notified if your + * event subscription is ever canceled because your client does not have + * permission to read this data (or it had permission but has now lost it). + * This callback will be passed an `Error` object indicating why the failure + * occurred. + * @param options - An object that can be used to configure `onlyOnce`, which + * then removes the listener after its first invocation. + * @returns A function that can be invoked to remove the listener. + */ +export declare function onValue( + query: Query, + callback: (snapshot: DataSnapshot) => unknown, + cancelCallback: (error: Error) => unknown, + options: ListenOptions +): Unsubscribe; +/** + * Creates a new `QueryConstraint` that orders by the specified child key. + * + * Queries can only order by one key at a time. Calling `orderByChild()` + * multiple times on the same query is an error. + * + * Firebase queries allow you to order your data by any child key on the fly. + * However, if you know in advance what your indexes will be, you can define + * them via the .indexOn rule in your Security Rules for better performance. See + * the{@link https://firebase.google.com/docs/database/security/indexing-data} + * rule for more information. + * + * You can read more about `orderByChild()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. + * + * @param path - The path to order by. + */ +export declare function orderByChild(path: string): QueryConstraint; +/** + * Creates a new `QueryConstraint` that orders by the key. + * + * Sorts the results of a query by their (ascending) key values. + * + * You can read more about `orderByKey()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. + */ +export declare function orderByKey(): QueryConstraint; +/** + * Creates a new `QueryConstraint` that orders by priority. + * + * Applications need not use priority but can order collections by + * ordinary properties (see + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data} + * for alternatives to priority. + */ +export declare function orderByPriority(): QueryConstraint; +/** + * Creates a new `QueryConstraint` that orders by value. + * + * If the children of a query are all scalar values (string, number, or + * boolean), you can order the results by their (ascending) values. + * + * You can read more about `orderByValue()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sort_data | Sort data}. + */ +export declare function orderByValue(): QueryConstraint; +/** + * Generates a new child location using a unique key and returns its + * `Reference`. + * + * This is the most common pattern for adding data to a collection of items. + * + * If you provide a value to `push()`, the value is written to the + * generated location. If you don't pass a value, nothing is written to the + * database and the child remains empty (but you can use the `Reference` + * elsewhere). + * + * The unique keys generated by `push()` are ordered by the current time, so the + * resulting list of items is chronologically sorted. The keys are also + * designed to be unguessable (they contain 72 random bits of entropy). + * + * See {@link https://firebase.google.com/docs/database/web/lists-of-data#append_to_a_list_of_data | Append to a list of data}. + * See {@link https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html | The 2^120 Ways to Ensure Unique Identifiers}. + * + * @param parent - The parent location. + * @param value - Optional value to be written at the generated location. + * @returns Combined `Promise` and `Reference`; resolves when write is complete, + * but can be used immediately as the `Reference` to the child location. + */ +export declare function push( + parent: DatabaseReference, + value?: unknown +): ThenableReference; +/** + * @license + * Copyright 2021 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. + */ +/** + * A `Query` sorts and filters the data at a Database location so only a subset + * of the child data is included. This can be used to order a collection of + * data by some attribute (for example, height of dinosaurs) as well as to + * restrict a large list of items (for example, chat messages) down to a number + * suitable for synchronizing to the client. Queries are created by chaining + * together one or more of the filter methods defined here. + * + * Just as with a `DatabaseReference`, you can receive data from a `Query` by using the + * `on*()` methods. You will only receive events and `DataSnapshot`s for the + * subset of the data that matches your query. + * + * See {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data} + * for more information. + */ +export declare interface Query { + /** The `DatabaseReference` for the `Query`'s location. */ + readonly ref: DatabaseReference; + /** + * Returns whether or not the current and provided queries represent the same + * location, have the same query parameters, and are from the same instance of + * `FirebaseApp`. + * + * Two `DatabaseReference` objects are equivalent if they represent the same location + * and are from the same instance of `FirebaseApp`. + * + * Two `Query` objects are equivalent if they represent the same location, + * have the same query parameters, and are from the same instance of + * `FirebaseApp`. Equivalent queries share the same sort order, limits, and + * starting and ending points. + * + * @param other - The query to compare against. + * @returns Whether or not the current and provided queries are equivalent. + */ + isEqual(other: Query | null): boolean; + /** + * Returns a JSON-serializable representation of this object. + * + * @returns A JSON-serializable representation of this object. + */ + toJSON(): string; + /** + * Gets the absolute URL for this location. + * + * The `toString()` method returns a URL that is ready to be put into a + * browser, curl command, or a `refFromURL()` call. Since all of those expect + * the URL to be url-encoded, `toString()` returns an encoded URL. + * + * Append '.json' to the returned URL when typed into a browser to download + * JSON-formatted data. If the location is secured (that is, not publicly + * readable), you will get a permission-denied error. + * + * @returns The absolute URL for this location. + */ + toString(): string; +} +/** + * Creates a new immutable instance of `Query` that is extended to also include + * additional query constraints. + * + * @param query - The Query instance to use as a base for the new constraints. + * @param queryConstraints - The list of `QueryConstraint`s to apply. + * @throws if any of the provided query constraints cannot be combined with the + * existing or new constraints. + */ +export declare function query( + query: Query, + ...queryConstraints: QueryConstraint[] +): Query; +/** + * A `QueryConstraint` is used to narrow the set of documents returned by a + * Database query. `QueryConstraint`s are created by invoking {@link endAt}, + * {@link endBefore}, {@link startAt}, {@link startAfter}, {@link + * limitToFirst}, {@link limitToLast}, {@link orderByChild}, + * {@link orderByChild}, {@link orderByKey} , {@link orderByPriority} , + * {@link orderByValue} or {@link equalTo} and + * can then be passed to {@link query} to create a new query instance that + * also contains this `QueryConstraint`. + */ +export declare abstract class QueryConstraint { + /** The type of this query constraints */ + abstract readonly type: QueryConstraintType; +} +/** Describes the different query constraints available in this SDK. */ +export declare type QueryConstraintType = + | 'endAt' + | 'endBefore' + | 'startAt' + | 'startAfter' + | 'limitToFirst' + | 'limitToLast' + | 'orderByChild' + | 'orderByKey' + | 'orderByPriority' + | 'orderByValue' + | 'equalTo'; +/* Excluded from this release type: _QueryImpl */ +/* Excluded from this release type: _QueryParams */ +/** + * + * Returns a `Reference` representing the location in the Database + * corresponding to the provided path. If no path is provided, the `Reference` + * will point to the root of the Database. + * + * @param db - The database instance to obtain a reference for. + * @param path - Optional path representing the location the returned + * `Reference` will point. If not provided, the returned `Reference` will + * point to the root of the Database. + * @returns If a path is provided, a `Reference` + * pointing to the provided path. Otherwise, a `Reference` pointing to the + * root of the Database. + */ +export declare function ref(db: Database, path?: string): DatabaseReference; +/* Excluded from this release type: _ReferenceImpl */ +/** + * Returns a `Reference` representing the location in the Database + * corresponding to the provided Firebase URL. + * + * An exception is thrown if the URL is not a valid Firebase Database URL or it + * has a different domain than the current `Database` instance. + * + * Note that all query parameters (`orderBy`, `limitToLast`, etc.) are ignored + * and are not applied to the returned `Reference`. + * + * @param db - The database instance to obtain a reference for. + * @param url - The Firebase URL at which the returned `Reference` will + * point. + * @returns A `Reference` pointing to the provided + * Firebase URL. + */ +export declare function refFromURL( + db: Database, + url: string +): DatabaseReference; +/** + * Removes the data at this Database location. + * + * Any data at child locations will also be deleted. + * + * The effect of the remove will be visible immediately and the corresponding + * event 'value' will be triggered. Synchronization of the remove to the + * Firebase servers will also be started, and the returned Promise will resolve + * when complete. If provided, the onComplete callback will be called + * asynchronously after synchronization has finished. + * + * @param ref - The location to remove. + * @returns Resolves when remove on server is complete. + */ +export declare function remove(ref: DatabaseReference): Promise; +/* Excluded from this release type: _repoManagerDatabaseFromApp */ +/** + * Atomically modifies the data at this location. + * + * Atomically modify the data at this location. Unlike a normal `set()`, which + * just overwrites the data regardless of its previous value, `runTransaction()` is + * used to modify the existing value to a new value, ensuring there are no + * conflicts with other clients writing to the same location at the same time. + * + * To accomplish this, you pass `runTransaction()` an update function which is + * used to transform the current value into a new value. If another client + * writes to the location before your new value is successfully written, your + * update function will be called again with the new current value, and the + * write will be retried. This will happen repeatedly until your write succeeds + * without conflict or you abort the transaction by not returning a value from + * your update function. + * + * Note: Modifying data with `set()` will cancel any pending transactions at + * that location, so extreme care should be taken if mixing `set()` and + * `runTransaction()` to update the same data. + * + * Note: When using transactions with Security and Firebase Rules in place, be + * aware that a client needs `.read` access in addition to `.write` access in + * order to perform a transaction. This is because the client-side nature of + * transactions requires the client to read the data in order to transactionally + * update it. + * + * @param ref - The location to atomically modify. + * @param transactionUpdate - A developer-supplied function which will be passed + * the current data stored at this location (as a JavaScript object). The + * function should return the new value it would like written (as a JavaScript + * object). If `undefined` is returned (i.e. you return with no arguments) the + * transaction will be aborted and the data at this location will not be + * modified. + * @param options - An options object to configure transactions. + * @returns A `Promise` that can optionally be used instead of the `onComplete` + * callback to handle success and failure. + */ +export declare function runTransaction( + ref: DatabaseReference, + transactionUpdate: (currentData: any) => unknown, + options?: TransactionOptions +): Promise; +/** + * @license + * Copyright 2020 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. + */ +/** + * Returns a placeholder value for auto-populating the current timestamp (time + * since the Unix epoch, in milliseconds) as determined by the Firebase + * servers. + */ +export declare function serverTimestamp(): object; +/** + * Writes data to this Database location. + * + * This will overwrite any data at this location and all child locations. + * + * The effect of the write will be visible immediately, and the corresponding + * events ("value", "child_added", etc.) will be triggered. Synchronization of + * the data to the Firebase servers will also be started, and the returned + * Promise will resolve when complete. If provided, the `onComplete` callback + * will be called asynchronously after synchronization has finished. + * + * Passing `null` for the new value is equivalent to calling `remove()`; namely, + * all data at this location and all child locations will be deleted. + * + * `set()` will remove any priority stored at this location, so if priority is + * meant to be preserved, you need to use `setWithPriority()` instead. + * + * Note that modifying data with `set()` will cancel any pending transactions + * at that location, so extreme care should be taken if mixing `set()` and + * `transaction()` to modify the same data. + * + * A single `set()` will generate a single "value" event at the location where + * the `set()` was performed. + * + * @param ref - The location to write to. + * @param value - The value to be written (string, number, boolean, object, + * array, or null). + * @returns Resolves when write to server is complete. + */ +export declare function set( + ref: DatabaseReference, + value: unknown +): Promise; +/** + * Sets a priority for the data at this Database location. + * + * Applications need not use priority but can order collections by + * ordinary properties (see + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} + * ). + * + * @param ref - The location to write to. + * @param priority - The priority to be written (string, number, or null). + * @returns Resolves when write to server is complete. + */ +export declare function setPriority( + ref: DatabaseReference, + priority: string | number | null +): Promise; +/* Excluded from this release type: _setSDKVersion */ +/** + * Writes data the Database location. Like `set()` but also specifies the + * priority for that data. + * + * Applications need not use priority but can order collections by + * ordinary properties (see + * {@link https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data | Sorting and filtering data} + * ). + * + * @param ref - The location to write to. + * @param value - The value to be written (string, number, boolean, object, + * array, or null). + * @param priority - The priority to be written (string, number, or null). + * @returns Resolves when write to server is complete. + */ +export declare function setWithPriority( + ref: DatabaseReference, + value: unknown, + priority: string | number | null +): Promise; +/** + * Creates a `QueryConstraint` with the specified starting point (exclusive). + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The starting point is exclusive. If only a value is provided, children + * with a value greater than the specified value will be included in the query. + * If a key is specified, then children must have a value greater than or equal + * to the specified value and a a key name greater than the specified key. + * + * @param value - The value to start after. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to start after. This argument is only allowed if + * ordering by child, value, or priority. + */ +export declare function startAfter( + value: number | string | boolean | null, + key?: string +): QueryConstraint; +/** + * Creates a `QueryConstraint` with the specified starting point. + * + * Using `startAt()`, `startAfter()`, `endBefore()`, `endAt()` and `equalTo()` + * allows you to choose arbitrary starting and ending points for your queries. + * + * The starting point is inclusive, so children with exactly the specified value + * will be included in the query. The optional key argument can be used to + * further limit the range of the query. If it is specified, then children that + * have exactly the specified value must also have a key name greater than or + * equal to the specified key. + * + * You can read more about `startAt()` in + * {@link https://firebase.google.com/docs/database/web/lists-of-data#filtering_data | Filtering data}. + * + * @param value - The value to start at. The argument type depends on which + * `orderBy*()` function was used in this query. Specify a value that matches + * the `orderBy*()` type. When used in combination with `orderByKey()`, the + * value must be a string. + * @param key - The child key to start at. This argument is only allowed if + * ordering by child, value, or priority. + */ +export declare function startAt( + value?: number | string | boolean | null, + key?: string +): QueryConstraint; +/* Excluded from this release type: _TEST_ACCESS_forceRestClient */ +/* Excluded from this release type: _TEST_ACCESS_hijackHash */ +/** + * A `Promise` that can also act as a `DatabaseReference` when returned by + * {@link push}. The reference is available immediately and the `Promise` resolves + * as the write to the backend completes. + */ +export declare interface ThenableReference + extends DatabaseReference, + Pick, 'then' | 'catch'> {} +/** An options object to configure transactions. */ +export declare interface TransactionOptions { + /** + * By default, events are raised each time the transaction update function + * runs. So if it is run multiple times, you may see intermediate states. You + * can set this to false to suppress these intermediate states and instead + * wait until the transaction has completed before events are raised. + */ + readonly applyLocally?: boolean; +} +/** + * A type for the resolve value of {@link runTransaction}. + */ +export declare class TransactionResult { + /** Whether the transaction was successfully committed. */ + readonly committed: boolean; + /** The resulting data snapshot. */ + readonly snapshot: DataSnapshot; + private constructor(); + /** Returns a JSON-serializable representation of this object. */ + toJSON(): object; +} +/** A callback that can invoked to remove a listener. */ +export declare type Unsubscribe = () => void; +/** + * Writes multiple values to the Database at once. + * + * The `values` argument contains multiple property-value pairs that will be + * written to the Database together. Each child property can either be a simple + * property (for example, "name") or a relative path (for example, + * "name/first") from the current location to the data to update. + * + * As opposed to the `set()` method, `update()` can be use to selectively update + * only the referenced properties at the current location (instead of replacing + * all the child properties at the current location). + * + * The effect of the write will be visible immediately, and the corresponding + * events ('value', 'child_added', etc.) will be triggered. Synchronization of + * the data to the Firebase servers will also be started, and the returned + * Promise will resolve when complete. If provided, the `onComplete` callback + * will be called asynchronously after synchronization has finished. + * + * A single `update()` will generate a single "value" event at the location + * where the `update()` was performed, regardless of how many children were + * modified. + * + * Note that modifying data with `update()` will cancel any pending + * transactions at that location, so extreme care should be taken if mixing + * `update()` and `transaction()` to modify the same data. + * + * Passing `null` to `update()` will remove the data at this location. + * + * See + * {@link https://firebase.googleblog.com/2015/09/introducing-multi-location-updates-and_86.html | Introducing multi-location updates and more}. + * + * @param ref - The location to write to. + * @param values - Object containing multiple values. + * @returns Resolves when update on server is complete. + */ +export declare function update( + ref: DatabaseReference, + values: object +): Promise; +export {}; diff --git a/repo-scripts/prune-dts/tests/firestore.input.d.ts b/repo-scripts/prune-dts/tests/firestore.input.d.ts index aa71ccffaf0..a69b8be42de 100644 --- a/repo-scripts/prune-dts/tests/firestore.input.d.ts +++ b/repo-scripts/prune-dts/tests/firestore.input.d.ts @@ -1,48 +1,17 @@ /** - * @license - * Copyright 2021 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 + * Cloud Firestore * - * 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. + * @packageDocumentation */ + import { DocumentData as DocumentData_2 } from '@firebase/firestore-types'; +import { EmulatorMockTokenOptions } from '@firebase/util'; import { FirebaseApp } from '@firebase/app'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { _FirebaseService } from '@firebase/app'; +import { FirebaseError } from '@firebase/util'; import { LogLevelString as LogLevel } from '@firebase/logger'; -import { Provider } from '@firebase/component'; import { SetOptions as SetOptions_2 } from '@firebase/firestore-types'; -/** - * Converts Firestore's internal types to the JavaScript types that we expose - * to the user. - */ -declare abstract class AbstractUserDataWriter { - convertValue( - value: Value, - serverTimestampBehavior?: ServerTimestampBehavior - ): unknown; - private convertObject; - private convertGeoPoint; - private convertArray; - private convertServerTimestamp; - private convertTimestamp; - protected convertDocumentKey( - name: string, - expectedDatabaseId: DatabaseId - ): DocumentKey; - protected abstract convertReference(name: string): unknown; - protected abstract convertBytes(bytes: ByteString): unknown; -} +/* Excluded from this release type: AbstractUserDataWriter */ /** * Describes a map whose keys are active target ids. We do not care about the type of the @@ -56,22 +25,171 @@ declare type ActiveTargets = SortedMap; * * @param reference - A reference to the collection to add this document to. * @param data - An Object containing the data for the new document. - * @returns A Promise resolved with a `DocumentReference` pointing to the + * @returns A `Promise` resolved with a `DocumentReference` pointing to the * newly created document after it has been written to the backend (Note that it * won't resolve while you're offline). */ -export declare function addDoc( - reference: CollectionReference, - data: T -): Promise>; +export declare function addDoc( + reference: CollectionReference, + data: WithFieldValue +): Promise>; + +/** + * Returns a new map where every key is prefixed with the outer key appended + * to a dot. + */ +export declare type AddPrefixToKeys< + Prefix extends string, + T extends Record +> = { + [K in keyof T & string as `${Prefix}.${K}`]+?: string extends K ? any : T[K]; +}; + +/** + * Represents an aggregation that can be performed by Firestore. + */ +export declare class AggregateField { + readonly _internalFieldPath?: _FieldPath | undefined; + /** A type string to uniquely identify instances of this class. */ + readonly type = 'AggregateField'; + /** Indicates the aggregation operation of this AggregateField. */ + readonly aggregateType: AggregateType; + /* Excluded from this release type: __constructor */ +} + +/** + * Compares two 'AggregateField` instances for equality. + * + * @param left Compare this AggregateField to the `right`. + * @param right Compare this AggregateField to the `left`. + */ +export declare function aggregateFieldEqual( + left: AggregateField, + right: AggregateField +): boolean; + +/** + * The union of all `AggregateField` types that are supported by Firestore. + */ +export declare type AggregateFieldType = + | ReturnType + | ReturnType + | ReturnType; + +/** + * The results of executing an aggregation query. + */ +export declare class AggregateQuerySnapshot< + AggregateSpecType extends AggregateSpec, + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { + private readonly _userDataWriter; + private readonly _data; + /** A type string to uniquely identify instances of this class. */ + readonly type = 'AggregateQuerySnapshot'; + /** + * The underlying query over which the aggregations recorded in this + * `AggregateQuerySnapshot` were performed. + */ + readonly query: Query; + /** @hideconstructor */ + constructor( + query: Query, + _userDataWriter: AbstractUserDataWriter, + _data: ApiClientObjectMap + ); + /** + * Returns the results of the aggregations performed over the underlying + * query. + * + * The keys of the returned object will be the same as those of the + * `AggregateSpec` object specified to the aggregation method, and the values + * will be the corresponding aggregation result. + * + * @returns The results of the aggregations performed over the underlying + * query. + */ + data(): AggregateSpecData; +} + +/** + * Compares two `AggregateQuerySnapshot` instances for equality. + * + * Two `AggregateQuerySnapshot` instances are considered "equal" if they have + * underlying queries that compare equal, and the same data. + * + * @param left - The first `AggregateQuerySnapshot` to compare. + * @param right - The second `AggregateQuerySnapshot` to compare. + * + * @returns `true` if the objects are "equal", as defined above, or `false` + * otherwise. + */ +export declare function aggregateQuerySnapshotEqual< + AggregateSpecType extends AggregateSpec, + AppModelType, + DbModelType extends DocumentData +>( + left: AggregateQuerySnapshot, + right: AggregateQuerySnapshot +): boolean; + +/** + * Specifies a set of aggregations and their aliases. + */ +export declare interface AggregateSpec { + [field: string]: AggregateFieldType; +} + +/** + * A type whose keys are taken from an `AggregateSpec`, and whose values are the + * result of the aggregation performed by the corresponding `AggregateField` + * from the input `AggregateSpec`. + */ +export declare type AggregateSpecData = { + [P in keyof T]: T[P] extends AggregateField ? U : never; +}; + +/** + * Union type representing the aggregate type to be performed. + */ +export declare type AggregateType = 'count' | 'avg' | 'sum'; + +/** + * 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 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}. + */ +export declare function and( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint; declare interface ApiClientObjectMap { [k: string]: T; } +/** + * An `AppliableConstraint` is an abstraction of a constraint that can be applied + * to a Firestore query. + */ +declare abstract class AppliableConstraint { + /** + * Takes the provided {@link Query} and returns a copy of the {@link Query} with this + * {@link AppliableConstraint} applied. + */ + abstract _apply( + query: Query + ): Query; +} + /** * Returns a special value that can be used with {@link (setDoc:1)} or {@link - * updateDoc} that tells the server to remove the given elements from any + * updateDoc:1} that tells the server to remove the given elements from any * array value that already exists on the server. All instances of each element * specified will be removed from the array. If the field being modified is not * already an array it will be overwritten with an empty array. @@ -83,8 +201,8 @@ declare interface ApiClientObjectMap { export declare function arrayRemove(...elements: unknown[]): FieldValue; /** - * Returns a special value that can be used with {@link setDoc} or {@link - * updateDoc} that tells the server to union the given elements with any array + * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link + * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array * value that already exists on the server. Each specified element that doesn't * already exist in the array will be added to the end. If the field being * modified is not already an array it will be overwritten with an array @@ -114,8 +232,12 @@ declare interface AsyncQueue { * Initialize the shutdown of this queue. Once this method is called, the * only possible way to request running an operation is through * `enqueueEvenWhileRestricted()`. + * + * @param purgeExistingTasks Whether already enqueued tasked should be + * rejected (unless enqueued with `enqueueEvenWhileRestricted()`). Defaults + * to false. */ - enterRestrictedMode(): void; + enterRestrictedMode(purgeExistingTasks?: boolean): void; /** * Adds a new operation to the queue. Returns a promise that will be resolved * when the promise returned by the new operation is (with its value). @@ -149,6 +271,19 @@ declare interface AsyncQueue { verifyOperationInProgress(): void; } +/* Excluded from this release type: AuthTokenFactory */ + +/* Excluded from this release type: _AutoId */ + +/** + * Create an AggregateField object that can be used to compute the average of + * a specified field over a range of documents in the result set of a query. + * @param field Specifies the field to average across the result set. + */ +export declare function average( + field: string | FieldPath +): AggregateField; + /** * Path represents an ordered sequence of string segments. */ @@ -232,8 +367,8 @@ declare type BatchId = number; */ declare class Bound { readonly position: Value[]; - readonly before: boolean; - constructor(position: Value[], before: boolean); + readonly inclusive: boolean; + constructor(position: Value[], inclusive: boolean); } /** @@ -319,9 +454,9 @@ declare interface BundleMetadata_2 { * An immutable object representing an array of bytes. */ export declare class Bytes { - _byteString: ByteString; + _byteString: _ByteString; /** @hideconstructor */ - constructor(byteString: ByteString); + constructor(byteString: _ByteString); /** * Creates a new `Bytes` object from the given Base64 string, converting it to * bytes. @@ -362,50 +497,17 @@ export declare class Bytes { isEqual(other: Bytes): boolean; } -/** - * @license - * Copyright 2020 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. - */ -/** - * Immutable class that represents a "proto" byte string. - * - * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when - * sent on the wire. This class abstracts away this differentiation by holding - * the proto byte string in a common class that must be converted into a string - * before being sent as a proto. - */ -declare class ByteString { - private readonly binaryString; - static readonly EMPTY_BYTE_STRING: ByteString; - private constructor(); - static fromBase64String(base64: string): ByteString; - static fromUint8Array(array: Uint8Array): ByteString; - toBase64(): string; - toUint8Array(): Uint8Array; - approximateByteSize(): number; - compareTo(other: ByteString): number; - isEqual(other: ByteString): boolean; -} +/* Excluded from this release type: _ByteString */ /** * Constant used to indicate the LRU garbage collection should be disabled. * Set this value as the `cacheSizeBytes` on the settings passed to the - * `Firestore` instance. + * {@link Firestore} instance. */ export declare const CACHE_SIZE_UNLIMITED = -1; +/* Excluded from this release type: _cast */ + declare const enum ChangeType { Added = 0, Removed = 1, @@ -413,14 +515,31 @@ declare const enum ChangeType { Metadata = 3 } +/** + * Helper for calculating the nested fields for a given type T1. This is needed + * to distribute union types such as `undefined | {...}` (happens for optional + * props) or `{a: A} | {b: B}`. + * + * In this use case, `V` is used to distribute the union types of `T[K]` on + * `Record`, since `T[K]` is evaluated as an expression and not distributed. + * + * See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types + */ +export declare type ChildUpdateFields = V extends Record< + string, + unknown +> + ? AddPrefixToKeys> + : never; + /** * Clears the persistent storage. This includes pending writes and cached * documents. * - * Must be called while the `Firestore` instance is not started (after the app is + * Must be called while the {@link Firestore} instance is not started (after the app is * terminated or when the app is first initialized). On startup, this function * must be called before other functions (other than {@link - * initializeFirestore} or {@link getFirestore})). If the `Firestore` + * initializeFirestore} or {@link (getFirestore:1)})). If the {@link Firestore} * instance is still running, the promise will be rejected with the error code * of `failed-precondition`. * @@ -431,12 +550,12 @@ declare const enum ChangeType { * to the disclosure of cached data in between user sessions, we strongly * recommend not enabling persistence at all. * - * @param firestore - The `Firestore` instance to clear persistence for. - * @returns A promise that is resolved when the persistent storage is + * @param firestore - The {@link Firestore} instance to clear persistence for. + * @returns A `Promise` that is resolved when the persistent storage is * cleared. Otherwise, the promise is rejected with an error. */ export declare function clearIndexedDbPersistence( - firestore: FirebaseFirestore + firestore: Firestore ): Promise; /** @@ -448,7 +567,7 @@ declare type ClientId = string; * Gets a `CollectionReference` instance that refers to the collection at * the specified absolute path. * - * @param firestore - A reference to the root Firestore instance. + * @param firestore - A reference to the root `Firestore` instance. * @param path - A slash-separated path to a collection. * @param pathSegments - Additional path segments to apply relative to the first * argument. @@ -457,10 +576,10 @@ declare type ClientId = string; * @returns The `CollectionReference` instance. */ export declare function collection( - firestore: FirebaseFirestore_2, + firestore: Firestore_2, path: string, ...pathSegments: string[] -): CollectionReference; +): CollectionReference; /** * Gets a `CollectionReference` instance that refers to a subcollection of @@ -474,11 +593,14 @@ export declare function collection( * to a collection. * @returns The `CollectionReference` instance. */ -export declare function collection( - reference: CollectionReference, +export declare function collection< + AppModelType, + DbModelType extends DocumentData +>( + reference: CollectionReference, path: string, ...pathSegments: string[] -): CollectionReference; +): CollectionReference; /** * Gets a `CollectionReference` instance that refers to a subcollection of @@ -492,41 +614,47 @@ export declare function collection( * to a collection. * @returns The `CollectionReference` instance. */ -export declare function collection( - reference: DocumentReference, +export declare function collection< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, path: string, ...pathSegments: string[] -): CollectionReference; +): CollectionReference; /** * Creates and returns a new `Query` instance that includes all documents in the * database that are contained in a collection or subcollection with the * given `collectionId`. * - * @param firestore - A reference to the root Firestore instance. + * @param firestore - A reference to the root `Firestore` instance. * @param collectionId - Identifies the collections to query over. Every * collection or subcollection with this ID as the last segment of its path * will be included. Cannot contain a slash. * @returns The created `Query`. */ export declare function collectionGroup( - firestore: FirebaseFirestore_2, + firestore: Firestore_2, collectionId: string -): Query; +): Query; /** * A `CollectionReference` object can be used for adding documents, getting - * document references, and querying for documents (using {@link query}). + * document references, and querying for documents (using {@link (query:1)}). */ -export declare class CollectionReference extends Query { - readonly firestore: FirebaseFirestore_2; - readonly _path: ResourcePath; +export declare class CollectionReference< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> extends Query { + readonly _path: _ResourcePath; + /** The type of this Firestore reference. */ readonly type = 'collection'; /** @hideconstructor */ constructor( - firestore: FirebaseFirestore_2, - converter: FirestoreDataConverter_2 | null, - _path: ResourcePath + firestore: Firestore_2, + converter: FirestoreDataConverter_2 | null, + _path: _ResourcePath ); /** The collection's identifier. */ get id(): string; @@ -539,19 +667,33 @@ export declare class CollectionReference extends Query { * A reference to the containing `DocumentReference` if this is a * subcollection. If this isn't a subcollection, the reference is null. */ - get parent(): DocumentReference | null; + get parent(): DocumentReference | null; /** - * Applies a custom data converter to this CollectionReference, allowing you + * Applies a custom data converter to this `CollectionReference`, allowing you * to use your own custom model objects with Firestore. When you call {@link * addDoc} with the returned `CollectionReference` instance, the provided - * converter will convert between Firestore data and your custom type `U`. + * converter will convert between Firestore data of type `NewDbModelType` and + * your custom type `NewAppModelType`. * * @param converter - Converts objects to and from Firestore. - * @returns A `CollectionReference` that uses the provided converter. + * @returns A `CollectionReference` that uses the provided converter. + */ + withConverter< + NewAppModelType, + NewDbModelType extends DocumentData = DocumentData + >( + converter: FirestoreDataConverter_2 + ): CollectionReference; + /** + * Removes the current converter. + * + * @param converter - `null` removes the current converter. + * @returns A `CollectionReference` that does not + * use a converter. */ - withConverter( - converter: FirestoreDataConverter_2 - ): CollectionReference; + withConverter( + converter: null + ): CollectionReference; } /** @@ -575,26 +717,71 @@ declare type Comparator = (key1: K, key2: K) => number; declare interface ComponentConfiguration { asyncQueue: AsyncQueue; databaseInfo: DatabaseInfo; - credentials: CredentialsProvider; + authCredentials: CredentialsProvider; + appCheckCredentials: CredentialsProvider; clientId: ClientId; initialUser: User; maxConcurrentLimboResolutions: number; } -declare type CompositeFilterOp = 'OPERATOR_UNSPECIFIED' | 'AND'; +declare type CompositeFilterOp = 'OPERATOR_UNSPECIFIED' | 'AND' | 'OR'; + +declare const enum CompositeOperator { + OR = 'or', + AND = 'and' +} + +/** + * Modify this instance to communicate with the Cloud Firestore emulator. + * + * Note: This must be called before this instance has been used to do any + * operations. + * + * @param firestore - The `Firestore` instance to configure to connect to the + * emulator. + * @param host - the emulator host (ex: localhost). + * @param port - the emulator port (ex: 9000). + * @param options.mockUserToken - the mock auth token to use for unit testing + * Security Rules. + */ +export declare function connectFirestoreEmulator( + firestore: Firestore_2, + host: string, + port: number, + options?: { + mockUserToken?: EmulatorMockTokenOptions | string; + } +): void; + +/** + * Create an AggregateField object that can be used to compute the count of + * documents in the result set of a query. + */ +export declare function count(): AggregateField; /** * A Listener for credential change events. The listener should fetch a new * token and may need to invalidate other state if the current user has also * changed. */ -declare type CredentialChangeListener = (user: User) => void; +declare type CredentialChangeListener = (credential: T) => Promise; /** * Provides methods for getting the uid and token for the current user and * listening for changes. */ -declare interface CredentialsProvider { +declare interface CredentialsProvider { + /** + * Starts the credentials provider and specifies a listener to be notified of + * credential changes (sign-in / sign-out, token changes). It is immediately + * called once with the initial user. + * + * The change listener is invoked on the provided AsyncQueue. + */ + start( + asyncQueue: AsyncQueue, + changeListener: CredentialChangeListener + ): void; /** Requests a token for the current user. */ getToken(): Promise; /** @@ -602,14 +789,7 @@ declare interface CredentialsProvider { * force-refresh the token. */ invalidateToken(): void; - /** - * Specifies a listener to be notified of credential changes - * (sign-in / sign-out, token changes). It is immediately called once with the - * initial user. - */ - setChangeListener(changeListener: CredentialChangeListener): void; - /** Removes the previously-set change listener. */ - removeChangeListener(): void; + shutdown(): void; } /** Settings for private credentials */ @@ -617,14 +797,7 @@ declare type CredentialsSettings = | FirstPartyCredentialsSettings | ProviderCredentialsSettings; -/** Represents the database ID a Firestore client is associated with. */ -declare class DatabaseId { - readonly projectId: string; - readonly database: string; - constructor(projectId: string, database?: string); - get isDefaultDatabase(): boolean; - isEqual(other: {}): boolean; -} +/* Excluded from this release type: _DatabaseId */ /** * @license @@ -643,17 +816,21 @@ declare class DatabaseId { * limitations under the License. */ declare class DatabaseInfo { - readonly databaseId: DatabaseId; + readonly databaseId: _DatabaseId; + readonly appId: string; readonly persistenceKey: string; readonly host: string; readonly ssl: boolean; readonly forceLongPolling: boolean; readonly autoDetectLongPolling: boolean; + readonly longPollingOptions: ExperimentalLongPollingOptions; + readonly useFetchStreams: boolean; /** * Constructs a DatabaseInfo using the provided host, databaseId and * persistenceKey. * * @param databaseId - The database to use. + * @param appId - The Firebase App Id. * @param persistenceKey - A unique identifier for this Firestore's local * storage (used in conjunction with the databaseId). * @param host - The Firestore backend host to connect to. @@ -662,14 +839,20 @@ declare class DatabaseInfo { * when using WebChannel as the network transport. * @param autoDetectLongPolling - Whether to use the detectBufferingProxy * option when using WebChannel as the network transport. + * @param longPollingOptions Options that configure long-polling. + * @param useFetchStreams Whether to use the Fetch API instead of + * XMLHTTPRequest */ constructor( - databaseId: DatabaseId, + databaseId: _DatabaseId, + appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, - autoDetectLongPolling: boolean + autoDetectLongPolling: boolean, + longPollingOptions: ExperimentalLongPollingOptions, + useFetchStreams: boolean ); } @@ -680,8 +863,11 @@ declare class DatabaseInfo { */ declare abstract class Datastore { abstract terminate(): void; + abstract serializer: JsonProtoSerializer; } +/* Excluded from this release type: _debugAssert */ + /** * Represents an operation scheduled to be run in the future on an AsyncQueue. * @@ -702,6 +888,7 @@ declare class DelayedOperation implements PromiseLike { private timerHandle; private readonly deferred; private constructor(); + get promise(): Promise; /** * Creates and returns a DelayedOperation that has been scheduled to be * executed on the provided asyncQueue after the provided delayMs. @@ -755,6 +942,16 @@ declare class DelayedOperation implements PromiseLike { private clearTimeout; } +/** + * Removes all persistent cache indexes. + * + * Please note this function will also deletes indexes generated by + * `setIndexConfiguration()`, which is deprecated. + */ +export declare function deleteAllPersistentCacheIndexes( + indexManager: PersistentCacheIndexManager +): void; + /** * Deletes the document referred to by the specified `DocumentReference`. * @@ -762,13 +959,14 @@ declare class DelayedOperation implements PromiseLike { * @returns A Promise resolved once the document has been successfully * deleted from the backend (note that it won't resolve while you're offline). */ -export declare function deleteDoc( - reference: DocumentReference -): Promise; +export declare function deleteDoc< + AppModelType, + DbModelType extends DocumentData +>(reference: DocumentReference): Promise; /** - * Returns a sentinel for use with {@link updateDoc} or - * {@link setDoc} with `{merge: true}` to mark a field for deletion. + * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or + * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion. */ export declare function deleteField(): FieldValue; @@ -786,17 +984,24 @@ declare const enum Direction { * `getDoc()` or `getDocs()` calls will return results from cache, and any write * operations will be queued until the network is restored. * - * @returns A promise that is resolved once the network has been disabled. + * @returns A `Promise` that is resolved once the network has been disabled. */ -export declare function disableNetwork( - firestore: FirebaseFirestore -): Promise; +export declare function disableNetwork(firestore: Firestore): Promise; + +/** + * Stops creating persistent cache indexes automatically for local query + * execution. The indexes which have been created by calling + * `enablePersistentCacheIndexAutoCreation()` still take effect. + */ +export declare function disablePersistentCacheIndexAutoCreation( + indexManager: PersistentCacheIndexManager +): void; /** * Gets a `DocumentReference` instance that refers to the document at the * specified absolute path. * - * @param firestore - A reference to the root Firestore instance. + * @param firestore - A reference to the root `Firestore` instance. * @param path - A slash-separated path to a document. * @param pathSegments - Additional path segments that will be applied relative * to the first argument. @@ -805,10 +1010,10 @@ export declare function disableNetwork( * @returns The `DocumentReference` instance. */ export declare function doc( - firestore: FirebaseFirestore_2, + firestore: Firestore_2, path: string, ...pathSegments: string[] -): DocumentReference; +): DocumentReference; /** * Gets a `DocumentReference` instance that refers to a document within @@ -825,11 +1030,11 @@ export declare function doc( * a document. * @returns The `DocumentReference` instance. */ -export declare function doc( - reference: CollectionReference, +export declare function doc( + reference: CollectionReference, path?: string, ...pathSegments: string[] -): DocumentReference; +): DocumentReference; /** * Gets a `DocumentReference` instance that refers to a document within @@ -843,45 +1048,83 @@ export declare function doc( * a document. * @returns The `DocumentReference` instance. */ -export declare function doc( - reference: DocumentReference, +export declare function doc( + reference: DocumentReference, path: string, ...pathSegments: string[] -): DocumentReference; +): DocumentReference; /** * Represents a document in Firestore with a key, version, data and whether the * data has local mutations applied to it. */ -declare class Document_2 extends MaybeDocument { - private readonly objectValue; +declare interface Document_2 { + /** The key for this document */ + readonly key: _DocumentKey; + /** + * The version of this document if it exists or a version at which this + * document was guaranteed to not exist. + */ + readonly version: SnapshotVersion; + /** + * The timestamp at which this document was read from the remote server. Uses + * `SnapshotVersion.min()` for documents created by the user. + */ + readonly readTime: SnapshotVersion; + /** + * The timestamp at which the document was created. This value increases + * monotonically when a document is deleted then recreated. It can also be + * compared to `createTime` of other documents and the `readTime` of a query. + */ + readonly createTime: SnapshotVersion; + /** The underlying data of this document or an empty value if no data exists. */ + readonly data: ObjectValue; + /** Returns whether local mutations were applied via the mutation queue. */ readonly hasLocalMutations: boolean; + /** Returns whether mutations were applied based on a write acknowledgment. */ readonly hasCommittedMutations: boolean; - constructor( - key: DocumentKey, - version: SnapshotVersion, - objectValue: ObjectValue, - options: DocumentOptions - ); - field(path: FieldPath_2): Value | null; - data(): ObjectValue; - toProto(): { - mapValue: MapValue; - }; - isEqual(other: MaybeDocument | null | undefined): boolean; + /** + * Whether this document had a local mutation applied that has not yet been + * acknowledged by Watch. + */ + readonly hasPendingWrites: boolean; + /** + * Returns whether this document is valid (i.e. it is an entry in the + * RemoteDocumentCache, was created by a mutation or read from the backend). + */ + isValidDocument(): boolean; + /** + * Returns whether the document exists and its data is known at the current + * version. + */ + isFoundDocument(): boolean; + /** + * Returns whether the document is known to not exist at the current version. + */ + isNoDocument(): boolean; + /** + * Returns whether the document exists and its data is unknown at the current + * version. + */ + isUnknownDocument(): boolean; + isEqual(other: Document_2 | null | undefined): boolean; + /** Creates a mutable copy of this document. */ + mutableCopy(): MutableDocument; toString(): string; - get hasPendingWrites(): boolean; } /** * A `DocumentChange` represents a change to the documents matching a query. * It contains the document affected and the type of change that occurred. */ -export declare interface DocumentChange { +export declare interface DocumentChange< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { /** The type of change ('added', 'modified', or 'removed'). */ readonly type: DocumentChangeType; /** The document affected by this change. */ - readonly doc: QueryDocumentSnapshot; + readonly doc: QueryDocumentSnapshot; /** * The index of the changed document in the result set immediately prior to * this `DocumentChange` (i.e. supposing that all prior `DocumentChange` objects @@ -908,10 +1151,11 @@ declare type DocumentComparator = ( ) => number; /** - * Document data (for use with {@link setDoc}) consists of fields mapped to + * Document data (for use with {@link @firebase/firestore/lite#(setDoc:1)}) consists of fields mapped to * values. */ export declare interface DocumentData { + /** A mapping between a field and its value. */ [field: string]: any; } @@ -921,33 +1165,90 @@ export declare interface DocumentData { */ export declare function documentId(): FieldPath; -declare class DocumentKey { - readonly path: ResourcePath; - constructor(path: ResourcePath); - static fromPath(path: string): DocumentKey; - static fromName(name: string): DocumentKey; - /** Returns true if the document is in the specified collectionId. */ - hasCollectionId(collectionId: string): boolean; - isEqual(other: DocumentKey | null): boolean; - toString(): string; - static comparator(k1: DocumentKey, k2: DocumentKey): number; - static isDocumentKey(path: ResourcePath): boolean; - /** - * Creates and returns a new document key with the given segments. - * - * @param segments - The segments of the path to the document - * @returns A new instance of DocumentKey - */ - static fromSegments(segments: string[]): DocumentKey; -} +/* Excluded from this release type: _DocumentKey */ + +declare type DocumentKeyMap = ObjectMap<_DocumentKey, T>; -declare type DocumentKeySet = SortedSet; +declare type DocumentKeySet = SortedSet<_DocumentKey>; -declare type DocumentMap = SortedMap; +declare type DocumentMap = SortedMap<_DocumentKey, Document_2>; -declare interface DocumentOptions { - hasLocalMutations?: boolean; - hasCommittedMutations?: boolean; +/** + * Provides methods to read and write document overlays. + * + * An overlay is a saved mutation, that gives a local view of a document when + * applied to the remote version of the document. + * + * Each overlay stores the largest batch ID that is included in the overlay, + * which allows us to remove the overlay once all batches leading up to it have + * been acknowledged. + */ +declare interface DocumentOverlayCache { + /** + * Gets the saved overlay mutation for the given document key. + * Returns null if there is no overlay for that key. + */ + getOverlay( + transaction: PersistenceTransaction, + key: _DocumentKey + ): PersistencePromise; + /** + * Gets the saved overlay mutation for the given document keys. Skips keys for + * which there are no overlays. + */ + getOverlays( + transaction: PersistenceTransaction, + keys: _DocumentKey[] + ): PersistencePromise; + /** + * Saves the given document mutation map to persistence as overlays. + * All overlays will have their largest batch id set to `largestBatchId`. + */ + saveOverlays( + transaction: PersistenceTransaction, + largestBatchId: number, + overlays: MutationMap + ): PersistencePromise; + /** Removes overlays for the given document keys and batch ID. */ + removeOverlaysForBatchId( + transaction: PersistenceTransaction, + documentKeys: DocumentKeySet, + batchId: number + ): PersistencePromise; + /** + * Returns all saved overlays for the given collection. + * + * @param transaction - The persistence transaction to use for this operation. + * @param collection - The collection path to get the overlays for. + * @param sinceBatchId - The minimum batch ID to filter by (exclusive). + * Only overlays that contain a change past `sinceBatchId` are returned. + * @returns Mapping of each document key in the collection to its overlay. + */ + getOverlaysForCollection( + transaction: PersistenceTransaction, + collection: _ResourcePath, + sinceBatchId: number + ): PersistencePromise; + /** + * Returns `count` overlays with a batch ID higher than `sinceBatchId` for the + * provided collection group, processed by ascending batch ID. The method + * always returns all overlays for a batch even if the last batch contains + * more documents than the remaining limit. + * + * @param transaction - The persistence transaction used for this operation. + * @param collectionGroup - The collection group to get the overlays for. + * @param sinceBatchId - The minimum batch ID to filter by (exclusive). + * Only overlays that contain a change past `sinceBatchId` are returned. + * @param count - The number of overlays to return. Can be exceeded if the last + * batch contains more entries. + * @return Mapping of each document key in the collection group to its overlay. + */ + getOverlaysForCollectionGroup( + transaction: PersistenceTransaction, + collectionGroup: string, + sinceBatchId: number, + count: number + ): PersistencePromise; } /** @@ -955,23 +1256,35 @@ declare interface DocumentOptions { * and can be used to write, read, or listen to the location. The document at * the referenced location may or may not exist. */ -export declare class DocumentReference { - readonly _converter: FirestoreDataConverter_2 | null; - readonly _key: DocumentKey; +export declare class DocumentReference< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { + /** + * If provided, the `FirestoreDataConverter` associated with this instance. + */ + readonly converter: FirestoreDataConverter_2< + AppModelType, + DbModelType + > | null; + readonly _key: _DocumentKey; /** The type of this Firestore reference. */ readonly type = 'document'; /** - * The {@link FirebaseFirestore} the document is in. + * The {@link Firestore} instance the document is in. * This is useful for performing transactions, for example. */ - readonly firestore: FirebaseFirestore_2; + readonly firestore: Firestore_2; /** @hideconstructor */ constructor( - firestore: FirebaseFirestore_2, - _converter: FirestoreDataConverter_2 | null, - _key: DocumentKey + firestore: Firestore_2, + /** + * If provided, the `FirestoreDataConverter` associated with this instance. + */ + converter: FirestoreDataConverter_2 | null, + _key: _DocumentKey ); - get _path(): ResourcePath; + get _path(): _ResourcePath; /** * The document's identifier within its collection. */ @@ -984,20 +1297,31 @@ export declare class DocumentReference { /** * The collection this `DocumentReference` belongs to. */ - get parent(): CollectionReference; + get parent(): CollectionReference; /** * Applies a custom data converter to this `DocumentReference`, allowing you * to use your own custom model objects with Firestore. When you call {@link - * setDoc}, {@link getDoc}, etc. with the returned `DocumentReference` - * instance, the provided converter will convert between Firestore data and - * your custom type `U`. + * @firebase/firestore/lite#(setDoc:1)}, {@link @firebase/firestore/lite#getDoc}, etc. with the returned `DocumentReference` + * instance, the provided converter will convert between Firestore data of + * type `NewDbModelType` and your custom type `NewAppModelType`. * * @param converter - Converts objects to and from Firestore. - * @returns A `DocumentReference` that uses the provided converter. + * @returns A `DocumentReference` that uses the provided converter. */ - withConverter( - converter: FirestoreDataConverter_2 - ): DocumentReference; + withConverter< + NewAppModelType, + NewDbModelType extends DocumentData = DocumentData + >( + converter: FirestoreDataConverter_2 + ): DocumentReference; + /** + * Removes the current converter. + * + * @param converter - `null` removes the current converter. + * @returns A `DocumentReference` that does not + * use a converter. + */ + withConverter(converter: null): DocumentReference; } /** @@ -1017,8 +1341,8 @@ declare class DocumentSet { private sortedSet; /** The default ordering is by key if the comparator is omitted */ constructor(comp?: DocumentComparator); - has(key: DocumentKey): boolean; - get(key: DocumentKey): Document_2 | null; + has(key: _DocumentKey): boolean; + get(key: _DocumentKey): Document_2 | null; first(): Document_2 | null; last(): Document_2 | null; isEmpty(): boolean; @@ -1026,14 +1350,14 @@ declare class DocumentSet { * Returns the index of the provided key in the document set, or -1 if the * document key is not present in the set; */ - indexOf(key: DocumentKey): number; + indexOf(key: _DocumentKey): number; get size(): number; /** Iterates documents in order defined by "comparator" */ forEach(cb: (doc: Document_2) => void): void; /** Inserts or updates a document with the same key */ add(doc: Document_2): DocumentSet; /** Deletes a document with a given key */ - delete(key: DocumentKey): DocumentSet; + delete(key: _DocumentKey): DocumentSet; isEqual(other: DocumentSet | null | undefined): boolean; toString(): string; private copy; @@ -1049,9 +1373,10 @@ declare class DocumentSet { * explicitly verify a document's existence. */ export declare class DocumentSnapshot< - T = DocumentData -> extends DocumentSnapshot_2 { - readonly _firestore: FirebaseFirestore; + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> extends DocumentSnapshot_2 { + readonly _firestore: Firestore; private readonly _firestoreImpl; /** * Metadata about the `DocumentSnapshot`, including information about its @@ -1060,23 +1385,22 @@ export declare class DocumentSnapshot< readonly metadata: SnapshotMetadata; /** @hideconstructor protected */ constructor( - _firestore: FirebaseFirestore, + _firestore: Firestore, userDataWriter: AbstractUserDataWriter, - key: DocumentKey, + key: _DocumentKey, document: Document_2 | null, metadata: SnapshotMetadata, - converter: UntypedFirestoreDataConverter | null + converter: UntypedFirestoreDataConverter | null ); /** - * Property of the `DocumentSnapshot` that signals whether or not the data - * exists. True if the document exists. + * Returns whether or not the data exists. True if the document exists. */ - exists(): this is QueryDocumentSnapshot; + exists(): this is QueryDocumentSnapshot; /** * Retrieves all fields in the document as an `Object`. Returns `undefined` if * the document doesn't exist. * - * By default, `FieldValue.serverTimestamp()` values that have not yet been + * By default, `serverTimestamp()` values that have not yet been * set to their final value will be returned as `null`. You can override * this by passing an options object. * @@ -1086,12 +1410,12 @@ export declare class DocumentSnapshot< * @returns An `Object` containing all fields in the document or `undefined` if * the document doesn't exist. */ - data(options?: SnapshotOptions): T | undefined; + data(options?: SnapshotOptions): AppModelType | undefined; /** * Retrieves the field specified by `fieldPath`. Returns `undefined` if the * document or field doesn't exist. * - * By default, a `FieldValue.serverTimestamp()` that has not yet been set to + * By default, a `serverTimestamp()` that has not yet been set to * its final value will be returned as `null`. You can override this by * passing an options object. * @@ -1115,32 +1439,35 @@ export declare class DocumentSnapshot< * access will return 'undefined'. You can use the `exists()` method to * explicitly verify a document's existence. */ -declare class DocumentSnapshot_2 { - _firestore: FirebaseFirestore_2; +declare class DocumentSnapshot_2< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { + _firestore: Firestore_2; _userDataWriter: AbstractUserDataWriter; - _key: DocumentKey; + _key: _DocumentKey; _document: Document_2 | null; - _converter: UntypedFirestoreDataConverter | null; + _converter: UntypedFirestoreDataConverter | null; /** @hideconstructor protected */ constructor( - _firestore: FirebaseFirestore_2, + _firestore: Firestore_2, _userDataWriter: AbstractUserDataWriter, - _key: DocumentKey, + _key: _DocumentKey, _document: Document_2 | null, - _converter: UntypedFirestoreDataConverter | null + _converter: UntypedFirestoreDataConverter | null ); /** Property of the `DocumentSnapshot` that provides the document's ID. */ get id(): string; /** * The `DocumentReference` for the document included in the `DocumentSnapshot`. */ - get ref(): DocumentReference; + get ref(): DocumentReference; /** * Signals whether or not the document at the snapshot's location exists. * * @returns true if the document exists. */ - exists(): this is QueryDocumentSnapshot_2; + exists(): this is QueryDocumentSnapshot_2; /** * Retrieves all fields in the document as an `Object`. Returns `undefined` if * the document doesn't exist. @@ -1148,7 +1475,7 @@ declare class DocumentSnapshot_2 { * @returns An `Object` containing all fields in the document or `undefined` * if the document doesn't exist. */ - data(): T | undefined; + data(): AppModelType | undefined; /** * Retrieves the field specified by `fieldPath`. Returns `undefined` if the * document or field doesn't exist. @@ -1161,38 +1488,49 @@ declare class DocumentSnapshot_2 { get(fieldPath: string | FieldPath): any; } -declare type DocumentVersionMap = SortedMap; +declare type DocumentVersionMap = SortedMap<_DocumentKey, SnapshotVersion>; declare interface DocumentViewChange { type: ChangeType; doc: Document_2; } +/* Excluded from this release type: _EmptyAppCheckTokenProvider */ + +/* Excluded from this release type: _EmptyAuthCredentialsProvider */ +export { EmulatorMockTokenOptions }; + /** * Attempts to enable persistent storage, if possible. * - * Must be called before any other functions (other than - * {@link initializeFirestore}, {@link getFirestore} or - * {@link clearIndexedDbPersistence}. + * On failure, `enableIndexedDbPersistence()` will reject the promise or + * throw an exception. There are several reasons why this can fail, which can be + * identified by the `code` on the error. * - * If this fails, `enableIndexedDbPersistence()` will reject the promise it - * returns. Note that even after this failure, the `Firestore` instance will - * remain usable, however offline persistence will be disabled. + * * failed-precondition: The app is already open in another browser tab. + * * unimplemented: The browser is incompatible with the offline persistence + * implementation. * - * There are several reasons why this can fail, which can be identified by - * the `code` on the error. + * Note that even after a failure, the {@link Firestore} instance will remain + * usable, however offline persistence will be disabled. * - * * failed-precondition: The app is already open in another browser tab. - * * unimplemented: The browser is incompatible with the offline - * persistence implementation. + * Note: `enableIndexedDbPersistence()` must be called before any other functions + * (other than {@link initializeFirestore}, {@link (getFirestore:1)} or + * {@link clearIndexedDbPersistence}. + * + * Persistence cannot be used in a Node.js environment. * - * @param firestore - The `Firestore` instance to enable persistence for. + * @param firestore - The {@link Firestore} instance to enable persistence for. * @param persistenceSettings - Optional settings object to configure * persistence. - * @returns A promise that represents successfully enabling persistent storage. + * @returns A `Promise` that represents successfully enabling persistent storage. + * @deprecated This function will be removed in a future major release. Instead, set + * `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to + * turn on IndexedDb cache. Calling this function when `FirestoreSettings.localCache` + * is already specified will throw an exception. */ export declare function enableIndexedDbPersistence( - firestore: FirebaseFirestore, + firestore: Firestore, persistenceSettings?: PersistenceSettings ): Promise; @@ -1202,83 +1540,103 @@ export declare function enableIndexedDbPersistence( * shared execution of queries and latency-compensated local document updates * across all connected instances. * - * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise - * it returns. Note that even after this failure, the `Firestore` instance will - * remain usable, however offline persistence will be disabled. - * - * There are several reasons why this can fail, which can be identified by - * the `code` on the error. + * On failure, `enableMultiTabIndexedDbPersistence()` will reject the promise or + * throw an exception. There are several reasons why this can fail, which can be + * identified by the `code` on the error. * * * failed-precondition: The app is already open in another browser tab and * multi-tab is not enabled. - * * unimplemented: The browser is incompatible with the offline - * persistence implementation. + * * unimplemented: The browser is incompatible with the offline persistence + * implementation. + * + * Note that even after a failure, the {@link Firestore} instance will remain + * usable, however offline persistence will be disabled. * - * @param firestore - The `Firestore` instance to enable persistence for. - * @returns A promise that represents successfully enabling persistent + * @param firestore - The {@link Firestore} instance to enable persistence for. + * @returns A `Promise` that represents successfully enabling persistent * storage. + * @deprecated This function will be removed in a future major release. Instead, set + * `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to + * turn on indexeddb cache. Calling this function when `FirestoreSettings.localCache` + * is already specified will throw an exception. */ export declare function enableMultiTabIndexedDbPersistence( - firestore: FirebaseFirestore + firestore: Firestore ): Promise; /** - * Re-enables use of the network for this Firestore instance after a prior + * Re-enables use of the network for this {@link Firestore} instance after a prior * call to {@link disableNetwork}. * - * @returns A promise that is resolved once the network has been enabled. + * @returns A `Promise` that is resolved once the network has been enabled. */ -export declare function enableNetwork( - firestore: FirebaseFirestore -): Promise; +export declare function enableNetwork(firestore: Firestore): Promise; + +/** + * Enables the SDK to create persistent cache indexes automatically for local + * query execution when the SDK believes cache indexes can help improve + * performance. + * + * This feature is disabled by default. + */ +export declare function enablePersistentCacheIndexAutoCreation( + indexManager: PersistentCacheIndexManager +): void; /** - * Creates a `QueryConstraint` that modifies the result set to end at the - * provided document (inclusive). The end position is relative to the order of - * the query. The document must contain all of the fields provided in the + * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at + * the provided document (inclusive). The end position is relative to the order + * of the query. The document must contain all of the fields provided in the * orderBy of the query. * * @param snapshot - The snapshot of the document to end at. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryEndAtConstraint} to pass to `query()` */ -export declare function endAt( - snapshot: DocumentSnapshot_2 -): QueryConstraint; +export declare function endAt( + snapshot: DocumentSnapshot_2 +): QueryEndAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to end at the - * provided fields relative to the order of the query. The order of the field + * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at + * the provided fields relative to the order of the query. The order of the field * values must match the order of the order by clauses of the query. * * @param fieldValues - The field values to end this query at, in order * of the query's order by. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryEndAtConstraint} to pass to `query()` */ -export declare function endAt(...fieldValues: unknown[]): QueryConstraint; +export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to end before the - * provided document (exclusive). The end position is relative to the order of - * the query. The document must contain all of the fields provided in the - * orderBy of the query. + * Creates a {@link QueryEndAtConstraint} that modifies the result set to end + * before the provided document (exclusive). The end position is relative to the + * order of the query. The document must contain all of the fields provided in + * the orderBy of the query. * * @param snapshot - The snapshot of the document to end before. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryEndAtConstraint} to pass to `query()` */ -export declare function endBefore( - snapshot: DocumentSnapshot_2 -): QueryConstraint; +export declare function endBefore< + AppModelType, + DbModelType extends DocumentData +>( + snapshot: DocumentSnapshot_2 +): QueryEndAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to end before the - * provided fields relative to the order of the query. The order of the field - * values must match the order of the order by clauses of the query. + * Creates a {@link QueryEndAtConstraint} that modifies the result set to end + * before the provided fields relative to the order of the query. The order of + * the field values must match the order of the order by clauses of the query. * * @param fieldValues - The field values to end this query before, in order * of the query's order by. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryEndAtConstraint} to pass to `query()` */ -export declare function endBefore(...fieldValues: unknown[]): QueryConstraint; +export declare function endBefore( + ...fieldValues: unknown[] +): QueryEndAtConstraint; + +/* Excluded from this release type: ensureFirestoreConfigured */ declare interface Entry { key: K; @@ -1295,27 +1653,139 @@ declare interface Entry { * allows users to tree-shake the Watch logic. */ declare interface EventManager { - onListen?: (query: Query_2) => Promise; - onUnlisten?: (query: Query_2) => Promise; + onListen?: ( + query: Query_2, + enableRemoteListen: boolean + ) => Promise; + onUnlisten?: (query: Query_2, disableRemoteListen: boolean) => Promise; + onFirstRemoteStoreListen?: (query: Query_2) => Promise; + onLastRemoteStoreUnlisten?: (query: Query_2) => Promise; + terminate(): void; } -declare type FieldFilterOp = - | 'OPERATOR_UNSPECIFIED' - | 'LESS_THAN' - | 'LESS_THAN_OR_EQUAL' - | 'GREATER_THAN' - | 'GREATER_THAN_OR_EQUAL' - | 'EQUAL' - | 'NOT_EQUAL' - | 'ARRAY_CONTAINS' - | 'IN' - | 'ARRAY_CONTAINS_ANY' - | 'NOT_IN'; +/* Excluded from this release type: executeWrite */ /** - * Provides a set of fields that can be used to partially patch a document. - * FieldMask is used in conjunction with ObjectValue. - * Examples: + * @license + * Copyright 2023 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. + */ +/** + * Options that configure the SDK’s underlying network transport (WebChannel) + * when long-polling is used. + * + * Note: This interface is "experimental" and is subject to change. + * + * See `FirestoreSettings.experimentalAutoDetectLongPolling`, + * `FirestoreSettings.experimentalForceLongPolling`, and + * `FirestoreSettings.experimentalLongPollingOptions`. + */ +export declare interface ExperimentalLongPollingOptions { + /** + * The desired maximum timeout interval, in seconds, to complete a + * long-polling GET response. Valid values are between 5 and 30, inclusive. + * Floating point values are allowed and will be rounded to the nearest + * millisecond. + * + * By default, when long-polling is used the "hanging GET" request sent by + * the client times out after 30 seconds. To request a different timeout + * from the server, set this setting with the desired timeout. + * + * Changing the default timeout may be useful, for example, if the buffering + * proxy that necessitated enabling long-polling in the first place has a + * shorter timeout for hanging GET requests, in which case setting the + * long-polling timeout to a shorter value, such as 25 seconds, may fix + * prematurely-closed hanging GET requests. + * For example, see https://github.com/firebase/firebase-js-sdk/issues/6987. + */ + timeoutSeconds?: number; +} + +declare class FieldFilter extends Filter { + readonly field: _FieldPath; + readonly op: Operator; + readonly value: Value; + protected constructor(field: _FieldPath, op: Operator, value: Value); + /** + * Creates a filter based on the provided arguments. + */ + static create(field: _FieldPath, op: Operator, value: Value): FieldFilter; + private static createKeyFieldInFilter; + matches(doc: Document_2): boolean; + protected matchesComparison(comparison: number): boolean; + isInequality(): boolean; + getFlattenedFilters(): readonly FieldFilter[]; + getFilters(): Filter[]; +} + +declare type FieldFilterOp = + | 'OPERATOR_UNSPECIFIED' + | 'LESS_THAN' + | 'LESS_THAN_OR_EQUAL' + | 'GREATER_THAN' + | 'GREATER_THAN_OR_EQUAL' + | 'EQUAL' + | 'NOT_EQUAL' + | 'ARRAY_CONTAINS' + | 'IN' + | 'ARRAY_CONTAINS_ANY' + | 'NOT_IN'; + +/** + * An index definition for field indexes in Firestore. + * + * Every index is associated with a collection. The definition contains a list + * of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or + * `CONTAINS` for ArrayContains/ArrayContainsAny queries). + * + * Unlike the backend, the SDK does not differentiate between collection or + * collection group-scoped indices. Every index can be used for both single + * collection and collection group queries. + */ +declare class FieldIndex { + /** + * The index ID. Returns -1 if the index ID is not available (e.g. the index + * has not yet been persisted). + */ + readonly indexId: number; + /** The collection ID this index applies to. */ + readonly collectionGroup: string; + /** The field segments for this index. */ + readonly fields: IndexSegment[]; + /** Shows how up-to-date the index is for the current user. */ + readonly indexState: IndexState; + /** An ID for an index that has not yet been added to persistence. */ + static UNKNOWN_ID: number; + constructor( + /** + * The index ID. Returns -1 if the index ID is not available (e.g. the index + * has not yet been persisted). + */ + indexId: number, + /** The collection ID this index applies to. */ + collectionGroup: string, + /** The field segments for this index. */ + fields: IndexSegment[], + /** Shows how up-to-date the index is for the current user. */ + indexState: IndexState + ); +} + +/** + * Provides a set of fields that can be used to partially patch a document. + * FieldMask is used in conjunction with ObjectValue. + * Examples: * foo - Overwrites foo entirely with the provided value. If foo is not * present in the companion ObjectValue, the field is deleted. * foo.bar - Overwrites only the field bar of the object foo. @@ -1323,15 +1793,21 @@ declare type FieldFilterOp = * containing foo */ declare class FieldMask { - readonly fields: FieldPath_2[]; - constructor(fields: FieldPath_2[]); + readonly fields: _FieldPath[]; + constructor(fields: _FieldPath[]); + static empty(): FieldMask; + /** + * Returns a new FieldMask object that is the result of adding all the given + * fields paths to this field mask. + */ + unionWith(extraFields: _FieldPath[]): FieldMask; /** * Verifies that `fieldPath` is included by at least one field in this field * mask. * * This is an O(n) operation, where `n` is the size of the field mask. */ - covers(fieldPath: FieldPath_2): boolean; + covers(fieldPath: _FieldPath): boolean; isEqual(other: FieldMask): boolean; } @@ -1345,9 +1821,9 @@ declare class FieldMask { */ export declare class FieldPath { /** Internal representation of a Firestore field path. */ - readonly _internalPath: FieldPath_2; + readonly _internalPath: _FieldPath; /** - * Creates a FieldPath from the provided field names. If more than one field + * Creates a `FieldPath` from the provided field names. If more than one field * name is provided, the path will point to a nested field in a document. * * @param fieldNames - A list of field names. @@ -1362,47 +1838,13 @@ export declare class FieldPath { isEqual(other: FieldPath): boolean; } -/** A dot-separated path for navigating sub-objects within a document. */ -declare class FieldPath_2 extends BasePath { - protected construct( - segments: string[], - offset?: number, - length?: number - ): FieldPath_2; - /** - * Returns true if the string could be used as a segment in a field path - * without escaping. - */ - private static isValidIdentifier; - canonicalString(): string; - toString(): string; - /** - * Returns true if this field references the key of a document. - */ - isKeyField(): boolean; - /** - * The field designating the key of a document. - */ - static keyField(): FieldPath_2; - /** - * Parses a field string from the given server-formatted string. - * - * - Splitting the empty string is not allowed (for now at least). - * - Empty segments within the string (e.g. if there are two consecutive - * separators) are not allowed. - * - * TODO(b/37244157): we should make this more strict. Right now, it allows - * non-identifier path components, even if they aren't escaped. - */ - static fromServerFormat(path: string): FieldPath_2; - static emptyPath(): FieldPath_2; -} +/* Excluded from this release type: _FieldPath */ /** A field path and the TransformOperation to perform upon it. */ declare class FieldTransform { - readonly field: FieldPath_2; + readonly field: _FieldPath; readonly transform: TransformOperation; - constructor(field: FieldPath_2, transform: TransformOperation); + constructor(field: _FieldPath, transform: TransformOperation); } declare type FieldTransformSetToServerValue = @@ -1417,62 +1859,87 @@ export declare abstract class FieldValue { _methodName: string; /** * @param _methodName - The public API endpoint that returns this class. + * @hideconstructor */ constructor(_methodName: string); + /** Compares `FieldValue`s for equality. */ abstract isEqual(other: FieldValue): boolean; abstract _toFieldTransform(context: ParseContext): FieldTransform | null; } declare abstract class Filter { abstract matches(doc: Document_2): boolean; + abstract getFlattenedFilters(): readonly FieldFilter[]; + abstract getFilters(): Filter[]; } +/* Excluded from this release type: _FirebaseService */ + /** * The Cloud Firestore service interface. * - * Do not call this constructor directly. Instead, use {@link getFirestore}. + * Do not call this constructor directly. Instead, use {@link (getFirestore:1)}. */ -export declare class FirebaseFirestore extends FirebaseFirestore_2 { - readonly _queue: AsyncQueue; +export declare class Firestore extends Firestore_2 { + /** + * Whether it's a {@link Firestore} or Firestore Lite instance. + */ + type: 'firestore-lite' | 'firestore'; + _queue: AsyncQueue; readonly _persistenceKey: string; _firestoreClient: FirestoreClient | undefined; + _componentsProvider?: { + _offline: OfflineComponentProviderFactory; + _online: OnlineComponentProviderFactory; + }; /** @hideconstructor */ constructor( - databaseIdOrApp: DatabaseId | FirebaseApp, - authProvider: Provider + authCredentialsProvider: CredentialsProvider, + appCheckCredentialsProvider: CredentialsProvider, + databaseId: _DatabaseId, + app?: FirebaseApp ); - _terminate(): Promise; + protected _terminate(): Promise; } /** * The Cloud Firestore service interface. * - * Do not call this constructor directly. Instead, use {@link getFirestore}. + * Do not call this constructor directly. Instead, use {@link (getFirestore:1)}. */ -declare class FirebaseFirestore_2 implements FirestoreService { - readonly _databaseId: DatabaseId; +declare class Firestore_2 implements FirestoreService { + _authCredentials: CredentialsProvider; + _appCheckCredentials: CredentialsProvider; + readonly _databaseId: _DatabaseId; + readonly _app?: FirebaseApp | undefined; + /** + * Whether it's a Firestore or Firestore Lite instance. + */ + type: 'firestore-lite' | 'firestore'; readonly _persistenceKey: string; - _credentials: CredentialsProvider; private _settings; private _settingsFrozen; - private _terminateTask?; - private _app?; + private _terminateTask; /** @hideconstructor */ constructor( - databaseIdOrApp: DatabaseId | FirebaseApp, - authProvider: Provider + _authCredentials: CredentialsProvider, + _appCheckCredentials: CredentialsProvider, + _databaseId: _DatabaseId, + _app?: FirebaseApp | undefined ); /** - * The {@link FirebaseApp} associated with this `Firestore` service + * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service * instance. */ get app(): FirebaseApp; get _initialized(): boolean; get _terminated(): boolean; _setSettings(settings: PrivateSettings): void; - _getSettings(): FirestoreSettings; - _freezeSettings(): FirestoreSettings; + _getSettings(): FirestoreSettingsImpl; + _freezeSettings(): FirestoreSettingsImpl; _delete(): Promise; + _restart(): Promise; + /** Returns a JSON-serializable representation of this `Firestore` instance. */ toJSON(): object; /** * Terminates all components used by this client. Subclasses can override @@ -1485,12 +1952,13 @@ declare class FirebaseFirestore_2 implements FirestoreService { } /** - * FirestoreClient is a top-level class that constructs and owns all of the - * pieces of the client SDK architecture. It is responsible for creating the - * async queue that is shared by all of the other components in the system. + * FirestoreClient is a top-level class that constructs and owns all of the // + * pieces of the client SDK architecture. It is responsible for creating the // + * async queue that is shared by all of the other components in the system. // */ declare class FirestoreClient { - private credentials; + private authCredentials; + private appCheckCredentials; /** * Asynchronous queue responsible for all of our internal processing. When * we get incoming work from the user (via public API) or the network @@ -1503,12 +1971,17 @@ declare class FirestoreClient { private databaseInfo; private user; private readonly clientId; - private credentialListener; - private readonly receivedInitialUser; - offlineComponents?: OfflineComponentProvider; - onlineComponents?: OnlineComponentProvider; + private authCredentialListener; + private appCheckCredentialListener; + _uninitializedComponentsProvider?: { + _offline: OfflineComponentProvider; + _online: OnlineComponentProvider; + }; + _offlineComponents?: OfflineComponentProvider; + _onlineComponents?: OnlineComponentProvider; constructor( - credentials: CredentialsProvider, + authCredentials: CredentialsProvider, + appCheckCredentials: CredentialsProvider, /** * Asynchronous queue responsible for all of our internal processing. When * we get incoming work from the user (via public API) or the network @@ -1518,179 +1991,528 @@ declare class FirestoreClient { * an async I/O to complete). */ asyncQueue: AsyncQueue, - databaseInfo: DatabaseInfo + databaseInfo: DatabaseInfo, + componentProvider?: { + _offline: OfflineComponentProvider; + _online: OnlineComponentProvider; + } ); - getConfiguration(): Promise; - setCredentialChangeListener(listener: (user: User) => void): void; - /** - * Checks that the client has not been terminated. Ensures that other methods on - * this class cannot be called after the client is terminated. - */ - verifyNotTerminated(): void; + get configuration(): ComponentConfiguration; + setCredentialChangeListener(listener: (user: User) => Promise): void; + setAppCheckTokenChangeListener( + listener: (appCheckToken: string, user: User) => Promise + ): void; terminate(): Promise; } /** - * Converter used by `withConverter()` to transform user objects of type `T` - * into Firestore data. + * Converter used by `withConverter()` to transform user objects of type + * `AppModelType` into Firestore data of type `DbModelType`. * * Using the converter allows you to specify generic type arguments when * storing and retrieving objects from Firestore. * + * In this context, an "AppModel" is a class that is used in an application to + * package together related information and functionality. Such a class could, + * for example, have properties with complex, nested data types, properties used + * for memoization, properties of types not supported by Firestore (such as + * `symbol` and `bigint`), and helper functions that perform compound + * operations. Such classes are not suitable and/or possible to store into a + * Firestore database. Instead, instances of such classes need to be converted + * to "plain old JavaScript objects" (POJOs) with exclusively primitive + * properties, potentially nested inside other POJOs or arrays of POJOs. In this + * context, this type is referred to as the "DbModel" and would be an object + * suitable for persisting into Firestore. For convenience, applications can + * implement `FirestoreDataConverter` and register the converter with Firestore + * objects, such as `DocumentReference` or `Query`, to automatically convert + * `AppModel` to `DbModel` when storing into Firestore, and convert `DbModel` + * to `AppModel` when retrieving from Firestore. + * * @example + * + * Simple Example + * + * ```typescript + * const numberConverter = { + * toFirestore(value: WithFieldValue) { + * return { value }; + * }, + * fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions) { + * return snapshot.data(options).value as number; + * } + * }; + * + * async function simpleDemo(db: Firestore): Promise { + * const documentRef = doc(db, 'values/value123').withConverter(numberConverter); + * + * // converters are used with `setDoc`, `addDoc`, and `getDoc` + * await setDoc(documentRef, 42); + * const snapshot1 = await getDoc(documentRef); + * assertEqual(snapshot1.data(), 42); + * + * // converters are not used when writing data with `updateDoc` + * await updateDoc(documentRef, { value: 999 }); + * const snapshot2 = await getDoc(documentRef); + * assertEqual(snapshot2.data(), 999); + * } + * ``` + * + * Advanced Example + * * ```typescript + * // The Post class is a model that is used by our application. + * // This class may have properties and methods that are specific + * // to our application execution, which do not need to be persisted + * // to Firestore. * class Post { - * constructor(readonly title: string, readonly author: string) {} + * constructor( + * readonly title: string, + * readonly author: string, + * readonly lastUpdatedMillis: number + * ) {} + * toString(): string { + * return `${this.title} by ${this.author}`; + * } + * } * - * toString(): string { - * return this.title + ', by ' + this.author; - * } + * // The PostDbModel represents how we want our posts to be stored + * // in Firestore. This DbModel has different properties (`ttl`, + * // `aut`, and `lut`) from the Post class we use in our application. + * interface PostDbModel { + * ttl: string; + * aut: { firstName: string; lastName: string }; + * lut: Timestamp; * } * - * const postConverter = { - * toFirestore(post: Post): firebase.firestore.DocumentData { - * return {title: post.title, author: post.author}; - * }, - * fromFirestore( - * snapshot: firebase.firestore.QueryDocumentSnapshot, - * options: firebase.firestore.SnapshotOptions - * ): Post { - * const data = snapshot.data(options)!; - * return new Post(data.title, data.author); - * } - * }; + * // The `PostConverter` implements `FirestoreDataConverter` and specifies + * // how the Firestore SDK can convert `Post` objects to `PostDbModel` + * // objects and vice versa. + * class PostConverter implements FirestoreDataConverter { + * toFirestore(post: WithFieldValue): WithFieldValue { + * return { + * ttl: post.title, + * aut: this._autFromAuthor(post.author), + * lut: this._lutFromLastUpdatedMillis(post.lastUpdatedMillis) + * }; + * } + * + * fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions): Post { + * const data = snapshot.data(options) as PostDbModel; + * const author = `${data.aut.firstName} ${data.aut.lastName}`; + * return new Post(data.ttl, author, data.lut.toMillis()); + * } + * + * _autFromAuthor( + * author: string | FieldValue + * ): { firstName: string; lastName: string } | FieldValue { + * if (typeof author !== 'string') { + * // `author` is a FieldValue, so just return it. + * return author; + * } + * const [firstName, lastName] = author.split(' '); + * return {firstName, lastName}; + * } + * + * _lutFromLastUpdatedMillis( + * lastUpdatedMillis: number | FieldValue + * ): Timestamp | FieldValue { + * if (typeof lastUpdatedMillis !== 'number') { + * // `lastUpdatedMillis` must be a FieldValue, so just return it. + * return lastUpdatedMillis; + * } + * return Timestamp.fromMillis(lastUpdatedMillis); + * } + * } * - * const postSnap = await firebase.firestore() - * .collection('posts') - * .withConverter(postConverter) - * .doc().get(); - * const post = postSnap.data(); - * if (post !== undefined) { - * post.title; // string - * post.toString(); // Should be defined - * post.someNonExistentProperty; // TS error + * async function advancedDemo(db: Firestore): Promise { + * // Create a `DocumentReference` with a `FirestoreDataConverter`. + * const documentRef = doc(db, 'posts/post123').withConverter(new PostConverter()); + * + * // The `data` argument specified to `setDoc()` is type checked by the + * // TypeScript compiler to be compatible with `Post`. Since the `data` + * // argument is typed as `WithFieldValue` rather than just `Post`, + * // this allows properties of the `data` argument to also be special + * // Firestore values that perform server-side mutations, such as + * // `arrayRemove()`, `deleteField()`, and `serverTimestamp()`. + * await setDoc(documentRef, { + * title: 'My Life', + * author: 'Foo Bar', + * lastUpdatedMillis: serverTimestamp() + * }); + * + * // The TypeScript compiler will fail to compile if the `data` argument to + * // `setDoc()` is _not_ compatible with `WithFieldValue`. This + * // type checking prevents the caller from specifying objects with incorrect + * // properties or property values. + * // @ts-expect-error "Argument of type { ttl: string; } is not assignable + * // to parameter of type WithFieldValue" + * await setDoc(documentRef, { ttl: 'The Title' }); + * + * // When retrieving a document with `getDoc()` the `DocumentSnapshot` + * // object's `data()` method returns a `Post`, rather than a generic object, + * // which would have been returned if the `DocumentReference` did _not_ have a + * // `FirestoreDataConverter` attached to it. + * const snapshot1: DocumentSnapshot = await getDoc(documentRef); + * const post1: Post = snapshot1.data()!; + * if (post1) { + * assertEqual(post1.title, 'My Life'); + * assertEqual(post1.author, 'Foo Bar'); + * } + * + * // The `data` argument specified to `updateDoc()` is type checked by the + * // TypeScript compiler to be compatible with `PostDbModel`. Note that + * // unlike `setDoc()`, whose `data` argument must be compatible with `Post`, + * // the `data` argument to `updateDoc()` must be compatible with + * // `PostDbModel`. Similar to `setDoc()`, since the `data` argument is typed + * // as `WithFieldValue` rather than just `PostDbModel`, this + * // allows properties of the `data` argument to also be those special + * // Firestore values, like `arrayRemove()`, `deleteField()`, and + * // `serverTimestamp()`. + * await updateDoc(documentRef, { + * 'aut.firstName': 'NewFirstName', + * lut: serverTimestamp() + * }); + * + * // The TypeScript compiler will fail to compile if the `data` argument to + * // `updateDoc()` is _not_ compatible with `WithFieldValue`. + * // This type checking prevents the caller from specifying objects with + * // incorrect properties or property values. + * // @ts-expect-error "Argument of type { title: string; } is not assignable + * // to parameter of type WithFieldValue" + * await updateDoc(documentRef, { title: 'New Title' }); + * const snapshot2: DocumentSnapshot = await getDoc(documentRef); + * const post2: Post = snapshot2.data()!; + * if (post2) { + * assertEqual(post2.title, 'My Life'); + * assertEqual(post2.author, 'NewFirstName Bar'); + * } * } * ``` */ -export declare interface FirestoreDataConverter - extends FirestoreDataConverter_2 { - /** - * Called by the Firestore SDK to convert a custom model object of type `T` - * into a plain JavaScript object (suitable for writing directly to the - * Firestore database). To use `set()` with `merge` and `mergeFields`, - * `toFirestore()` must be defined with `Partial`. - */ - toFirestore(modelObject: T): DocumentData; +export declare interface FirestoreDataConverter< + AppModelType, + DbModelType extends DocumentData = DocumentData +> extends FirestoreDataConverter_2 { /** - * Called by the Firestore SDK to convert a custom model object of type `T` - * into a plain JavaScript object (suitable for writing directly to the - * Firestore database). Used with {@link setData}, {@link WriteBatch#set} - * and {@link Transaction#set} with `merge:true` or `mergeFields`. + * Called by the Firestore SDK to convert a custom model object of type + * `AppModelType` into a plain JavaScript object (suitable for writing + * directly to the Firestore database) of type `DbModelType`. To use `set()` + * with `merge` and `mergeFields`, `toFirestore()` must be defined with + * `PartialWithFieldValue`. + * + * The `WithFieldValue` type extends `T` to also allow FieldValues such as + * {@link (deleteField:1)} to be used as property values. + */ + toFirestore( + modelObject: WithFieldValue + ): WithFieldValue; + /** + * Called by the Firestore SDK to convert a custom model object of type + * `AppModelType` into a plain JavaScript object (suitable for writing + * directly to the Firestore database) of type `DbModelType`. Used with + * {@link (setDoc:1)}, {@link (WriteBatch.set:1)} and + * {@link (Transaction.set:1)} with `merge:true` or `mergeFields`. + * + * The `PartialWithFieldValue` type extends `Partial` to allow + * FieldValues such as {@link (arrayUnion:1)} to be used as property values. + * It also supports nested `Partial` by allowing nested fields to be + * omitted. */ - toFirestore(modelObject: Partial, options: SetOptions): DocumentData; + toFirestore( + modelObject: PartialWithFieldValue, + options: SetOptions + ): PartialWithFieldValue; /** * Called by the Firestore SDK to convert Firestore data into an object of - * type T. You can access your data by calling: `snapshot.data(options)`. + * type `AppModelType`. You can access your data by calling: + * `snapshot.data(options)`. + * + * Generally, the data returned from `snapshot.data()` can be cast to + * `DbModelType`; however, this is not guaranteed because Firestore does not + * enforce a schema on the database. For example, writes from a previous + * version of the application or writes from another client that did not use a + * type converter could have written data with different properties and/or + * property types. The implementation will need to choose whether to + * gracefully recover from non-conforming data or throw an error. + * + * To override this method, see {@link (FirestoreDataConverter.fromFirestore:1)}. * * @param snapshot - A `QueryDocumentSnapshot` containing your data and metadata. * @param options - The `SnapshotOptions` from the initial call to `data()`. */ fromFirestore( - snapshot: QueryDocumentSnapshot, + snapshot: QueryDocumentSnapshot, options?: SnapshotOptions - ): T; + ): AppModelType; } /** - * Converter used by `withConverter()` to transform user objects of type `T` - * into Firestore data. + * Converter used by `withConverter()` to transform user objects of type + * `AppModelType` into Firestore data of type `DbModelType`. * * Using the converter allows you to specify generic type arguments when * storing and retrieving objects from Firestore. * + * In this context, an "AppModel" is a class that is used in an application to + * package together related information and functionality. Such a class could, + * for example, have properties with complex, nested data types, properties used + * for memoization, properties of types not supported by Firestore (such as + * `symbol` and `bigint`), and helper functions that perform compound + * operations. Such classes are not suitable and/or possible to store into a + * Firestore database. Instead, instances of such classes need to be converted + * to "plain old JavaScript objects" (POJOs) with exclusively primitive + * properties, potentially nested inside other POJOs or arrays of POJOs. In this + * context, this type is referred to as the "DbModel" and would be an object + * suitable for persisting into Firestore. For convenience, applications can + * implement `FirestoreDataConverter` and register the converter with Firestore + * objects, such as `DocumentReference` or `Query`, to automatically convert + * `AppModel` to `DbModel` when storing into Firestore, and convert `DbModel` + * to `AppModel` when retrieving from Firestore. + * * @example + * + * Simple Example + * + * ```typescript + * const numberConverter = { + * toFirestore(value: WithFieldValue) { + * return { value }; + * }, + * fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions) { + * return snapshot.data(options).value as number; + * } + * }; + * + * async function simpleDemo(db: Firestore): Promise { + * const documentRef = doc(db, 'values/value123').withConverter(numberConverter); + * + * // converters are used with `setDoc`, `addDoc`, and `getDoc` + * await setDoc(documentRef, 42); + * const snapshot1 = await getDoc(documentRef); + * assertEqual(snapshot1.data(), 42); + * + * // converters are not used when writing data with `updateDoc` + * await updateDoc(documentRef, { value: 999 }); + * const snapshot2 = await getDoc(documentRef); + * assertEqual(snapshot2.data(), 999); + * } + * ``` + * + * Advanced Example + * * ```typescript + * // The Post class is a model that is used by our application. + * // This class may have properties and methods that are specific + * // to our application execution, which do not need to be persisted + * // to Firestore. * class Post { - * constructor(readonly title: string, readonly author: string) {} + * constructor( + * readonly title: string, + * readonly author: string, + * readonly lastUpdatedMillis: number + * ) {} + * toString(): string { + * return `${this.title} by ${this.author}`; + * } + * } * - * toString(): string { - * return this.title + ', by ' + this.author; - * } + * // The PostDbModel represents how we want our posts to be stored + * // in Firestore. This DbModel has different properties (`ttl`, + * // `aut`, and `lut`) from the Post class we use in our application. + * interface PostDbModel { + * ttl: string; + * aut: { firstName: string; lastName: string }; + * lut: Timestamp; * } * - * const postConverter = { - * toFirestore(post: Post): firebase.firestore.DocumentData { - * return {title: post.title, author: post.author}; - * }, - * fromFirestore(snapshot: firebase.firestore.QueryDocumentSnapshot): Post { - * const data = snapshot.data(options)!; - * return new Post(data.title, data.author); - * } - * }; + * // The `PostConverter` implements `FirestoreDataConverter` and specifies + * // how the Firestore SDK can convert `Post` objects to `PostDbModel` + * // objects and vice versa. + * class PostConverter implements FirestoreDataConverter { + * toFirestore(post: WithFieldValue): WithFieldValue { + * return { + * ttl: post.title, + * aut: this._autFromAuthor(post.author), + * lut: this._lutFromLastUpdatedMillis(post.lastUpdatedMillis) + * }; + * } + * + * fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions): Post { + * const data = snapshot.data(options) as PostDbModel; + * const author = `${data.aut.firstName} ${data.aut.lastName}`; + * return new Post(data.ttl, author, data.lut.toMillis()); + * } + * + * _autFromAuthor( + * author: string | FieldValue + * ): { firstName: string; lastName: string } | FieldValue { + * if (typeof author !== 'string') { + * // `author` is a FieldValue, so just return it. + * return author; + * } + * const [firstName, lastName] = author.split(' '); + * return {firstName, lastName}; + * } + * + * _lutFromLastUpdatedMillis( + * lastUpdatedMillis: number | FieldValue + * ): Timestamp | FieldValue { + * if (typeof lastUpdatedMillis !== 'number') { + * // `lastUpdatedMillis` must be a FieldValue, so just return it. + * return lastUpdatedMillis; + * } + * return Timestamp.fromMillis(lastUpdatedMillis); + * } + * } * - * const postSnap = await firebase.firestore() - * .collection('posts') - * .withConverter(postConverter) - * .doc().get(); - * const post = postSnap.data(); - * if (post !== undefined) { - * post.title; // string - * post.toString(); // Should be defined - * post.someNonExistentProperty; // TS error + * async function advancedDemo(db: Firestore): Promise { + * // Create a `DocumentReference` with a `FirestoreDataConverter`. + * const documentRef = doc(db, 'posts/post123').withConverter(new PostConverter()); + * + * // The `data` argument specified to `setDoc()` is type checked by the + * // TypeScript compiler to be compatible with `Post`. Since the `data` + * // argument is typed as `WithFieldValue` rather than just `Post`, + * // this allows properties of the `data` argument to also be special + * // Firestore values that perform server-side mutations, such as + * // `arrayRemove()`, `deleteField()`, and `serverTimestamp()`. + * await setDoc(documentRef, { + * title: 'My Life', + * author: 'Foo Bar', + * lastUpdatedMillis: serverTimestamp() + * }); + * + * // The TypeScript compiler will fail to compile if the `data` argument to + * // `setDoc()` is _not_ compatible with `WithFieldValue`. This + * // type checking prevents the caller from specifying objects with incorrect + * // properties or property values. + * // @ts-expect-error "Argument of type { ttl: string; } is not assignable + * // to parameter of type WithFieldValue" + * await setDoc(documentRef, { ttl: 'The Title' }); + * + * // When retrieving a document with `getDoc()` the `DocumentSnapshot` + * // object's `data()` method returns a `Post`, rather than a generic object, + * // which would have been returned if the `DocumentReference` did _not_ have a + * // `FirestoreDataConverter` attached to it. + * const snapshot1: DocumentSnapshot = await getDoc(documentRef); + * const post1: Post = snapshot1.data()!; + * if (post1) { + * assertEqual(post1.title, 'My Life'); + * assertEqual(post1.author, 'Foo Bar'); + * } + * + * // The `data` argument specified to `updateDoc()` is type checked by the + * // TypeScript compiler to be compatible with `PostDbModel`. Note that + * // unlike `setDoc()`, whose `data` argument must be compatible with `Post`, + * // the `data` argument to `updateDoc()` must be compatible with + * // `PostDbModel`. Similar to `setDoc()`, since the `data` argument is typed + * // as `WithFieldValue` rather than just `PostDbModel`, this + * // allows properties of the `data` argument to also be those special + * // Firestore values, like `arrayRemove()`, `deleteField()`, and + * // `serverTimestamp()`. + * await updateDoc(documentRef, { + * 'aut.firstName': 'NewFirstName', + * lut: serverTimestamp() + * }); + * + * // The TypeScript compiler will fail to compile if the `data` argument to + * // `updateDoc()` is _not_ compatible with `WithFieldValue`. + * // This type checking prevents the caller from specifying objects with + * // incorrect properties or property values. + * // @ts-expect-error "Argument of type { title: string; } is not assignable + * // to parameter of type WithFieldValue" + * await updateDoc(documentRef, { title: 'New Title' }); + * const snapshot2: DocumentSnapshot = await getDoc(documentRef); + * const post2: Post = snapshot2.data()!; + * if (post2) { + * assertEqual(post2.title, 'My Life'); + * assertEqual(post2.author, 'NewFirstName Bar'); + * } * } * ``` */ -declare interface FirestoreDataConverter_2 { - /** - * Called by the Firestore SDK to convert a custom model object of type `T` - * into a plain JavaScript object (suitable for writing directly to the - * Firestore database). Used with {@link setData}, {@link WriteBatch#set} - * and {@link Transaction#set}. - */ - toFirestore(modelObject: T): DocumentData; - /** - * Called by the Firestore SDK to convert a custom model object of type `T` - * into a plain JavaScript object (suitable for writing directly to the - * Firestore database). Used with {@link setData}, {@link WriteBatch#set} - * and {@link Transaction#set} with `merge:true` or `mergeFields`. +declare interface FirestoreDataConverter_2< + AppModelType, + DbModelType extends DocumentData = DocumentData +> { + /** + * Called by the Firestore SDK to convert a custom model object of type + * `AppModelType` into a plain JavaScript object (suitable for writing + * directly to the Firestore database) of type `DbModelType`. Used with + * {@link @firebase/firestore/lite#(setDoc:1)}, + * {@link @firebase/firestore/lite#(WriteBatch.set:1)} and + * {@link @firebase/firestore/lite#(Transaction.set:1)}. + * + * The `WithFieldValue` type extends `T` to also allow FieldValues such as + * {@link (deleteField:1)} to be used as property values. + */ + toFirestore( + modelObject: WithFieldValue + ): WithFieldValue; + /** + * Called by the Firestore SDK to convert a custom model object of type + * `AppModelType` into a plain JavaScript object (suitable for writing + * directly to the Firestore database) of type `DbModelType`. Used with + * {@link @firebase/firestore/lite#(setDoc:1)}, + * {@link @firebase/firestore/lite#(WriteBatch.set:1)} and + * {@link @firebase/firestore/lite#(Transaction.set:1)} with `merge:true` + * or `mergeFields`. + * + * The `PartialWithFieldValue` type extends `Partial` to allow + * FieldValues such as {@link (arrayUnion:1)} to be used as property values. + * It also supports nested `Partial` by allowing nested fields to be + * omitted. */ - toFirestore(modelObject: Partial, options: SetOptions): DocumentData; + toFirestore( + modelObject: PartialWithFieldValue, + options: SetOptions + ): PartialWithFieldValue; /** * Called by the Firestore SDK to convert Firestore data into an object of - * type T. You can access your data by calling: `snapshot.data()`. + * type `AppModelType`. You can access your data by calling: + * `snapshot.data()`. + * + * + * Generally, the data returned from `snapshot.data()` can be cast to + * `DbModelType`; however, this is not guaranteed because Firestore does not + * enforce a schema on the database. For example, writes from a previous + * version of the application or writes from another client that did not use a + * type converter could have written data with different properties and/or + * property types. The implementation will need to choose whether to + * gracefully recover from non-conforming data or throw an error. * * @param snapshot - A `QueryDocumentSnapshot` containing your data and * metadata. */ - fromFirestore(snapshot: QueryDocumentSnapshot_2): T; + fromFirestore( + snapshot: QueryDocumentSnapshot_2 + ): AppModelType; } /** An error returned by a Firestore operation. */ -export declare class FirestoreError extends Error { +export declare class FirestoreError extends FirebaseError { + /** + * The backend error code associated with this error. + */ readonly code: FirestoreErrorCode; + /** + * A custom error description. + */ readonly message: string; - readonly name: string; + /** The stack of the error. */ readonly stack?: string; /** @hideconstructor */ - constructor(code: FirestoreErrorCode, message: string); + constructor( + /** + * The backend error code associated with this error. + */ + code: FirestoreErrorCode, + /** + * A custom error description. + */ + message: string + ); } -/** - * @license - * Copyright 2017 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. - */ /** * The set of Firestore status codes. The codes are the same at the ones * exposed by gRPC here: @@ -1748,6 +2570,13 @@ export declare type FirestoreErrorCode = | 'data-loss' | 'unauthenticated'; +/** + * Union type from all supported SDK cache layer. + */ +export declare type FirestoreLocalCache = + | MemoryLocalCache + | PersistentLocalCache; + /** * An interface implemented by FirebaseFirestore that provides compatibility * with the usage in this file. @@ -1755,19 +2584,112 @@ export declare type FirestoreErrorCode = * This interface mainly exists to remove a cyclic dependency. */ declare interface FirestoreService extends _FirebaseService { - _credentials: CredentialsProvider; + _authCredentials: CredentialsProvider; + _appCheckCredentials: CredentialsProvider; _persistenceKey: string; - _databaseId: DatabaseId; + _databaseId: _DatabaseId; _terminated: boolean; - _freezeSettings(): FirestoreSettings; + _freezeSettings(): FirestoreSettingsImpl; +} + +/** + * Specifies custom configurations for your Cloud Firestore instance. + * You must set these before invoking any other methods. + */ +export declare interface FirestoreSettings extends FirestoreSettings_2 { + /** + * NOTE: This field will be deprecated in a future major release. Use `cache` field + * instead to specify cache size, and other cache configurations. + * + * An approximate cache size threshold for the on-disk data. If the cache + * grows beyond this size, Firestore will start removing data that hasn't been + * recently used. The size is not a guarantee that the cache will stay below + * that size, only that if the cache exceeds the given size, cleanup will be + * attempted. + * + * The default value is 40 MB. The threshold must be set to at least 1 MB, and + * can be set to `CACHE_SIZE_UNLIMITED` to disable garbage collection. + */ + cacheSizeBytes?: number; + /** + * Specifies the cache used by the SDK. Available options are `MemoryLocalCache` + * and `PersistentLocalCache`, each with different configuration options. + * + * When unspecified, `MemoryLocalCache` will be used by default. + * + * NOTE: setting this field and `cacheSizeBytes` at the same time will throw + * exception during SDK initialization. Instead, using the configuration in + * the `FirestoreLocalCache` object to specify the cache size. + */ + localCache?: FirestoreLocalCache; + /** + * Forces the SDK’s underlying network transport (WebChannel) to use + * long-polling. Each response from the backend will be closed immediately + * after the backend sends data (by default responses are kept open in + * case the backend has more data to send). This avoids incompatibility + * issues with certain proxies, antivirus software, etc. that incorrectly + * buffer traffic indefinitely. Use of this option will cause some + * performance degradation though. + * + * This setting cannot be used with `experimentalAutoDetectLongPolling` and + * may be removed in a future release. If you find yourself using it to + * work around a specific network reliability issue, please tell us about + * it in https://github.com/firebase/firebase-js-sdk/issues/1674. + * + * This setting cannot be used in a Node.js environment. + */ + experimentalForceLongPolling?: boolean; + /** + * Configures the SDK's underlying transport (WebChannel) to automatically + * detect if long-polling should be used. This is very similar to + * `experimentalForceLongPolling`, but only uses long-polling if required. + * + * After having had a default value of `false` since its inception in 2019, + * the default value of this setting was changed in May 2023 to `true` in + * v9.22.0 of the Firebase JavaScript SDK. That is, auto-detection of long + * polling is now enabled by default. To disable it, set this setting to + * `false`, and please open a GitHub issue to share the problems that + * motivated you disabling long-polling auto-detection. + * + * This setting cannot be used in a Node.js environment. + */ + experimentalAutoDetectLongPolling?: boolean; + /** + * Options that configure the SDK’s underlying network transport (WebChannel) + * when long-polling is used. + * + * These options are only used if `experimentalForceLongPolling` is true or if + * `experimentalAutoDetectLongPolling` is true and the auto-detection + * determined that long-polling was needed. Otherwise, these options have no + * effect. + */ + experimentalLongPollingOptions?: ExperimentalLongPollingOptions; +} + +/** + * Specifies custom configurations for your Cloud Firestore instance. + * You must set these before invoking any other methods. + */ +declare interface FirestoreSettings_2 { + /** The hostname to connect to. */ + host?: string; + /** Whether to use SSL when connecting. */ + ssl?: boolean; + /** + * Whether to skip nested properties that are set to `undefined` during + * object serialization. If set to `true`, these properties are skipped + * and not written to Firestore. If set to `false` or omitted, the SDK + * throws an exception when it encounters properties of type `undefined`. + */ + ignoreUndefinedProperties?: boolean; } /** * A concrete type describing all the values that can be applied via a - * user-supplied firestore.Settings object. This is a separate type so that + * user-supplied `FirestoreSettings` object. This is a separate type so that * defaults can be supplied and the value can be checked for equality. */ -declare class FirestoreSettings { +declare class FirestoreSettingsImpl { /** The hostname to connect to. */ readonly host: string; /** Whether to use SSL when connecting. */ @@ -1775,10 +2697,13 @@ declare class FirestoreSettings { readonly cacheSizeBytes: number; readonly experimentalForceLongPolling: boolean; readonly experimentalAutoDetectLongPolling: boolean; + readonly experimentalLongPollingOptions: ExperimentalLongPollingOptions; readonly ignoreUndefinedProperties: boolean; + readonly useFetchStreams: boolean; + readonly localCache?: FirestoreLocalCache; credentials?: any; constructor(settings: PrivateSettings); - isEqual(other: FirestoreSettings): boolean; + isEqual(other: FirestoreSettingsImpl): boolean; } declare namespace firestoreV1ApiClientInterfaces { @@ -1861,6 +2786,15 @@ declare namespace firestoreV1ApiClientInterfaces { interface ExistenceFilter { targetId?: number; count?: number; + unchangedNames?: BloomFilter; + } + interface BloomFilter { + bits?: BitSequence; + hashCount?: number; + } + interface BitSequence { + bitmap?: string | Uint8Array; + padding?: number; } interface FieldFilter { field?: FieldReference; @@ -1886,7 +2820,7 @@ declare namespace firestoreV1ApiClientInterfaces { name?: string; collectionId?: string; fields?: IndexField[]; - state?: IndexState; + state?: IndexState_2; } interface IndexField { fieldPath?: string; @@ -1971,6 +2905,40 @@ declare namespace firestoreV1ApiClientInterfaces { readTime?: string; skippedResults?: number; } + interface RunAggregationQueryRequest { + parent?: string; + structuredAggregationQuery?: StructuredAggregationQuery; + transaction?: string; + newTransaction?: TransactionOptions; + readTime?: string; + } + interface RunAggregationQueryResponse { + result?: AggregationResult; + transaction?: string; + readTime?: string; + } + interface AggregationResult { + aggregateFields?: ApiClientObjectMap; + } + interface StructuredAggregationQuery { + structuredQuery?: StructuredQuery; + aggregations?: Aggregation[]; + } + interface Aggregation { + count?: Count; + sum?: Sum; + avg?: Avg; + alias?: string; + } + interface Count { + upTo?: number; + } + interface Sum { + field?: FieldReference; + } + interface Avg { + field?: FieldReference; + } interface Status { code?: number; message?: string; @@ -1997,6 +2965,11 @@ declare namespace firestoreV1ApiClientInterfaces { readTime?: Timestamp_2; targetId?: number; once?: boolean; + expectedCount?: + | number + | { + value: number; + }; } interface TargetChange { targetChangeType?: TargetChangeTargetChangeType; @@ -2053,11 +3026,7 @@ declare namespace firestoreV1ApiClientInterfaces { } } -declare interface FirstPartyCredentialsSettings { - ['type']: 'gapi'; - ['client']: unknown; - ['sessionIndex']: string; -} +/* Excluded from this release type: FirstPartyCredentialsSettings */ /** * @license @@ -2079,16 +3048,6 @@ declare type FulfilledHandler = | ((result: T) => R | PersistencePromise) | null; -/** - * Interface implemented by the LRU scheduler to start(), stop() and restart - * garbage collection. - */ -declare interface GarbageCollectionScheduler { - readonly started: boolean; - start(localStore: LocalStore): void; - stop(): void; -} - /** * @license * Copyright 2017 Google LLC @@ -2137,6 +3096,7 @@ export declare class GeoPoint { * @returns true if this `GeoPoint` is equal to the provided one. */ isEqual(other: GeoPoint): boolean; + /** Returns a JSON-serializable representation of this GeoPoint. */ toJSON(): { latitude: number; longitude: number; @@ -2148,6 +3108,86 @@ export declare class GeoPoint { _compareTo(other: GeoPoint): number; } +/** + * Calculates the specified aggregations over the documents in the result + * set of the given query without actually downloading the documents. + * + * Using this function to perform aggregations is efficient because only the + * final aggregation values, not the documents' data, are downloaded. This + * function can perform aggregations of the documents in cases where the result + * set is prohibitively large to download entirely (thousands of documents). + * + * The result received from the server is presented, unaltered, without + * considering any local state. That is, documents in the local cache are not + * taken into consideration, neither are local modifications not yet + * synchronized with the server. Previously-downloaded results, if any, are not + * used. Every invocation of this function necessarily involves a round trip to + * the server. + * + * @param query The query whose result set is aggregated over. + * @param aggregateSpec An `AggregateSpec` object that specifies the aggregates + * to perform over the result set. The AggregateSpec specifies aliases for each + * aggregate, which can be used to retrieve the aggregate result. + * @example + * ```typescript + * const aggregateSnapshot = await getAggregateFromServer(query, { + * countOfDocs: count(), + * totalHours: sum('hours'), + * averageScore: average('score') + * }); + * + * const countOfDocs: number = aggregateSnapshot.data().countOfDocs; + * const totalHours: number = aggregateSnapshot.data().totalHours; + * const averageScore: number | null = aggregateSnapshot.data().averageScore; + * ``` + */ +export declare function getAggregateFromServer< + AggregateSpecType extends AggregateSpec, + AppModelType, + DbModelType extends DocumentData +>( + query: Query, + aggregateSpec: AggregateSpecType +): Promise< + AggregateQuerySnapshot +>; + +/** + * Calculates the number of documents in the result set of the given query + * without actually downloading the documents. + * + * Using this function to count the documents is efficient because only the + * final count, not the documents' data, is downloaded. This function can + * count the documents in cases where the result set is prohibitively large to + * download entirely (thousands of documents). + * + * The result received from the server is presented, unaltered, without + * considering any local state. That is, documents in the local cache are not + * taken into consideration, neither are local modifications not yet + * synchronized with the server. Previously-downloaded results, if any, are not + * used. Every invocation of this function necessarily involves a round trip to + * the server. + * + * @param query The query whose result set size is calculated. + * @returns A Promise that will be resolved with the count; the count can be + * retrieved from `snapshot.data().count`, where `snapshot` is the + * `AggregateQuerySnapshot` to which the returned Promise resolves. + */ +export declare function getCountFromServer< + AppModelType, + DbModelType extends DocumentData +>( + query: Query +): Promise< + AggregateQuerySnapshot< + { + count: AggregateField; + }, + AppModelType, + DbModelType + > +>; + /** * Reads the document referred to by this `DocumentReference`. * @@ -2160,31 +3200,37 @@ export declare class GeoPoint { * @returns A Promise resolved with a `DocumentSnapshot` containing the * current document contents. */ -export declare function getDoc( - reference: DocumentReference -): Promise>; +export declare function getDoc( + reference: DocumentReference +): Promise>; /** * Reads the document referred to by this `DocumentReference` from cache. * Returns an error if the document is not currently cached. * - * @returns A Promise resolved with a `DocumentSnapshot` containing the + * @returns A `Promise` resolved with a `DocumentSnapshot` containing the * current document contents. */ -export declare function getDocFromCache( - reference: DocumentReference -): Promise>; +export declare function getDocFromCache< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference +): Promise>; /** * Reads the document referred to by this `DocumentReference` from the server. * Returns an error if the network is not available. * - * @returns A Promise resolved with a `DocumentSnapshot` containing the + * @returns A `Promise` resolved with a `DocumentSnapshot` containing the * current document contents. */ -export declare function getDocFromServer( - reference: DocumentReference -): Promise>; +export declare function getDocFromServer< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference +): Promise>; /** * Executes the query and returns the results as a `QuerySnapshot`. @@ -2194,44 +3240,126 @@ export declare function getDocFromServer( * you are offline and the server cannot be reached. To specify this behavior, * invoke {@link getDocsFromCache} or {@link getDocsFromServer}. * - * @returns A Promise that will be resolved with the results of the query. + * @returns A `Promise` that will be resolved with the results of the query. */ -export declare function getDocs(query: Query): Promise>; +export declare function getDocs( + query: Query +): Promise>; /** * Executes the query and returns the results as a `QuerySnapshot` from cache. - * Returns an error if the document is not currently cached. + * Returns an empty result set if no documents matching the query are currently + * cached. * - * @returns A Promise that will be resolved with the results of the query. + * @returns A `Promise` that will be resolved with the results of the query. */ -export declare function getDocsFromCache( - query: Query -): Promise>; +export declare function getDocsFromCache< + AppModelType, + DbModelType extends DocumentData +>( + query: Query +): Promise>; /** * Executes the query and returns the results as a `QuerySnapshot` from the * server. Returns an error if the network is not available. * - * @returns A Promise that will be resolved with the results of the query. + * @returns A `Promise` that will be resolved with the results of the query. + */ +export declare function getDocsFromServer< + AppModelType, + DbModelType extends DocumentData +>( + query: Query +): Promise>; + +/** + * Returns the existing default {@link Firestore} instance that is associated with the + * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new + * instance with default settings. + * + * @returns The default {@link Firestore} instance of the default app. + */ +export declare function getFirestore(): Firestore; + +/** + * Returns the existing default {@link Firestore} instance that is associated with the + * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new + * instance with default settings. + * + * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore} + * instance is associated with. + * @returns The default {@link Firestore} instance of the provided app. + */ +export declare function getFirestore(app: FirebaseApp): Firestore; + +/** + * Returns the existing named {@link Firestore} instance that is associated with the + * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new + * instance with default settings. + * + * @param databaseId - The name of the database. + * @returns The named {@link Firestore} instance of the default app. + * @beta */ -export declare function getDocsFromServer( - query: Query -): Promise>; +export declare function getFirestore(databaseId: string): Firestore; /** - * Returns the existing instance of Firestore that is associated with the - * provided {@link FirebaseApp}. If no instance exists, initializes a new + * Returns the existing named {@link Firestore} instance that is associated with the + * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new * instance with default settings. * - * @param app - The {@link FirebaseApp} instance that the returned Firestore + * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore} * instance is associated with. - * @returns The `Firestore` instance of the provided app. + * @param databaseId - The name of the database. + * @returns The named {@link Firestore} instance of the provided app. + * @beta + */ +export declare function getFirestore( + app: FirebaseApp, + databaseId: string +): Firestore; + +/** + * Returns the PersistentCache Index Manager used by the given `Firestore` + * object. + * + * @return The `PersistentCacheIndexManager` instance, or `null` if local + * persistent storage is not in use. + */ +export declare function getPersistentCacheIndexManager( + firestore: Firestore +): PersistentCacheIndexManager | null; + +/** + * General purpose cache for global values. + * + * Global state that cuts across components should be saved here. Following are contained herein: + * + * `sessionToken` tracks server interaction across Listen and Write streams. This facilitates cache + * synchronization and invalidation. */ -export declare function getFirestore(app: FirebaseApp): FirebaseFirestore; +declare interface GlobalsCache { + /** + * Gets session token. + */ + getSessionToken( + transaction: PersistenceTransaction + ): PersistencePromise<_ByteString>; + /** + * Sets session token. + * + * @param sessionToken - The new session token. + */ + setSessionToken( + transaction: PersistenceTransaction, + sessionToken: _ByteString + ): PersistencePromise; +} /** - * Returns a special value that can be used with {@link setDoc} or {@link - * updateDoc} that tells the server to increment the field's current value by + * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link + * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by * the given value. * * If either the operand or the current field value uses floating point @@ -2250,8 +3378,86 @@ export declare function getFirestore(app: FirebaseApp): FirebaseFirestore; */ export declare function increment(n: number): FieldValue; +/** + * The SDK definition of a Firestore index. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare interface Index { + /** The ID of the collection to index. */ + readonly collectionGroup: string; + /** A list of fields to index. */ + readonly fields?: IndexField[]; + [key: string]: unknown; +} + +/** + * A list of Firestore indexes to speed up local query execution. + * + * See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format} + * for a description of the format of the index definition. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare interface IndexConfiguration { + /** A list of all Firestore indexes. */ + readonly indexes?: Index[]; + [key: string]: unknown; +} + +/** + * A single field element in an index configuration. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare interface IndexField { + /** The field path to index. */ + readonly fieldPath: string; + /** + * What type of array index to create. Set to `CONTAINS` for `array-contains` + * and `array-contains-any` indexes. + * + * Only one of `arrayConfig` or `order` should be set; + */ + readonly arrayConfig?: 'CONTAINS'; + /** + * What type of array index to create. Set to `ASCENDING` or 'DESCENDING` for + * `==`, `!=`, `<=`, `<=`, `in` and `not-in` filters. + * + * Only one of `arrayConfig` or `order` should be set. + */ + readonly order?: 'ASCENDING' | 'DESCENDING'; + [key: string]: unknown; +} + declare type IndexFieldMode = 'MODE_UNSPECIFIED' | 'ASCENDING' | 'DESCENDING'; +/** The type of the index, e.g. for which type of query it can be used. */ +declare const enum IndexKind { + /** + * Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries. + */ + ASCENDING = 0, + /** + * Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries. + */ + DESCENDING = 1, + /** Contains index. Can be used for ArrayContains and ArrayContainsAny. */ + CONTAINS = 2 +} + /** * Represents a set of indexes that are used to execute queries efficiently. * @@ -2270,7 +3476,7 @@ declare interface IndexManager { */ addToCollectionParentIndex( transaction: PersistenceTransaction, - collectionPath: ResourcePath + collectionPath: _ResourcePath ): PersistencePromise; /** * Retrieves all parent locations containing the given collectionId, as a @@ -2280,45 +3486,267 @@ declare interface IndexManager { getCollectionParents( transaction: PersistenceTransaction, collectionId: string - ): PersistencePromise; + ): PersistencePromise<_ResourcePath[]>; + /** + * Adds a field path index. + * + * Values for this index are persisted via the index backfill, which runs + * asynchronously in the background. Once the first values are written, + * an index can be used to serve partial results for any matching queries. + * Any unindexed portion of the database will continue to be served via + * collection scons. + */ + addFieldIndex( + transaction: PersistenceTransaction, + index: FieldIndex + ): PersistencePromise; + /** Removes the given field index and deletes all index values. */ + deleteFieldIndex( + transaction: PersistenceTransaction, + index: FieldIndex + ): PersistencePromise; + /** Removes all field indexes and deletes all index values. */ + deleteAllFieldIndexes( + transaction: PersistenceTransaction + ): PersistencePromise; + /** Creates a full matched field index which serves the given target. */ + createTargetIndexes( + transaction: PersistenceTransaction, + target: Target + ): PersistencePromise; + /** + * Returns a list of field indexes that correspond to the specified collection + * group. + * + * @param collectionGroup The collection group to get matching field indexes + * for. + * @return A collection of field indexes for the specified collection group. + */ + getFieldIndexes( + transaction: PersistenceTransaction, + collectionGroup: string + ): PersistencePromise; + /** Returns all configured field indexes. */ + getFieldIndexes( + transaction: PersistenceTransaction + ): PersistencePromise; + /** + * Returns the type of index (if any) that can be used to serve the given + * target. + */ + getIndexType( + transaction: PersistenceTransaction, + target: Target + ): PersistencePromise; + /** + * Returns the documents that match the given target based on the provided + * index or `null` if the target does not have a matching index. + */ + getDocumentsMatchingTarget( + transaction: PersistenceTransaction, + target: Target + ): PersistencePromise<_DocumentKey[] | null>; + /** + * Returns the next collection group to update. Returns `null` if no group + * exists. + */ + getNextCollectionGroupToUpdate( + transaction: PersistenceTransaction + ): PersistencePromise; + /** + * Sets the collection group's latest read time. + * + * This method updates the index offset for all field indices for the + * collection group and increments their sequence number. Subsequent calls to + * `getNextCollectionGroupToUpdate()` will return a different collection group + * (unless only one collection group is configured). + */ + updateCollectionGroup( + transaction: PersistenceTransaction, + collectionGroup: string, + offset: IndexOffset + ): PersistencePromise; + /** Updates the index entries for the provided documents. */ + updateIndexEntries( + transaction: PersistenceTransaction, + documents: DocumentMap + ): PersistencePromise; + /** + * Iterates over all field indexes that are used to serve the given target, + * and returns the minimum offset of them all. + */ + getMinOffset( + transaction: PersistenceTransaction, + target: Target + ): PersistencePromise; + /** Returns the minimum offset for the given collection group. */ + getMinOffsetFromCollectionGroup( + transaction: PersistenceTransaction, + collectionGroup: string + ): PersistencePromise; +} + +/** + * Stores the latest read time, document and batch ID that were processed for an + * index. + */ +declare class IndexOffset { + /** + * The latest read time version that has been indexed by Firestore for this + * field index. + */ + readonly readTime: SnapshotVersion; + /** + * The key of the last document that was indexed for this query. Use + * `DocumentKey.empty()` if no document has been indexed. + */ + readonly documentKey: _DocumentKey; + readonly largestBatchId: number; + constructor( + /** + * The latest read time version that has been indexed by Firestore for this + * field index. + */ + readTime: SnapshotVersion, + /** + * The key of the last document that was indexed for this query. Use + * `DocumentKey.empty()` if no document has been indexed. + */ + documentKey: _DocumentKey, + largestBatchId: number + ); + /** Returns an offset that sorts before all regular offsets. */ + static min(): IndexOffset; + /** Returns an offset that sorts after all regular offsets. */ + static max(): IndexOffset; +} + +/** An index component consisting of field path and index type. */ +declare class IndexSegment { + /** The field path of the component. */ + readonly fieldPath: _FieldPath; + /** The fields sorting order. */ + readonly kind: IndexKind; + constructor( + /** The field path of the component. */ + fieldPath: _FieldPath, + /** The fields sorting order. */ + kind: IndexKind + ); +} + +/** + * Stores the "high water mark" that indicates how updated the Index is for the + * current user. + */ +declare class IndexState { + /** + * Indicates when the index was last updated (relative to other indexes). + */ + readonly sequenceNumber: number; + /** The the latest indexed read time, document and batch id. */ + readonly offset: IndexOffset; + constructor( + /** + * Indicates when the index was last updated (relative to other indexes). + */ + sequenceNumber: number, + /** The the latest indexed read time, document and batch id. */ + offset: IndexOffset + ); + /** The state of an index that has not yet been backfilled. */ + static empty(): IndexState; +} + +declare type IndexState_2 = + | 'STATE_UNSPECIFIED' + | 'CREATING' + | 'READY' + | 'ERROR'; + +/** Represents the index state as it relates to a particular target. */ +declare const enum IndexType { + /** Indicates that no index could be found for serving the target. */ + NONE = 0, + /** + * Indicates that only a "partial index" could be found for serving the + * target. A partial index is one which does not have a segment for every + * filter/orderBy in the target. + */ + PARTIAL = 1, + /** + * Indicates that a "full index" could be found for serving the target. A full + * index is one which has a segment for every filter/orderBy in the target. + */ + FULL = 2 } -declare type IndexState = 'STATE_UNSPECIFIED' | 'CREATING' | 'READY' | 'ERROR'; - /** - * Initializes a new instance of Cloud Firestore with the provided settings. + * Initializes a new instance of {@link Firestore} with the provided settings. * Can only be called before any other function, including - * {@link getFirestore}. If the custom settings are empty, this function is - * equivalent to calling {@link getFirestore}. + * {@link (getFirestore:1)}. If the custom settings are empty, this function is + * equivalent to calling {@link (getFirestore:1)}. * - * @param app - The {@link FirebaseApp} with which the `Firestore` instance will + * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will * be associated. - * @param settings - A settings object to configure the `Firestore` instance. - * @returns A newly initialized `Firestore` instance. + * @param settings - A settings object to configure the {@link Firestore} instance. + * @param databaseId - The name of the database. + * @returns A newly initialized {@link Firestore} instance. */ export declare function initializeFirestore( app: FirebaseApp, - settings: Settings -): FirebaseFirestore; + settings: FirestoreSettings, + databaseId?: string +): Firestore; + +/* Excluded from this release type: _internalAggregationQueryToProtoRunAggregationQueryRequest */ + +/* Excluded from this release type: _internalQueryToProtoQueryTarget */ + +/* Excluded from this release type: _isBase64Available */ + +/** + * This class generates JsonObject values for the Datastore API suitable for + * sending to either GRPC stub methods or via the JSON/HTTP REST API. + * + * The serializer supports both Protobuf.js and Proto3 JSON formats. By + * setting `useProto3Json` to true, the serializer will use the Proto3 JSON + * format. + * + * For a description of the Proto3 JSON format check + * https://developers.google.com/protocol-buffers/docs/proto3#json + * + * TODO(klimt): We can remove the databaseId argument if we keep the full + * resource name in documents. + */ +declare class JsonProtoSerializer implements Serializer { + readonly databaseId: _DatabaseId; + readonly useProto3Json: boolean; + constructor(databaseId: _DatabaseId, useProto3Json: boolean); +} + +declare type Kind = 'memory' | 'persistent'; /** - * Creates a `QueryConstraint` that only returns the first matching documents. + * Creates a {@link QueryLimitConstraint} that only returns the first matching + * documents. * * @param limit - The maximum number of items to return. - * @returns The created `Query`. + * @returns The created {@link QueryLimitConstraint}. */ -export declare function limit(limit: number): QueryConstraint; +export declare function limit(limit: number): QueryLimitConstraint; /** - * Creates a `QueryConstraint` that only returns the last matching documents. + * Creates a {@link QueryLimitConstraint} that only returns the last matching + * documents. * * You must specify at least one `orderBy` clause for `limitToLast` queries, * otherwise an exception will be thrown during execution. * * @param limit - The maximum number of items to return. - * @returns The created `Query`. + * @returns The created {@link QueryLimitConstraint}. */ -export declare function limitToLast(limit: number): QueryConstraint; +export declare function limitToLast(limit: number): QueryLimitConstraint; declare const enum LimitType { First = 'F', @@ -2330,6 +3758,14 @@ declare type LimitType_2 = 'FIRST' | 'LAST'; declare type ListenSequenceNumber = number; +/** + * Describe the source a query listens to. + * + * Set to `default` to listen to both cache and server changes. Set to `cache` + * to listen to changes in cache only. + */ +export declare type ListenSource = 'default' | 'cache'; + declare class LLRBEmptyNode { get key(): never; get value(): never; @@ -2406,16 +3842,16 @@ declare class LLRBNode { /** * Loads a Firestore bundle into the local cache. * - * @param firestore - The `Firestore` instance to load bundles for for. - * @param bundleData - An object representing the bundle to be loaded. Valid objects are - * `ArrayBuffer`, `ReadableStream` or `string`. + * @param firestore - The {@link Firestore} instance to load bundles for. + * @param bundleData - An object representing the bundle to be loaded. Valid + * objects are `ArrayBuffer`, `ReadableStream` or `string`. * - * @return - * A `LoadBundleTask` object, which notifies callers with progress updates, and completion - * or error events. It can be used as a `Promise`. + * @returns A `LoadBundleTask` object, which notifies callers with progress + * updates, and completion or error events. It can be used as a + * `Promise`. */ export declare function loadBundle( - firestore: FirebaseFirestore, + firestore: Firestore, bundleData: ReadableStream | ArrayBuffer | string ): LoadBundleTask; @@ -2502,11 +3938,160 @@ export declare interface LoadBundleTaskProgress { taskState: TaskState; } +/** + * A readonly view of the local state of all documents we're tracking (i.e. we + * have a cached version in remoteDocumentCache or local mutations for the + * document). The view is computed by applying the mutations in the + * MutationQueue to the RemoteDocumentCache. + */ +declare class LocalDocumentsView { + readonly remoteDocumentCache: RemoteDocumentCache; + readonly mutationQueue: MutationQueue; + readonly documentOverlayCache: DocumentOverlayCache; + readonly indexManager: IndexManager; + constructor( + remoteDocumentCache: RemoteDocumentCache, + mutationQueue: MutationQueue, + documentOverlayCache: DocumentOverlayCache, + indexManager: IndexManager + ); + /** + * Get the local view of the document identified by `key`. + * + * @returns Local view of the document or null if we don't have any cached + * state for it. + */ + getDocument( + transaction: PersistenceTransaction, + key: _DocumentKey + ): PersistencePromise; + /** + * Gets the local view of the documents identified by `keys`. + * + * If we don't have cached state for a document in `keys`, a NoDocument will + * be stored for that key in the resulting set. + */ + getDocuments( + transaction: PersistenceTransaction, + keys: DocumentKeySet + ): PersistencePromise; + /** + * Similar to `getDocuments`, but creates the local view from the given + * `baseDocs` without retrieving documents from the local store. + * + * @param transaction - The transaction this operation is scoped to. + * @param docs - The documents to apply local mutations to get the local views. + * @param existenceStateChanged - The set of document keys whose existence state + * is changed. This is useful to determine if some documents overlay needs + * to be recalculated. + */ + getLocalViewOfDocuments( + transaction: PersistenceTransaction, + docs: MutableDocumentMap, + existenceStateChanged?: DocumentKeySet + ): PersistencePromise; + /** + * Gets the overlayed documents for the given document map, which will include + * the local view of those documents and a `FieldMask` indicating which fields + * are mutated locally, `null` if overlay is a Set or Delete mutation. + */ + getOverlayedDocuments( + transaction: PersistenceTransaction, + docs: MutableDocumentMap + ): PersistencePromise; + /** + * Fetches the overlays for {@code docs} and adds them to provided overlay map + * if the map does not already contain an entry for the given document key. + */ + private populateOverlays; + /** + * Computes the local view for the given documents. + * + * @param docs - The documents to compute views for. It also has the base + * version of the documents. + * @param overlays - The overlays that need to be applied to the given base + * version of the documents. + * @param existenceStateChanged - A set of documents whose existence states + * might have changed. This is used to determine if we need to re-calculate + * overlays from mutation queues. + * @return A map represents the local documents view. + */ + computeViews( + transaction: PersistenceTransaction, + docs: MutableDocumentMap, + overlays: OverlayMap, + existenceStateChanged: DocumentKeySet + ): PersistencePromise; + private recalculateAndSaveOverlays; + /** + * Recalculates overlays by reading the documents from remote document cache + * first, and saves them after they are calculated. + */ + recalculateAndSaveOverlaysForDocumentKeys( + transaction: PersistenceTransaction, + documentKeys: DocumentKeySet + ): PersistencePromise>; + /** + * Performs a query against the local view of all documents. + * + * @param transaction - The persistence transaction. + * @param query - The query to match documents against. + * @param offset - Read time and key to start scanning by (exclusive). + * @param context - A optional tracker to keep a record of important details + * during database local query execution. + */ + getDocumentsMatchingQuery( + transaction: PersistenceTransaction, + query: Query_2, + offset: IndexOffset, + context?: QueryContext + ): PersistencePromise; + /** + * Given a collection group, returns the next documents that follow the provided offset, along + * with an updated batch ID. + * + *

The documents returned by this method are ordered by remote version from the provided + * offset. If there are no more remote documents after the provided offset, documents with + * mutations in order of batch id from the offset are returned. Since all documents in a batch are + * returned together, the total number of documents returned can exceed {@code count}. + * + * @param transaction + * @param collectionGroup The collection group for the documents. + * @param offset The offset to index into. + * @param count The number of documents to return + * @return A LocalWriteResult with the documents that follow the provided offset and the last processed batch id. + */ + getNextDocuments( + transaction: PersistenceTransaction, + collectionGroup: string, + offset: IndexOffset, + count: number + ): PersistencePromise; + private getDocumentsMatchingDocumentQuery; + private getDocumentsMatchingCollectionGroupQuery; + private getDocumentsMatchingCollectionQuery; +} + declare interface LocalStore { collectGarbage(garbageCollector: LruGarbageCollector): Promise; + /** Manages the list of active field and collection indices. */ + indexManager: IndexManager; + /** + * The "local" view of all documents (layering mutationQueue on top of + * remoteDocumentCache). + */ + localDocuments: LocalDocumentsView; +} + +/** The result of a write to the local store. */ +declare interface LocalWriteResult { + batchId: BatchId; + changes: DocumentMap; } export { LogLevel }; +/* Excluded from this release type: _logWarn */ + declare interface LruGarbageCollector { readonly params: LruParams; collect( @@ -2575,23 +4160,179 @@ declare interface LruResults { declare type MapValue = firestoreV1ApiClientInterfaces.MapValue; /** - * The result of a lookup for a given path may be an existing document or a - * marker that this document does not exist at a given version. + * An settings object to configure an `MemoryLocalCache` instance. */ -declare abstract class MaybeDocument { - readonly key: DocumentKey; - readonly version: SnapshotVersion; - constructor(key: DocumentKey, version: SnapshotVersion); +export declare type MemoryCacheSettings = { /** - * Whether this document had a local mutation applied that has not yet been - * acknowledged by Watch. + * The garbage collector to use, for the memory cache layer. + * A `MemoryEagerGarbageCollector` is used when this is undefined. */ - abstract get hasPendingWrites(): boolean; - abstract isEqual(other: MaybeDocument | null | undefined): boolean; - abstract toString(): string; + garbageCollector?: MemoryGarbageCollector; +}; + +/** + * A garbage collector deletes documents whenever they are not part of any + * active queries, and have no local mutations attached to them. + * + * This collector tries to ensure lowest memory footprints from the SDK, + * at the risk of documents not being cached for offline queries or for + * direct queries to the cache. + * + * Use factory function {@link memoryEagerGarbageCollector()} to create an + * instance of this collector. + */ +export declare type MemoryEagerGarbageCollector = { + kind: 'memoryEager'; + /* Excluded from this release type: _offlineComponentProvider */ +}; + +/** + * Creates an instance of `MemoryEagerGarbageCollector`. This is also the + * default garbage collector unless it is explicitly specified otherwise. + */ +export declare function memoryEagerGarbageCollector(): MemoryEagerGarbageCollector; + +/** + * Union type from all support garbage collectors for memory local cache. + */ +export declare type MemoryGarbageCollector = + | MemoryEagerGarbageCollector + | MemoryLruGarbageCollector; + +/** + * Provides an in-memory cache to the SDK. This is the default cache unless explicitly + * configured otherwise. + * + * To use, create an instance using the factory function {@link memoryLocalCache()}, then + * set the instance to `FirestoreSettings.cache` and call `initializeFirestore` using + * the settings object. + */ +export declare type MemoryLocalCache = { + kind: 'memory'; + /* Excluded from this release type: _onlineComponentProvider */ + /* Excluded from this release type: _offlineComponentProvider */ +}; + +/** + * Creates an instance of `MemoryLocalCache`. The instance can be set to + * `FirestoreSettings.cache` to tell the SDK which cache layer to use. + */ +export declare function memoryLocalCache( + settings?: MemoryCacheSettings +): MemoryLocalCache; + +/** + * A garbage collector deletes Least-Recently-Used documents in multiple + * batches. + * + * This collector is configured with a target size, and will only perform + * collection when the cached documents exceed the target size. It avoids + * querying backend repeated for the same query or document, at the risk + * of having a larger memory footprint. + * + * Use factory function {@link memoryLruGarbageCollector()} to create a + * instance of this collector. + */ +export declare type MemoryLruGarbageCollector = { + kind: 'memoryLru'; + /* Excluded from this release type: _offlineComponentProvider */ +}; + +/** + * Creates an instance of `MemoryLruGarbageCollector`. + * + * A target size can be specified as part of the setting parameter. The + * collector will start deleting documents once the cache size exceeds + * the given size. The default cache size is 40MB (40 * 1024 * 1024 bytes). + */ +export declare function memoryLruGarbageCollector(settings?: { + cacheSizeBytes?: number; +}): MemoryLruGarbageCollector; + +/** + * Represents a document in Firestore with a key, version, data and whether it + * has local mutations applied to it. + * + * Documents can transition between states via `convertToFoundDocument()`, + * `convertToNoDocument()` and `convertToUnknownDocument()`. If a document does + * not transition to one of these states even after all mutations have been + * applied, `isValidDocument()` returns false and the document should be removed + * from all views. + */ +declare class MutableDocument implements Document_2 { + readonly key: _DocumentKey; + private documentType; + version: SnapshotVersion; + readTime: SnapshotVersion; + createTime: SnapshotVersion; + data: ObjectValue; + private documentState; + private constructor(); + /** + * Creates a document with no known version or data, but which can serve as + * base document for mutations. + */ + static newInvalidDocument(documentKey: _DocumentKey): MutableDocument; + /** + * Creates a new document that is known to exist with the given data at the + * given version. + */ + static newFoundDocument( + documentKey: _DocumentKey, + version: SnapshotVersion, + createTime: SnapshotVersion, + value: ObjectValue + ): MutableDocument; + /** Creates a new document that is known to not exist at the given version. */ + static newNoDocument( + documentKey: _DocumentKey, + version: SnapshotVersion + ): MutableDocument; + /** + * Creates a new document that is known to exist at the given version but + * whose data is not known (e.g. a document that was updated without a known + * base document). + */ + static newUnknownDocument( + documentKey: _DocumentKey, + version: SnapshotVersion + ): MutableDocument; + /** + * Changes the document type to indicate that it exists and that its version + * and data are known. + */ + convertToFoundDocument( + version: SnapshotVersion, + value: ObjectValue + ): MutableDocument; + /** + * Changes the document type to indicate that it doesn't exist at the given + * version. + */ + convertToNoDocument(version: SnapshotVersion): MutableDocument; + /** + * Changes the document type to indicate that it exists at a given version but + * that its data is not known (e.g. a document that was updated without a known + * base document). + */ + convertToUnknownDocument(version: SnapshotVersion): MutableDocument; + setHasCommittedMutations(): MutableDocument; + setHasLocalMutations(): MutableDocument; + setReadTime(readTime: SnapshotVersion): MutableDocument; + get hasLocalMutations(): boolean; + get hasCommittedMutations(): boolean; + get hasPendingWrites(): boolean; + isValidDocument(): boolean; + isFoundDocument(): boolean; + isNoDocument(): boolean; + isUnknownDocument(): boolean; + isEqual(other: Document_2 | null | undefined): boolean; + mutableCopy(): MutableDocument; + toString(): string; } -declare type MaybeDocumentMap = SortedMap; +/** Miscellaneous collection types / constants. */ +declare type MutableDocumentMap = SortedMap<_DocumentKey, MutableDocument>; /** * A mutation describes a self-contained change to a document. Mutations can @@ -2609,13 +4350,13 @@ declare type MaybeDocumentMap = SortedMap; * * SetMutation Document(v3) Document(v3) * SetMutation NoDocument(v3) Document(v0) - * SetMutation null Document(v0) + * SetMutation InvalidDocument(v0) Document(v0) * PatchMutation Document(v3) Document(v3) * PatchMutation NoDocument(v3) NoDocument(v3) - * PatchMutation null null + * PatchMutation InvalidDocument(v0) UnknownDocument(v3) * DeleteMutation Document(v3) NoDocument(v0) * DeleteMutation NoDocument(v3) NoDocument(v0) - * DeleteMutation null NoDocument(v0) + * DeleteMutation InvalidDocument(v0) NoDocument(v0) * * For acknowledged mutations, we use the updateTime of the WriteResponse as * the resulting version for Set and Patch mutations. As deletes have no @@ -2623,8 +4364,8 @@ declare type MaybeDocumentMap = SortedMap; * Delete mutations. * * If a mutation is acknowledged by the backend but fails the precondition check - * locally, we return an `UnknownDocument` and rely on Watch to send us the - * updated version. + * locally, we transition to an `UnknownDocument` and rely on Watch to send us + * the updated version. * * Field transforms are used only with Patch and Set Mutations. We use the * `updateTransforms` message to store transforms, rather than the `transforms`s @@ -2632,15 +4373,22 @@ declare type MaybeDocumentMap = SortedMap; * * ## Subclassing Notes * - * Subclasses of Mutation need to implement applyToRemoteDocument() and + * Every type of mutation needs to implement its own applyToRemoteDocument() and * applyToLocalView() to implement the actual behavior of applying the mutation - * to some source document. + * to some source document (see `setMutationApplyToRemoteDocument()` for an + * example). */ declare abstract class Mutation { abstract readonly type: MutationType; - abstract readonly key: DocumentKey; + abstract readonly key: _DocumentKey; abstract readonly precondition: Precondition; abstract readonly fieldTransforms: FieldTransform[]; + /** + * Returns a `FieldMask` representing the fields that will be changed by + * applying this mutation. Returns `null` if the mutation will overwrite the + * entire document. + */ + abstract getFieldMask(): FieldMask | null; } /** @@ -2670,34 +4418,37 @@ declare class MutationBatch { ); /** * Applies all the mutations in this MutationBatch to the specified document - * to create a new remote document + * to compute the state of the remote document * - * @param docKey - The key of the document to apply mutations to. - * @param maybeDoc - The document to apply mutations to. + * @param document - The document to apply mutations to. * @param batchResult - The result of applying the MutationBatch to the * backend. */ applyToRemoteDocument( - docKey: DocumentKey, - maybeDoc: MaybeDocument | null, + document: MutableDocument, batchResult: MutationBatchResult - ): MaybeDocument | null; + ): void; /** * Computes the local view of a document given all the mutations in this * batch. * - * @param docKey - The key of the document to apply mutations to. - * @param maybeDoc - The document to apply mutations to. + * @param document - The document to apply mutations to. + * @param mutatedFields - Fields that have been updated before applying this mutation batch. + * @returns A `FieldMask` representing all the fields that are mutated. */ applyToLocalView( - docKey: DocumentKey, - maybeDoc: MaybeDocument | null - ): MaybeDocument | null; + document: MutableDocument, + mutatedFields: FieldMask | null + ): FieldMask | null; /** * Computes the local view for all provided documents given the mutations in - * this batch. + * this batch. Returns a `DocumentKey` to `Mutation` map which can be used to + * replace all the mutation applications. */ - applyToLocalDocumentSet(maybeDocs: MaybeDocumentMap): MaybeDocumentMap; + applyToLocalDocumentSet( + documentMap: OverlayedDocumentMap, + documentsWithoutRemoteVersion: DocumentKeySet + ): MutationMap; keys(): DocumentKeySet; isEqual(other: MutationBatch): boolean; } @@ -2725,6 +4476,8 @@ declare class MutationBatchResult { ): MutationBatchResult; } +declare type MutationMap = DocumentKeyMap; + /** A queue of mutations to apply to the remote store. */ declare interface MutationQueue { /** Returns true if this queue contains no mutation batches. */ @@ -2794,7 +4547,7 @@ declare interface MutationQueue { */ getAllMutationBatchesAffectingDocumentKey( transaction: PersistenceTransaction, - documentKey: DocumentKey + documentKey: _DocumentKey ): PersistencePromise; /** * Finds all mutation batches that could possibly affect the given set of @@ -2810,7 +4563,7 @@ declare interface MutationQueue { */ getAllMutationBatchesAffectingDocumentKeys( transaction: PersistenceTransaction, - documentKeys: SortedMap + documentKeys: SortedMap<_DocumentKey, unknown> ): PersistencePromise; /** * Finds all mutation batches that could affect the results for the given @@ -2871,9 +4624,9 @@ declare class MutationResult { * containing field transforms has been committed. Contains one FieldValue * for each FieldTransform that was in the mutation. * - * Will be null if the mutation did not contain any field transforms. + * Will be empty if the mutation did not contain any field transforms. */ - readonly transformResults: Array | null; + readonly transformResults: Array; constructor( /** * The version at which the mutation was committed: @@ -2891,9 +4644,9 @@ declare class MutationResult { * containing field transforms has been committed. Contains one FieldValue * for each FieldTransform that was in the mutation. * - * Will be null if the mutation did not contain any field transforms. + * Will be empty if the mutation did not contain any field transforms. */ - transformResults: Array | null + transformResults: Array ); } @@ -2917,14 +4670,19 @@ declare interface NamedQuery { } /** - * Reads a Firestore `Query` from local cache, identified by the given name. + * Reads a Firestore {@link Query} from local cache, identified by the given + * name. * * The named queries are packaged into bundles on the server side (along - * with resulting documents), and loaded to local cache using `loadBundle`. Once in local - * cache, use this method to extract a `Query` by name. + * with resulting documents), and loaded to local cache using `loadBundle`. Once + * in local cache, use this method to extract a {@link Query} by name. + * + * @param firestore - The {@link Firestore} instance to read the query from. + * @param name - The name of the query. + * @returns A `Promise` that is resolved with the Query or `null`. */ export declare function namedQuery( - firestore: FirebaseFirestore, + firestore: Firestore, name: string ): Promise; @@ -2938,10 +4696,17 @@ declare interface NamedQuery_2 { readTime?: Timestamp_2 | null; } -declare type NullableMaybeDocumentMap = SortedMap< - DocumentKey, - MaybeDocument | null ->; +/** + * For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, + * 'bar.qux': T2}). Intersect them together to make a single map containing + * all possible keys that are all marked as optional + */ +export declare type NestedUpdateFields> = + UnionToIntersection< + { + [K in keyof T & string]: ChildUpdateFields; + }[keyof T & string] + >; /** * @license @@ -2975,6 +4740,8 @@ declare class ObjectMap { * constant time lookups in practice. */ private inner; + /** The number of entries stored in the map */ + private innerSize; constructor( mapKeyFn: (key: KeyType) => string, equalsFn: (l: KeyType, r: KeyType) => boolean @@ -2990,6 +4757,7 @@ declare class ObjectMap { delete(key: KeyType): boolean; forEach(fn: (key: KeyType, val: ValueType) => void): void; isEmpty(): boolean; + size(): number; } /** @@ -2997,19 +4765,50 @@ declare class ObjectMap { * ability to add and remove fields (via the ObjectValueBuilder). */ declare class ObjectValue { - readonly proto: { + readonly value: { mapValue: MapValue; }; - constructor(proto: { mapValue: MapValue }); + constructor(value: { mapValue: MapValue }); static empty(): ObjectValue; /** * Returns the value at the given path or null. * * @param path - the path to search - * @returns The value at the path or if there it doesn't exist. + * @returns The value at the path or null if the path is not set. + */ + field(path: _FieldPath): Value | null; + /** + * Sets the field to the provided value. + * + * @param path - The field path to set. + * @param value - The value to set. + */ + set(path: _FieldPath, value: Value): void; + /** + * Sets the provided fields to the provided values. + * + * @param data - A map of fields to values (or null for deletes). + */ + setAll(data: Map<_FieldPath, Value | null>): void; + /** + * Removes the field at the specified path. If there is no field at the + * specified path, nothing is changed. + * + * @param path - The field path to remove. */ - field(path: FieldPath_2): Value | null; + delete(path: _FieldPath): void; isEqual(other: ObjectValue): boolean; + /** + * Returns the map that contains the leaf element of `path`. If the parent + * entry does not yet exist, or if it is not a map, a new map will be created. + */ + private getFieldsMap; + /** + * Modifies `fieldsMap` by adding, replacing or deleting the specified + * entries. + */ + private applyChanges; + clone(): ObjectValue; } /** @@ -3017,20 +4816,27 @@ declare class ObjectValue { * cache. Implementations override `initialize()` to provide all components. */ declare interface OfflineComponentProvider { + readonly kind: Kind; persistence: Persistence; sharedClientState: SharedClientState; localStore: LocalStore; - gcScheduler: GarbageCollectionScheduler | null; + gcScheduler: Scheduler | null; + indexBackfillerScheduler: Scheduler | null; synchronizeTabs: boolean; initialize(cfg: ComponentConfiguration): Promise; terminate(): Promise; } +declare interface OfflineComponentProviderFactory { + build(onlineComponents: OnlineComponentProvider): OfflineComponentProvider; +} + /** * Initializes and wires the components that are needed to interface with the * network. */ declare class OnlineComponentProvider { + static readonly provider: OnlineComponentProviderFactory; protected localStore: LocalStore; protected sharedClientState: SharedClientState; datastore: Datastore; @@ -3051,6 +4857,10 @@ declare class OnlineComponentProvider { terminate(): Promise; } +declare interface OnlineComponentProviderFactory { + build(): OnlineComponentProvider; +} + /** * Describes the online state of the Firestore client. Note that this does not * indicate whether or not the remote store is trying to connect or not. This is @@ -3096,10 +4906,13 @@ declare const enum OnlineState { * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - reference: DocumentReference, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, observer: { - next?: (snapshot: DocumentSnapshot) => void; + next?: (snapshot: DocumentSnapshot) => void; error?: (error: FirestoreError) => void; complete?: () => void; } @@ -3119,11 +4932,14 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - reference: DocumentReference, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, options: SnapshotListenOptions, observer: { - next?: (snapshot: DocumentSnapshot) => void; + next?: (snapshot: DocumentSnapshot) => void; error?: (error: FirestoreError) => void; complete?: () => void; } @@ -3147,9 +4963,12 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - reference: DocumentReference, - onNext: (snapshot: DocumentSnapshot) => void, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, + onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void ): Unsubscribe; @@ -3173,10 +4992,13 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - reference: DocumentReference, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, options: SnapshotListenOptions, - onNext: (snapshot: DocumentSnapshot) => void, + onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void ): Unsubscribe; @@ -3195,10 +5017,13 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - query: Query, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + query: Query, observer: { - next?: (snapshot: QuerySnapshot) => void; + next?: (snapshot: QuerySnapshot) => void; error?: (error: FirestoreError) => void; complete?: () => void; } @@ -3219,11 +5044,14 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - query: Query, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + query: Query, options: SnapshotListenOptions, observer: { - next?: (snapshot: QuerySnapshot) => void; + next?: (snapshot: QuerySnapshot) => void; error?: (error: FirestoreError) => void; complete?: () => void; } @@ -3248,9 +5076,12 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - query: Query, - onNext: (snapshot: QuerySnapshot) => void, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + query: Query, + onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void ): Unsubscribe; @@ -3275,10 +5106,13 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - query: Query, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + query: Query, options: SnapshotListenOptions, - onNext: (snapshot: QuerySnapshot) => void, + onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void ): Unsubscribe; @@ -3299,7 +5133,7 @@ export declare function onSnapshot( * listener. */ export declare function onSnapshotsInSync( - firestore: FirebaseFirestore, + firestore: Firestore, observer: { next?: (value: void) => void; error?: (error: FirestoreError) => void; @@ -3314,42 +5148,72 @@ export declare function onSnapshotsInSync( * * NOTE: The snapshots-in-sync event only indicates that listeners are in sync * with each other, but does not relate to whether those snapshots are in sync - * with the server. Use SnapshotMetadata in the individual listeners to + * with the server. Use `SnapshotMetadata` in the individual listeners to * determine if a snapshot is from the cache or the server. * - * @param firestore - The instance of Firestore for synchronizing snapshots. + * @param firestore - The `Firestore` instance for synchronizing snapshots. * @param onSync - A callback to be called every time all snapshot listeners are * in sync with each other. * @returns An unsubscribe function that can be called to cancel the snapshot * listener. */ export declare function onSnapshotsInSync( - firestore: FirebaseFirestore, + firestore: Firestore, onSync: () => void ): Unsubscribe; +declare const enum Operator { + LESS_THAN = '<', + LESS_THAN_OR_EQUAL = '<=', + EQUAL = '==', + NOT_EQUAL = '!=', + GREATER_THAN = '>', + GREATER_THAN_OR_EQUAL = '>=', + ARRAY_CONTAINS = 'array-contains', + IN = 'in', + NOT_IN = 'not-in', + ARRAY_CONTAINS_ANY = 'array-contains-any' +} + +/** + * 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 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}. + */ +export declare function or( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint; + /** * An ordering on a field, in some Direction. Direction defaults to ASCENDING. */ declare class OrderBy { - readonly field: FieldPath_2; + readonly field: _FieldPath; readonly dir: Direction; - constructor(field: FieldPath_2, dir?: Direction); + constructor(field: _FieldPath, dir?: Direction); } /** - * Creates a `QueryConstraint` that sorts the query result by the + * Creates a {@link QueryOrderByConstraint} that sorts the query result by the * specified field, optionally in descending order instead of ascending. * + * Note: Documents that do not contain the specified field will not be present + * in the query result. + * * @param fieldPath - The field to sort by. * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If * not specified, order will be ascending. - * @returns The created `Query`. + * @returns The created {@link QueryOrderByConstraint}. */ export declare function orderBy( fieldPath: string | FieldPath, directionStr?: OrderByDirection -): QueryConstraint; +): QueryOrderByConstraint; /** * The direction of a {@link orderBy} clause is specified as 'desc' or 'asc' @@ -3362,8 +5226,52 @@ declare type OrderDirection = | 'ASCENDING' | 'DESCENDING'; +/** + * Representation of an overlay computed by Firestore. + * + * Holds information about a mutation and the largest batch id in Firestore when + * the mutation was created. + */ +declare class Overlay { + readonly largestBatchId: number; + readonly mutation: Mutation; + constructor(largestBatchId: number, mutation: Mutation); + getKey(): _DocumentKey; + isEqual(other: Overlay | null): boolean; + toString(): string; +} + +/** + * Represents a local view (overlay) of a document, and the fields that are + * locally mutated. + */ +declare class OverlayedDocument { + readonly overlayedDocument: Document_2; + /** + * 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; + constructor( + overlayedDocument: Document_2, + /** + * 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`. + */ + mutatedFields: FieldMask | null + ); +} + +declare type OverlayedDocumentMap = DocumentKeyMap; + +declare type OverlayMap = DocumentKeyMap; + declare interface ParseContext { - readonly databaseId: DatabaseId; + readonly databaseId: _DatabaseId; readonly ignoreUndefinedProperties: boolean; } @@ -3377,7 +5285,7 @@ declare class ParsedSetData { fieldMask: FieldMask | null, fieldTransforms: FieldTransform[] ); - toMutation(key: DocumentKey, precondition: Precondition): Mutation; + toMutation(key: _DocumentKey, precondition: Precondition): Mutation; } /** The result of parsing "update" data (i.e. for an updateData call). */ @@ -3390,9 +5298,23 @@ declare class ParsedUpdateData { fieldMask: FieldMask, fieldTransforms: FieldTransform[] ); - toMutation(key: DocumentKey, precondition: Precondition): Mutation; + toMutation(key: _DocumentKey, precondition: Precondition): Mutation; } +/** + * Similar to TypeScript's `Partial`, but allows nested fields to be + * omitted and FieldValues to be passed in as property values. + */ +export declare type PartialWithFieldValue = + | Partial + | (T extends Primitive + ? T + : T extends {} + ? { + [K in keyof T]?: PartialWithFieldValue | FieldValue; + } + : never); + /** * Persistence is the lowest-level shared interface to persistent storage in * Firestore. @@ -3457,6 +5379,10 @@ declare interface Persistence { * PORTING NOTE: This is only used for Web multi-tab. */ setNetworkEnabled(networkEnabled: boolean): void; + /** + * Returns GlobalCache representing a general purpose cache for global values. + */ + getGlobalsCache(): GlobalsCache; /** * Returns a MutationQueue representing the persisted mutations for the * given user. @@ -3467,7 +5393,7 @@ declare interface Persistence { * extent possible (e.g. in the case of uid switching from * sally=>jack=>sally, sally's mutation queue will be preserved). */ - getMutationQueue(user: User): MutationQueue; + getMutationQueue(user: User, indexManager: IndexManager): MutationQueue; /** * Returns a TargetCache representing the persisted cache of targets. * @@ -3500,7 +5426,12 @@ declare interface Persistence { * this is called. In particular, the memory-backed implementation does this * to emulate the persisted implementation to the extent possible. */ - getIndexManager(): IndexManager; + getIndexManager(user: User): IndexManager; + /** + * Returns a DocumentOverlayCache representing the documents that are mutated + * locally. + */ + getDocumentOverlayCache(user: User): DocumentOverlayCache; /** * Performs an operation inside a persistence transaction. Any reads or writes * against persistence must be performed within a transaction. Writes will be @@ -3520,7 +5451,7 @@ declare interface Persistence { * be acquired and the returned promise will be rejected with a * FAILED_PRECONDITION error. * @param transactionOperation - The operation to run inside a transaction. - * @returns A promise that is resolved once the transaction completes. + * @returns A `Promise` that is resolved once the transaction completes. */ runTransaction( action: string, @@ -3597,32 +5528,177 @@ declare class PersistencePromise { }, f: (r: R) => PersistencePromise ): PersistencePromise; + /** + * Concurrently map all array elements through asynchronous function. + */ + static mapArray( + array: T[], + f: (t: T) => PersistencePromise + ): PersistencePromise; + /** + * An alternative to recursive PersistencePromise calls, that avoids + * potential memory problems from unbounded chains of promises. + * + * The `action` will be called repeatedly while `condition` is true. + */ + static doWhile( + condition: () => boolean, + action: () => PersistencePromise + ): PersistencePromise; } +/** + * Settings that can be passed to `enableIndexedDbPersistence()` to configure + * Firestore persistence. + * + * Persistence cannot be used in a Node.js environment. + */ export declare interface PersistenceSettings { + /** + * Whether to force enable persistence for the client. This cannot be used + * with multi-tab synchronization and is primarily intended for use with Web + * Workers. Setting this to `true` will enable persistence, but cause other + * tabs using persistence to fail. + */ forceOwnership?: boolean; } /** - * A base class representing a persistence transaction, encapsulating both the - * transaction's sequence numbers as well as a list of onCommitted listeners. - * - * When you call Persistence.runTransaction(), it will create a transaction and - * pass it to your callback. You then pass it to any method that operates - * on persistence. + * A base class representing a persistence transaction, encapsulating both the + * transaction's sequence numbers as well as a list of onCommitted listeners. + * + * When you call Persistence.runTransaction(), it will create a transaction and + * pass it to your callback. You then pass it to any method that operates + * on persistence. + */ +declare abstract class PersistenceTransaction { + private readonly onCommittedListeners; + abstract readonly currentSequenceNumber: ListenSequenceNumber; + addOnCommittedListener(listener: () => void): void; + raiseOnCommittedEvent(): void; +} + +/** The different modes supported by `Persistence.runTransaction()`. */ +declare type PersistenceTransactionMode = + | 'readonly' + | 'readwrite' + | 'readwrite-primary'; + +/** + * A `PersistentCacheIndexManager` for configuring persistent cache indexes used + * for local query execution. + * + * To use, call `getPersistentCacheIndexManager()` to get an instance. + */ +export declare class PersistentCacheIndexManager { + readonly _firestore: Firestore; + /** A type string to uniquely identify instances of this class. */ + readonly type: 'PersistentCacheIndexManager'; + /** @hideconstructor */ + constructor(_firestore: Firestore); +} + +/** + * An settings object to configure an `PersistentLocalCache` instance. + * + * Persistent cache cannot be used in a Node.js environment. + */ +export declare type PersistentCacheSettings = { + /** + * An approximate cache size threshold for the on-disk data. If the cache + * grows beyond this size, Firestore will start removing data that hasn't been + * recently used. The SDK does not guarantee that the cache will stay below + * that size, only that if the cache exceeds the given size, cleanup will be + * attempted. + * + * The default value is 40 MB. The threshold must be set to at least 1 MB, and + * can be set to `CACHE_SIZE_UNLIMITED` to disable garbage collection. + */ + cacheSizeBytes?: number; + /** + * Specifies how multiple tabs/windows will be managed by the SDK. + */ + tabManager?: PersistentTabManager; +}; + +/** + * Provides a persistent cache backed by IndexedDb to the SDK. + * + * To use, create an instance using the factory function {@link persistentLocalCache()}, then + * set the instance to `FirestoreSettings.cache` and call `initializeFirestore` using + * the settings object. + */ +export declare type PersistentLocalCache = { + kind: 'persistent'; + /* Excluded from this release type: _onlineComponentProvider */ + /* Excluded from this release type: _offlineComponentProvider */ +}; + +/** + * Creates an instance of `PersistentLocalCache`. The instance can be set to + * `FirestoreSettings.cache` to tell the SDK which cache layer to use. + * + * Persistent cache cannot be used in a Node.js environment. + */ +export declare function persistentLocalCache( + settings?: PersistentCacheSettings +): PersistentLocalCache; + +/** + * A tab manager supporting multiple tabs. SDK will synchronize queries and + * mutations done across all tabs using the SDK. + */ +export declare type PersistentMultipleTabManager = { + kind: 'PersistentMultipleTab'; + /* Excluded from this release type: _initialize */ + /* Excluded from this release type: _onlineComponentProvider */ + /* Excluded from this release type: _offlineComponentProvider */ +}; + +/** + * Creates an instance of `PersistentMultipleTabManager`. + */ +export declare function persistentMultipleTabManager(): PersistentMultipleTabManager; + +/** + * A tab manager supporting only one tab, no synchronization will be + * performed across tabs. + */ +export declare type PersistentSingleTabManager = { + kind: 'persistentSingleTab'; + /* Excluded from this release type: _initialize */ + /* Excluded from this release type: _onlineComponentProvider */ + /* Excluded from this release type: _offlineComponentProvider */ +}; + +/** + * Creates an instance of `PersistentSingleTabManager`. + * + * @param settings Configures the created tab manager. + */ +export declare function persistentSingleTabManager( + settings: PersistentSingleTabManagerSettings | undefined +): PersistentSingleTabManager; + +/** + * Type to configure an `PersistentSingleTabManager` instance. + */ +export declare type PersistentSingleTabManagerSettings = { + /** + * Whether to force-enable persistent (IndexedDB) cache for the client. This + * cannot be used with multi-tab synchronization and is primarily intended for + * use with Web Workers. Setting this to `true` will enable IndexedDB, but cause + * other tabs using IndexedDB cache to fail. + */ + forceOwnership?: boolean; +}; + +/** + * A union of all available tab managers. */ -declare abstract class PersistenceTransaction { - private readonly onCommittedListeners; - abstract readonly currentSequenceNumber: ListenSequenceNumber; - addOnCommittedListener(listener: () => void): void; - raiseOnCommittedEvent(): void; -} - -/** The different modes supported by `Persistence.runTransaction()`. */ -declare type PersistenceTransactionMode = - | 'readonly' - | 'readwrite' - | 'readwrite-primary'; +export declare type PersistentTabManager = + | PersistentSingleTabManager + | PersistentMultipleTabManager; /** * Encodes a precondition for a mutation. This follows the model that the @@ -3644,70 +5720,121 @@ declare class Precondition { isEqual(other: Precondition): boolean; } -/** Undocumented, private additional settings not exposed in our public API. */ -declare interface PrivateSettings extends Settings_2 { - credentials?: CredentialsSettings; -} +/** + * These types primarily exist to support the `UpdateData`, + * `WithFieldValue`, and `PartialWithFieldValue` types and are not consumed + * directly by the end developer. + */ +/** Primitive types. */ +export declare type Primitive = string | number | boolean | undefined | null; + +/* Excluded from this release type: PrivateSettings */ declare interface ProviderCredentialsSettings { ['type']: 'provider'; - ['client']: CredentialsProvider; + ['client']: CredentialsProvider; } /** - * A `Query` refers to a Query which you can read or listen to. You can also + * A `Query` refers to a query which you can read or listen to. You can also * construct refined `Query` objects by adding filters and ordering. */ -export declare class Query { - readonly _converter: FirestoreDataConverter_2 | null; +export declare class Query< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { + /** + * If provided, the `FirestoreDataConverter` associated with this instance. + */ + readonly converter: FirestoreDataConverter_2< + AppModelType, + DbModelType + > | null; readonly _query: Query_2; /** The type of this Firestore reference. */ readonly type: 'query' | 'collection'; /** - * The `FirebaseFirestore` for the Firestore database (useful for performing + * The `Firestore` instance for the Firestore database (useful for performing * transactions, etc.). */ - readonly firestore: FirebaseFirestore_2; + readonly firestore: Firestore_2; /** @hideconstructor protected */ constructor( - firestore: FirebaseFirestore_2, - _converter: FirestoreDataConverter_2 | null, + firestore: Firestore_2, + /** + * If provided, the `FirestoreDataConverter` associated with this instance. + */ + converter: FirestoreDataConverter_2 | null, _query: Query_2 ); + /** + * Removes the current converter. + * + * @param converter - `null` removes the current converter. + * @returns A `Query` that does not use a + * converter. + */ + withConverter(converter: null): Query; /** * Applies a custom data converter to this query, allowing you to use your own * custom model objects with Firestore. When you call {@link getDocs} with * the returned query, the provided converter will convert between Firestore - * data and your custom type `U`. + * data of type `NewDbModelType` and your custom type `NewAppModelType`. * * @param converter - Converts objects to and from Firestore. - * @returns A `Query` that uses the provided converter. + * @returns A `Query` that uses the provided converter. */ - withConverter(converter: FirestoreDataConverter_2): Query; + withConverter< + NewAppModelType, + NewDbModelType extends DocumentData = DocumentData + >( + converter: FirestoreDataConverter_2 + ): Query; } /** - * Creates a new immutable instance of `query` that is extended to also include - * additional query constraints. + * Creates a new immutable instance of {@link Query} that is extended to also + * include additional query constraints. + * + * @param query - The {@link Query} instance to use as a base for the new + * constraints. + * @param compositeFilter - The {@link QueryCompositeFilterConstraint} to + * apply. Create {@link QueryCompositeFilterConstraint} using {@link and} or + * {@link or}. + * @param queryConstraints - Additional {@link QueryNonFilterConstraint}s to + * apply (e.g. {@link orderBy}, {@link limit}). + * @throws if any of the provided query constraints cannot be combined with the + * existing or new constraints. + */ +export declare function query( + query: Query, + compositeFilter: QueryCompositeFilterConstraint, + ...queryConstraints: QueryNonFilterConstraint[] +): Query; + +/** + * Creates a new immutable instance of {@link Query} that is extended to also + * include additional query constraints. * - * @param query - The query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. + * @param query - The {@link Query} instance to use as a base for the new + * constraints. + * @param queryConstraints - The list of {@link QueryConstraint}s to apply. * @throws if any of the provided query constraints cannot be combined with the * existing or new constraints. */ -export declare function query( - query: Query, +export declare function query( + query: Query, ...queryConstraints: QueryConstraint[] -): Query; +): Query; /** * The Query interface defines all external properties of a query. * - * QueryImpl implements this interface to provide memoization for `queryOrderBy` + * QueryImpl implements this interface to provide memoization for `queryNormalizedOrderBy` * and `queryToTarget`. */ declare interface Query_2 { - readonly path: ResourcePath; + readonly path: _ResourcePath; readonly collectionGroup: string | null; readonly explicitOrderBy: OrderBy[]; readonly filters: Filter[]; @@ -3717,22 +5844,51 @@ declare interface Query_2 { readonly endAt: Bound | null; } +/** + * A `QueryCompositeFilterConstraint` is used to narrow the set of documents + * returned by a Firestore query by performing the logical OR or AND of multiple + * {@link QueryFieldFilterConstraint}s or {@link QueryCompositeFilterConstraint}s. + * `QueryCompositeFilterConstraint`s are created by invoking {@link or} or + * {@link and} and can then be passed to {@link (query:1)} to create a new query + * instance that also contains the `QueryCompositeFilterConstraint`. + */ +export declare class QueryCompositeFilterConstraint extends AppliableConstraint { + /** The type of this query constraint */ + readonly type: 'or' | 'and'; + private readonly _queryConstraints; + /* Excluded from this release type: __constructor */ + static _create( + type: 'or' | 'and', + _queryConstraints: QueryFilterConstraint[] + ): QueryCompositeFilterConstraint; + _parse( + query: Query + ): Filter; + _apply( + query: Query + ): Query; + _getQueryConstraints(): readonly AppliableConstraint[]; + _getOperator(): CompositeOperator; +} + /** * A `QueryConstraint` is used to narrow the set of documents returned by a * Firestore query. `QueryConstraint`s are created by invoking {@link where}, - * {@link orderBy}, {@link startAt}, {@link startAfter}, {@link - * endBefore}, {@link endAt}, {@link limit} or {@link limitToLast} and - * can then be passed to {@link query} to create a new query instance that + * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link + * (endBefore:1)}, {@link (endAt:1)}, {@link limit}, {@link limitToLast} and + * can then be passed to {@link (query:1)} to create a new query instance that * also contains this `QueryConstraint`. */ -export declare abstract class QueryConstraint { - /** The type of this query constraints */ +export declare abstract class QueryConstraint extends AppliableConstraint { + /** The type of this query constraint */ abstract readonly type: QueryConstraintType; /** - * Takes the provided `Query` and returns a copy of the `Query` with this - * `QueryConstraint` applied. + * Takes the provided {@link Query} and returns a copy of the {@link Query} with this + * {@link AppliableConstraint} applied. */ - abstract _apply(query: Query): Query; + abstract _apply( + query: Query + ): Query; } /** Describes the different query constraints available in this SDK. */ @@ -3746,6 +5902,35 @@ export declare type QueryConstraintType = | 'endAt' | 'endBefore'; +/** + * @license + * Copyright 2023 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. + */ +/** + * A tracker to keep a record of important details during database local query + * execution. + */ +declare class QueryContext { + /** + * Counts the number of documents passed through during local query execution. + */ + private _documentReadCount; + get documentReadCount(): number; + incrementDocumentReadCount(amount: number): void; +} + /** * A `QueryDocumentSnapshot` contains data read from a document in your * Firestore database as part of a query. The document is guaranteed to exist @@ -3758,12 +5943,13 @@ export declare type QueryConstraintType = * 'undefined'. */ export declare class QueryDocumentSnapshot< - T = DocumentData -> extends DocumentSnapshot { + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> extends DocumentSnapshot { /** * Retrieves all fields in the document as an `Object`. * - * By default, `FieldValue.serverTimestamp()` values that have not yet been + * By default, `serverTimestamp()` values that have not yet been * set to their final value will be returned as `null`. You can override * this by passing an options object. * @@ -3773,7 +5959,7 @@ export declare class QueryDocumentSnapshot< * have not yet been set to their final value). * @returns An `Object` containing all fields in the document. */ - data(options?: SnapshotOptions): T; + data(options?: SnapshotOptions): AppModelType; } /** @@ -3788,15 +5974,39 @@ export declare class QueryDocumentSnapshot< * 'undefined'. */ declare class QueryDocumentSnapshot_2< - T = DocumentData -> extends DocumentSnapshot_2 { + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> extends DocumentSnapshot_2 { /** * Retrieves all fields in the document as an `Object`. * * @override * @returns An `Object` containing all fields in the document. */ - data(): T; + data(): AppModelType; +} + +/** + * A `QueryEndAtConstraint` is used to exclude documents from the end of a + * result set returned by a Firestore query. + * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or + * {@link (endBefore:1)} and can then be passed to {@link (query:1)} to create a new + * query instance that also contains this `QueryEndAtConstraint`. + */ +export declare class QueryEndAtConstraint extends QueryConstraint { + /** The type of this query constraint */ + readonly type: 'endBefore' | 'endAt'; + private readonly _docOrFields; + private readonly _inclusive; + /* Excluded from this release type: __constructor */ + static _create( + type: 'endBefore' | 'endAt', + _docOrFields: Array>, + _inclusive: boolean + ): QueryEndAtConstraint; + _apply( + query: Query + ): Query; } /** @@ -3808,7 +6018,110 @@ declare class QueryDocumentSnapshot_2< * @returns true if the references point to the same location in the same * Firestore database. */ -export declare function queryEqual(left: Query, right: Query): boolean; +export declare function queryEqual< + AppModelType, + DbModelType extends DocumentData +>( + left: Query, + right: Query +): boolean; + +/** + * A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by + * a Firestore query by filtering on one or more document fields. + * `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then + * be passed to {@link (query:1)} to create a new query instance that also contains + * this `QueryFieldFilterConstraint`. + */ +export declare class QueryFieldFilterConstraint extends QueryConstraint { + private readonly _field; + private _op; + private _value; + /** The type of this query constraint */ + readonly type = 'where'; + /* Excluded from this release type: __constructor */ + static _create( + _field: _FieldPath, + _op: Operator, + _value: unknown + ): QueryFieldFilterConstraint; + _apply( + query: Query + ): Query; + _parse( + query: Query + ): FieldFilter; +} + +/** + * `QueryFilterConstraint` is a helper union type that represents + * {@link QueryFieldFilterConstraint} and {@link QueryCompositeFilterConstraint}. + */ +export declare type QueryFilterConstraint = + | QueryFieldFilterConstraint + | QueryCompositeFilterConstraint; + +/** + * A `QueryLimitConstraint` is used to limit the number of documents returned by + * a Firestore query. + * `QueryLimitConstraint`s are created by invoking {@link limit} or + * {@link limitToLast} and can then be passed to {@link (query:1)} to create a new + * query instance that also contains this `QueryLimitConstraint`. + */ +export declare class QueryLimitConstraint extends QueryConstraint { + /** The type of this query constraint */ + readonly type: 'limit' | 'limitToLast'; + private readonly _limit; + private readonly _limitType; + /* Excluded from this release type: __constructor */ + static _create( + type: 'limit' | 'limitToLast', + _limit: number, + _limitType: LimitType + ): QueryLimitConstraint; + _apply( + query: Query + ): Query; +} + +/** + * `QueryNonFilterConstraint` is a helper union type that represents + * QueryConstraints which are used to narrow or order the set of documents, + * but that do not explicitly filter on a document field. + * `QueryNonFilterConstraint`s are created by invoking {@link orderBy}, + * {@link (startAt:1)}, {@link (startAfter:1)}, {@link (endBefore:1)}, {@link (endAt:1)}, + * {@link limit} or {@link limitToLast} and can then be passed to {@link (query:1)} + * to create a new query instance that also contains the `QueryConstraint`. + */ +export declare type QueryNonFilterConstraint = + | QueryOrderByConstraint + | QueryLimitConstraint + | QueryStartAtConstraint + | QueryEndAtConstraint; + +/** + * A `QueryOrderByConstraint` is used to sort the set of documents returned by a + * Firestore query. `QueryOrderByConstraint`s are created by invoking + * {@link orderBy} and can then be passed to {@link (query:1)} to create a new query + * instance that also contains this `QueryOrderByConstraint`. + * + * Note: Documents that do not contain the orderBy field will not be present in + * the query result. + */ +export declare class QueryOrderByConstraint extends QueryConstraint { + private readonly _field; + private _direction; + /** The type of this query constraint */ + readonly type = 'orderBy'; + /* Excluded from this release type: __constructor */ + static _create( + _field: _FieldPath, + _direction: Direction + ): QueryOrderByConstraint; + _apply( + query: Query + ): Query; +} /** * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects @@ -3817,8 +6130,11 @@ export declare function queryEqual(left: Query, right: Query): boolean; * number of documents can be determined via the `empty` and `size` * properties. */ -export declare class QuerySnapshot { - readonly _firestore: FirebaseFirestore; +export declare class QuerySnapshot< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { + readonly _firestore: Firestore; readonly _userDataWriter: AbstractUserDataWriter; readonly _snapshot: ViewSnapshot; /** @@ -3830,18 +6146,18 @@ export declare class QuerySnapshot { * The query on which you called `get` or `onSnapshot` in order to get this * `QuerySnapshot`. */ - readonly query: Query; + readonly query: Query; private _cachedChanges?; private _cachedChangesIncludeMetadataChanges?; /** @hideconstructor */ constructor( - _firestore: FirebaseFirestore, + _firestore: Firestore, _userDataWriter: AbstractUserDataWriter, - query: Query, + query: Query, _snapshot: ViewSnapshot ); /** An array of all the documents in the `QuerySnapshot`. */ - get docs(): Array>; + get docs(): Array>; /** The number of documents in the `QuerySnapshot`. */ get size(): number; /** True if there are no documents in the `QuerySnapshot`. */ @@ -3854,7 +6170,9 @@ export declare class QuerySnapshot { * @param thisArg - The `this` binding for the callback. */ forEach( - callback: (result: QueryDocumentSnapshot) => void, + callback: ( + result: QueryDocumentSnapshot + ) => void, thisArg?: unknown ): void; /** @@ -3866,7 +6184,32 @@ export declare class QuerySnapshot { * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger * snapshot events. */ - docChanges(options?: SnapshotListenOptions): Array>; + docChanges( + options?: SnapshotListenOptions + ): Array>; +} + +/** + * A `QueryStartAtConstraint` is used to exclude documents from the start of a + * result set returned by a Firestore query. + * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or + * {@link (startAfter:1)} and can then be passed to {@link (query:1)} to create a + * new query instance that also contains this `QueryStartAtConstraint`. + */ +export declare class QueryStartAtConstraint extends QueryConstraint { + /** The type of this query constraint */ + readonly type: 'startAt' | 'startAfter'; + private readonly _docOrFields; + private readonly _inclusive; + /* Excluded from this release type: __constructor */ + static _create( + type: 'startAt' | 'startAfter', + _docOrFields: Array>, + _inclusive: boolean + ): QueryStartAtConstraint; + _apply( + query: Query + ): Query; } /** The different states of a watch target. */ @@ -3880,9 +6223,16 @@ declare type QueryTargetState = 'not-current' | 'current' | 'rejected'; * @returns true if the references point to the same location in the same * Firestore database. */ -export declare function refEqual( - left: DocumentReference | CollectionReference, - right: DocumentReference | CollectionReference +export declare function refEqual< + AppModelType, + DbModelType extends DocumentData +>( + left: + | DocumentReference + | CollectionReference, + right: + | DocumentReference + | CollectionReference ): boolean; /** @@ -3903,13 +6253,13 @@ declare interface ReferenceDelegate { addReference( txn: PersistenceTransaction, targetId: TargetId, - doc: DocumentKey + doc: _DocumentKey ): PersistencePromise; /** Notify the delegate that the given document was removed from a target. */ removeReference( txn: PersistenceTransaction, targetId: TargetId, - doc: DocumentKey + doc: _DocumentKey ): PersistencePromise; /** * Notify the delegate that a target was removed. The delegate may, but is not obligated to, @@ -3925,12 +6275,12 @@ declare interface ReferenceDelegate { */ markPotentiallyOrphaned( txn: PersistenceTransaction, - doc: DocumentKey + doc: _DocumentKey ): PersistencePromise; /** Notify the delegate that a limbo document was updated. */ updateLimboDocument( txn: PersistenceTransaction, - doc: DocumentKey + doc: _DocumentKey ): PersistencePromise; } @@ -3943,52 +6293,66 @@ declare type Rejector = (error: Error) => void; /** * Represents cached documents received from the remote backend. * - * The cache is keyed by DocumentKey and entries in the cache are MaybeDocument - * instances, meaning we can cache both Document instances (an actual document - * with data) as well as NoDocument instances (indicating that the document is - * known to not exist). + * The cache is keyed by DocumentKey and entries in the cache are + * MutableDocuments, meaning we can cache both actual documents as well as + * documents that are known to not exist. */ declare interface RemoteDocumentCache { + /** Sets the index manager to use for managing the collectionGroup index. */ + setIndexManager(indexManager: IndexManager): void; /** * Looks up an entry in the cache. * * @param documentKey - The key of the entry to look up.* - * @returns The cached Document or NoDocument entry, or null if we have - * nothing cached. + * @returns The cached document entry. Returns an invalid document if the + * document is not cached. */ getEntry( transaction: PersistenceTransaction, - documentKey: DocumentKey - ): PersistencePromise; + documentKey: _DocumentKey + ): PersistencePromise; /** * Looks up a set of entries in the cache. * * @param documentKeys - The keys of the entries to look up. - * @returns The cached Document or NoDocument entries indexed by key. If an - * entry is not cached, the corresponding key will be mapped to a null value. + * @returns The cached document entries indexed by key. If an entry is not + * cached, the corresponding key will be mapped to an invalid document. */ getEntries( transaction: PersistenceTransaction, documentKeys: DocumentKeySet - ): PersistencePromise; + ): PersistencePromise; /** - * Executes a query against the cached Document entries. - * - * Implementations may return extra documents if convenient. The results - * should be re-filtered by the consumer before presenting them to the user. - * - * Cached NoDocument entries have no bearing on query results. + * Returns the documents matching the given query * * @param query - The query to match documents against. - * @param sinceReadTime - If not set to SnapshotVersion.min(), return only - * documents that have been read since this snapshot version (exclusive). + * @param offset - The offset to start the scan at (exclusive). + * @param context - A optional tracker to keep a record of important details + * during database local query execution. * @returns The set of matching documents. */ getDocumentsMatchingQuery( transaction: PersistenceTransaction, query: Query_2, - sinceReadTime: SnapshotVersion - ): PersistencePromise; + offset: IndexOffset, + mutatedDocs: OverlayMap, + context?: QueryContext + ): PersistencePromise; + /** + * Looks up the next `limit` documents for a collection group based on the + * provided offset. The ordering is based on the document's read time and key. + * + * @param collectionGroup - The collection group to scan. + * @param offset - The offset to start the scan at (exclusive). + * @param limit - The maximum number of results to return. + * @returns The set of matching documents. + */ + getAllFromCollectionGroup( + transaction: PersistenceTransaction, + collectionGroup: string, + offset: IndexOffset, + limit: number + ): PersistencePromise; /** * Provides access to add or update the contents of the cache. The buffer * handles proper size accounting for the change. @@ -4009,14 +6373,6 @@ declare interface RemoteDocumentCache { getSize(transaction: PersistenceTransaction): PersistencePromise; } -/** - * Represents a document change to be applied to remote document cache. - */ -declare interface RemoteDocumentChange { - readonly maybeDocument: MaybeDocument | null; - readonly readTime: SnapshotVersion | null; -} - /** * An in-memory buffer of entries to be written to a RemoteDocumentCache. * It can be used to batch up a set of changes to be written to the cache, but @@ -4032,34 +6388,33 @@ declare interface RemoteDocumentChange { * porting this class as part of that implementation work. */ declare abstract class RemoteDocumentChangeBuffer { - protected changes: ObjectMap; + protected changes: ObjectMap<_DocumentKey, MutableDocument>; private changesApplied; protected abstract getFromCache( transaction: PersistenceTransaction, - documentKey: DocumentKey - ): PersistencePromise; + documentKey: _DocumentKey + ): PersistencePromise; protected abstract getAllFromCache( transaction: PersistenceTransaction, documentKeys: DocumentKeySet - ): PersistencePromise; + ): PersistencePromise; protected abstract applyChanges( transaction: PersistenceTransaction ): PersistencePromise; - protected getReadTime(key: DocumentKey): SnapshotVersion; /** * Buffers a `RemoteDocumentCache.addEntry()` call. * * You can only modify documents that have already been retrieved via * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`). */ - addEntry(maybeDocument: MaybeDocument, readTime: SnapshotVersion): void; + addEntry(document: MutableDocument): void; /** * Buffers a `RemoteDocumentCache.removeEntry()` call. * * You can only remove documents that have already been retrieved via * `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`). */ - removeEntry(key: DocumentKey, readTime?: SnapshotVersion | null): void; + removeEntry(key: _DocumentKey, readTime: SnapshotVersion): void; /** * Looks up an entry in the cache. The buffered changes will first be checked, * and if no buffered change applies, this will forward to @@ -4068,13 +6423,13 @@ declare abstract class RemoteDocumentChangeBuffer { * @param transaction - The transaction in which to perform any persistence * operations. * @param documentKey - The key of the entry to look up. - * @returns The cached Document or NoDocument entry, or null if we have - * nothing cached. + * @returns The cached document or an invalid document if we have nothing + * cached. */ getEntry( transaction: PersistenceTransaction, - documentKey: DocumentKey - ): PersistencePromise; + documentKey: _DocumentKey + ): PersistencePromise; /** * Looks up several entries in the cache, forwarding to * `RemoteDocumentCache.getEntry()`. @@ -4082,14 +6437,13 @@ declare abstract class RemoteDocumentChangeBuffer { * @param transaction - The transaction in which to perform any persistence * operations. * @param documentKeys - The keys of the entries to look up. - * @returns A map of cached `Document`s or `NoDocument`s, indexed by key. If - * an entry cannot be found, the corresponding key will be mapped to a - * null value. + * @returns A map of cached documents, indexed by key. If an entry cannot be + * found, the corresponding key will be mapped to an invalid document. */ getEntries( transaction: PersistenceTransaction, documentKeys: DocumentKeySet - ): PersistencePromise; + ): PersistencePromise; /** * Applies buffered changes to the underlying RemoteDocumentCache, using * the provided transaction. @@ -4114,15 +6468,16 @@ declare class RemoteEvent { */ readonly targetChanges: Map; /** - * A set of targets that is known to be inconsistent. Listens for these - * targets should be re-established without resume tokens. + * A map of targets that is known to be inconsistent, and the purpose for + * re-listening. Listens for these targets should be re-established without + * resume tokens. */ - readonly targetMismatches: SortedSet; + readonly targetMismatches: SortedMap; /** * A set of which documents have changed or been deleted, along with the * doc's new values (if not deleted). */ - readonly documentUpdates: MaybeDocumentMap; + readonly documentUpdates: MutableDocumentMap; /** * A set of which document updates are due only to limbo resolution targets. */ @@ -4137,15 +6492,16 @@ declare class RemoteEvent { */ targetChanges: Map, /** - * A set of targets that is known to be inconsistent. Listens for these - * targets should be re-established without resume tokens. + * A map of targets that is known to be inconsistent, and the purpose for + * re-listening. Listens for these targets should be re-established without + * resume tokens. */ - targetMismatches: SortedSet, + targetMismatches: SortedMap, /** * A set of which documents have changed or been deleted, along with the * doc's new values (if not deleted). */ - documentUpdates: MaybeDocumentMap, + documentUpdates: MutableDocumentMap, /** * A set of which document updates are due only to limbo resolution targets. */ @@ -4159,7 +6515,8 @@ declare class RemoteEvent { */ static createSynthesizedRemoteEventForCurrentChange( targetId: TargetId, - current: boolean + current: boolean, + resumeToken: _ByteString ): RemoteEvent; } @@ -4239,26 +6596,7 @@ declare interface RemoteSyncer { declare type Resolver = (value?: T) => void; -/** - * A slash-separated path for navigating resources (documents and collections) - * within Firestore. - */ -declare class ResourcePath extends BasePath { - protected construct( - segments: string[], - offset?: number, - length?: number - ): ResourcePath; - canonicalString(): string; - toString(): string; - /** - * Creates a resource path from the given slash-delimited string. If multiple - * arguments are provided, all components are combined. Leading and trailing - * slashes from all components are ignored. - */ - static fromString(...pathComponents: string[]): ResourcePath; - static emptyPath(): ResourcePath; -} +/* Excluded from this release type: _ResourcePath */ /** * Executes the given `updateFunction` and then attempts to commit the changes @@ -4272,18 +6610,35 @@ declare class ResourcePath extends BasePath { * transaction against. * @param updateFunction - The function to execute within the transaction * context. + * @param options - An options object to configure maximum number of attempts to + * commit. * @returns If the transaction completed successfully or was explicitly aborted * (the `updateFunction` returned a failed promise), the promise returned by the * `updateFunction `is returned here. Otherwise, if the transaction failed, a * rejected promise with the corresponding failure error is returned. */ export declare function runTransaction( - firestore: FirebaseFirestore, - updateFunction: (transaction: Transaction) => Promise + firestore: Firestore, + updateFunction: (transaction: Transaction) => Promise, + options?: TransactionOptions ): Promise; /** - * Returns a sentinel used with {@link setDoc} or {@link updateDoc} to + * Interface to schedule periodic tasks within SDK. + */ +declare interface Scheduler { + readonly started: boolean; + start(): void; + stop(): void; +} + +/** Base interface for the Serializer implementation. */ +declare interface Serializer { + readonly useProto3Json: boolean; +} + +/** + * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to * include a server-generated timestamp in the written data. */ export declare function serverTimestamp(): FieldValue; @@ -4296,12 +6651,12 @@ declare type ServerTimestampBehavior = 'estimate' | 'previous' | 'none'; * * @param reference - A reference to the document to write. * @param data - A map of the fields and values for the document. - * @returns A Promise resolved once the data has been successfully written + * @returns A `Promise` resolved once the data has been successfully written * to the backend (note that it won't resolve while you're offline). */ -export declare function setDoc( - reference: DocumentReference, - data: T +export declare function setDoc( + reference: DocumentReference, + data: WithFieldValue ): Promise; /** @@ -4315,12 +6670,78 @@ export declare function setDoc( * @returns A Promise resolved once the data has been successfully written * to the backend (note that it won't resolve while you're offline). */ -export declare function setDoc( - reference: DocumentReference, - data: Partial, +export declare function setDoc( + reference: DocumentReference, + data: PartialWithFieldValue, options: SetOptions ): Promise; +/** + * Configures indexing for local query execution. Any previous index + * configuration is overridden. The `Promise` resolves once the index + * configuration has been persisted. + * + * The index entries themselves are created asynchronously. You can continue to + * use queries that require indexing even if the indices are not yet available. + * Query execution will automatically start using the index once the index + * entries have been written. + * + * Indexes are only supported with IndexedDb persistence. If IndexedDb is not + * enabled, any index configuration is ignored. + * + * @param firestore - The {@link Firestore} instance to configure indexes for. + * @param configuration -The index definition. + * @throws FirestoreError if the JSON format is invalid. + * @returns A `Promise` that resolves once all indices are successfully + * configured. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare function setIndexConfiguration( + firestore: Firestore, + configuration: IndexConfiguration +): Promise; + +/** + * Configures indexing for local query execution. Any previous index + * configuration is overridden. The `Promise` resolves once the index + * configuration has been persisted. + * + * The index entries themselves are created asynchronously. You can continue to + * use queries that require indexing even if the indices are not yet available. + * Query execution will automatically start using the index once the index + * entries have been written. + * + * Indexes are only supported with IndexedDb persistence. Invoke either + * `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()` + * before setting an index configuration. If IndexedDb is not enabled, any + * index configuration is ignored. + * + * The method accepts the JSON format exported by the Firebase CLI (`firebase + * firestore:indexes`). If the JSON format is invalid, this method throws an + * error. + * + * @param firestore - The {@link Firestore} instance to configure indexes for. + * @param json -The JSON format exported by the Firebase CLI. + * @throws FirestoreError if the JSON format is invalid. + * @returns A `Promise` that resolves once all indices are successfully + * configured. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare function setIndexConfiguration( + firestore: Firestore, + json: string +): Promise; + /** * Sets the verbosity of Cloud Firestore logs (debug, error, or silent). * @@ -4337,17 +6758,19 @@ export declare function setDoc( export declare function setLogLevel(logLevel: LogLevel): void; /** - * An options object that configures the behavior of {@link setDoc}, {@link - * WriteBatch#set} and {@link Transaction#set} calls. These calls can be + * An options object that configures the behavior of {@link @firebase/firestore/lite#(setDoc:1)}, {@link + * @firebase/firestore/lite#(WriteBatch.set:1)} and {@link @firebase/firestore/lite#(Transaction.set:1)} calls. These calls can be * configured to perform granular merges instead of overwriting the target * documents in their entirety by providing a `SetOptions` with `merge: true`. * * @param merge - Changes the behavior of a `setDoc()` call to only replace the * values specified in its data argument. Fields omitted from the `setDoc()` - * call remain untouched. + * call remain untouched. If your input sets any field to an empty map, all + * nested fields are overwritten. * @param mergeFields - Changes the behavior of `setDoc()` calls to only replace * the specified field paths. Any field path that is not specified is ignored - * and remains untouched. + * and remains untouched. If your input sets any field to an empty map, all + * nested fields are overwritten. */ export declare type SetOptions = | { @@ -4357,19 +6780,6 @@ export declare type SetOptions = readonly mergeFields?: Array; }; -export declare interface Settings extends Settings_2 { - cacheSizeBytes?: number; -} - -declare interface Settings_2 { - host?: string; - ssl?: boolean; - ignoreUndefinedProperties?: boolean; - cacheSizeBytes?: number; - experimentalForceLongPolling?: boolean; - experimentalAutoDetectLongPolling?: boolean; -} - /** * A `SharedClientState` keeps track of the global state of the mutations * and query targets for all active clients with the same persistence key (i.e. @@ -4410,7 +6820,10 @@ declare interface SharedClientState { * If the target id is already associated with local client, the method simply * returns its `QueryTargetState`. */ - addLocalQueryTarget(targetId: TargetId): QueryTargetState; + addLocalQueryTarget( + targetId: TargetId, + addToActiveTargetIds?: boolean + ): QueryTargetState; /** Removes the Query Target ID association from the local client. */ removeLocalQueryTarget(targetId: TargetId): void; /** Checks whether the target is associated with the local client. */ @@ -4471,8 +6884,10 @@ declare interface SharedClientState { /** * Notifies other clients when remote documents have changed due to loading * a bundle. + * + * @param collectionGroups The collection groups affected by this bundle. */ - notifyBundleLoaded(): void; + notifyBundleLoaded(collectionGroups: Set): void; } /** @@ -4482,14 +6897,21 @@ declare interface SharedClientState { * @param right - A snapshot to compare. * @returns true if the snapshots are equal. */ -export declare function snapshotEqual( - left: DocumentSnapshot | QuerySnapshot, - right: DocumentSnapshot | QuerySnapshot +export declare function snapshotEqual< + AppModelType, + DbModelType extends DocumentData +>( + left: + | DocumentSnapshot + | QuerySnapshot, + right: + | DocumentSnapshot + | QuerySnapshot ): boolean; /** - * An options object that can be passed to {@link onSnapshot} and {@link - * QuerySnapshot#docChanges} to control which types of changes to include in the + * An options object that can be passed to {@link (onSnapshot:1)} and {@link + * QuerySnapshot.docChanges} to control which types of changes to include in the * result set. */ export declare interface SnapshotListenOptions { @@ -4498,6 +6920,11 @@ export declare interface SnapshotListenOptions { * changed. Default is false. */ readonly includeMetadataChanges?: boolean; + /** + * Set the source the query listens to. Default to "default", which + * listens to both cache and server. + */ + readonly source?: ListenSource; } /** @@ -4563,6 +6990,7 @@ declare class SnapshotVersion { private timestamp; static fromTimestamp(value: Timestamp): SnapshotVersion; static min(): SnapshotVersion; + static max(): SnapshotVersion; private constructor(); compareTo(other: SnapshotVersion): number; isEqual(other: SnapshotVersion): boolean; @@ -4659,55 +7087,69 @@ declare class SortedSetIterator { } /** - * Creates a `QueryConstraint` that modifies the result set to start after the - * provided document (exclusive). The starting position is relative to the order - * of the query. The document must contain all of the fields provided in the - * orderBy of the query. + * Creates a {@link QueryStartAtConstraint} that modifies the result set to + * start after the provided document (exclusive). The starting position is + * relative to the order of the query. The document must contain all of the + * fields provided in the orderBy of the query. * * @param snapshot - The snapshot of the document to start after. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryStartAtConstraint} to pass to `query()` */ -export declare function startAfter( - snapshot: DocumentSnapshot_2 -): QueryConstraint; +export declare function startAfter< + AppModelType, + DbModelType extends DocumentData +>( + snapshot: DocumentSnapshot_2 +): QueryStartAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to start after the - * provided fields relative to the order of the query. The order of the field - * values must match the order of the order by clauses of the query. + * Creates a {@link QueryStartAtConstraint} that modifies the result set to + * start after the provided fields relative to the order of the query. The order + * of the field values must match the order of the order by clauses of the query. * * @param fieldValues - The field values to start this query after, in order * of the query's order by. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryStartAtConstraint} to pass to `query()` */ -export declare function startAfter(...fieldValues: unknown[]): QueryConstraint; +export declare function startAfter( + ...fieldValues: unknown[] +): QueryStartAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to start at the - * provided document (inclusive). The starting position is relative to the order - * of the query. The document must contain all of the fields provided in the - * `orderBy` of this query. + * Creates a {@link QueryStartAtConstraint} that modifies the result set to + * start at the provided document (inclusive). The starting position is relative + * to the order of the query. The document must contain all of the fields + * provided in the `orderBy` of this query. * * @param snapshot - The snapshot of the document to start at. - * @returns A `QueryConstraint` to pass to `query()`. + * @returns A {@link QueryStartAtConstraint} to pass to `query()`. */ -export declare function startAt( - snapshot: DocumentSnapshot_2 -): QueryConstraint; +export declare function startAt( + snapshot: DocumentSnapshot_2 +): QueryStartAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to start at the - * provided fields relative to the order of the query. The order of the field - * values must match the order of the order by clauses of the query. + * Creates a {@link QueryStartAtConstraint} that modifies the result set to + * start at the provided fields relative to the order of the query. The order of + * the field values must match the order of the order by clauses of the query. * * @param fieldValues - The field values to start this query at, in order * of the query's order by. - * @returns A `QueryConstraint` to pass to `query()`. + * @returns A {@link QueryStartAtConstraint} to pass to `query()`. */ -export declare function startAt(...fieldValues: unknown[]): QueryConstraint; +export declare function startAt( + ...fieldValues: unknown[] +): QueryStartAtConstraint; declare type StructuredQuery = firestoreV1ApiClientInterfaces.StructuredQuery; +/** + * Create an AggregateField object that can be used to compute the sum of + * a specified field over a range of documents in the result set of a query. + * @param field Specifies the field to sum across the result set. + */ +export declare function sum(field: string | FieldPath): AggregateField; + /** * @license * Copyright 2017 Google LLC @@ -4754,7 +7196,7 @@ declare interface SyncEngine { * in persistence. */ declare interface Target { - readonly path: ResourcePath; + readonly path: _ResourcePath; readonly collectionGroup: string | null; readonly orderBy: OrderBy[]; readonly filters: Filter[]; @@ -4910,7 +7352,7 @@ declare interface TargetCache { ): PersistencePromise; containsKey( transaction: PersistenceTransaction, - key: DocumentKey + key: _DocumentKey ): PersistencePromise; } @@ -4929,7 +7371,7 @@ declare class TargetChange { * query. The resume token essentially identifies a point in time from which * the server should resume sending results. */ - readonly resumeToken: ByteString; + readonly resumeToken: _ByteString; /** * The "current" (synced) status of this target. Note that "current" * has special meaning in the RPC protocol that implies that a target is @@ -4958,7 +7400,7 @@ declare class TargetChange { * query. The resume token essentially identifies a point in time from which * the server should resume sending results. */ - resumeToken: ByteString, + resumeToken: _ByteString, /** * The "current" (synced) status of this target. Note that "current" * has special meaning in the RPC protocol that implies that a target is @@ -4988,7 +7430,8 @@ declare class TargetChange { */ static createSynthesizedTargetChangeForCurrentChange( targetId: TargetId, - current: boolean + current: boolean, + resumeToken: _ByteString ): TargetChange; } @@ -5030,7 +7473,13 @@ declare class TargetData { * matches the target. The resume token essentially identifies a point in * time from which the server should resume sending results. */ - readonly resumeToken: ByteString; + readonly resumeToken: _ByteString; + /** + * The number of documents that last matched the query at the resume token or + * read time. Documents are counted only when making a listen request with + * resume token or read time, otherwise, keep it null. + */ + readonly expectedCount: number | null; constructor( /** The target being listened to. */ target: Target, @@ -5059,7 +7508,13 @@ declare class TargetData { * matches the target. The resume token essentially identifies a point in * time from which the server should resume sending results. */ - resumeToken?: ByteString + resumeToken?: _ByteString, + /** + * The number of documents that last matched the query at the resume token or + * read time. Documents are counted only when making a listen request with + * resume token or read time, otherwise, keep it null. + */ + expectedCount?: number | null ); /** Creates a new target data instance with an updated sequence number. */ withSequenceNumber(sequenceNumber: number): TargetData; @@ -5068,9 +7523,13 @@ declare class TargetData { * snapshot version. */ withResumeToken( - resumeToken: ByteString, + resumeToken: _ByteString, snapshotVersion: SnapshotVersion ): TargetData; + /** + * Creates a new target data instance with an updated expected count. + */ + withExpectedCount(expectedCount: number): TargetData; /** * Creates a new target data instance with an updated last limbo free * snapshot version number. @@ -5089,13 +7548,19 @@ declare type TargetId = number; /** An enumeration of the different purposes we have for targets. */ declare const enum TargetPurpose { /** A regular, normal query target. */ - Listen = 0, + Listen = 'TargetPurposeListen', /** - * The query target was used to refill a query after an existence filter mismatch. + * The query target was used to refill a query after an existence filter + * mismatch. */ - ExistenceFilterMismatch = 1, + ExistenceFilterMismatch = 'TargetPurposeExistenceFilterMismatch', + /** + * The query target was used if the query is the result of a false positive in + * the bloom filter. + */ + ExistenceFilterMismatchBloom = 'TargetPurposeExistenceFilterMismatchBloom', /** The query target was used to resolve a limbo document. */ - LimboResolution = 2 + LimboResolution = 'TargetPurposeLimboResolution' } /** @@ -5107,13 +7572,13 @@ declare const enum TargetPurpose { export declare type TaskState = 'Error' | 'Running' | 'Success'; /** - * Terminates the provided Firestore instance. + * Terminates the provided {@link Firestore} instance. * * After calling `terminate()` only the `clearIndexedDbPersistence()` function * may be used. Any other function will throw a `FirestoreError`. * * To restart after termination, create a new instance of FirebaseFirestore with - * {@link getFirestore}. + * {@link (getFirestore:1)}. * * Termination does not cancel any pending writes, and any promises that are * awaiting a response from the server will not be resolved. If you have @@ -5125,10 +7590,16 @@ export declare type TaskState = 'Error' | 'Running' | 'Success'; * of its resources or in combination with `clearIndexedDbPersistence()` to * ensure that all local state is destroyed between test runs. * - * @returns A promise that is resolved when the instance has been successfully + * @returns A `Promise` that is resolved when the instance has been successfully * terminated. */ -export declare function terminate(firestore: FirebaseFirestore): Promise; +export declare function terminate(firestore: Firestore): Promise; + +/* Excluded from this release type: _TestingHooks */ + +/* Excluded from this release type: _TestingHooksExistenceFilterMismatchCallback */ + +/* Excluded from this release type: _TestingHooksExistenceFilterMismatchInfo */ /** * Wellknown "timer" IDs used when scheduling delayed operations on the @@ -5141,15 +7612,17 @@ declare const enum TimerId { /** All can be used with runDelayedOperationsEarly() to run all timers. */ All = 'all', /** - * The following 4 timers are used in persistent_stream.ts for the listen and + * The following 5 timers are used in persistent_stream.ts for the listen and * write streams. The "Idle" timer is used to close the stream due to * inactivity. The "ConnectionBackoff" timer is used to restart a stream once - * the appropriate backoff delay has elapsed. + * the appropriate backoff delay has elapsed. The health check is used to mark + * a stream healthy if it has not received an error during its initial setup. */ ListenStreamIdle = 'listen_stream_idle', ListenStreamConnectionBackoff = 'listen_stream_connection_backoff', WriteStreamIdle = 'write_stream_idle', WriteStreamConnectionBackoff = 'write_stream_connection_backoff', + HealthCheckTimeout = 'health_check_timeout', /** * A timer used in online_state_tracker.ts to transition from * OnlineState.Unknown to Offline after a set timeout, rather than waiting @@ -5172,7 +7645,11 @@ declare const enum TimerId { * A timer used to retry operations scheduled via retryable AsyncQueue * operations. */ - AsyncQueueRetry = 'async_queue_retry' + AsyncQueueRetry = 'async_queue_retry', + /** + * A timer used to periodically attempt index backfill. + */ + IndexBackfill = 'index_backfill' } /** @@ -5206,7 +7683,13 @@ declare const enum TimerId { * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}. */ export declare class Timestamp { + /** + * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. + */ readonly seconds: number; + /** + * The fractions of a second at nanosecond resolution.* + */ readonly nanoseconds: number; /** * Creates a new timestamp with the current date, with millisecond precision. @@ -5242,10 +7725,20 @@ export declare class Timestamp { * non-negative nanoseconds values that count forward in time. Must be * from 0 to 999,999,999 inclusive. */ - constructor(seconds: number, nanoseconds: number); + constructor( + /** + * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. + */ + seconds: number, + /** + * The fractions of a second at nanosecond resolution.* + */ + nanoseconds: number + ); /** - * Converts a `Timestamp` to a JavaScript `Date` object. This conversion causes - * a loss of precision since `Date` objects only support millisecond precision. + * Converts a `Timestamp` to a JavaScript `Date` object. This conversion + * causes a loss of precision since `Date` objects only support millisecond + * precision. * * @returns JavaScript `Date` object representing the same point in time as * this `Timestamp`, with millisecond precision. @@ -5267,14 +7760,16 @@ export declare class Timestamp { * @returns true if this `Timestamp` is equal to the provided one. */ isEqual(other: Timestamp): boolean; + /** Returns a textual representation of this `Timestamp`. */ toString(): string; + /** Returns a JSON-serializable representation of this `Timestamp`. */ toJSON(): { seconds: number; nanoseconds: number; }; /** - * Converts this object to a primitive string, which allows Timestamp objects to be compared - * using the `>`, `<=`, `>=` and `>` operators. + * Converts this object to a primitive string, which allows `Timestamp` objects + * to be compared using the `>`, `<=`, `>=` and `>` operators. */ valueOf(): string; } @@ -5292,15 +7787,14 @@ declare interface Token { /** * The user with which the token is associated (used for persisting user * state on disk, etc.). + * This will be null for Tokens of the type 'AppCheck'. */ - user: User; - /** Extra header values to be passed along with a request */ - authHeaders: { - [header: string]: string; - }; + user?: User; + /** Header values to set for this token */ + headers: Map; } -declare type TokenType = 'OAuth' | 'FirstParty'; +declare type TokenType = 'OAuth' | 'FirstParty' | 'AppCheck'; /** * A reference to a transaction. @@ -5310,16 +7804,18 @@ declare type TokenType = 'OAuth' | 'FirstParty'; * {@link runTransaction}. */ export declare class Transaction extends Transaction_2 { - protected readonly _firestore: FirebaseFirestore; + protected readonly _firestore: Firestore; /** @hideconstructor */ - constructor(_firestore: FirebaseFirestore, _transaction: Transaction_3); + constructor(_firestore: Firestore, _transaction: Transaction_3); /** * Reads the document referenced by the provided {@link DocumentReference}. * * @param documentRef - A reference to the document to be read. * @returns A `DocumentSnapshot` with the read data. */ - get(documentRef: DocumentReference): Promise>; + get( + documentRef: DocumentReference + ): Promise>; } /** @@ -5330,27 +7826,33 @@ export declare class Transaction extends Transaction_2 { * {@link runTransaction}. */ declare class Transaction_2 { - protected readonly _firestore: FirebaseFirestore_2; + protected readonly _firestore: Firestore_2; private readonly _transaction; private readonly _dataReader; /** @hideconstructor */ - constructor(_firestore: FirebaseFirestore_2, _transaction: Transaction_3); + constructor(_firestore: Firestore_2, _transaction: Transaction_3); /** * Reads the document referenced by the provided {@link DocumentReference}. * * @param documentRef - A reference to the document to be read. * @returns A `DocumentSnapshot` with the read data. */ - get(documentRef: DocumentReference): Promise>; + get( + documentRef: DocumentReference + ): Promise>; /** * Writes to the document referred to by the provided {@link * DocumentReference}. If the document does not exist yet, it will be created. * * @param documentRef - A reference to the document to be set. * @param data - An object of the fields and values for the document. + * @throws Error - If the provided input is not a valid Firestore document. * @returns This `Transaction` instance. Used for chaining method calls. */ - set(documentRef: DocumentReference, data: T): this; + set( + documentRef: DocumentReference, + data: WithFieldValue + ): this; /** * Writes to the document referred to by the provided {@link * DocumentReference}. If the document does not exist yet, it will be created. @@ -5360,11 +7862,12 @@ declare class Transaction_2 { * @param documentRef - A reference to the document to be set. * @param data - An object of the fields and values for the document. * @param options - An object to configure the set behavior. + * @throws Error - If the provided input is not a valid Firestore document. * @returns This `Transaction` instance. Used for chaining method calls. */ - set( - documentRef: DocumentReference, - data: Partial, + set( + documentRef: DocumentReference, + data: PartialWithFieldValue, options: SetOptions ): this; /** @@ -5376,9 +7879,13 @@ declare class Transaction_2 { * @param data - An object containing the fields and values with which to * update the document. Fields can contain dots to reference nested fields * within the document. + * @throws Error - If the provided input is not valid Firestore data. * @returns This `Transaction` instance. Used for chaining method calls. */ - update(documentRef: DocumentReference, data: UpdateData): this; + update( + documentRef: DocumentReference, + data: UpdateData + ): this; /** * Updates fields in the document referred to by the provided {@link * DocumentReference}. The update will fail if applied to a document that does @@ -5391,10 +7898,11 @@ declare class Transaction_2 { * @param field - The first field to update. * @param value - The first value. * @param moreFieldsAndValues - Additional key/value pairs. + * @throws Error - If the provided input is not valid Firestore data. * @returns This `Transaction` instance. Used for chaining method calls. */ - update( - documentRef: DocumentReference, + update( + documentRef: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[] @@ -5405,7 +7913,9 @@ declare class Transaction_2 { * @param documentRef - A reference to the document to be deleted. * @returns This `Transaction` instance. Used for chaining method calls. */ - delete(documentRef: DocumentReference): this; + delete( + documentRef: DocumentReference + ): this; } /** @@ -5421,7 +7931,7 @@ declare class Transaction_3 { * A deferred usage error that occurred previously in this transaction that * will cause the transaction to fail once it actually commits. */ - private lastWriteError; + private lastTransactionError; /** * Set of documents that have been written in the transaction. * @@ -5430,10 +7940,10 @@ declare class Transaction_3 { */ private writtenDocs; constructor(datastore: Datastore); - lookup(keys: DocumentKey[]): Promise; - set(key: DocumentKey, data: ParsedSetData): void; - update(key: DocumentKey, data: ParsedUpdateData): void; - delete(key: DocumentKey): void; + lookup(keys: _DocumentKey[]): Promise; + set(key: _DocumentKey, data: ParsedSetData): void; + update(key: _DocumentKey, data: ParsedUpdateData): void; + delete(key: _DocumentKey): void; commit(): Promise; private recordVersion; /** @@ -5449,6 +7959,30 @@ declare class Transaction_3 { private ensureCommitNotCalled; } +/** + * @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. + */ +/** + * Options to customize transaction behavior. + */ +export declare interface TransactionOptions { + /** Maximum number of attempts to commit, after which transaction fails. Default is 5. */ + readonly maxAttempts?: number; +} + /** Used to represent a field transform on a mutation. */ declare class TransformOperation { private _; @@ -5461,7 +7995,27 @@ declare type UnaryFilterOp = | 'IS_NOT_NAN' | 'IS_NOT_NULL'; +/** + * Given a union type `U = T1 | T2 | ...`, returns an intersected type + * `(T1 & T2 & ...)`. + * + * Uses distributive conditional types and inference from conditional types. + * This works because multiple candidates for the same type variable in + * contra-variant positions causes an intersection type to be inferred. + * https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-inference-in-conditional-types + * https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type + */ +export declare type UnionToIntersection = ( + U extends unknown ? (k: U) => void : never +) extends (k: infer I) => void + ? I + : never; + +/** + * A function returned by `onSnapshot()` that removes the listener when invoked. + */ export declare interface Unsubscribe { + /** Removes the listener when invoked. */ (): void; } @@ -5469,20 +8023,33 @@ export declare interface Unsubscribe { * An untyped Firestore Data Converter interface that is shared between the * lite, firestore-exp and classic SDK. */ -declare interface UntypedFirestoreDataConverter { - toFirestore(modelObject: T): DocumentData_2; - toFirestore(modelObject: Partial, options: SetOptions_2): DocumentData_2; - fromFirestore(snapshot: unknown, options?: unknown): T; +declare interface UntypedFirestoreDataConverter< + AppModelType, + DbModelType extends DocumentData_2 = DocumentData_2 +> { + toFirestore( + modelObject: WithFieldValue + ): WithFieldValue; + toFirestore( + modelObject: PartialWithFieldValue, + options: SetOptions_2 + ): PartialWithFieldValue; + fromFirestore(snapshot: unknown, options?: unknown): AppModelType; } /** - * Update data (for use with {@link updateDoc}) consists of field paths (e.g. - * 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference - * nested fields within the document. + * Update data (for use with {@link (updateDoc:1)}) that consists of field paths + * (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots + * reference nested fields within the document. FieldValues can be passed in + * as property values. */ -export declare interface UpdateData { - [fieldPath: string]: any; -} +export declare type UpdateData = T extends Primitive + ? T + : T extends {} + ? { + [K in keyof T]?: UpdateData | FieldValue; + } & NestedUpdateFields + : Partial; /** * Updates fields in the document referred to by the specified @@ -5493,12 +8060,15 @@ export declare interface UpdateData { * @param data - An object containing the fields and values with which to * update the document. Fields can contain dots to reference nested fields * within the document. - * @returns A Promise resolved once the data has been successfully written + * @returns A `Promise` resolved once the data has been successfully written * to the backend (note that it won't resolve while you're offline). */ -export declare function updateDoc( - reference: DocumentReference, - data: UpdateData +export declare function updateDoc< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, + data: UpdateData ): Promise; /** @@ -5513,33 +8083,19 @@ export declare function updateDoc( * @param field - The first field to update. * @param value - The first value. * @param moreFieldsAndValues - Additional key value pairs. - * @returns A Promise resolved once the data has been successfully written + * @returns A `Promise` resolved once the data has been successfully written * to the backend (note that it won't resolve while you're offline). */ -export declare function updateDoc( - reference: DocumentReference, +export declare function updateDoc< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[] ): Promise; -/** - * Modify this instance to communicate with the Cloud Firestore emulator. - * - * Note: This must be called before this instance has been used to do any - * operations. - * - * @param firestore - The Firestore instance to configure to connect to the - * emulator. - * @param host - the emulator host (ex: localhost). - * @param port - the emulator port (ex: 9000). - */ -export declare function useFirestoreEmulator( - firestore: FirebaseFirestore_2, - host: string, - port: number -): void; - /** * @license * Copyright 2017 Google LLC @@ -5566,6 +8122,7 @@ declare class User { static readonly UNAUTHENTICATED: User; static readonly GOOGLE_CREDENTIALS: User; static readonly FIRST_PARTY: User; + static readonly MOCK_USER: User; constructor(uid: string | null); isAuthenticated(): boolean; /** @@ -5576,10 +8133,56 @@ declare class User { isEqual(otherUser: User): boolean; } +/* Excluded from this release type: _validateIsNotUsedTogether */ + declare type Value = firestoreV1ApiClientInterfaces.Value; declare type ValueNullValue = 'NULL_VALUE'; +/** + * Creates a new `VectorValue` constructed with a copy of the given array of numbers. + * + * @param values - Create a `VectorValue` instance with a copy of this array of numbers. + * + * @returns A new `VectorValue` constructed with a copy of the given array of numbers. + */ +export declare function vector(values?: number[]): VectorValue; + +/** + * @license + * Copyright 2024 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. + */ +/** + * Represents a vector type in Firestore documents. + * Create an instance with {@link FieldValue.vector}. + * + * @class VectorValue + */ +export declare class VectorValue { + private readonly _values; + /* Excluded from this release type: __constructor */ + /** + * Returns a copy of the raw number array form of the vector. + */ + toArray(): number[]; + /** + * Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise. + */ + isEqual(other: VectorValue): boolean; +} + declare class ViewSnapshot { readonly query: Query_2; readonly docs: DocumentSet; @@ -5589,6 +8192,7 @@ declare class ViewSnapshot { readonly fromCache: boolean; readonly syncStateChanged: boolean; readonly excludesMetadataChanges: boolean; + readonly hasCachedResults: boolean; constructor( query: Query_2, docs: DocumentSet, @@ -5597,14 +8201,16 @@ declare class ViewSnapshot { mutatedKeys: DocumentKeySet, fromCache: boolean, syncStateChanged: boolean, - excludesMetadataChanges: boolean + excludesMetadataChanges: boolean, + hasCachedResults: boolean ); /** Returns a view snapshot as if all documents in the snapshot were added. */ static fromInitialDocuments( query: Query_2, documents: DocumentSet, mutatedKeys: DocumentKeySet, - fromCache: boolean + fromCache: boolean, + hasCachedResults: boolean ): ViewSnapshot; get hasPendingWrites(): boolean; isEqual(other: ViewSnapshot): boolean; @@ -5614,38 +8220,38 @@ declare class ViewSnapshot { * Waits until all currently pending writes for the active user have been * acknowledged by the backend. * - * The returned Promise resolves immediately if there are no outstanding writes. - * Otherwise, the Promise waits for all previously issued writes (including + * The returned promise resolves immediately if there are no outstanding writes. + * Otherwise, the promise waits for all previously issued writes (including * those written in a previous app session), but it does not wait for writes * that were added after the function is called. If you want to wait for * additional writes, call `waitForPendingWrites()` again. * - * Any outstanding `waitForPendingWrites()` Promises are rejected during user + * Any outstanding `waitForPendingWrites()` promises are rejected during user * changes. * - * @returns A Promise which resolves when all currently pending writes have been + * @returns A `Promise` which resolves when all currently pending writes have been * acknowledged by the backend. */ export declare function waitForPendingWrites( - firestore: FirebaseFirestore + firestore: Firestore ): Promise; /** - * Creates a `QueryConstraint` that enforces that documents must contain the - * specified field and that the value should satisfy the relation constraint - * provided. + * Creates a {@link QueryFieldFilterConstraint} that enforces that documents + * must contain the specified field and that the value should satisfy the + * relation constraint provided. * * @param fieldPath - The path to compare * @param opStr - The operation string (e.g "<", "<=", "==", "<", * "<=", "!="). * @param value - The value for comparison - * @returns The created `Query`. + * @returns The created {@link QueryFieldFilterConstraint}. */ export declare function where( fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown -): QueryConstraint; +): QueryFieldFilterConstraint; /** * Filter conditions in a {@link where} clause are specified using the @@ -5664,12 +8270,26 @@ export declare type WhereFilterOp = | 'array-contains-any' | 'not-in'; +/** + * Allows FieldValues to be passed in as a property value while maintaining + * type safety. + */ +export declare type WithFieldValue = + | T + | (T extends Primitive + ? T + : T extends {} + ? { + [K in keyof T]: WithFieldValue | FieldValue; + } + : never); + /** * A write batch, used to perform multiple writes as a single atomic unit. * * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It * provides methods for adding writes to the write batch. None of the writes - * will be committed (or visible locally) until {@link WriteBatch#commit} is + * will be committed (or visible locally) until {@link WriteBatch.commit} is * called. */ export declare class WriteBatch { @@ -5680,7 +8300,7 @@ export declare class WriteBatch { private _committed; /** @hideconstructor */ constructor( - _firestore: FirebaseFirestore_2, + _firestore: Firestore_2, _commitHandler: (m: Mutation[]) => Promise ); /** @@ -5691,7 +8311,10 @@ export declare class WriteBatch { * @param data - An object of the fields and values for the document. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - set(documentRef: DocumentReference, data: T): WriteBatch; + set( + documentRef: DocumentReference, + data: WithFieldValue + ): WriteBatch; /** * Writes to the document referred to by the provided {@link * DocumentReference}. If the document does not exist yet, it will be created. @@ -5701,11 +8324,12 @@ export declare class WriteBatch { * @param documentRef - A reference to the document to be set. * @param data - An object of the fields and values for the document. * @param options - An object to configure the set behavior. + * @throws Error - If the provided input is not a valid Firestore document. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - set( - documentRef: DocumentReference, - data: Partial, + set( + documentRef: DocumentReference, + data: PartialWithFieldValue, options: SetOptions ): WriteBatch; /** @@ -5717,9 +8341,13 @@ export declare class WriteBatch { * @param data - An object containing the fields and values with which to * update the document. Fields can contain dots to reference nested fields * within the document. + * @throws Error - If the provided input is not valid Firestore data. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - update(documentRef: DocumentReference, data: UpdateData): WriteBatch; + update( + documentRef: DocumentReference, + data: UpdateData + ): WriteBatch; /** * Updates fields in the document referred to by this {@link * DocumentReference}. The update will fail if applied to a document that does @@ -5732,10 +8360,11 @@ export declare class WriteBatch { * @param field - The first field to update. * @param value - The first value. * @param moreFieldsAndValues - Additional key value pairs. + * @throws Error - If the provided input is not valid Firestore data. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - update( - documentRef: DocumentReference, + update( + documentRef: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[] @@ -5746,16 +8375,18 @@ export declare class WriteBatch { * @param documentRef - A reference to the document to be deleted. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - delete(documentRef: DocumentReference): WriteBatch; + delete( + documentRef: DocumentReference + ): WriteBatch; /** * Commits all of the writes in this write batch as a single atomic unit. * * The result of these writes will only be reflected in document reads that - * occur after the returned Promise resolves. If the client is offline, the + * occur after the returned promise resolves. If the client is offline, the * write fails. If you would like to see local modifications or buffer writes * until the client is online, use the full Firestore SDK. * - * @returns A Promise resolved once all of the writes in the batch have been + * @returns A `Promise` resolved once all of the writes in the batch have been * successfully written to the backend as an atomic unit (note that it won't * resolve while you're offline). */ @@ -5765,15 +8396,15 @@ export declare class WriteBatch { /** * Creates a write batch, used for performing multiple writes as a single - * atomic operation. The maximum number of writes allowed in a single WriteBatch + * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch} * is 500. * * Unlike transactions, write batches are persisted offline and therefore are * preferable when you don't need to condition your writes on read data. * - * @returns A `WriteBatch` that can be used to atomically execute multiple + * @returns A {@link WriteBatch} that can be used to atomically execute multiple * writes. */ -export declare function writeBatch(firestore: FirebaseFirestore): WriteBatch; +export declare function writeBatch(firestore: Firestore): WriteBatch; export {}; diff --git a/repo-scripts/prune-dts/tests/firestore.output.d.ts b/repo-scripts/prune-dts/tests/firestore.output.d.ts index 58411538953..33048292e38 100644 --- a/repo-scripts/prune-dts/tests/firestore.output.d.ts +++ b/repo-scripts/prune-dts/tests/firestore.output.d.ts @@ -1,25 +1,13 @@ /** - * @license - * Copyright 2021 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 + * Cloud Firestore * - * 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. + * @packageDocumentation */ import { DocumentData as DocumentData_2 } from '@firebase/firestore-types'; +import { EmulatorMockTokenOptions } from '@firebase/util'; import { FirebaseApp } from '@firebase/app'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { _FirebaseService } from '@firebase/app'; +import { FirebaseError } from '@firebase/util'; import { LogLevelString as LogLevel } from '@firebase/logger'; -import { Provider } from '@firebase/component'; import { SetOptions as SetOptions_2 } from '@firebase/firestore-types'; /** * Add a new document to specified `CollectionReference` with the given data, @@ -27,17 +15,133 @@ import { SetOptions as SetOptions_2 } from '@firebase/firestore-types'; * * @param reference - A reference to the collection to add this document to. * @param data - An Object containing the data for the new document. - * @returns A Promise resolved with a `DocumentReference` pointing to the + * @returns A `Promise` resolved with a `DocumentReference` pointing to the * newly created document after it has been written to the backend (Note that it * won't resolve while you're offline). */ -export declare function addDoc( - reference: CollectionReference, - data: T -): Promise>; +export declare function addDoc( + reference: CollectionReference, + data: WithFieldValue +): Promise>; +/** + * Returns a new map where every key is prefixed with the outer key appended + * to a dot. + */ +export declare type AddPrefixToKeys< + Prefix extends string, + T extends Record +> = { + [K in keyof T & string as `${Prefix}.${K}`]+?: string extends K ? any : T[K]; +}; +/** + * Represents an aggregation that can be performed by Firestore. + */ +export declare class AggregateField { + /** A type string to uniquely identify instances of this class. */ + readonly type = 'AggregateField'; + /** Indicates the aggregation operation of this AggregateField. */ + readonly aggregateType: AggregateType; +} +/** + * Compares two 'AggregateField` instances for equality. + * + * @param left Compare this AggregateField to the `right`. + * @param right Compare this AggregateField to the `left`. + */ +export declare function aggregateFieldEqual( + left: AggregateField, + right: AggregateField +): boolean; +/** + * The union of all `AggregateField` types that are supported by Firestore. + */ +export declare type AggregateFieldType = + | ReturnType + | ReturnType + | ReturnType; +/** + * The results of executing an aggregation query. + */ +export declare class AggregateQuerySnapshot< + AggregateSpecType extends AggregateSpec, + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { + /** A type string to uniquely identify instances of this class. */ + readonly type = 'AggregateQuerySnapshot'; + /** + * The underlying query over which the aggregations recorded in this + * `AggregateQuerySnapshot` were performed. + */ + readonly query: Query; + private constructor(); + /** + * Returns the results of the aggregations performed over the underlying + * query. + * + * The keys of the returned object will be the same as those of the + * `AggregateSpec` object specified to the aggregation method, and the values + * will be the corresponding aggregation result. + * + * @returns The results of the aggregations performed over the underlying + * query. + */ + data(): AggregateSpecData; +} +/** + * Compares two `AggregateQuerySnapshot` instances for equality. + * + * Two `AggregateQuerySnapshot` instances are considered "equal" if they have + * underlying queries that compare equal, and the same data. + * + * @param left - The first `AggregateQuerySnapshot` to compare. + * @param right - The second `AggregateQuerySnapshot` to compare. + * + * @returns `true` if the objects are "equal", as defined above, or `false` + * otherwise. + */ +export declare function aggregateQuerySnapshotEqual< + AggregateSpecType extends AggregateSpec, + AppModelType, + DbModelType extends DocumentData +>( + left: AggregateQuerySnapshot, + right: AggregateQuerySnapshot +): boolean; +/** + * Specifies a set of aggregations and their aliases. + */ +export declare interface AggregateSpec { + [field: string]: AggregateFieldType; +} +/** + * A type whose keys are taken from an `AggregateSpec`, and whose values are the + * result of the aggregation performed by the corresponding `AggregateField` + * from the input `AggregateSpec`. + */ +export declare type AggregateSpecData = { + [P in keyof T]: T[P] extends AggregateField ? U : never; +}; +/** + * Union type representing the aggregate type to be performed. + */ +export declare type AggregateType = 'count' | 'avg' | 'sum'; +/** + * 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 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}. + */ +export declare function and( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint; /** * Returns a special value that can be used with {@link (setDoc:1)} or {@link - * updateDoc} that tells the server to remove the given elements from any + * updateDoc:1} that tells the server to remove the given elements from any * array value that already exists on the server. All instances of each element * specified will be removed from the array. If the field being modified is not * already an array it will be overwritten with an empty array. @@ -48,8 +152,8 @@ export declare function addDoc( */ export declare function arrayRemove(...elements: unknown[]): FieldValue; /** - * Returns a special value that can be used with {@link setDoc} or {@link - * updateDoc} that tells the server to union the given elements with any array + * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link + * @firebase/firestore/lite#(updateDoc:1)} that tells the server to union the given elements with any array * value that already exists on the server. Each specified element that doesn't * already exist in the array will be added to the end. If the field being * modified is not already an array it will be overwritten with an array @@ -60,6 +164,16 @@ export declare function arrayRemove(...elements: unknown[]): FieldValue; * `updateDoc()`. */ export declare function arrayUnion(...elements: unknown[]): FieldValue; +/* Excluded from this release type: AuthTokenFactory */ +/* Excluded from this release type: _AutoId */ +/** + * Create an AggregateField object that can be used to compute the average of + * a specified field over a range of documents in the result set of a query. + * @param field Specifies the field to average across the result set. + */ +export declare function average( + field: string | FieldPath +): AggregateField; /** * An immutable object representing an array of bytes. */ @@ -104,20 +218,37 @@ export declare class Bytes { */ isEqual(other: Bytes): boolean; } +/* Excluded from this release type: _ByteString */ /** * Constant used to indicate the LRU garbage collection should be disabled. * Set this value as the `cacheSizeBytes` on the settings passed to the - * `Firestore` instance. + * {@link Firestore} instance. */ export declare const CACHE_SIZE_UNLIMITED = -1; +/** + * Helper for calculating the nested fields for a given type T1. This is needed + * to distribute union types such as `undefined | {...}` (happens for optional + * props) or `{a: A} | {b: B}`. + * + * In this use case, `V` is used to distribute the union types of `T[K]` on + * `Record`, since `T[K]` is evaluated as an expression and not distributed. + * + * See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types + */ +export declare type ChildUpdateFields = V extends Record< + string, + unknown +> + ? AddPrefixToKeys> + : never; /** * Clears the persistent storage. This includes pending writes and cached * documents. * - * Must be called while the `Firestore` instance is not started (after the app is + * Must be called while the {@link Firestore} instance is not started (after the app is * terminated or when the app is first initialized). On startup, this function * must be called before other functions (other than {@link - * initializeFirestore} or {@link getFirestore})). If the `Firestore` + * initializeFirestore} or {@link (getFirestore:1)})). If the {@link Firestore} * instance is still running, the promise will be rejected with the error code * of `failed-precondition`. * @@ -128,18 +259,18 @@ export declare const CACHE_SIZE_UNLIMITED = -1; * to the disclosure of cached data in between user sessions, we strongly * recommend not enabling persistence at all. * - * @param firestore - The `Firestore` instance to clear persistence for. - * @returns A promise that is resolved when the persistent storage is + * @param firestore - The {@link Firestore} instance to clear persistence for. + * @returns A `Promise` that is resolved when the persistent storage is * cleared. Otherwise, the promise is rejected with an error. */ export declare function clearIndexedDbPersistence( - firestore: FirebaseFirestore + firestore: Firestore ): Promise; /** * Gets a `CollectionReference` instance that refers to the collection at * the specified absolute path. * - * @param firestore - A reference to the root Firestore instance. + * @param firestore - A reference to the root `Firestore` instance. * @param path - A slash-separated path to a collection. * @param pathSegments - Additional path segments to apply relative to the first * argument. @@ -148,10 +279,10 @@ export declare function clearIndexedDbPersistence( * @returns The `CollectionReference` instance. */ export declare function collection( - firestore: FirebaseFirestore, + firestore: Firestore, path: string, ...pathSegments: string[] -): CollectionReference; +): CollectionReference; /** * Gets a `CollectionReference` instance that refers to a subcollection of * `reference` at the specified relative path. @@ -164,11 +295,14 @@ export declare function collection( * to a collection. * @returns The `CollectionReference` instance. */ -export declare function collection( - reference: CollectionReference, +export declare function collection< + AppModelType, + DbModelType extends DocumentData +>( + reference: CollectionReference, path: string, ...pathSegments: string[] -): CollectionReference; +): CollectionReference; /** * Gets a `CollectionReference` instance that refers to a subcollection of * `reference` at the specified relative path. @@ -181,32 +315,38 @@ export declare function collection( * to a collection. * @returns The `CollectionReference` instance. */ -export declare function collection( - reference: DocumentReference, +export declare function collection< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, path: string, ...pathSegments: string[] -): CollectionReference; +): CollectionReference; /** * Creates and returns a new `Query` instance that includes all documents in the * database that are contained in a collection or subcollection with the * given `collectionId`. * - * @param firestore - A reference to the root Firestore instance. + * @param firestore - A reference to the root `Firestore` instance. * @param collectionId - Identifies the collections to query over. Every * collection or subcollection with this ID as the last segment of its path * will be included. Cannot contain a slash. * @returns The created `Query`. */ export declare function collectionGroup( - firestore: FirebaseFirestore, + firestore: Firestore, collectionId: string -): Query; +): Query; /** * A `CollectionReference` object can be used for adding documents, getting - * document references, and querying for documents (using {@link query}). + * document references, and querying for documents (using {@link (query:1)}). */ -export declare class CollectionReference extends Query { - readonly firestore: FirebaseFirestore; +export declare class CollectionReference< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> extends Query { + /** The type of this Firestore reference. */ readonly type = 'collection'; private constructor(); /** The collection's identifier. */ @@ -220,20 +360,69 @@ export declare class CollectionReference extends Query { * A reference to the containing `DocumentReference` if this is a * subcollection. If this isn't a subcollection, the reference is null. */ - get parent(): DocumentReference | null; + get parent(): DocumentReference | null; /** - * Applies a custom data converter to this CollectionReference, allowing you + * Applies a custom data converter to this `CollectionReference`, allowing you * to use your own custom model objects with Firestore. When you call {@link * addDoc} with the returned `CollectionReference` instance, the provided - * converter will convert between Firestore data and your custom type `U`. + * converter will convert between Firestore data of type `NewDbModelType` and + * your custom type `NewAppModelType`. * * @param converter - Converts objects to and from Firestore. - * @returns A `CollectionReference` that uses the provided converter. + * @returns A `CollectionReference` that uses the provided converter. */ - withConverter( - converter: FirestoreDataConverter - ): CollectionReference; + withConverter< + NewAppModelType, + NewDbModelType extends DocumentData = DocumentData + >( + converter: FirestoreDataConverter + ): CollectionReference; + /** + * Removes the current converter. + * + * @param converter - `null` removes the current converter. + * @returns A `CollectionReference` that does not + * use a converter. + */ + withConverter( + converter: null + ): CollectionReference; } +/** + * Modify this instance to communicate with the Cloud Firestore emulator. + * + * Note: This must be called before this instance has been used to do any + * operations. + * + * @param firestore - The `Firestore` instance to configure to connect to the + * emulator. + * @param host - the emulator host (ex: localhost). + * @param port - the emulator port (ex: 9000). + * @param options.mockUserToken - the mock auth token to use for unit testing + * Security Rules. + */ +export declare function connectFirestoreEmulator( + firestore: Firestore, + host: string, + port: number, + options?: { + mockUserToken?: EmulatorMockTokenOptions | string; + } +): void; +/** + * Create an AggregateField object that can be used to compute the count of + * documents in the result set of a query. + */ +export declare function count(): AggregateField; +/** + * Removes all persistent cache indexes. + * + * Please note this function will also deletes indexes generated by + * `setIndexConfiguration()`, which is deprecated. + */ +export declare function deleteAllPersistentCacheIndexes( + indexManager: PersistentCacheIndexManager +): void; /** * Deletes the document referred to by the specified `DocumentReference`. * @@ -241,12 +430,13 @@ export declare class CollectionReference extends Query { * @returns A Promise resolved once the document has been successfully * deleted from the backend (note that it won't resolve while you're offline). */ -export declare function deleteDoc( - reference: DocumentReference -): Promise; +export declare function deleteDoc< + AppModelType, + DbModelType extends DocumentData +>(reference: DocumentReference): Promise; /** - * Returns a sentinel for use with {@link updateDoc} or - * {@link setDoc} with `{merge: true}` to mark a field for deletion. + * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or + * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion. */ export declare function deleteField(): FieldValue; /** @@ -255,16 +445,22 @@ export declare function deleteField(): FieldValue; * `getDoc()` or `getDocs()` calls will return results from cache, and any write * operations will be queued until the network is restored. * - * @returns A promise that is resolved once the network has been disabled. + * @returns A `Promise` that is resolved once the network has been disabled. */ -export declare function disableNetwork( - firestore: FirebaseFirestore -): Promise; +export declare function disableNetwork(firestore: Firestore): Promise; +/** + * Stops creating persistent cache indexes automatically for local query + * execution. The indexes which have been created by calling + * `enablePersistentCacheIndexAutoCreation()` still take effect. + */ +export declare function disablePersistentCacheIndexAutoCreation( + indexManager: PersistentCacheIndexManager +): void; /** * Gets a `DocumentReference` instance that refers to the document at the * specified absolute path. * - * @param firestore - A reference to the root Firestore instance. + * @param firestore - A reference to the root `Firestore` instance. * @param path - A slash-separated path to a document. * @param pathSegments - Additional path segments that will be applied relative * to the first argument. @@ -273,10 +469,10 @@ export declare function disableNetwork( * @returns The `DocumentReference` instance. */ export declare function doc( - firestore: FirebaseFirestore, + firestore: Firestore, path: string, ...pathSegments: string[] -): DocumentReference; +): DocumentReference; /** * Gets a `DocumentReference` instance that refers to a document within * `reference` at the specified relative path. If no path is specified, an @@ -292,11 +488,11 @@ export declare function doc( * a document. * @returns The `DocumentReference` instance. */ -export declare function doc( - reference: CollectionReference, +export declare function doc( + reference: CollectionReference, path?: string, ...pathSegments: string[] -): DocumentReference; +): DocumentReference; /** * Gets a `DocumentReference` instance that refers to a document within * `reference` at the specified relative path. @@ -309,20 +505,23 @@ export declare function doc( * a document. * @returns The `DocumentReference` instance. */ -export declare function doc( - reference: DocumentReference, +export declare function doc( + reference: DocumentReference, path: string, ...pathSegments: string[] -): DocumentReference; +): DocumentReference; /** * A `DocumentChange` represents a change to the documents matching a query. * It contains the document affected and the type of change that occurred. */ -export declare interface DocumentChange { +export declare interface DocumentChange< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { /** The type of change ('added', 'modified', or 'removed'). */ readonly type: DocumentChangeType; /** The document affected by this change. */ - readonly doc: QueryDocumentSnapshot; + readonly doc: QueryDocumentSnapshot; /** * The index of the changed document in the result set immediately prior to * this `DocumentChange` (i.e. supposing that all prior `DocumentChange` objects @@ -342,10 +541,11 @@ export declare interface DocumentChange { */ export declare type DocumentChangeType = 'added' | 'removed' | 'modified'; /** - * Document data (for use with {@link setDoc}) consists of fields mapped to + * Document data (for use with {@link @firebase/firestore/lite#(setDoc:1)}) consists of fields mapped to * values. */ export declare interface DocumentData { + /** A mapping between a field and its value. */ [field: string]: any; } /** @@ -358,14 +558,21 @@ export declare function documentId(): FieldPath; * and can be used to write, read, or listen to the location. The document at * the referenced location may or may not exist. */ -export declare class DocumentReference { +export declare class DocumentReference< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { + /** + * If provided, the `FirestoreDataConverter` associated with this instance. + */ + readonly converter: FirestoreDataConverter | null; /** The type of this Firestore reference. */ readonly type = 'document'; /** - * The {@link FirebaseFirestore} the document is in. + * The {@link Firestore} instance the document is in. * This is useful for performing transactions, for example. */ - readonly firestore: FirebaseFirestore; + readonly firestore: Firestore; private constructor(); /** * The document's identifier within its collection. @@ -379,18 +586,31 @@ export declare class DocumentReference { /** * The collection this `DocumentReference` belongs to. */ - get parent(): CollectionReference; + get parent(): CollectionReference; /** * Applies a custom data converter to this `DocumentReference`, allowing you * to use your own custom model objects with Firestore. When you call {@link - * setDoc}, {@link getDoc}, etc. with the returned `DocumentReference` - * instance, the provided converter will convert between Firestore data and - * your custom type `U`. + * @firebase/firestore/lite#(setDoc:1)}, {@link @firebase/firestore/lite#getDoc}, etc. with the returned `DocumentReference` + * instance, the provided converter will convert between Firestore data of + * type `NewDbModelType` and your custom type `NewAppModelType`. * * @param converter - Converts objects to and from Firestore. - * @returns A `DocumentReference` that uses the provided converter. + * @returns A `DocumentReference` that uses the provided converter. + */ + withConverter< + NewAppModelType, + NewDbModelType extends DocumentData = DocumentData + >( + converter: FirestoreDataConverter + ): DocumentReference; + /** + * Removes the current converter. + * + * @param converter - `null` removes the current converter. + * @returns A `DocumentReference` that does not + * use a converter. */ - withConverter(converter: FirestoreDataConverter): DocumentReference; + withConverter(converter: null): DocumentReference; } /** * A `DocumentSnapshot` contains data read from a document in your Firestore @@ -401,7 +621,10 @@ export declare class DocumentReference { * access will return 'undefined'. You can use the `exists()` method to * explicitly verify a document's existence. */ -export declare class DocumentSnapshot { +export declare class DocumentSnapshot< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { /** * Metadata about the `DocumentSnapshot`, including information about its * source and local modifications. @@ -409,15 +632,14 @@ export declare class DocumentSnapshot { readonly metadata: SnapshotMetadata; protected constructor(); /** - * Property of the `DocumentSnapshot` that signals whether or not the data - * exists. True if the document exists. + * Returns whether or not the data exists. True if the document exists. */ - exists(): this is QueryDocumentSnapshot; + exists(): this is QueryDocumentSnapshot; /** * Retrieves all fields in the document as an `Object`. Returns `undefined` if * the document doesn't exist. * - * By default, `FieldValue.serverTimestamp()` values that have not yet been + * By default, `serverTimestamp()` values that have not yet been * set to their final value will be returned as `null`. You can override * this by passing an options object. * @@ -427,12 +649,12 @@ export declare class DocumentSnapshot { * @returns An `Object` containing all fields in the document or `undefined` if * the document doesn't exist. */ - data(options?: SnapshotOptions): T | undefined; + data(options?: SnapshotOptions): AppModelType | undefined; /** * Retrieves the field specified by `fieldPath`. Returns `undefined` if the * document or field doesn't exist. * - * By default, a `FieldValue.serverTimestamp()` that has not yet been set to + * By default, a `serverTimestamp()` that has not yet been set to * its final value will be returned as `null`. You can override this by * passing an options object. * @@ -452,33 +674,42 @@ export declare class DocumentSnapshot { /** * The `DocumentReference` for the document included in the `DocumentSnapshot`. */ - get ref(): DocumentReference; + get ref(): DocumentReference; } +/* Excluded from this release type: _EmptyAppCheckTokenProvider */ +/* Excluded from this release type: _EmptyAuthCredentialsProvider */ +export { EmulatorMockTokenOptions }; /** * Attempts to enable persistent storage, if possible. * - * Must be called before any other functions (other than - * {@link initializeFirestore}, {@link getFirestore} or - * {@link clearIndexedDbPersistence}. + * On failure, `enableIndexedDbPersistence()` will reject the promise or + * throw an exception. There are several reasons why this can fail, which can be + * identified by the `code` on the error. * - * If this fails, `enableIndexedDbPersistence()` will reject the promise it - * returns. Note that even after this failure, the `Firestore` instance will - * remain usable, however offline persistence will be disabled. + * * failed-precondition: The app is already open in another browser tab. + * * unimplemented: The browser is incompatible with the offline persistence + * implementation. * - * There are several reasons why this can fail, which can be identified by - * the `code` on the error. + * Note that even after a failure, the {@link Firestore} instance will remain + * usable, however offline persistence will be disabled. * - * * failed-precondition: The app is already open in another browser tab. - * * unimplemented: The browser is incompatible with the offline - * persistence implementation. + * Note: `enableIndexedDbPersistence()` must be called before any other functions + * (other than {@link initializeFirestore}, {@link (getFirestore:1)} or + * {@link clearIndexedDbPersistence}. + * + * Persistence cannot be used in a Node.js environment. * - * @param firestore - The `Firestore` instance to enable persistence for. + * @param firestore - The {@link Firestore} instance to enable persistence for. * @param persistenceSettings - Optional settings object to configure * persistence. - * @returns A promise that represents successfully enabling persistent storage. + * @returns A `Promise` that represents successfully enabling persistent storage. + * @deprecated This function will be removed in a future major release. Instead, set + * `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to + * turn on IndexedDb cache. Calling this function when `FirestoreSettings.localCache` + * is already specified will throw an exception. */ export declare function enableIndexedDbPersistence( - firestore: FirebaseFirestore, + firestore: Firestore, persistenceSettings?: PersistenceSettings ): Promise; /** @@ -487,78 +718,140 @@ export declare function enableIndexedDbPersistence( * shared execution of queries and latency-compensated local document updates * across all connected instances. * - * If this fails, `enableMultiTabIndexedDbPersistence()` will reject the promise - * it returns. Note that even after this failure, the `Firestore` instance will - * remain usable, however offline persistence will be disabled. - * - * There are several reasons why this can fail, which can be identified by - * the `code` on the error. + * On failure, `enableMultiTabIndexedDbPersistence()` will reject the promise or + * throw an exception. There are several reasons why this can fail, which can be + * identified by the `code` on the error. * * * failed-precondition: The app is already open in another browser tab and * multi-tab is not enabled. - * * unimplemented: The browser is incompatible with the offline - * persistence implementation. + * * unimplemented: The browser is incompatible with the offline persistence + * implementation. + * + * Note that even after a failure, the {@link Firestore} instance will remain + * usable, however offline persistence will be disabled. * - * @param firestore - The `Firestore` instance to enable persistence for. - * @returns A promise that represents successfully enabling persistent + * @param firestore - The {@link Firestore} instance to enable persistence for. + * @returns A `Promise` that represents successfully enabling persistent * storage. + * @deprecated This function will be removed in a future major release. Instead, set + * `FirestoreSettings.localCache` to an instance of `PersistentLocalCache` to + * turn on indexeddb cache. Calling this function when `FirestoreSettings.localCache` + * is already specified will throw an exception. */ export declare function enableMultiTabIndexedDbPersistence( - firestore: FirebaseFirestore + firestore: Firestore ): Promise; /** - * Re-enables use of the network for this Firestore instance after a prior + * Re-enables use of the network for this {@link Firestore} instance after a prior * call to {@link disableNetwork}. * - * @returns A promise that is resolved once the network has been enabled. + * @returns A `Promise` that is resolved once the network has been enabled. */ -export declare function enableNetwork( - firestore: FirebaseFirestore -): Promise; +export declare function enableNetwork(firestore: Firestore): Promise; +/** + * Enables the SDK to create persistent cache indexes automatically for local + * query execution when the SDK believes cache indexes can help improve + * performance. + * + * This feature is disabled by default. + */ +export declare function enablePersistentCacheIndexAutoCreation( + indexManager: PersistentCacheIndexManager +): void; /** - * Creates a `QueryConstraint` that modifies the result set to end at the - * provided document (inclusive). The end position is relative to the order of - * the query. The document must contain all of the fields provided in the + * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at + * the provided document (inclusive). The end position is relative to the order + * of the query. The document must contain all of the fields provided in the * orderBy of the query. * * @param snapshot - The snapshot of the document to end at. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryEndAtConstraint} to pass to `query()` */ -export declare function endAt( - snapshot: DocumentSnapshot -): QueryConstraint; +export declare function endAt( + snapshot: DocumentSnapshot +): QueryEndAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to end at the - * provided fields relative to the order of the query. The order of the field + * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at + * the provided fields relative to the order of the query. The order of the field * values must match the order of the order by clauses of the query. * * @param fieldValues - The field values to end this query at, in order * of the query's order by. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryEndAtConstraint} to pass to `query()` */ -export declare function endAt(...fieldValues: unknown[]): QueryConstraint; +export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to end before the - * provided document (exclusive). The end position is relative to the order of - * the query. The document must contain all of the fields provided in the - * orderBy of the query. + * Creates a {@link QueryEndAtConstraint} that modifies the result set to end + * before the provided document (exclusive). The end position is relative to the + * order of the query. The document must contain all of the fields provided in + * the orderBy of the query. * * @param snapshot - The snapshot of the document to end before. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryEndAtConstraint} to pass to `query()` */ -export declare function endBefore( - snapshot: DocumentSnapshot -): QueryConstraint; +export declare function endBefore< + AppModelType, + DbModelType extends DocumentData +>(snapshot: DocumentSnapshot): QueryEndAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to end before the - * provided fields relative to the order of the query. The order of the field - * values must match the order of the order by clauses of the query. + * Creates a {@link QueryEndAtConstraint} that modifies the result set to end + * before the provided fields relative to the order of the query. The order of + * the field values must match the order of the order by clauses of the query. * * @param fieldValues - The field values to end this query before, in order * of the query's order by. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryEndAtConstraint} to pass to `query()` */ -export declare function endBefore(...fieldValues: unknown[]): QueryConstraint; +export declare function endBefore( + ...fieldValues: unknown[] +): QueryEndAtConstraint; +/* Excluded from this release type: executeWrite */ +/** + * @license + * Copyright 2023 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. + */ +/** + * Options that configure the SDK’s underlying network transport (WebChannel) + * when long-polling is used. + * + * Note: This interface is "experimental" and is subject to change. + * + * See `FirestoreSettings.experimentalAutoDetectLongPolling`, + * `FirestoreSettings.experimentalForceLongPolling`, and + * `FirestoreSettings.experimentalLongPollingOptions`. + */ +export declare interface ExperimentalLongPollingOptions { + /** + * The desired maximum timeout interval, in seconds, to complete a + * long-polling GET response. Valid values are between 5 and 30, inclusive. + * Floating point values are allowed and will be rounded to the nearest + * millisecond. + * + * By default, when long-polling is used the "hanging GET" request sent by + * the client times out after 30 seconds. To request a different timeout + * from the server, set this setting with the desired timeout. + * + * Changing the default timeout may be useful, for example, if the buffering + * proxy that necessitated enabling long-polling in the first place has a + * shorter timeout for hanging GET requests, in which case setting the + * long-polling timeout to a shorter value, such as 25 seconds, may fix + * prematurely-closed hanging GET requests. + * For example, see https://github.com/firebase/firebase-js-sdk/issues/6987. + */ + timeoutSeconds?: number; +} /** * A `FieldPath` refers to a field in a document. The path may consist of a * single field name (referring to a top-level field in the document), or a @@ -569,7 +862,7 @@ export declare function endBefore(...fieldValues: unknown[]): QueryConstraint; */ export declare class FieldPath { /** - * Creates a FieldPath from the provided field names. If more than one field + * Creates a `FieldPath` from the provided field names. If more than one field * name is provided, the path will point to a nested field in a document. * * @param fieldNames - A list of field names. @@ -588,119 +881,286 @@ export declare class FieldPath { * or `update()`. */ export declare abstract class FieldValue { - /** - * @param _methodName - The public API endpoint that returns this class. - */ - constructor(_methodName: string); + private constructor(); + /** Compares `FieldValue`s for equality. */ abstract isEqual(other: FieldValue): boolean; } +/* Excluded from this release type: _FirebaseService */ /** * The Cloud Firestore service interface. * - * Do not call this constructor directly. Instead, use {@link getFirestore}. + * Do not call this constructor directly. Instead, use {@link (getFirestore:1)}. */ -export declare class FirebaseFirestore { +export declare class Firestore { + /** + * Whether it's a {@link Firestore} or Firestore Lite instance. + */ + type: 'firestore-lite' | 'firestore'; private constructor(); /** - * The {@link FirebaseApp} associated with this `Firestore` service + * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service * instance. */ get app(): FirebaseApp; + /** + * Returns a JSON-serializable representation of this `Firestore` instance. + */ toJSON(): object; } /** - * Converter used by `withConverter()` to transform user objects of type `T` - * into Firestore data. + * Converter used by `withConverter()` to transform user objects of type + * `AppModelType` into Firestore data of type `DbModelType`. * * Using the converter allows you to specify generic type arguments when * storing and retrieving objects from Firestore. * + * In this context, an "AppModel" is a class that is used in an application to + * package together related information and functionality. Such a class could, + * for example, have properties with complex, nested data types, properties used + * for memoization, properties of types not supported by Firestore (such as + * `symbol` and `bigint`), and helper functions that perform compound + * operations. Such classes are not suitable and/or possible to store into a + * Firestore database. Instead, instances of such classes need to be converted + * to "plain old JavaScript objects" (POJOs) with exclusively primitive + * properties, potentially nested inside other POJOs or arrays of POJOs. In this + * context, this type is referred to as the "DbModel" and would be an object + * suitable for persisting into Firestore. For convenience, applications can + * implement `FirestoreDataConverter` and register the converter with Firestore + * objects, such as `DocumentReference` or `Query`, to automatically convert + * `AppModel` to `DbModel` when storing into Firestore, and convert `DbModel` + * to `AppModel` when retrieving from Firestore. + * * @example + * + * Simple Example + * * ```typescript + * const numberConverter = { + * toFirestore(value: WithFieldValue) { + * return { value }; + * }, + * fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions) { + * return snapshot.data(options).value as number; + * } + * }; + * + * async function simpleDemo(db: Firestore): Promise { + * const documentRef = doc(db, 'values/value123').withConverter(numberConverter); + * + * // converters are used with `setDoc`, `addDoc`, and `getDoc` + * await setDoc(documentRef, 42); + * const snapshot1 = await getDoc(documentRef); + * assertEqual(snapshot1.data(), 42); + * + * // converters are not used when writing data with `updateDoc` + * await updateDoc(documentRef, { value: 999 }); + * const snapshot2 = await getDoc(documentRef); + * assertEqual(snapshot2.data(), 999); + * } + * ``` + * + * Advanced Example + * + * ```typescript + * // The Post class is a model that is used by our application. + * // This class may have properties and methods that are specific + * // to our application execution, which do not need to be persisted + * // to Firestore. * class Post { - * constructor(readonly title: string, readonly author: string) {} + * constructor( + * readonly title: string, + * readonly author: string, + * readonly lastUpdatedMillis: number + * ) {} + * toString(): string { + * return `${this.title} by ${this.author}`; + * } + * } * - * toString(): string { - * return this.title + ', by ' + this.author; - * } + * // The PostDbModel represents how we want our posts to be stored + * // in Firestore. This DbModel has different properties (`ttl`, + * // `aut`, and `lut`) from the Post class we use in our application. + * interface PostDbModel { + * ttl: string; + * aut: { firstName: string; lastName: string }; + * lut: Timestamp; * } * - * const postConverter = { - * toFirestore(post: Post): firebase.firestore.DocumentData { - * return {title: post.title, author: post.author}; - * }, - * fromFirestore( - * snapshot: firebase.firestore.QueryDocumentSnapshot, - * options: firebase.firestore.SnapshotOptions - * ): Post { - * const data = snapshot.data(options)!; - * return new Post(data.title, data.author); - * } - * }; + * // The `PostConverter` implements `FirestoreDataConverter` and specifies + * // how the Firestore SDK can convert `Post` objects to `PostDbModel` + * // objects and vice versa. + * class PostConverter implements FirestoreDataConverter { + * toFirestore(post: WithFieldValue): WithFieldValue { + * return { + * ttl: post.title, + * aut: this._autFromAuthor(post.author), + * lut: this._lutFromLastUpdatedMillis(post.lastUpdatedMillis) + * }; + * } + * + * fromFirestore(snapshot: QueryDocumentSnapshot, options: SnapshotOptions): Post { + * const data = snapshot.data(options) as PostDbModel; + * const author = `${data.aut.firstName} ${data.aut.lastName}`; + * return new Post(data.ttl, author, data.lut.toMillis()); + * } + * + * _autFromAuthor( + * author: string | FieldValue + * ): { firstName: string; lastName: string } | FieldValue { + * if (typeof author !== 'string') { + * // `author` is a FieldValue, so just return it. + * return author; + * } + * const [firstName, lastName] = author.split(' '); + * return {firstName, lastName}; + * } + * + * _lutFromLastUpdatedMillis( + * lastUpdatedMillis: number | FieldValue + * ): Timestamp | FieldValue { + * if (typeof lastUpdatedMillis !== 'number') { + * // `lastUpdatedMillis` must be a FieldValue, so just return it. + * return lastUpdatedMillis; + * } + * return Timestamp.fromMillis(lastUpdatedMillis); + * } + * } * - * const postSnap = await firebase.firestore() - * .collection('posts') - * .withConverter(postConverter) - * .doc().get(); - * const post = postSnap.data(); - * if (post !== undefined) { - * post.title; // string - * post.toString(); // Should be defined - * post.someNonExistentProperty; // TS error + * async function advancedDemo(db: Firestore): Promise { + * // Create a `DocumentReference` with a `FirestoreDataConverter`. + * const documentRef = doc(db, 'posts/post123').withConverter(new PostConverter()); + * + * // The `data` argument specified to `setDoc()` is type checked by the + * // TypeScript compiler to be compatible with `Post`. Since the `data` + * // argument is typed as `WithFieldValue` rather than just `Post`, + * // this allows properties of the `data` argument to also be special + * // Firestore values that perform server-side mutations, such as + * // `arrayRemove()`, `deleteField()`, and `serverTimestamp()`. + * await setDoc(documentRef, { + * title: 'My Life', + * author: 'Foo Bar', + * lastUpdatedMillis: serverTimestamp() + * }); + * + * // The TypeScript compiler will fail to compile if the `data` argument to + * // `setDoc()` is _not_ compatible with `WithFieldValue`. This + * // type checking prevents the caller from specifying objects with incorrect + * // properties or property values. + * // @ts-expect-error "Argument of type { ttl: string; } is not assignable + * // to parameter of type WithFieldValue" + * await setDoc(documentRef, { ttl: 'The Title' }); + * + * // When retrieving a document with `getDoc()` the `DocumentSnapshot` + * // object's `data()` method returns a `Post`, rather than a generic object, + * // which would have been returned if the `DocumentReference` did _not_ have a + * // `FirestoreDataConverter` attached to it. + * const snapshot1: DocumentSnapshot = await getDoc(documentRef); + * const post1: Post = snapshot1.data()!; + * if (post1) { + * assertEqual(post1.title, 'My Life'); + * assertEqual(post1.author, 'Foo Bar'); + * } + * + * // The `data` argument specified to `updateDoc()` is type checked by the + * // TypeScript compiler to be compatible with `PostDbModel`. Note that + * // unlike `setDoc()`, whose `data` argument must be compatible with `Post`, + * // the `data` argument to `updateDoc()` must be compatible with + * // `PostDbModel`. Similar to `setDoc()`, since the `data` argument is typed + * // as `WithFieldValue` rather than just `PostDbModel`, this + * // allows properties of the `data` argument to also be those special + * // Firestore values, like `arrayRemove()`, `deleteField()`, and + * // `serverTimestamp()`. + * await updateDoc(documentRef, { + * 'aut.firstName': 'NewFirstName', + * lut: serverTimestamp() + * }); + * + * // The TypeScript compiler will fail to compile if the `data` argument to + * // `updateDoc()` is _not_ compatible with `WithFieldValue`. + * // This type checking prevents the caller from specifying objects with + * // incorrect properties or property values. + * // @ts-expect-error "Argument of type { title: string; } is not assignable + * // to parameter of type WithFieldValue" + * await updateDoc(documentRef, { title: 'New Title' }); + * const snapshot2: DocumentSnapshot = await getDoc(documentRef); + * const post2: Post = snapshot2.data()!; + * if (post2) { + * assertEqual(post2.title, 'My Life'); + * assertEqual(post2.author, 'NewFirstName Bar'); + * } * } * ``` */ -export declare interface FirestoreDataConverter { +export declare interface FirestoreDataConverter< + AppModelType, + DbModelType extends DocumentData = DocumentData +> { /** - * Called by the Firestore SDK to convert a custom model object of type `T` - * into a plain JavaScript object (suitable for writing directly to the - * Firestore database). To use `set()` with `merge` and `mergeFields`, - * `toFirestore()` must be defined with `Partial`. - */ - toFirestore(modelObject: T): DocumentData; - /** - * Called by the Firestore SDK to convert a custom model object of type `T` - * into a plain JavaScript object (suitable for writing directly to the - * Firestore database). Used with {@link setData}, {@link WriteBatch#set} - * and {@link Transaction#set} with `merge:true` or `mergeFields`. + * Called by the Firestore SDK to convert a custom model object of type + * `AppModelType` into a plain JavaScript object (suitable for writing + * directly to the Firestore database) of type `DbModelType`. To use `set()` + * with `merge` and `mergeFields`, `toFirestore()` must be defined with + * `PartialWithFieldValue`. + * + * The `WithFieldValue` type extends `T` to also allow FieldValues such as + * {@link (deleteField:1)} to be used as property values. + */ + toFirestore( + modelObject: WithFieldValue + ): WithFieldValue; + /** + * Called by the Firestore SDK to convert a custom model object of type + * `AppModelType` into a plain JavaScript object (suitable for writing + * directly to the Firestore database) of type `DbModelType`. Used with + * {@link (setDoc:1)}, {@link (WriteBatch.set:1)} and + * {@link (Transaction.set:1)} with `merge:true` or `mergeFields`. + * + * The `PartialWithFieldValue` type extends `Partial` to allow + * FieldValues such as {@link (arrayUnion:1)} to be used as property values. + * It also supports nested `Partial` by allowing nested fields to be + * omitted. */ - toFirestore(modelObject: Partial, options: SetOptions): DocumentData; + toFirestore( + modelObject: PartialWithFieldValue, + options: SetOptions + ): PartialWithFieldValue; /** * Called by the Firestore SDK to convert Firestore data into an object of - * type T. You can access your data by calling: `snapshot.data(options)`. + * type `AppModelType`. You can access your data by calling: + * `snapshot.data(options)`. + * + * Generally, the data returned from `snapshot.data()` can be cast to + * `DbModelType`; however, this is not guaranteed because Firestore does not + * enforce a schema on the database. For example, writes from a previous + * version of the application or writes from another client that did not use a + * type converter could have written data with different properties and/or + * property types. The implementation will need to choose whether to + * gracefully recover from non-conforming data or throw an error. + * + * To override this method, see {@link (FirestoreDataConverter.fromFirestore:1)}. * * @param snapshot - A `QueryDocumentSnapshot` containing your data and metadata. * @param options - The `SnapshotOptions` from the initial call to `data()`. */ fromFirestore( - snapshot: QueryDocumentSnapshot, + snapshot: QueryDocumentSnapshot, options?: SnapshotOptions - ): T; + ): AppModelType; } /** An error returned by a Firestore operation. */ -export declare class FirestoreError extends Error { +export declare class FirestoreError extends FirebaseError { + /** + * The backend error code associated with this error. + */ readonly code: FirestoreErrorCode; + /** + * A custom error description. + */ readonly message: string; - readonly name: string; + /** The stack of the error. */ readonly stack?: string; private constructor(); } -/** - * @license - * Copyright 2017 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. - */ /** * The set of Firestore status codes. The codes are the same at the ones * exposed by gRPC here: @@ -757,6 +1217,100 @@ export declare type FirestoreErrorCode = | 'unavailable' | 'data-loss' | 'unauthenticated'; +/** + * Union type from all supported SDK cache layer. + */ +export declare type FirestoreLocalCache = + | MemoryLocalCache + | PersistentLocalCache; +/** + * Specifies custom configurations for your Cloud Firestore instance. + * You must set these before invoking any other methods. + */ +export declare interface FirestoreSettings { + /** + * NOTE: This field will be deprecated in a future major release. Use `cache` field + * instead to specify cache size, and other cache configurations. + * + * An approximate cache size threshold for the on-disk data. If the cache + * grows beyond this size, Firestore will start removing data that hasn't been + * recently used. The size is not a guarantee that the cache will stay below + * that size, only that if the cache exceeds the given size, cleanup will be + * attempted. + * + * The default value is 40 MB. The threshold must be set to at least 1 MB, and + * can be set to `CACHE_SIZE_UNLIMITED` to disable garbage collection. + */ + cacheSizeBytes?: number; + /** + * Specifies the cache used by the SDK. Available options are `MemoryLocalCache` + * and `PersistentLocalCache`, each with different configuration options. + * + * When unspecified, `MemoryLocalCache` will be used by default. + * + * NOTE: setting this field and `cacheSizeBytes` at the same time will throw + * exception during SDK initialization. Instead, using the configuration in + * the `FirestoreLocalCache` object to specify the cache size. + */ + localCache?: FirestoreLocalCache; + /** + * Forces the SDK’s underlying network transport (WebChannel) to use + * long-polling. Each response from the backend will be closed immediately + * after the backend sends data (by default responses are kept open in + * case the backend has more data to send). This avoids incompatibility + * issues with certain proxies, antivirus software, etc. that incorrectly + * buffer traffic indefinitely. Use of this option will cause some + * performance degradation though. + * + * This setting cannot be used with `experimentalAutoDetectLongPolling` and + * may be removed in a future release. If you find yourself using it to + * work around a specific network reliability issue, please tell us about + * it in https://github.com/firebase/firebase-js-sdk/issues/1674. + * + * This setting cannot be used in a Node.js environment. + */ + experimentalForceLongPolling?: boolean; + /** + * Configures the SDK's underlying transport (WebChannel) to automatically + * detect if long-polling should be used. This is very similar to + * `experimentalForceLongPolling`, but only uses long-polling if required. + * + * After having had a default value of `false` since its inception in 2019, + * the default value of this setting was changed in May 2023 to `true` in + * v9.22.0 of the Firebase JavaScript SDK. That is, auto-detection of long + * polling is now enabled by default. To disable it, set this setting to + * `false`, and please open a GitHub issue to share the problems that + * motivated you disabling long-polling auto-detection. + * + * This setting cannot be used in a Node.js environment. + */ + experimentalAutoDetectLongPolling?: boolean; + /** + * Options that configure the SDK’s underlying network transport (WebChannel) + * when long-polling is used. + * + * These options are only used if `experimentalForceLongPolling` is true or if + * `experimentalAutoDetectLongPolling` is true and the auto-detection + * determined that long-polling was needed. Otherwise, these options have no + * effect. + */ + experimentalLongPollingOptions?: ExperimentalLongPollingOptions; + /** + * The hostname to connect to. + */ + host?: string; + /** + * Whether to use SSL when connecting. + */ + ssl?: boolean; + /** + * Whether to skip nested properties that are set to `undefined` during + * object serialization. If set to `true`, these properties are skipped + * and not written to Firestore. If set to `false` or omitted, the SDK + * throws an exception when it encounters properties of type `undefined`. + */ + ignoreUndefinedProperties?: boolean; +} /** * @license * Copyright 2017 Google LLC @@ -803,11 +1357,90 @@ export declare class GeoPoint { * @returns true if this `GeoPoint` is equal to the provided one. */ isEqual(other: GeoPoint): boolean; + /** Returns a JSON-serializable representation of this GeoPoint. */ toJSON(): { latitude: number; longitude: number; }; } +/** + * Calculates the specified aggregations over the documents in the result + * set of the given query without actually downloading the documents. + * + * Using this function to perform aggregations is efficient because only the + * final aggregation values, not the documents' data, are downloaded. This + * function can perform aggregations of the documents in cases where the result + * set is prohibitively large to download entirely (thousands of documents). + * + * The result received from the server is presented, unaltered, without + * considering any local state. That is, documents in the local cache are not + * taken into consideration, neither are local modifications not yet + * synchronized with the server. Previously-downloaded results, if any, are not + * used. Every invocation of this function necessarily involves a round trip to + * the server. + * + * @param query The query whose result set is aggregated over. + * @param aggregateSpec An `AggregateSpec` object that specifies the aggregates + * to perform over the result set. The AggregateSpec specifies aliases for each + * aggregate, which can be used to retrieve the aggregate result. + * @example + * ```typescript + * const aggregateSnapshot = await getAggregateFromServer(query, { + * countOfDocs: count(), + * totalHours: sum('hours'), + * averageScore: average('score') + * }); + * + * const countOfDocs: number = aggregateSnapshot.data().countOfDocs; + * const totalHours: number = aggregateSnapshot.data().totalHours; + * const averageScore: number | null = aggregateSnapshot.data().averageScore; + * ``` + */ +export declare function getAggregateFromServer< + AggregateSpecType extends AggregateSpec, + AppModelType, + DbModelType extends DocumentData +>( + query: Query, + aggregateSpec: AggregateSpecType +): Promise< + AggregateQuerySnapshot +>; +/** + * Calculates the number of documents in the result set of the given query + * without actually downloading the documents. + * + * Using this function to count the documents is efficient because only the + * final count, not the documents' data, is downloaded. This function can + * count the documents in cases where the result set is prohibitively large to + * download entirely (thousands of documents). + * + * The result received from the server is presented, unaltered, without + * considering any local state. That is, documents in the local cache are not + * taken into consideration, neither are local modifications not yet + * synchronized with the server. Previously-downloaded results, if any, are not + * used. Every invocation of this function necessarily involves a round trip to + * the server. + * + * @param query The query whose result set size is calculated. + * @returns A Promise that will be resolved with the count; the count can be + * retrieved from `snapshot.data().count`, where `snapshot` is the + * `AggregateQuerySnapshot` to which the returned Promise resolves. + */ +export declare function getCountFromServer< + AppModelType, + DbModelType extends DocumentData +>( + query: Query +): Promise< + AggregateQuerySnapshot< + { + count: AggregateField; + }, + AppModelType, + DbModelType + > +>; /** * Reads the document referred to by this `DocumentReference`. * @@ -820,29 +1453,35 @@ export declare class GeoPoint { * @returns A Promise resolved with a `DocumentSnapshot` containing the * current document contents. */ -export declare function getDoc( - reference: DocumentReference -): Promise>; +export declare function getDoc( + reference: DocumentReference +): Promise>; /** * Reads the document referred to by this `DocumentReference` from cache. * Returns an error if the document is not currently cached. * - * @returns A Promise resolved with a `DocumentSnapshot` containing the + * @returns A `Promise` resolved with a `DocumentSnapshot` containing the * current document contents. */ -export declare function getDocFromCache( - reference: DocumentReference -): Promise>; +export declare function getDocFromCache< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference +): Promise>; /** * Reads the document referred to by this `DocumentReference` from the server. * Returns an error if the network is not available. * - * @returns A Promise resolved with a `DocumentSnapshot` containing the + * @returns A `Promise` resolved with a `DocumentSnapshot` containing the * current document contents. */ -export declare function getDocFromServer( - reference: DocumentReference -): Promise>; +export declare function getDocFromServer< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference +): Promise>; /** * Executes the query and returns the results as a `QuerySnapshot`. * @@ -851,40 +1490,92 @@ export declare function getDocFromServer( * you are offline and the server cannot be reached. To specify this behavior, * invoke {@link getDocsFromCache} or {@link getDocsFromServer}. * - * @returns A Promise that will be resolved with the results of the query. + * @returns A `Promise` that will be resolved with the results of the query. */ -export declare function getDocs(query: Query): Promise>; +export declare function getDocs( + query: Query +): Promise>; /** * Executes the query and returns the results as a `QuerySnapshot` from cache. - * Returns an error if the document is not currently cached. + * Returns an empty result set if no documents matching the query are currently + * cached. * - * @returns A Promise that will be resolved with the results of the query. + * @returns A `Promise` that will be resolved with the results of the query. */ -export declare function getDocsFromCache( - query: Query -): Promise>; +export declare function getDocsFromCache< + AppModelType, + DbModelType extends DocumentData +>( + query: Query +): Promise>; /** * Executes the query and returns the results as a `QuerySnapshot` from the * server. Returns an error if the network is not available. * - * @returns A Promise that will be resolved with the results of the query. + * @returns A `Promise` that will be resolved with the results of the query. + */ +export declare function getDocsFromServer< + AppModelType, + DbModelType extends DocumentData +>( + query: Query +): Promise>; +/** + * Returns the existing default {@link Firestore} instance that is associated with the + * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new + * instance with default settings. + * + * @returns The default {@link Firestore} instance of the default app. */ -export declare function getDocsFromServer( - query: Query -): Promise>; +export declare function getFirestore(): Firestore; /** - * Returns the existing instance of Firestore that is associated with the - * provided {@link FirebaseApp}. If no instance exists, initializes a new + * Returns the existing default {@link Firestore} instance that is associated with the + * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new * instance with default settings. * - * @param app - The {@link FirebaseApp} instance that the returned Firestore + * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore} * instance is associated with. - * @returns The `Firestore` instance of the provided app. + * @returns The default {@link Firestore} instance of the provided app. */ -export declare function getFirestore(app: FirebaseApp): FirebaseFirestore; +export declare function getFirestore(app: FirebaseApp): Firestore; /** - * Returns a special value that can be used with {@link setDoc} or {@link - * updateDoc} that tells the server to increment the field's current value by + * Returns the existing named {@link Firestore} instance that is associated with the + * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new + * instance with default settings. + * + * @param databaseId - The name of the database. + * @returns The named {@link Firestore} instance of the default app. + * @beta + */ +export declare function getFirestore(databaseId: string): Firestore; +/** + * Returns the existing named {@link Firestore} instance that is associated with the + * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new + * instance with default settings. + * + * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore} + * instance is associated with. + * @param databaseId - The name of the database. + * @returns The named {@link Firestore} instance of the provided app. + * @beta + */ +export declare function getFirestore( + app: FirebaseApp, + databaseId: string +): Firestore; +/** + * Returns the PersistentCache Index Manager used by the given `Firestore` + * object. + * + * @return The `PersistentCacheIndexManager` instance, or `null` if local + * persistent storage is not in use. + */ +export declare function getPersistentCacheIndexManager( + firestore: Firestore +): PersistentCacheIndexManager | null; +/** + * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link + * @firebase/firestore/lite#(updateDoc:1)} that tells the server to increment the field's current value by * the given value. * * If either the operand or the current field value uses floating point @@ -903,50 +1594,122 @@ export declare function getFirestore(app: FirebaseApp): FirebaseFirestore; */ export declare function increment(n: number): FieldValue; /** - * Initializes a new instance of Cloud Firestore with the provided settings. + * The SDK definition of a Firestore index. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare interface Index { + /** The ID of the collection to index. */ + readonly collectionGroup: string; + /** A list of fields to index. */ + readonly fields?: IndexField[]; + [key: string]: unknown; +} +/** + * A list of Firestore indexes to speed up local query execution. + * + * See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format} + * for a description of the format of the index definition. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare interface IndexConfiguration { + /** A list of all Firestore indexes. */ + readonly indexes?: Index[]; + [key: string]: unknown; +} +/** + * A single field element in an index configuration. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare interface IndexField { + /** The field path to index. */ + readonly fieldPath: string; + /** + * What type of array index to create. Set to `CONTAINS` for `array-contains` + * and `array-contains-any` indexes. + * + * Only one of `arrayConfig` or `order` should be set; + */ + readonly arrayConfig?: 'CONTAINS'; + /** + * What type of array index to create. Set to `ASCENDING` or 'DESCENDING` for + * `==`, `!=`, `<=`, `<=`, `in` and `not-in` filters. + * + * Only one of `arrayConfig` or `order` should be set. + */ + readonly order?: 'ASCENDING' | 'DESCENDING'; + [key: string]: unknown; +} +/** + * Initializes a new instance of {@link Firestore} with the provided settings. * Can only be called before any other function, including - * {@link getFirestore}. If the custom settings are empty, this function is - * equivalent to calling {@link getFirestore}. + * {@link (getFirestore:1)}. If the custom settings are empty, this function is + * equivalent to calling {@link (getFirestore:1)}. * - * @param app - The {@link FirebaseApp} with which the `Firestore` instance will + * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will * be associated. - * @param settings - A settings object to configure the `Firestore` instance. - * @returns A newly initialized `Firestore` instance. + * @param settings - A settings object to configure the {@link Firestore} instance. + * @param databaseId - The name of the database. + * @returns A newly initialized {@link Firestore} instance. */ export declare function initializeFirestore( app: FirebaseApp, - settings: Settings -): FirebaseFirestore; + settings: FirestoreSettings, + databaseId?: string +): Firestore; /** - * Creates a `QueryConstraint` that only returns the first matching documents. + * Creates a {@link QueryLimitConstraint} that only returns the first matching + * documents. * * @param limit - The maximum number of items to return. - * @returns The created `Query`. + * @returns The created {@link QueryLimitConstraint}. */ -export declare function limit(limit: number): QueryConstraint; +export declare function limit(limit: number): QueryLimitConstraint; /** - * Creates a `QueryConstraint` that only returns the last matching documents. + * Creates a {@link QueryLimitConstraint} that only returns the last matching + * documents. * * You must specify at least one `orderBy` clause for `limitToLast` queries, * otherwise an exception will be thrown during execution. * * @param limit - The maximum number of items to return. - * @returns The created `Query`. + * @returns The created {@link QueryLimitConstraint}. */ -export declare function limitToLast(limit: number): QueryConstraint; +export declare function limitToLast(limit: number): QueryLimitConstraint; +/** + * Describe the source a query listens to. + * + * Set to `default` to listen to both cache and server changes. Set to `cache` + * to listen to changes in cache only. + */ +export declare type ListenSource = 'default' | 'cache'; /** * Loads a Firestore bundle into the local cache. * - * @param firestore - The `Firestore` instance to load bundles for for. - * @param bundleData - An object representing the bundle to be loaded. Valid objects are - * `ArrayBuffer`, `ReadableStream` or `string`. + * @param firestore - The {@link Firestore} instance to load bundles for. + * @param bundleData - An object representing the bundle to be loaded. Valid + * objects are `ArrayBuffer`, `ReadableStream` or `string`. * - * @return - * A `LoadBundleTask` object, which notifies callers with progress updates, and completion - * or error events. It can be used as a `Promise`. + * @returns A `LoadBundleTask` object, which notifies callers with progress + * updates, and completion or error events. It can be used as a + * `Promise`. */ export declare function loadBundle( - firestore: FirebaseFirestore, + firestore: Firestore, bundleData: ReadableStream | ArrayBuffer | string ): LoadBundleTask; /** @@ -1008,16 +1771,110 @@ export declare interface LoadBundleTaskProgress { } export { LogLevel }; /** - * Reads a Firestore `Query` from local cache, identified by the given name. + * An settings object to configure an `MemoryLocalCache` instance. + */ +export declare type MemoryCacheSettings = { + /** + * The garbage collector to use, for the memory cache layer. + * A `MemoryEagerGarbageCollector` is used when this is undefined. + */ + garbageCollector?: MemoryGarbageCollector; +}; +/** + * A garbage collector deletes documents whenever they are not part of any + * active queries, and have no local mutations attached to them. + * + * This collector tries to ensure lowest memory footprints from the SDK, + * at the risk of documents not being cached for offline queries or for + * direct queries to the cache. + * + * Use factory function {@link memoryEagerGarbageCollector()} to create an + * instance of this collector. + */ +export declare type MemoryEagerGarbageCollector = { + kind: 'memoryEager'; +}; +/** + * Creates an instance of `MemoryEagerGarbageCollector`. This is also the + * default garbage collector unless it is explicitly specified otherwise. + */ +export declare function memoryEagerGarbageCollector(): MemoryEagerGarbageCollector; +/** + * Union type from all support garbage collectors for memory local cache. + */ +export declare type MemoryGarbageCollector = + | MemoryEagerGarbageCollector + | MemoryLruGarbageCollector; +/** + * Provides an in-memory cache to the SDK. This is the default cache unless explicitly + * configured otherwise. + * + * To use, create an instance using the factory function {@link memoryLocalCache()}, then + * set the instance to `FirestoreSettings.cache` and call `initializeFirestore` using + * the settings object. + */ +export declare type MemoryLocalCache = { + kind: 'memory'; +}; +/** + * Creates an instance of `MemoryLocalCache`. The instance can be set to + * `FirestoreSettings.cache` to tell the SDK which cache layer to use. + */ +export declare function memoryLocalCache( + settings?: MemoryCacheSettings +): MemoryLocalCache; +/** + * A garbage collector deletes Least-Recently-Used documents in multiple + * batches. + * + * This collector is configured with a target size, and will only perform + * collection when the cached documents exceed the target size. It avoids + * querying backend repeated for the same query or document, at the risk + * of having a larger memory footprint. + * + * Use factory function {@link memoryLruGarbageCollector()} to create a + * instance of this collector. + */ +export declare type MemoryLruGarbageCollector = { + kind: 'memoryLru'; +}; +/** + * Creates an instance of `MemoryLruGarbageCollector`. + * + * A target size can be specified as part of the setting parameter. The + * collector will start deleting documents once the cache size exceeds + * the given size. The default cache size is 40MB (40 * 1024 * 1024 bytes). + */ +export declare function memoryLruGarbageCollector(settings?: { + cacheSizeBytes?: number; +}): MemoryLruGarbageCollector; +/** + * Reads a Firestore {@link Query} from local cache, identified by the given + * name. * * The named queries are packaged into bundles on the server side (along - * with resulting documents), and loaded to local cache using `loadBundle`. Once in local - * cache, use this method to extract a `Query` by name. + * with resulting documents), and loaded to local cache using `loadBundle`. Once + * in local cache, use this method to extract a {@link Query} by name. + * + * @param firestore - The {@link Firestore} instance to read the query from. + * @param name - The name of the query. + * @returns A `Promise` that is resolved with the Query or `null`. */ export declare function namedQuery( - firestore: FirebaseFirestore, + firestore: Firestore, name: string ): Promise; +/** + * For each field (e.g. 'bar'), find all nested keys (e.g. {'bar.baz': T1, + * 'bar.qux': T2}). Intersect them together to make a single map containing + * all possible keys that are all marked as optional + */ +export declare type NestedUpdateFields> = + UnionToIntersection< + { + [K in keyof T & string]: ChildUpdateFields; + }[keyof T & string] + >; /** * Attaches a listener for `DocumentSnapshot` events. You may either pass * individual `onNext` and `onError` callbacks or pass a single observer @@ -1031,10 +1888,13 @@ export declare function namedQuery( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - reference: DocumentReference, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, observer: { - next?: (snapshot: DocumentSnapshot) => void; + next?: (snapshot: DocumentSnapshot) => void; error?: (error: FirestoreError) => void; complete?: () => void; } @@ -1053,11 +1913,14 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - reference: DocumentReference, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, options: SnapshotListenOptions, observer: { - next?: (snapshot: DocumentSnapshot) => void; + next?: (snapshot: DocumentSnapshot) => void; error?: (error: FirestoreError) => void; complete?: () => void; } @@ -1080,9 +1943,12 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - reference: DocumentReference, - onNext: (snapshot: DocumentSnapshot) => void, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, + onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void ): Unsubscribe; @@ -1105,10 +1971,13 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - reference: DocumentReference, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, options: SnapshotListenOptions, - onNext: (snapshot: DocumentSnapshot) => void, + onNext: (snapshot: DocumentSnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void ): Unsubscribe; @@ -1126,10 +1995,13 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - query: Query, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + query: Query, observer: { - next?: (snapshot: QuerySnapshot) => void; + next?: (snapshot: QuerySnapshot) => void; error?: (error: FirestoreError) => void; complete?: () => void; } @@ -1149,11 +2021,14 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - query: Query, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + query: Query, options: SnapshotListenOptions, observer: { - next?: (snapshot: QuerySnapshot) => void; + next?: (snapshot: QuerySnapshot) => void; error?: (error: FirestoreError) => void; complete?: () => void; } @@ -1177,9 +2052,12 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - query: Query, - onNext: (snapshot: QuerySnapshot) => void, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + query: Query, + onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void ): Unsubscribe; @@ -1203,10 +2081,13 @@ export declare function onSnapshot( * @returns An unsubscribe function that can be called to cancel * the snapshot listener. */ -export declare function onSnapshot( - query: Query, +export declare function onSnapshot< + AppModelType, + DbModelType extends DocumentData +>( + query: Query, options: SnapshotListenOptions, - onNext: (snapshot: QuerySnapshot) => void, + onNext: (snapshot: QuerySnapshot) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void ): Unsubscribe; @@ -1226,7 +2107,7 @@ export declare function onSnapshot( * listener. */ export declare function onSnapshotsInSync( - firestore: FirebaseFirestore, + firestore: Firestore, observer: { next?: (value: void) => void; error?: (error: FirestoreError) => void; @@ -1240,87 +2121,283 @@ export declare function onSnapshotsInSync( * * NOTE: The snapshots-in-sync event only indicates that listeners are in sync * with each other, but does not relate to whether those snapshots are in sync - * with the server. Use SnapshotMetadata in the individual listeners to + * with the server. Use `SnapshotMetadata` in the individual listeners to * determine if a snapshot is from the cache or the server. * - * @param firestore - The instance of Firestore for synchronizing snapshots. + * @param firestore - The `Firestore` instance for synchronizing snapshots. * @param onSync - A callback to be called every time all snapshot listeners are * in sync with each other. * @returns An unsubscribe function that can be called to cancel the snapshot * listener. */ export declare function onSnapshotsInSync( - firestore: FirebaseFirestore, + firestore: Firestore, onSync: () => void ): Unsubscribe; /** - * Creates a `QueryConstraint` that sorts the query result by the + * 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 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}. + */ +export declare function or( + ...queryConstraints: QueryFilterConstraint[] +): QueryCompositeFilterConstraint; +/** + * Creates a {@link QueryOrderByConstraint} that sorts the query result by the * specified field, optionally in descending order instead of ascending. * + * Note: Documents that do not contain the specified field will not be present + * in the query result. + * * @param fieldPath - The field to sort by. * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If * not specified, order will be ascending. - * @returns The created `Query`. + * @returns The created {@link QueryOrderByConstraint}. */ export declare function orderBy( fieldPath: string | FieldPath, directionStr?: OrderByDirection -): QueryConstraint; +): QueryOrderByConstraint; /** * The direction of a {@link orderBy} clause is specified as 'desc' or 'asc' * (descending or ascending). */ export declare type OrderByDirection = 'desc' | 'asc'; +/** + * Similar to TypeScript's `Partial`, but allows nested fields to be + * omitted and FieldValues to be passed in as property values. + */ +export declare type PartialWithFieldValue = + | Partial + | (T extends Primitive + ? T + : T extends {} + ? { + [K in keyof T]?: PartialWithFieldValue | FieldValue; + } + : never); +/** + * Settings that can be passed to `enableIndexedDbPersistence()` to configure + * Firestore persistence. + * + * Persistence cannot be used in a Node.js environment. + */ export declare interface PersistenceSettings { + /** + * Whether to force enable persistence for the client. This cannot be used + * with multi-tab synchronization and is primarily intended for use with Web + * Workers. Setting this to `true` will enable persistence, but cause other + * tabs using persistence to fail. + */ forceOwnership?: boolean; } /** - * A `Query` refers to a Query which you can read or listen to. You can also + * A `PersistentCacheIndexManager` for configuring persistent cache indexes used + * for local query execution. + * + * To use, call `getPersistentCacheIndexManager()` to get an instance. + */ +export declare class PersistentCacheIndexManager { + /** A type string to uniquely identify instances of this class. */ + readonly type: 'PersistentCacheIndexManager'; + private constructor(); +} +/** + * An settings object to configure an `PersistentLocalCache` instance. + * + * Persistent cache cannot be used in a Node.js environment. + */ +export declare type PersistentCacheSettings = { + /** + * An approximate cache size threshold for the on-disk data. If the cache + * grows beyond this size, Firestore will start removing data that hasn't been + * recently used. The SDK does not guarantee that the cache will stay below + * that size, only that if the cache exceeds the given size, cleanup will be + * attempted. + * + * The default value is 40 MB. The threshold must be set to at least 1 MB, and + * can be set to `CACHE_SIZE_UNLIMITED` to disable garbage collection. + */ + cacheSizeBytes?: number; + /** + * Specifies how multiple tabs/windows will be managed by the SDK. + */ + tabManager?: PersistentTabManager; +}; +/** + * Provides a persistent cache backed by IndexedDb to the SDK. + * + * To use, create an instance using the factory function {@link persistentLocalCache()}, then + * set the instance to `FirestoreSettings.cache` and call `initializeFirestore` using + * the settings object. + */ +export declare type PersistentLocalCache = { + kind: 'persistent'; +}; +/** + * Creates an instance of `PersistentLocalCache`. The instance can be set to + * `FirestoreSettings.cache` to tell the SDK which cache layer to use. + * + * Persistent cache cannot be used in a Node.js environment. + */ +export declare function persistentLocalCache( + settings?: PersistentCacheSettings +): PersistentLocalCache; +/** + * A tab manager supporting multiple tabs. SDK will synchronize queries and + * mutations done across all tabs using the SDK. + */ +export declare type PersistentMultipleTabManager = { + kind: 'PersistentMultipleTab'; +}; +/** + * Creates an instance of `PersistentMultipleTabManager`. + */ +export declare function persistentMultipleTabManager(): PersistentMultipleTabManager; +/** + * A tab manager supporting only one tab, no synchronization will be + * performed across tabs. + */ +export declare type PersistentSingleTabManager = { + kind: 'persistentSingleTab'; +}; +/** + * Creates an instance of `PersistentSingleTabManager`. + * + * @param settings Configures the created tab manager. + */ +export declare function persistentSingleTabManager( + settings: PersistentSingleTabManagerSettings | undefined +): PersistentSingleTabManager; +/** + * Type to configure an `PersistentSingleTabManager` instance. + */ +export declare type PersistentSingleTabManagerSettings = { + /** + * Whether to force-enable persistent (IndexedDB) cache for the client. This + * cannot be used with multi-tab synchronization and is primarily intended for + * use with Web Workers. Setting this to `true` will enable IndexedDB, but cause + * other tabs using IndexedDB cache to fail. + */ + forceOwnership?: boolean; +}; +/** + * A union of all available tab managers. + */ +export declare type PersistentTabManager = + | PersistentSingleTabManager + | PersistentMultipleTabManager; +/** + * These types primarily exist to support the `UpdateData`, + * `WithFieldValue`, and `PartialWithFieldValue` types and are not consumed + * directly by the end developer. + */ +/** Primitive types. */ +export declare type Primitive = string | number | boolean | undefined | null; +/** + * A `Query` refers to a query which you can read or listen to. You can also * construct refined `Query` objects by adding filters and ordering. */ -export declare class Query { +export declare class Query< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { + /** + * If provided, the `FirestoreDataConverter` associated with this instance. + */ + readonly converter: FirestoreDataConverter | null; /** The type of this Firestore reference. */ readonly type: 'query' | 'collection'; /** - * The `FirebaseFirestore` for the Firestore database (useful for performing + * The `Firestore` instance for the Firestore database (useful for performing * transactions, etc.). */ - readonly firestore: FirebaseFirestore; + readonly firestore: Firestore; protected constructor(); + /** + * Removes the current converter. + * + * @param converter - `null` removes the current converter. + * @returns A `Query` that does not use a + * converter. + */ + withConverter(converter: null): Query; /** * Applies a custom data converter to this query, allowing you to use your own * custom model objects with Firestore. When you call {@link getDocs} with * the returned query, the provided converter will convert between Firestore - * data and your custom type `U`. + * data of type `NewDbModelType` and your custom type `NewAppModelType`. * * @param converter - Converts objects to and from Firestore. - * @returns A `Query` that uses the provided converter. - */ - withConverter(converter: FirestoreDataConverter): Query; + * @returns A `Query` that uses the provided converter. + */ + withConverter< + NewAppModelType, + NewDbModelType extends DocumentData = DocumentData + >( + converter: FirestoreDataConverter + ): Query; } /** - * Creates a new immutable instance of `query` that is extended to also include - * additional query constraints. + * Creates a new immutable instance of {@link Query} that is extended to also + * include additional query constraints. + * + * @param query - The {@link Query} instance to use as a base for the new + * constraints. + * @param compositeFilter - The {@link QueryCompositeFilterConstraint} to + * apply. Create {@link QueryCompositeFilterConstraint} using {@link and} or + * {@link or}. + * @param queryConstraints - Additional {@link QueryNonFilterConstraint}s to + * apply (e.g. {@link orderBy}, {@link limit}). + * @throws if any of the provided query constraints cannot be combined with the + * existing or new constraints. + */ +export declare function query( + query: Query, + compositeFilter: QueryCompositeFilterConstraint, + ...queryConstraints: QueryNonFilterConstraint[] +): Query; +/** + * Creates a new immutable instance of {@link Query} that is extended to also + * include additional query constraints. * - * @param query - The query instance to use as a base for the new constraints. - * @param queryConstraints - The list of `QueryConstraint`s to apply. + * @param query - The {@link Query} instance to use as a base for the new + * constraints. + * @param queryConstraints - The list of {@link QueryConstraint}s to apply. * @throws if any of the provided query constraints cannot be combined with the * existing or new constraints. */ -export declare function query( - query: Query, +export declare function query( + query: Query, ...queryConstraints: QueryConstraint[] -): Query; +): Query; +/** + * A `QueryCompositeFilterConstraint` is used to narrow the set of documents + * returned by a Firestore query by performing the logical OR or AND of multiple + * {@link QueryFieldFilterConstraint}s or {@link QueryCompositeFilterConstraint}s. + * `QueryCompositeFilterConstraint`s are created by invoking {@link or} or + * {@link and} and can then be passed to {@link (query:1)} to create a new query + * instance that also contains the `QueryCompositeFilterConstraint`. + */ +export declare class QueryCompositeFilterConstraint { + /** The type of this query constraint */ + readonly type: 'or' | 'and'; +} /** * A `QueryConstraint` is used to narrow the set of documents returned by a * Firestore query. `QueryConstraint`s are created by invoking {@link where}, - * {@link orderBy}, {@link startAt}, {@link startAfter}, {@link - * endBefore}, {@link endAt}, {@link limit} or {@link limitToLast} and - * can then be passed to {@link query} to create a new query instance that + * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link + * (endBefore:1)}, {@link (endAt:1)}, {@link limit}, {@link limitToLast} and + * can then be passed to {@link (query:1)} to create a new query instance that * also contains this `QueryConstraint`. */ export declare abstract class QueryConstraint { - /** The type of this query constraints */ + /** The type of this query constraint */ abstract readonly type: QueryConstraintType; } /** Describes the different query constraints available in this SDK. */ @@ -1345,12 +2422,13 @@ export declare type QueryConstraintType = * 'undefined'. */ export declare class QueryDocumentSnapshot< - T = DocumentData -> extends DocumentSnapshot { + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> extends DocumentSnapshot { /** * Retrieves all fields in the document as an `Object`. * - * By default, `FieldValue.serverTimestamp()` values that have not yet been + * By default, `serverTimestamp()` values that have not yet been * set to their final value will be returned as `null`. You can override * this by passing an options object. * @@ -1360,7 +2438,18 @@ export declare class QueryDocumentSnapshot< * have not yet been set to their final value). * @returns An `Object` containing all fields in the document. */ - data(options?: SnapshotOptions): T; + data(options?: SnapshotOptions): AppModelType; +} +/** + * A `QueryEndAtConstraint` is used to exclude documents from the end of a + * result set returned by a Firestore query. + * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or + * {@link (endBefore:1)} and can then be passed to {@link (query:1)} to create a new + * query instance that also contains this `QueryEndAtConstraint`. + */ +export declare class QueryEndAtConstraint extends QueryConstraint { + /** The type of this query constraint */ + readonly type: 'endBefore' | 'endAt'; } /** * Returns true if the provided queries point to the same collection and apply @@ -1371,7 +2460,69 @@ export declare class QueryDocumentSnapshot< * @returns true if the references point to the same location in the same * Firestore database. */ -export declare function queryEqual(left: Query, right: Query): boolean; +export declare function queryEqual< + AppModelType, + DbModelType extends DocumentData +>( + left: Query, + right: Query +): boolean; +/** + * A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by + * a Firestore query by filtering on one or more document fields. + * `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then + * be passed to {@link (query:1)} to create a new query instance that also contains + * this `QueryFieldFilterConstraint`. + */ +export declare class QueryFieldFilterConstraint extends QueryConstraint { + /** The type of this query constraint */ + readonly type = 'where'; +} +/** + * `QueryFilterConstraint` is a helper union type that represents + * {@link QueryFieldFilterConstraint} and {@link QueryCompositeFilterConstraint}. + */ +export declare type QueryFilterConstraint = + | QueryFieldFilterConstraint + | QueryCompositeFilterConstraint; +/** + * A `QueryLimitConstraint` is used to limit the number of documents returned by + * a Firestore query. + * `QueryLimitConstraint`s are created by invoking {@link limit} or + * {@link limitToLast} and can then be passed to {@link (query:1)} to create a new + * query instance that also contains this `QueryLimitConstraint`. + */ +export declare class QueryLimitConstraint extends QueryConstraint { + /** The type of this query constraint */ + readonly type: 'limit' | 'limitToLast'; +} +/** + * `QueryNonFilterConstraint` is a helper union type that represents + * QueryConstraints which are used to narrow or order the set of documents, + * but that do not explicitly filter on a document field. + * `QueryNonFilterConstraint`s are created by invoking {@link orderBy}, + * {@link (startAt:1)}, {@link (startAfter:1)}, {@link (endBefore:1)}, {@link (endAt:1)}, + * {@link limit} or {@link limitToLast} and can then be passed to {@link (query:1)} + * to create a new query instance that also contains the `QueryConstraint`. + */ +export declare type QueryNonFilterConstraint = + | QueryOrderByConstraint + | QueryLimitConstraint + | QueryStartAtConstraint + | QueryEndAtConstraint; +/** + * A `QueryOrderByConstraint` is used to sort the set of documents returned by a + * Firestore query. `QueryOrderByConstraint`s are created by invoking + * {@link orderBy} and can then be passed to {@link (query:1)} to create a new query + * instance that also contains this `QueryOrderByConstraint`. + * + * Note: Documents that do not contain the orderBy field will not be present in + * the query result. + */ +export declare class QueryOrderByConstraint extends QueryConstraint { + /** The type of this query constraint */ + readonly type = 'orderBy'; +} /** * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects * representing the results of a query. The documents can be accessed as an @@ -1379,7 +2530,10 @@ export declare function queryEqual(left: Query, right: Query): boolean; * number of documents can be determined via the `empty` and `size` * properties. */ -export declare class QuerySnapshot { +export declare class QuerySnapshot< + AppModelType = DocumentData, + DbModelType extends DocumentData = DocumentData +> { /** * Metadata about this snapshot, concerning its source and if it has local * modifications. @@ -1389,10 +2543,10 @@ export declare class QuerySnapshot { * The query on which you called `get` or `onSnapshot` in order to get this * `QuerySnapshot`. */ - readonly query: Query; + readonly query: Query; private constructor(); /** An array of all the documents in the `QuerySnapshot`. */ - get docs(): Array>; + get docs(): Array>; /** The number of documents in the `QuerySnapshot`. */ get size(): number; /** True if there are no documents in the `QuerySnapshot`. */ @@ -1405,7 +2559,9 @@ export declare class QuerySnapshot { * @param thisArg - The `this` binding for the callback. */ forEach( - callback: (result: QueryDocumentSnapshot) => void, + callback: ( + result: QueryDocumentSnapshot + ) => void, thisArg?: unknown ): void; /** @@ -1417,7 +2573,20 @@ export declare class QuerySnapshot { * changes (i.e. only `DocumentSnapshot.metadata` changed) should trigger * snapshot events. */ - docChanges(options?: SnapshotListenOptions): Array>; + docChanges( + options?: SnapshotListenOptions + ): Array>; +} +/** + * A `QueryStartAtConstraint` is used to exclude documents from the start of a + * result set returned by a Firestore query. + * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or + * {@link (startAfter:1)} and can then be passed to {@link (query:1)} to create a + * new query instance that also contains this `QueryStartAtConstraint`. + */ +export declare class QueryStartAtConstraint extends QueryConstraint { + /** The type of this query constraint */ + readonly type: 'startAt' | 'startAfter'; } /** * Returns true if the provided references are equal. @@ -1427,10 +2596,18 @@ export declare class QuerySnapshot { * @returns true if the references point to the same location in the same * Firestore database. */ -export declare function refEqual( - left: DocumentReference | CollectionReference, - right: DocumentReference | CollectionReference +export declare function refEqual< + AppModelType, + DbModelType extends DocumentData +>( + left: + | DocumentReference + | CollectionReference, + right: + | DocumentReference + | CollectionReference ): boolean; +/* Excluded from this release type: _ResourcePath */ /** * Executes the given `updateFunction` and then attempts to commit the changes * applied within the transaction. If any document read within the transaction @@ -1443,17 +2620,20 @@ export declare function refEqual( * transaction against. * @param updateFunction - The function to execute within the transaction * context. + * @param options - An options object to configure maximum number of attempts to + * commit. * @returns If the transaction completed successfully or was explicitly aborted * (the `updateFunction` returned a failed promise), the promise returned by the * `updateFunction `is returned here. Otherwise, if the transaction failed, a * rejected promise with the corresponding failure error is returned. */ export declare function runTransaction( - firestore: FirebaseFirestore, - updateFunction: (transaction: Transaction) => Promise + firestore: Firestore, + updateFunction: (transaction: Transaction) => Promise, + options?: TransactionOptions ): Promise; /** - * Returns a sentinel used with {@link setDoc} or {@link updateDoc} to + * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to * include a server-generated timestamp in the written data. */ export declare function serverTimestamp(): FieldValue; @@ -1463,12 +2643,12 @@ export declare function serverTimestamp(): FieldValue; * * @param reference - A reference to the document to write. * @param data - A map of the fields and values for the document. - * @returns A Promise resolved once the data has been successfully written + * @returns A `Promise` resolved once the data has been successfully written * to the backend (note that it won't resolve while you're offline). */ -export declare function setDoc( - reference: DocumentReference, - data: T +export declare function setDoc( + reference: DocumentReference, + data: WithFieldValue ): Promise; /** * Writes to the document referred to by the specified `DocumentReference`. If @@ -1481,11 +2661,75 @@ export declare function setDoc( * @returns A Promise resolved once the data has been successfully written * to the backend (note that it won't resolve while you're offline). */ -export declare function setDoc( - reference: DocumentReference, - data: Partial, +export declare function setDoc( + reference: DocumentReference, + data: PartialWithFieldValue, options: SetOptions ): Promise; +/** + * Configures indexing for local query execution. Any previous index + * configuration is overridden. The `Promise` resolves once the index + * configuration has been persisted. + * + * The index entries themselves are created asynchronously. You can continue to + * use queries that require indexing even if the indices are not yet available. + * Query execution will automatically start using the index once the index + * entries have been written. + * + * Indexes are only supported with IndexedDb persistence. If IndexedDb is not + * enabled, any index configuration is ignored. + * + * @param firestore - The {@link Firestore} instance to configure indexes for. + * @param configuration -The index definition. + * @throws FirestoreError if the JSON format is invalid. + * @returns A `Promise` that resolves once all indices are successfully + * configured. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare function setIndexConfiguration( + firestore: Firestore, + configuration: IndexConfiguration +): Promise; +/** + * Configures indexing for local query execution. Any previous index + * configuration is overridden. The `Promise` resolves once the index + * configuration has been persisted. + * + * The index entries themselves are created asynchronously. You can continue to + * use queries that require indexing even if the indices are not yet available. + * Query execution will automatically start using the index once the index + * entries have been written. + * + * Indexes are only supported with IndexedDb persistence. Invoke either + * `enableIndexedDbPersistence()` or `enableMultiTabIndexedDbPersistence()` + * before setting an index configuration. If IndexedDb is not enabled, any + * index configuration is ignored. + * + * The method accepts the JSON format exported by the Firebase CLI (`firebase + * firestore:indexes`). If the JSON format is invalid, this method throws an + * error. + * + * @param firestore - The {@link Firestore} instance to configure indexes for. + * @param json -The JSON format exported by the Firebase CLI. + * @throws FirestoreError if the JSON format is invalid. + * @returns A `Promise` that resolves once all indices are successfully + * configured. + * + * @deprecated Instead of creating cache indexes manually, consider using + * `enablePersistentCacheIndexAutoCreation()` to let the SDK decide whether to + * create cache indexes for queries running locally. + * + * @beta + */ +export declare function setIndexConfiguration( + firestore: Firestore, + json: string +): Promise; /** * Sets the verbosity of Cloud Firestore logs (debug, error, or silent). * @@ -1501,17 +2745,19 @@ export declare function setDoc( */ export declare function setLogLevel(logLevel: LogLevel): void; /** - * An options object that configures the behavior of {@link setDoc}, {@link - * WriteBatch#set} and {@link Transaction#set} calls. These calls can be + * An options object that configures the behavior of {@link @firebase/firestore/lite#(setDoc:1)}, {@link + * @firebase/firestore/lite#(WriteBatch.set:1)} and {@link @firebase/firestore/lite#(Transaction.set:1)} calls. These calls can be * configured to perform granular merges instead of overwriting the target * documents in their entirety by providing a `SetOptions` with `merge: true`. * * @param merge - Changes the behavior of a `setDoc()` call to only replace the * values specified in its data argument. Fields omitted from the `setDoc()` - * call remain untouched. + * call remain untouched. If your input sets any field to an empty map, all + * nested fields are overwritten. * @param mergeFields - Changes the behavior of `setDoc()` calls to only replace * the specified field paths. Any field path that is not specified is ignored - * and remains untouched. + * and remains untouched. If your input sets any field to an empty map, all + * nested fields are overwritten. */ export declare type SetOptions = | { @@ -1520,14 +2766,6 @@ export declare type SetOptions = | { readonly mergeFields?: Array; }; -export declare interface Settings { - cacheSizeBytes?: number; - host?: string; - ssl?: boolean; - ignoreUndefinedProperties?: boolean; - experimentalForceLongPolling?: boolean; - experimentalAutoDetectLongPolling?: boolean; -} /** * Returns true if the provided snapshots are equal. * @@ -1535,13 +2773,20 @@ export declare interface Settings { * @param right - A snapshot to compare. * @returns true if the snapshots are equal. */ -export declare function snapshotEqual( - left: DocumentSnapshot | QuerySnapshot, - right: DocumentSnapshot | QuerySnapshot +export declare function snapshotEqual< + AppModelType, + DbModelType extends DocumentData +>( + left: + | DocumentSnapshot + | QuerySnapshot, + right: + | DocumentSnapshot + | QuerySnapshot ): boolean; /** - * An options object that can be passed to {@link onSnapshot} and {@link - * QuerySnapshot#docChanges} to control which types of changes to include in the + * An options object that can be passed to {@link (onSnapshot:1)} and {@link + * QuerySnapshot.docChanges} to control which types of changes to include in the * result set. */ export declare interface SnapshotListenOptions { @@ -1550,6 +2795,11 @@ export declare interface SnapshotListenOptions { * changed. Default is false. */ readonly includeMetadataChanges?: boolean; + /** + * Set the source the query listens to. Default to "default", which + * listens to both cache and server. + */ + readonly source?: ListenSource; } /** * Metadata about a snapshot, describing the state of the snapshot. @@ -1604,49 +2854,62 @@ export declare interface SnapshotOptions { readonly serverTimestamps?: 'estimate' | 'previous' | 'none'; } /** - * Creates a `QueryConstraint` that modifies the result set to start after the - * provided document (exclusive). The starting position is relative to the order - * of the query. The document must contain all of the fields provided in the - * orderBy of the query. + * Creates a {@link QueryStartAtConstraint} that modifies the result set to + * start after the provided document (exclusive). The starting position is + * relative to the order of the query. The document must contain all of the + * fields provided in the orderBy of the query. * * @param snapshot - The snapshot of the document to start after. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryStartAtConstraint} to pass to `query()` */ -export declare function startAfter( - snapshot: DocumentSnapshot -): QueryConstraint; +export declare function startAfter< + AppModelType, + DbModelType extends DocumentData +>( + snapshot: DocumentSnapshot +): QueryStartAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to start after the - * provided fields relative to the order of the query. The order of the field - * values must match the order of the order by clauses of the query. + * Creates a {@link QueryStartAtConstraint} that modifies the result set to + * start after the provided fields relative to the order of the query. The order + * of the field values must match the order of the order by clauses of the query. * * @param fieldValues - The field values to start this query after, in order * of the query's order by. - * @returns A `QueryConstraint` to pass to `query()` + * @returns A {@link QueryStartAtConstraint} to pass to `query()` */ -export declare function startAfter(...fieldValues: unknown[]): QueryConstraint; +export declare function startAfter( + ...fieldValues: unknown[] +): QueryStartAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to start at the - * provided document (inclusive). The starting position is relative to the order - * of the query. The document must contain all of the fields provided in the - * `orderBy` of this query. + * Creates a {@link QueryStartAtConstraint} that modifies the result set to + * start at the provided document (inclusive). The starting position is relative + * to the order of the query. The document must contain all of the fields + * provided in the `orderBy` of this query. * * @param snapshot - The snapshot of the document to start at. - * @returns A `QueryConstraint` to pass to `query()`. + * @returns A {@link QueryStartAtConstraint} to pass to `query()`. */ -export declare function startAt( - snapshot: DocumentSnapshot -): QueryConstraint; +export declare function startAt( + snapshot: DocumentSnapshot +): QueryStartAtConstraint; /** - * Creates a `QueryConstraint` that modifies the result set to start at the - * provided fields relative to the order of the query. The order of the field - * values must match the order of the order by clauses of the query. + * Creates a {@link QueryStartAtConstraint} that modifies the result set to + * start at the provided fields relative to the order of the query. The order of + * the field values must match the order of the order by clauses of the query. * * @param fieldValues - The field values to start this query at, in order * of the query's order by. - * @returns A `QueryConstraint` to pass to `query()`. + * @returns A {@link QueryStartAtConstraint} to pass to `query()`. + */ +export declare function startAt( + ...fieldValues: unknown[] +): QueryStartAtConstraint; +/** + * Create an AggregateField object that can be used to compute the sum of + * a specified field over a range of documents in the result set of a query. + * @param field Specifies the field to sum across the result set. */ -export declare function startAt(...fieldValues: unknown[]): QueryConstraint; +export declare function sum(field: string | FieldPath): AggregateField; /** * Represents the state of bundle loading tasks. * @@ -1655,13 +2918,13 @@ export declare function startAt(...fieldValues: unknown[]): QueryConstraint; */ export declare type TaskState = 'Error' | 'Running' | 'Success'; /** - * Terminates the provided Firestore instance. + * Terminates the provided {@link Firestore} instance. * * After calling `terminate()` only the `clearIndexedDbPersistence()` function * may be used. Any other function will throw a `FirestoreError`. * * To restart after termination, create a new instance of FirebaseFirestore with - * {@link getFirestore}. + * {@link (getFirestore:1)}. * * Termination does not cancel any pending writes, and any promises that are * awaiting a response from the server will not be resolved. If you have @@ -1673,10 +2936,10 @@ export declare type TaskState = 'Error' | 'Running' | 'Success'; * of its resources or in combination with `clearIndexedDbPersistence()` to * ensure that all local state is destroyed between test runs. * - * @returns A promise that is resolved when the instance has been successfully + * @returns A `Promise` that is resolved when the instance has been successfully * terminated. */ -export declare function terminate(firestore: FirebaseFirestore): Promise; +export declare function terminate(firestore: Firestore): Promise; /** * @license * Copyright 2017 Google LLC @@ -1708,7 +2971,13 @@ export declare function terminate(firestore: FirebaseFirestore): Promise; * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}. */ export declare class Timestamp { + /** + * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. + */ readonly seconds: number; + /** + * The fractions of a second at nanosecond resolution.* + */ readonly nanoseconds: number; /** * Creates a new timestamp with the current date, with millisecond precision. @@ -1744,10 +3013,20 @@ export declare class Timestamp { * non-negative nanoseconds values that count forward in time. Must be * from 0 to 999,999,999 inclusive. */ - constructor(seconds: number, nanoseconds: number); + constructor( + /** + * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. + */ + seconds: number, + /** + * The fractions of a second at nanosecond resolution.* + */ + nanoseconds: number + ); /** - * Converts a `Timestamp` to a JavaScript `Date` object. This conversion causes - * a loss of precision since `Date` objects only support millisecond precision. + * Converts a `Timestamp` to a JavaScript `Date` object. This conversion + * causes a loss of precision since `Date` objects only support millisecond + * precision. * * @returns JavaScript `Date` object representing the same point in time as * this `Timestamp`, with millisecond precision. @@ -1768,14 +3047,16 @@ export declare class Timestamp { * @returns true if this `Timestamp` is equal to the provided one. */ isEqual(other: Timestamp): boolean; + /** Returns a textual representation of this `Timestamp`. */ toString(): string; + /** Returns a JSON-serializable representation of this `Timestamp`. */ toJSON(): { seconds: number; nanoseconds: number; }; /** - * Converts this object to a primitive string, which allows Timestamp objects to be compared - * using the `>`, `<=`, `>=` and `>` operators. + * Converts this object to a primitive string, which allows `Timestamp` objects + * to be compared using the `>`, `<=`, `>=` and `>` operators. */ valueOf(): string; } @@ -1794,16 +3075,22 @@ export declare class Transaction { * @param documentRef - A reference to the document to be read. * @returns A `DocumentSnapshot` with the read data. */ - get(documentRef: DocumentReference): Promise>; + get( + documentRef: DocumentReference + ): Promise>; /** * Writes to the document referred to by the provided {@link * DocumentReference}. If the document does not exist yet, it will be created. * * @param documentRef - A reference to the document to be set. * @param data - An object of the fields and values for the document. + * @throws Error - If the provided input is not a valid Firestore document. * @returns This `Transaction` instance. Used for chaining method calls. */ - set(documentRef: DocumentReference, data: T): this; + set( + documentRef: DocumentReference, + data: WithFieldValue + ): this; /** * Writes to the document referred to by the provided {@link * DocumentReference}. If the document does not exist yet, it will be created. @@ -1813,25 +3100,30 @@ export declare class Transaction { * @param documentRef - A reference to the document to be set. * @param data - An object of the fields and values for the document. * @param options - An object to configure the set behavior. + * @throws Error - If the provided input is not a valid Firestore document. * @returns This `Transaction` instance. Used for chaining method calls. */ - set( - documentRef: DocumentReference, - data: Partial, + set( + documentRef: DocumentReference, + data: PartialWithFieldValue, options: SetOptions ): this; /** - * Updates fields in the document referred to by the provided {@link - * DocumentReference}. The update will fail if applied to a document that does - * not exist. - * - * @param documentRef - A reference to the document to be updated. - * @param data - An object containing the fields and values with which to -update the document. Fields can contain dots to reference nested fields -within the document. - * @returns This `Transaction` instance. Used for chaining method calls. - */ - update(documentRef: DocumentReference, data: UpdateData): this; + * Updates fields in the document referred to by the provided {@link + * DocumentReference}. The update will fail if applied to a document that does + * not exist. + * + * @param documentRef - A reference to the document to be updated. + * @param data - An object containing the fields and values with which to + * update the document. Fields can contain dots to reference nested fields + * within the document. + * @throws Error - If the provided input is not valid Firestore data. + * @returns This `Transaction` instance. Used for chaining method calls. + */ + update( + documentRef: DocumentReference, + data: UpdateData + ): this; /** * Updates fields in the document referred to by the provided {@link * DocumentReference}. The update will fail if applied to a document that does @@ -1844,10 +3136,11 @@ within the document. * @param field - The first field to update. * @param value - The first value. * @param moreFieldsAndValues - Additional key/value pairs. + * @throws Error - If the provided input is not valid Firestore data. * @returns This `Transaction` instance. Used for chaining method calls. */ - update( - documentRef: DocumentReference, + update( + documentRef: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[] @@ -1858,19 +3151,68 @@ within the document. * @param documentRef - A reference to the document to be deleted. * @returns This `Transaction` instance. Used for chaining method calls. */ - delete(documentRef: DocumentReference): this; + delete( + documentRef: DocumentReference + ): this; +} +/** + * @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. + */ +/** + * Options to customize transaction behavior. + */ +export declare interface TransactionOptions { + /** Maximum number of attempts to commit, after which transaction fails. Default is 5. */ + readonly maxAttempts?: number; } +/** + * Given a union type `U = T1 | T2 | ...`, returns an intersected type + * `(T1 & T2 & ...)`. + * + * Uses distributive conditional types and inference from conditional types. + * This works because multiple candidates for the same type variable in + * contra-variant positions causes an intersection type to be inferred. + * https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-inference-in-conditional-types + * https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type + */ +export declare type UnionToIntersection = ( + U extends unknown ? (k: U) => void : never +) extends (k: infer I) => void + ? I + : never; +/** + * A function returned by `onSnapshot()` that removes the listener when invoked. + */ export declare interface Unsubscribe { + /** Removes the listener when invoked. */ (): void; } /** - * Update data (for use with {@link updateDoc}) consists of field paths (e.g. - * 'foo' or 'foo.baz') mapped to values. Fields that contain dots reference - * nested fields within the document. + * Update data (for use with {@link (updateDoc:1)}) that consists of field paths + * (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots + * reference nested fields within the document. FieldValues can be passed in + * as property values. */ -export declare interface UpdateData { - [fieldPath: string]: any; -} +export declare type UpdateData = T extends Primitive + ? T + : T extends {} + ? { + [K in keyof T]?: UpdateData | FieldValue; + } & NestedUpdateFields + : Partial; /** * Updates fields in the document referred to by the specified * `DocumentReference`. The update will fail if applied to a document that does @@ -1880,12 +3222,15 @@ export declare interface UpdateData { * @param data - An object containing the fields and values with which to * update the document. Fields can contain dots to reference nested fields * within the document. - * @returns A Promise resolved once the data has been successfully written + * @returns A `Promise` resolved once the data has been successfully written * to the backend (note that it won't resolve while you're offline). */ -export declare function updateDoc( - reference: DocumentReference, - data: UpdateData +export declare function updateDoc< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, + data: UpdateData ): Promise; /** * Updates fields in the document referred to by the specified @@ -1899,66 +3244,94 @@ export declare function updateDoc( * @param field - The first field to update. * @param value - The first value. * @param moreFieldsAndValues - Additional key value pairs. - * @returns A Promise resolved once the data has been successfully written + * @returns A `Promise` resolved once the data has been successfully written * to the backend (note that it won't resolve while you're offline). */ -export declare function updateDoc( - reference: DocumentReference, +export declare function updateDoc< + AppModelType, + DbModelType extends DocumentData +>( + reference: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[] ): Promise; /** - * Modify this instance to communicate with the Cloud Firestore emulator. + * Creates a new `VectorValue` constructed with a copy of the given array of numbers. * - * Note: This must be called before this instance has been used to do any - * operations. + * @param values - Create a `VectorValue` instance with a copy of this array of numbers. * - * @param firestore - The Firestore instance to configure to connect to the - * emulator. - * @param host - the emulator host (ex: localhost). - * @param port - the emulator port (ex: 9000). + * @returns A new `VectorValue` constructed with a copy of the given array of numbers. */ -export declare function useFirestoreEmulator( - firestore: FirebaseFirestore, - host: string, - port: number -): void; +export declare function vector(values?: number[]): VectorValue; +/** + * @license + * Copyright 2024 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. + */ +/** + * Represents a vector type in Firestore documents. + * Create an instance with {@link FieldValue.vector}. + * + * @class VectorValue + */ +export declare class VectorValue { + /* Excluded from this release type: __constructor */ + /** + * Returns a copy of the raw number array form of the vector. + */ + toArray(): number[]; + /** + * Returns `true` if the two VectorValue has the same raw number arrays, returns `false` otherwise. + */ + isEqual(other: VectorValue): boolean; +} /** * Waits until all currently pending writes for the active user have been * acknowledged by the backend. * - * The returned Promise resolves immediately if there are no outstanding writes. - * Otherwise, the Promise waits for all previously issued writes (including + * The returned promise resolves immediately if there are no outstanding writes. + * Otherwise, the promise waits for all previously issued writes (including * those written in a previous app session), but it does not wait for writes * that were added after the function is called. If you want to wait for * additional writes, call `waitForPendingWrites()` again. * - * Any outstanding `waitForPendingWrites()` Promises are rejected during user + * Any outstanding `waitForPendingWrites()` promises are rejected during user * changes. * - * @returns A Promise which resolves when all currently pending writes have been + * @returns A `Promise` which resolves when all currently pending writes have been * acknowledged by the backend. */ export declare function waitForPendingWrites( - firestore: FirebaseFirestore + firestore: Firestore ): Promise; /** - * Creates a `QueryConstraint` that enforces that documents must contain the - * specified field and that the value should satisfy the relation constraint - * provided. + * Creates a {@link QueryFieldFilterConstraint} that enforces that documents + * must contain the specified field and that the value should satisfy the + * relation constraint provided. * * @param fieldPath - The path to compare * @param opStr - The operation string (e.g "<", "<=", "==", "<", * "<=", "!="). * @param value - The value for comparison - * @returns The created `Query`. + * @returns The created {@link QueryFieldFilterConstraint}. */ export declare function where( fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown -): QueryConstraint; +): QueryFieldFilterConstraint; /** * Filter conditions in a {@link where} clause are specified using the * strings '<', '<=', '==', '!=', '>=', '>', 'array-contains', 'in', @@ -1975,12 +3348,25 @@ export declare type WhereFilterOp = | 'in' | 'array-contains-any' | 'not-in'; +/** + * Allows FieldValues to be passed in as a property value while maintaining + * type safety. + */ +export declare type WithFieldValue = + | T + | (T extends Primitive + ? T + : T extends {} + ? { + [K in keyof T]: WithFieldValue | FieldValue; + } + : never); /** * A write batch, used to perform multiple writes as a single atomic unit. * * A `WriteBatch` object can be acquired by calling {@link writeBatch}. It * provides methods for adding writes to the write batch. None of the writes - * will be committed (or visible locally) until {@link WriteBatch#commit} is + * will be committed (or visible locally) until {@link WriteBatch.commit} is * called. */ export declare class WriteBatch { @@ -1993,7 +3379,10 @@ export declare class WriteBatch { * @param data - An object of the fields and values for the document. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - set(documentRef: DocumentReference, data: T): WriteBatch; + set( + documentRef: DocumentReference, + data: WithFieldValue + ): WriteBatch; /** * Writes to the document referred to by the provided {@link * DocumentReference}. If the document does not exist yet, it will be created. @@ -2003,11 +3392,12 @@ export declare class WriteBatch { * @param documentRef - A reference to the document to be set. * @param data - An object of the fields and values for the document. * @param options - An object to configure the set behavior. + * @throws Error - If the provided input is not a valid Firestore document. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - set( - documentRef: DocumentReference, - data: Partial, + set( + documentRef: DocumentReference, + data: PartialWithFieldValue, options: SetOptions ): WriteBatch; /** @@ -2019,9 +3409,13 @@ export declare class WriteBatch { * @param data - An object containing the fields and values with which to * update the document. Fields can contain dots to reference nested fields * within the document. + * @throws Error - If the provided input is not valid Firestore data. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - update(documentRef: DocumentReference, data: UpdateData): WriteBatch; + update( + documentRef: DocumentReference, + data: UpdateData + ): WriteBatch; /** * Updates fields in the document referred to by this {@link * DocumentReference}. The update will fail if applied to a document that does @@ -2034,10 +3428,11 @@ export declare class WriteBatch { * @param field - The first field to update. * @param value - The first value. * @param moreFieldsAndValues - Additional key value pairs. + * @throws Error - If the provided input is not valid Firestore data. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - update( - documentRef: DocumentReference, + update( + documentRef: DocumentReference, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[] @@ -2048,16 +3443,18 @@ export declare class WriteBatch { * @param documentRef - A reference to the document to be deleted. * @returns This `WriteBatch` instance. Used for chaining method calls. */ - delete(documentRef: DocumentReference): WriteBatch; + delete( + documentRef: DocumentReference + ): WriteBatch; /** * Commits all of the writes in this write batch as a single atomic unit. * * The result of these writes will only be reflected in document reads that - * occur after the returned Promise resolves. If the client is offline, the + * occur after the returned promise resolves. If the client is offline, the * write fails. If you would like to see local modifications or buffer writes * until the client is online, use the full Firestore SDK. * - * @returns A Promise resolved once all of the writes in the batch have been + * @returns A `Promise` resolved once all of the writes in the batch have been * successfully written to the backend as an atomic unit (note that it won't * resolve while you're offline). */ @@ -2065,14 +3462,14 @@ export declare class WriteBatch { } /** * Creates a write batch, used for performing multiple writes as a single - * atomic operation. The maximum number of writes allowed in a single WriteBatch + * atomic operation. The maximum number of writes allowed in a single {@link WriteBatch} * is 500. * * Unlike transactions, write batches are persisted offline and therefore are * preferable when you don't need to condition your writes on read data. * - * @returns A `WriteBatch` that can be used to atomically execute multiple + * @returns A {@link WriteBatch} that can be used to atomically execute multiple * writes. */ -export declare function writeBatch(firestore: FirebaseFirestore): WriteBatch; +export declare function writeBatch(firestore: Firestore): WriteBatch; export {}; diff --git a/repo-scripts/prune-dts/tests/messaging.input.d.ts b/repo-scripts/prune-dts/tests/messaging.input.d.ts new file mode 100644 index 00000000000..f25b27fc1f7 --- /dev/null +++ b/repo-scripts/prune-dts/tests/messaging.input.d.ts @@ -0,0 +1,223 @@ +/** + * The Firebase Cloud Messaging Web SDK. + * This SDK does not work in a Node.js environment. + * + * @packageDocumentation + */ + +import { FirebaseApp } from '@firebase/app'; +import { NextFn } from '@firebase/util'; +import { Observer } from '@firebase/util'; +import { Unsubscribe } from '@firebase/util'; + +/** + * Deletes the registration token associated with this {@link Messaging} instance and unsubscribes + * the {@link Messaging} instance from the push subscription. + * + * @param messaging - The {@link Messaging} instance. + * + * @returns The promise resolves when the token has been successfully deleted. + * + * @public + */ +export declare function deleteToken(messaging: Messaging): Promise; + +/** + * Options for features provided by the FCM SDK for Web. See {@link + * https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#webpushfcmoptions | + * WebpushFcmOptions}. + * + * @public + */ +export declare interface FcmOptions { + /** + * The link to open when the user clicks on the notification. + */ + link?: string; + /** + * The label associated with the message's analytics data. + */ + analyticsLabel?: string; +} + +/* Excluded from this release type: _FirebaseMessagingName */ + +/** + * Retrieves a Firebase Cloud Messaging instance. + * + * @returns The Firebase Cloud Messaging instance associated with the provided firebase app. + * + * @public + */ +export declare function getMessaging(app?: FirebaseApp): Messaging; + +/** + * Subscribes the {@link Messaging} instance to push notifications. Returns a Firebase Cloud + * Messaging registration token that can be used to send push messages to that {@link Messaging} + * instance. + * + * If notification permission isn't already granted, this method asks the user for permission. The + * returned promise rejects if the user does not allow the app to show notifications. + * + * @param messaging - The {@link Messaging} instance. + * @param options - Provides an optional vapid key and an optional service worker registration. + * + * @returns The promise resolves with an FCM registration token. + * + * @public + */ +export declare function getToken( + messaging: Messaging, + options?: GetTokenOptions +): Promise; + +/** + * Options for {@link getToken}. + * + * @public + */ +export declare interface GetTokenOptions { + /** + * The public server key provided to push services. The key is used to + * authenticate push subscribers to receive push messages only from sending servers that hold + * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some + * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended + * to generate and import a VAPID key for your project with + * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_in_your_app | Configure Web Credentials with FCM}. + * See + * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol} + * for details on web push services. + */ + vapidKey?: string; + /** + * The service worker registration for receiving push + * messaging. If the registration is not provided explicitly, you need to have a + * `firebase-messaging-sw.js` at your root location. See + * {@link https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token | Access the registration token} + * for more details. + */ + serviceWorkerRegistration?: ServiceWorkerRegistration; +} + +/** + * @license + * Copyright 2020 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. + */ +/** + * Checks if all required APIs exist in the browser. + * @returns a Promise that resolves to a boolean. + * + * @public + */ +export declare function isSupported(): Promise; + +/** + * Message payload that contains the notification payload that is represented with + * {@link NotificationPayload} and the data payload that contains an arbitrary + * number of key-value pairs sent by developers through the + * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}. + * + * @public + */ +export declare interface MessagePayload { + /** + * {@inheritdoc NotificationPayload} + */ + notification?: NotificationPayload; + /** + * Arbitrary key/value payload. + */ + data?: { + [key: string]: string; + }; + /** + * {@inheritdoc FcmOptions} + */ + fcmOptions?: FcmOptions; + /** + * The sender of this message. + */ + from: string; + /** + * The collapse key of the message. See + * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages} + */ + collapseKey: string; + /** + * The message ID of a message. + */ + messageId: string; +} + +/** + * Public interface of the Firebase Cloud Messaging SDK. + * + * @public + */ +export declare interface Messaging { + /** + * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with. + */ + app: FirebaseApp; +} +export { NextFn }; + +/** + * Display notification details. Details are sent through the + * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}. + * + * @public + */ +export declare interface NotificationPayload { + /** + * The notification's title. + */ + title?: string; + /** + * The notification's body text. + */ + body?: string; + /** + * The URL of an image that is downloaded on the device and displayed in the notification. + */ + image?: string; + /** + * The URL to use for the notification's icon. If you don't send this key in the request, + * FCM displays the launcher icon specified in your app manifest. + */ + icon?: string; +} +export { Observer }; + +/** + * When a push message is received and the user is currently on a page for your origin, the + * message is passed to the page and an `onMessage()` event is dispatched with the payload of + * the push message. + * + * + * @param messaging - The {@link Messaging} instance. + * @param nextOrObserver - This function, or observer object with `next` defined, + * is called when a message is received and the user is currently viewing your page. + * @returns To stop listening for messages execute this returned function. + * + * @public + */ +export declare function onMessage( + messaging: Messaging, + nextOrObserver: NextFn | Observer +): Unsubscribe; +export { Unsubscribe }; + +export {}; diff --git a/repo-scripts/prune-dts/tests/messaging.output.d.ts b/repo-scripts/prune-dts/tests/messaging.output.d.ts new file mode 100644 index 00000000000..8b2fb30d5b9 --- /dev/null +++ b/repo-scripts/prune-dts/tests/messaging.output.d.ts @@ -0,0 +1,210 @@ +/** + * The Firebase Cloud Messaging Web SDK. + * This SDK does not work in a Node.js environment. + * + * @packageDocumentation + */ +import { FirebaseApp } from '@firebase/app'; +import { NextFn } from '@firebase/util'; +import { Observer } from '@firebase/util'; +import { Unsubscribe } from '@firebase/util'; +/** + * Deletes the registration token associated with this {@link Messaging} instance and unsubscribes + * the {@link Messaging} instance from the push subscription. + * + * @param messaging - The {@link Messaging} instance. + * + * @returns The promise resolves when the token has been successfully deleted. + * + * @public + */ +export declare function deleteToken(messaging: Messaging): Promise; +/** + * Options for features provided by the FCM SDK for Web. See {@link + * https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#webpushfcmoptions | + * WebpushFcmOptions}. + * + * @public + */ +export declare interface FcmOptions { + /** + * The link to open when the user clicks on the notification. + */ + link?: string; + /** + * The label associated with the message's analytics data. + */ + analyticsLabel?: string; +} +/* Excluded from this release type: _FirebaseMessagingName */ +/** + * Retrieves a Firebase Cloud Messaging instance. + * + * @returns The Firebase Cloud Messaging instance associated with the provided firebase app. + * + * @public + */ +export declare function getMessaging(app?: FirebaseApp): Messaging; +/** + * Subscribes the {@link Messaging} instance to push notifications. Returns a Firebase Cloud + * Messaging registration token that can be used to send push messages to that {@link Messaging} + * instance. + * + * If notification permission isn't already granted, this method asks the user for permission. The + * returned promise rejects if the user does not allow the app to show notifications. + * + * @param messaging - The {@link Messaging} instance. + * @param options - Provides an optional vapid key and an optional service worker registration. + * + * @returns The promise resolves with an FCM registration token. + * + * @public + */ +export declare function getToken( + messaging: Messaging, + options?: GetTokenOptions +): Promise; +/** + * Options for {@link getToken}. + * + * @public + */ +export declare interface GetTokenOptions { + /** + * The public server key provided to push services. The key is used to + * authenticate push subscribers to receive push messages only from sending servers that hold + * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some + * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended + * to generate and import a VAPID key for your project with + * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_in_your_app | Configure Web Credentials with FCM}. + * See + * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol} + * for details on web push services. + */ + vapidKey?: string; + /** + * The service worker registration for receiving push + * messaging. If the registration is not provided explicitly, you need to have a + * `firebase-messaging-sw.js` at your root location. See + * {@link https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token | Access the registration token} + * for more details. + */ + serviceWorkerRegistration?: ServiceWorkerRegistration; +} +/** + * @license + * Copyright 2020 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. + */ +/** + * Checks if all required APIs exist in the browser. + * @returns a Promise that resolves to a boolean. + * + * @public + */ +export declare function isSupported(): Promise; +/** + * Message payload that contains the notification payload that is represented with + * {@link NotificationPayload} and the data payload that contains an arbitrary + * number of key-value pairs sent by developers through the + * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}. + * + * @public + */ +export declare interface MessagePayload { + /** + * {@inheritdoc NotificationPayload} + */ + notification?: NotificationPayload; + /** + * Arbitrary key/value payload. + */ + data?: { + [key: string]: string; + }; + /** + * {@inheritdoc FcmOptions} + */ + fcmOptions?: FcmOptions; + /** + * The sender of this message. + */ + from: string; + /** + * The collapse key of the message. See + * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages} + */ + collapseKey: string; + /** + * The message ID of a message. + */ + messageId: string; +} +/** + * Public interface of the Firebase Cloud Messaging SDK. + * + * @public + */ +export declare interface Messaging { + /** + * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with. + */ + app: FirebaseApp; +} +export { NextFn }; +/** + * Display notification details. Details are sent through the + * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}. + * + * @public + */ +export declare interface NotificationPayload { + /** + * The notification's title. + */ + title?: string; + /** + * The notification's body text. + */ + body?: string; + /** + * The URL of an image that is downloaded on the device and displayed in the notification. + */ + image?: string; + /** + * The URL to use for the notification's icon. If you don't send this key in the request, + * FCM displays the launcher icon specified in your app manifest. + */ + icon?: string; +} +export { Observer }; +/** + * When a push message is received and the user is currently on a page for your origin, the + * message is passed to the page and an `onMessage()` event is dispatched with the payload of + * the push message. + * + * + * @param messaging - The {@link Messaging} instance. + * @param nextOrObserver - This function, or observer object with `next` defined, + * is called when a message is received and the user is currently viewing your page. + * @returns To stop listening for messages execute this returned function. + * + * @public + */ +export declare function onMessage( + messaging: Messaging, + nextOrObserver: NextFn | Observer +): Unsubscribe; +export { Unsubscribe }; +export {}; diff --git a/repo-scripts/prune-dts/tests/resolves-generics-through-inheritence.output.d.ts b/repo-scripts/prune-dts/tests/resolves-generics-through-inheritance.output.d.ts similarity index 100% rename from repo-scripts/prune-dts/tests/resolves-generics-through-inheritence.output.d.ts rename to repo-scripts/prune-dts/tests/resolves-generics-through-inheritance.output.d.ts diff --git a/repo-scripts/prune-dts/tests/storage-public.input.d.ts b/repo-scripts/prune-dts/tests/storage-public.input.d.ts new file mode 100644 index 00000000000..8c9ae2ca7f3 --- /dev/null +++ b/repo-scripts/prune-dts/tests/storage-public.input.d.ts @@ -0,0 +1,1080 @@ +/** + * Cloud Storage for Firebase + * + * @packageDocumentation + */ + +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { CompleteFn } from '@firebase/util'; +import { EmulatorMockTokenOptions } from '@firebase/util'; +import { FirebaseApp } from '@firebase/app'; +import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; +import { FirebaseError } from '@firebase/util'; +import { NextFn } from '@firebase/util'; +import { Provider } from '@firebase/component'; +import { Subscribe } from '@firebase/util'; +import { Unsubscribe } from '@firebase/util'; + +/** + * A function that is called if the event stream ends normally. + */ +declare type CompleteFn_2 = () => void; + +/** + * A lightweight wrapper around XMLHttpRequest with a + * goog.net.XhrIo-like interface. + * + * You can create a new connection by invoking `newTextConnection()`, + * `newBytesConnection()` or `newStreamConnection()`. + */ +declare interface Connection { + /** + * Sends a request to the provided URL. + * + * This method never rejects its promise. In case of encountering an error, + * it sets an error code internally which can be accessed by calling + * getErrorCode() by callers. + */ + send( + url: string, + method: string, + body?: ArrayBufferView | Blob | string | null, + headers?: Headers_2 + ): Promise; + getErrorCode(): ErrorCode; + getStatus(): number; + getResponse(): T; + getErrorText(): string; + /** + * Abort the request. + */ + abort(): void; + getResponseHeader(header: string): string | null; + addUploadProgressListener(listener: (p1: ProgressEvent) => void): void; + removeUploadProgressListener(listener: (p1: ProgressEvent) => void): void; +} + +/** Response type exposed by the networking APIs. */ +declare type ConnectionType = + | string + | ArrayBuffer + | Blob + | ReadableStream; + +/** + * Modify this {@link FirebaseStorage} instance to communicate with the Cloud Storage emulator. + * + * @param storage - The {@link FirebaseStorage} instance + * @param host - The emulator host (ex: localhost) + * @param port - The emulator port (ex: 5001) + * @param options - Emulator options. `options.mockUserToken` is the mock auth + * token to use for unit testing Security Rules. + * @public + */ +export declare function connectStorageEmulator( + storage: FirebaseStorage, + host: string, + port: number, + options?: { + mockUserToken?: EmulatorMockTokenOptions | string; + } +): void; + +/* Excluded from this release type: _dataFromString */ + +/** + * Deletes the object at this location. + * @public + * @param ref - {@link StorageReference} for object to delete. + * @returns A `Promise` that resolves if the deletion succeeds. + */ +export declare function deleteObject(ref: StorageReference): Promise; +export { EmulatorMockTokenOptions }; + +/** + * Error codes for requests made by the XhrIo wrapper. + */ +declare enum ErrorCode { + NO_ERROR = 0, + NETWORK_ERROR = 1, + ABORT = 2 +} + +/** + * A function that is called with a `StorageError` + * if the event stream ends due to an error. + */ +declare type ErrorFn = (error: StorageError) => void; + +/** A function to handle an error. */ +declare type ErrorHandler = ( + connection: Connection, + response: StorageError +) => StorageError; + +/* Excluded from this release type: _FbsBlob */ + +/* Excluded from this release type: _FirebaseService */ + +/** + * A Firebase Storage instance. + * @public + */ +export declare interface FirebaseStorage extends _FirebaseService { + /** + * The {@link @firebase/app#FirebaseApp} associated with this `FirebaseStorage` instance. + */ + readonly app: FirebaseApp; + /** + * The maximum time to retry uploads in milliseconds. + */ + maxUploadRetryTime: number; + /** + * The maximum time to retry operations other than uploads or downloads in + * milliseconds. + */ + maxOperationRetryTime: number; +} + +/* Excluded from this release type: _FirebaseStorageImpl */ + +/** + * The full set of object metadata, including read-only properties. + * @public + */ +export declare interface FullMetadata extends UploadMetadata { + /** + * The bucket this object is contained in. + */ + bucket: string; + /** + * The full path of this object. + */ + fullPath: string; + /** + * The object's generation. + * {@link https://cloud.google.com/storage/docs/metadata#generation-number} + */ + generation: string; + /** + * The object's metageneration. + * {@link https://cloud.google.com/storage/docs/metadata#generation-number} + */ + metageneration: string; + /** + * The short name of this object, which is the last component of the full path. + * For example, if fullPath is 'full/path/image.png', name is 'image.png'. + */ + name: string; + /** + * The size of this object, in bytes. + */ + size: number; + /** + * A date string representing when this object was created. + */ + timeCreated: string; + /** + * A date string representing when this object was last updated. + */ + updated: string; + /** + * Tokens to allow access to the download URL. + */ + downloadTokens: string[] | undefined; + /** + * `StorageReference` associated with this upload. + */ + ref?: StorageReference | undefined; +} + +/** + * Downloads the data at the object's location. Returns an error if the object + * is not found. + * + * To use this functionality, you have to whitelist your app's origin in your + * Cloud Storage bucket. See also + * https://cloud.google.com/storage/docs/configuring-cors + * + * This API is not available in Node. + * + * @public + * @param ref - StorageReference where data should be downloaded. + * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to + * retrieve. + * @returns A Promise that resolves with a Blob containing the object's bytes + */ +export declare function getBlob( + ref: StorageReference, + maxDownloadSizeBytes?: number +): Promise; + +/** + * Downloads the data at the object's location. Returns an error if the object + * is not found. + * + * To use this functionality, you have to whitelist your app's origin in your + * Cloud Storage bucket. See also + * https://cloud.google.com/storage/docs/configuring-cors + * + * @public + * @param ref - StorageReference where data should be downloaded. + * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to + * retrieve. + * @returns A Promise containing the object's bytes + */ +export declare function getBytes( + ref: StorageReference, + maxDownloadSizeBytes?: number +): Promise; + +/* Excluded from this release type: _getChild */ + +/** + * Returns the download URL for the given {@link StorageReference}. + * @public + * @param ref - {@link StorageReference} to get the download URL for. + * @returns A `Promise` that resolves with the download + * URL for this object. + */ +export declare function getDownloadURL(ref: StorageReference): Promise; + +/** + * A `Promise` that resolves with the metadata for this object. If this + * object doesn't exist or metadata cannot be retrieved, the promise is + * rejected. + * @public + * @param ref - {@link StorageReference} to get metadata from. + */ +export declare function getMetadata( + ref: StorageReference +): Promise; + +/** + * Gets a {@link FirebaseStorage} instance for the given Firebase app. + * @public + * @param app - Firebase app to get {@link FirebaseStorage} instance for. + * @param bucketUrl - The gs:// url to your Firebase Storage Bucket. + * If not passed, uses the app's default Storage Bucket. + * @returns A {@link FirebaseStorage} instance. + */ +export declare function getStorage( + app?: FirebaseApp, + bucketUrl?: string +): FirebaseStorage; + +/** + * Downloads the data at the object's location. Raises an error event if the + * object is not found. + * + * This API is only available in Node. + * + * @public + * @param ref - StorageReference where data should be downloaded. + * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to + * retrieve. + * @returns A stream with the object's data as bytes + */ +export declare function getStream( + ref: StorageReference, + maxDownloadSizeBytes?: number +): ReadableStream; + +/** + * @license + * Copyright 2017 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. + */ +/** Network headers */ +declare type Headers_2 = Record; + +/** + * Internal enum for task state. + */ +declare const enum InternalTaskState { + RUNNING = 'running', + PAUSING = 'pausing', + PAUSED = 'paused', + SUCCESS = 'success', + CANCELING = 'canceling', + CANCELED = 'canceled', + ERROR = 'error' +} + +/* Excluded from this release type: _invalidArgument */ + +/* Excluded from this release type: _invalidRootOperation */ + +/** + * List items (files) and prefixes (folders) under this storage reference. + * + * List API is only available for Firebase Rules Version 2. + * + * GCS is a key-blob store. Firebase Storage imposes the semantic of '/' + * delimited folder structure. + * Refer to GCS's List API if you want to learn more. + * + * To adhere to Firebase Rules's Semantics, Firebase Storage does not + * support objects whose paths end with "/" or contain two consecutive + * "/"s. Firebase Storage List API will filter these unsupported objects. + * list() may fail if there are too many unsupported objects in the bucket. + * @public + * + * @param ref - {@link StorageReference} to get list from. + * @param options - See {@link ListOptions} for details. + * @returns A `Promise` that resolves with the items and prefixes. + * `prefixes` contains references to sub-folders and `items` + * contains references to objects in this folder. `nextPageToken` + * can be used to get the rest of the results. + */ +export declare function list( + ref: StorageReference, + options?: ListOptions +): Promise; + +/** + * List all items (files) and prefixes (folders) under this storage reference. + * + * This is a helper method for calling list() repeatedly until there are + * no more results. The default pagination size is 1000. + * + * Note: The results may not be consistent if objects are changed while this + * operation is running. + * + * Warning: `listAll` may potentially consume too many resources if there are + * too many results. + * @public + * @param ref - {@link StorageReference} to get list from. + * + * @returns A `Promise` that resolves with all the items and prefixes under + * the current storage reference. `prefixes` contains references to + * sub-directories and `items` contains references to objects in this + * folder. `nextPageToken` is never returned. + */ +export declare function listAll(ref: StorageReference): Promise; + +/** + * The options `list()` accepts. + * @public + */ +export declare interface ListOptions { + /** + * If set, limits the total number of `prefixes` and `items` to return. + * The default and maximum maxResults is 1000. + */ + maxResults?: number | null; + /** + * The `nextPageToken` from a previous call to `list()`. If provided, + * listing is resumed from the previous position. + */ + pageToken?: string | null; +} + +/** + * Result returned by list(). + * @public + */ +export declare interface ListResult { + /** + * References to prefixes (sub-folders). You can call list() on them to + * get its contents. + * + * Folders are implicit based on '/' in the object paths. + * For example, if a bucket has two objects '/a/b/1' and '/a/b/2', list('/a') + * will return '/a/b' as a prefix. + */ + prefixes: StorageReference[]; + /** + * Objects in this directory. + * You can call getMetadata() and getDownloadUrl() on them. + */ + items: StorageReference[]; + /** + * If set, there might be more results for this list. Use this token to resume the list. + */ + nextPageToken?: string; +} + +/* Excluded from this release type: _Location */ + +/** + * @fileoverview Documentation for the metadata format. + */ +/** + * The full set of object metadata, including read-only properties. + */ +declare interface Metadata extends FullMetadata { + [prop: string]: unknown; +} + +/** + * Function that is called once for each value in a stream of values. + */ +declare type NextFn_2 = (value: T) => void; + +/** + * Returns a {@link StorageReference} for the given url. + * @param storage - {@link FirebaseStorage} instance. + * @param url - URL. If empty, returns root reference. + * @public + */ +export declare function ref( + storage: FirebaseStorage, + url?: string +): StorageReference; + +/** + * Returns a {@link StorageReference} for the given path in the + * default bucket. + * @param storageOrRef - {@link FirebaseStorage} or {@link StorageReference}. + * @param pathOrUrlStorage - path. If empty, returns root reference (if {@link FirebaseStorage} + * instance provided) or returns same reference (if {@link StorageReference} provided). + * @public + */ +export declare function ref( + storageOrRef: FirebaseStorage | StorageReference, + path?: string +): StorageReference; + +/* Excluded from this release type: _Reference */ + +declare interface Request_2 { + getPromise(): Promise; + /** + * Cancels the request. IMPORTANT: the promise may still be resolved with an + * appropriate value (if the request is finished before you call this method, + * but the promise has not yet been resolved), so don't just assume it will be + * rejected if you call this function. + * @param appDelete - True if the cancelation came from the app being deleted. + */ + cancel(appDelete?: boolean): void; +} + +/** + * A function that converts a server response to the API type expected by the + * SDK. + * + * @param I - the type of the backend's network response + * @param O - the output response type used by the rest of the SDK. + */ +declare type RequestHandler = ( + connection: Connection, + response: I +) => O; + +/** + * Contains a fully specified request. + * + * @param I - the type of the backend's network response. + * @param O - the output response type used by the rest of the SDK. + */ +declare class RequestInfo_2 { + url: string; + method: string; + /** + * Returns the value with which to resolve the request's promise. Only called + * if the request is successful. Throw from this function to reject the + * returned Request's promise with the thrown error. + * Note: The XhrIo passed to this function may be reused after this callback + * returns. Do not keep a reference to it in any way. + */ + handler: RequestHandler; + timeout: number; + urlParams: UrlParams; + headers: Headers_2; + body: Blob | string | Uint8Array | null; + errorHandler: ErrorHandler | null; + /** + * Called with the current number of bytes uploaded and total size (-1 if not + * computable) of the request body (i.e. used to report upload progress). + */ + progressCallback: ((p1: number, p2: number) => void) | null; + successCodes: number[]; + additionalRetryCodes: number[]; + constructor( + url: string, + method: string, + /** + * Returns the value with which to resolve the request's promise. Only called + * if the request is successful. Throw from this function to reject the + * returned Request's promise with the thrown error. + * Note: The XhrIo passed to this function may be reused after this callback + * returns. Do not keep a reference to it in any way. + */ + handler: RequestHandler, + timeout: number + ); +} + +/** + * Object metadata that can be set at any time. + * @public + */ +export declare interface SettableMetadata { + /** + * Served as the 'Cache-Control' header on object download. + */ + cacheControl?: string | undefined; + /** + * Served as the 'Content-Disposition' header on object download. + */ + contentDisposition?: string | undefined; + /** + * Served as the 'Content-Encoding' header on object download. + */ + contentEncoding?: string | undefined; + /** + * Served as the 'Content-Language' header on object download. + */ + contentLanguage?: string | undefined; + /** + * Served as the 'Content-Type' header on object download. + */ + contentType?: string | undefined; + /** + * Additional user-defined custom metadata. + */ + customMetadata?: + | { + [key: string]: string; + } + | undefined; +} + +/** + * An error returned by the Firebase Storage SDK. + * @public + */ +export declare class StorageError extends FirebaseError { + private status_; + private readonly _baseMessage; + /** + * Stores custom error data unique to the `StorageError`. + */ + customData: { + serverResponse: string | null; + }; + /** + * @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and + * added to the end of the message. + * @param message - Error message. + * @param status_ - Corresponding HTTP Status Code + */ + constructor(code: StorageErrorCode, message: string, status_?: number); + get status(): number; + set status(status: number); + /** + * Compares a `StorageErrorCode` against this error's code, filtering out the prefix. + */ + _codeEquals(code: StorageErrorCode): boolean; + /** + * Optional response message that was added by the server. + */ + get serverResponse(): null | string; + set serverResponse(serverResponse: string | null); +} + +/** + * @public + * Error codes that can be attached to `StorageError` objects. + */ +export declare enum StorageErrorCode { + UNKNOWN = 'unknown', + OBJECT_NOT_FOUND = 'object-not-found', + BUCKET_NOT_FOUND = 'bucket-not-found', + PROJECT_NOT_FOUND = 'project-not-found', + QUOTA_EXCEEDED = 'quota-exceeded', + UNAUTHENTICATED = 'unauthenticated', + UNAUTHORIZED = 'unauthorized', + UNAUTHORIZED_APP = 'unauthorized-app', + RETRY_LIMIT_EXCEEDED = 'retry-limit-exceeded', + INVALID_CHECKSUM = 'invalid-checksum', + CANCELED = 'canceled', + INVALID_EVENT_NAME = 'invalid-event-name', + INVALID_URL = 'invalid-url', + INVALID_DEFAULT_BUCKET = 'invalid-default-bucket', + NO_DEFAULT_BUCKET = 'no-default-bucket', + CANNOT_SLICE_BLOB = 'cannot-slice-blob', + SERVER_FILE_WRONG_SIZE = 'server-file-wrong-size', + NO_DOWNLOAD_URL = 'no-download-url', + INVALID_ARGUMENT = 'invalid-argument', + INVALID_ARGUMENT_COUNT = 'invalid-argument-count', + APP_DELETED = 'app-deleted', + INVALID_ROOT_OPERATION = 'invalid-root-operation', + INVALID_FORMAT = 'invalid-format', + INTERNAL_ERROR = 'internal-error', + UNSUPPORTED_ENVIRONMENT = 'unsupported-environment' +} + +/** + * A stream observer for Firebase Storage. + * @public + */ +export declare interface StorageObserver { + next?: NextFn | null; + error?: (error: StorageError) => void | null; + complete?: CompleteFn | null; +} + +/** + * An observer identical to the `Observer` defined in packages/util except the + * error passed into the ErrorFn is specifically a `StorageError`. + */ +declare interface StorageObserver_2 { + /** + * Function that is called once for each value in the event stream. + */ + next?: NextFn_2; + /** + * A function that is called with a `StorageError` + * if the event stream ends due to an error. + */ + error?: ErrorFn; + /** + * A function that is called if the event stream ends normally. + */ + complete?: CompleteFn_2; +} + +/** + * Represents a reference to a Google Cloud Storage object. Developers can + * upload, download, and delete objects, as well as get/set object metadata. + * @public + */ +export declare interface StorageReference { + /** + * Returns a gs:// URL for this object in the form + * `gs://///` + * @returns The gs:// URL. + */ + toString(): string; + /** + * A reference to the root of this object's bucket. + */ + root: StorageReference; + /** + * The name of the bucket containing this reference's object. + */ + bucket: string; + /** + * The full path of this object. + */ + fullPath: string; + /** + * The short name of this object, which is the last component of the full path. + * For example, if fullPath is 'full/path/image.png', name is 'image.png'. + */ + name: string; + /** + * The {@link FirebaseStorage} instance associated with this reference. + */ + storage: FirebaseStorage; + /** + * A reference pointing to the parent location of this reference, or null if + * this reference is the root. + */ + parent: StorageReference | null; +} + +declare class StringData { + data: Uint8Array; + contentType: string | null; + constructor(data: Uint8Array, contentType?: string | null); +} + +/** + * @license + * Copyright 2017 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. + */ +/** + * An enumeration of the possible string formats for upload. + * @public + */ +export declare type StringFormat = + (typeof StringFormat)[keyof typeof StringFormat]; + +/** + * An enumeration of the possible string formats for upload. + * @public + */ +export declare const StringFormat: { + /** + * Indicates the string should be interpreted "raw", that is, as normal text. + * The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte + * sequence. + * Example: The string 'Hello! \\ud83d\\ude0a' becomes the byte sequence + * 48 65 6c 6c 6f 21 20 f0 9f 98 8a + */ + readonly RAW: 'raw'; + /** + * Indicates the string should be interpreted as base64-encoded data. + * Padding characters (trailing '='s) are optional. + * Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence + * ad 69 8e fb e1 3a b7 bf eb 97 + */ + readonly BASE64: 'base64'; + /** + * Indicates the string should be interpreted as base64url-encoded data. + * Padding characters (trailing '='s) are optional. + * Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence + * ad 69 8e fb e1 3a b7 bf eb 97 + */ + readonly BASE64URL: 'base64url'; + /** + * Indicates the string is a data URL, such as one obtained from + * canvas.toDataURL(). + * Example: the string 'data:application/octet-stream;base64,aaaa' + * becomes the byte sequence + * 69 a6 9a + * (the content-type "application/octet-stream" is also applied, but can + * be overridden in the metadata object). + */ + readonly DATA_URL: 'data_url'; +}; + +/** + * Subscribes to an event stream. + */ +declare type Subscribe_2 = ( + next?: NextFn_2 | StorageObserver_2, + error?: ErrorFn, + complete?: CompleteFn_2 +) => Unsubscribe_2; + +/** + * An event that is triggered on a task. + * @public + */ +export declare type TaskEvent = 'state_changed'; + +/* Excluded from this release type: _TaskEvent */ + +/** + * Represents the current state of a running upload. + * @public + */ +export declare type TaskState = + | 'running' + | 'paused' + | 'success' + | 'canceled' + | 'error'; + +/* Excluded from this release type: _TaskState */ + +/** + * Unsubscribes from a stream. + */ +declare type Unsubscribe_2 = () => void; + +/** + * Updates the metadata for this object. + * @public + * @param ref - {@link StorageReference} to update metadata for. + * @param metadata - The new metadata for the object. + * Only values that have been explicitly set will be changed. Explicitly + * setting a value to null will remove the metadata. + * @returns A `Promise` that resolves with the new metadata for this object. + */ +export declare function updateMetadata( + ref: StorageReference, + metadata: SettableMetadata +): Promise; + +/** + * Uploads data to this object's location. + * The upload is not resumable. + * @public + * @param ref - {@link StorageReference} where data should be uploaded. + * @param data - The data to upload. + * @param metadata - Metadata for the data to upload. + * @returns A Promise containing an UploadResult + */ +export declare function uploadBytes( + ref: StorageReference, + data: Blob | Uint8Array | ArrayBuffer, + metadata?: UploadMetadata +): Promise; + +/** + * Uploads data to this object's location. + * The upload can be paused and resumed, and exposes progress updates. + * @public + * @param ref - {@link StorageReference} where data should be uploaded. + * @param data - The data to upload. + * @param metadata - Metadata for the data to upload. + * @returns An UploadTask + */ +export declare function uploadBytesResumable( + ref: StorageReference, + data: Blob | Uint8Array | ArrayBuffer, + metadata?: UploadMetadata +): UploadTask; + +/** + * Object metadata that can be set at upload. + * @public + */ +export declare interface UploadMetadata extends SettableMetadata { + /** + * A Base64-encoded MD5 hash of the object being uploaded. + */ + md5Hash?: string | undefined; +} + +/** + * Result returned from a non-resumable upload. + * @public + */ +export declare interface UploadResult { + /** + * Contains the metadata sent back from the server. + */ + readonly metadata: FullMetadata; + /** + * The reference that spawned this upload. + */ + readonly ref: StorageReference; +} + +/** + * Uploads a string to this object's location. + * The upload is not resumable. + * @public + * @param ref - {@link StorageReference} where string should be uploaded. + * @param value - The string to upload. + * @param format - The format of the string to upload. + * @param metadata - Metadata for the string to upload. + * @returns A Promise containing an UploadResult + */ +export declare function uploadString( + ref: StorageReference, + value: string, + format?: StringFormat, + metadata?: UploadMetadata +): Promise; + +/** + * Represents the process of uploading an object. Allows you to monitor and + * manage the upload. + * @public + */ +export declare interface UploadTask { + /** + * Cancels a running task. Has no effect on a complete or failed task. + * @returns True if the cancel had an effect. + */ + cancel(): boolean; + /** + * Equivalent to calling `then(null, onRejected)`. + */ + catch(onRejected: (error: StorageError) => unknown): Promise; + /** + * Listens for events on this task. + * + * Events have three callback functions (referred to as `next`, `error`, and + * `complete`). + * + * If only the event is passed, a function that can be used to register the + * callbacks is returned. Otherwise, the callbacks are passed after the event. + * + * Callbacks can be passed either as three separate arguments or as the + * `next`, `error`, and `complete` properties of an object. Any of the three + * callbacks is optional, as long as at least one is specified. In addition, + * when you add your callbacks, you get a function back. You can call this + * function to unregister the associated callbacks. + * + * @example **Pass callbacks separately or in an object.** + * ```javascript + * var next = function(snapshot) {}; + * var error = function(error) {}; + * var complete = function() {}; + * + * // The first example. + * uploadTask.on( + * firebase.storage.TaskEvent.STATE_CHANGED, + * next, + * error, + * complete); + * + * // This is equivalent to the first example. + * uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, { + * 'next': next, + * 'error': error, + * 'complete': complete + * }); + * + * // This is equivalent to the first example. + * var subscribe = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED); + * subscribe(next, error, complete); + * + * // This is equivalent to the first example. + * var subscribe = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED); + * subscribe({ + * 'next': next, + * 'error': error, + * 'complete': complete + * }); + * ``` + * + * @example **Any callback is optional.** + * ```javascript + * // Just listening for completion, this is legal. + * uploadTask.on( + * firebase.storage.TaskEvent.STATE_CHANGED, + * null, + * null, + * function() { + * console.log('upload complete!'); + * }); + * + * // Just listening for progress/state changes, this is legal. + * uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, function(snapshot) { + * var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100; + * console.log(percent + "% done"); + * }); + * + * // This is also legal. + * uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, { + * 'complete': function() { + * console.log('upload complete!'); + * } + * }); + * ``` + * + * @example **Use the returned function to remove callbacks.** + * ```javascript + * var unsubscribe = uploadTask.on( + * firebase.storage.TaskEvent.STATE_CHANGED, + * function(snapshot) { + * var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100; + * console.log(percent + "% done"); + * // Stop after receiving one update. + * unsubscribe(); + * }); + * + * // This code is equivalent to the above. + * var handle = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED); + * unsubscribe = handle(function(snapshot) { + * var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100; + * console.log(percent + "% done"); + * // Stop after receiving one update. + * unsubscribe(); + * }); + * ``` + * + * @param event - The type of event to listen for. + * @param nextOrObserver - + * The `next` function, which gets called for each item in + * the event stream, or an observer object with some or all of these three + * properties (`next`, `error`, `complete`). + * @param error - A function that gets called with a `StorageError` + * if the event stream ends due to an error. + * @param completed - A function that gets called if the + * event stream ends normally. + * @returns + * If only the event argument is passed, returns a function you can use to + * add callbacks (see the examples above). If more than just the event + * argument is passed, returns a function you can call to unregister the + * callbacks. + */ + on( + event: TaskEvent, + nextOrObserver?: + | StorageObserver + | null + | ((snapshot: UploadTaskSnapshot) => unknown), + error?: ((a: StorageError) => unknown) | null, + complete?: Unsubscribe | null + ): Unsubscribe | Subscribe; + /** + * Pauses a currently running task. Has no effect on a paused or failed task. + * @returns True if the operation took effect, false if ignored. + */ + pause(): boolean; + /** + * Resumes a paused task. Has no effect on a currently running or failed task. + * @returns True if the operation took effect, false if ignored. + */ + resume(): boolean; + /** + * A snapshot of the current task state. + */ + snapshot: UploadTaskSnapshot; + /** + * This object behaves like a Promise, and resolves with its snapshot data + * when the upload completes. + * @param onFulfilled - The fulfillment callback. Promise chaining works as normal. + * @param onRejected - The rejection callback. + */ + then( + onFulfilled?: ((snapshot: UploadTaskSnapshot) => unknown) | null, + onRejected?: ((error: StorageError) => unknown) | null + ): Promise; +} + +/* Excluded from this release type: _UploadTask */ + +/** + * Holds data about the current state of the upload task. + * @public + */ +export declare interface UploadTaskSnapshot { + /** + * The number of bytes that have been successfully uploaded so far. + */ + bytesTransferred: number; + /** + * Before the upload completes, contains the metadata sent to the server. + * After the upload completes, contains the metadata sent back from the server. + */ + metadata: FullMetadata; + /** + * The reference that spawned this snapshot's upload task. + */ + ref: StorageReference; + /** + * The current state of the task. + */ + state: TaskState; + /** + * The task of which this is a snapshot. + */ + task: UploadTask; + /** + * The total number of bytes to be uploaded. + */ + totalBytes: number; +} + +/** + * Type for url params stored in RequestInfo. + */ +declare interface UrlParams { + [name: string]: string | number; +} + +export {}; diff --git a/repo-scripts/prune-dts/tests/storage-public.output.d.ts b/repo-scripts/prune-dts/tests/storage-public.output.d.ts new file mode 100644 index 00000000000..10b4c2a5237 --- /dev/null +++ b/repo-scripts/prune-dts/tests/storage-public.output.d.ts @@ -0,0 +1,796 @@ +/** + * Cloud Storage for Firebase + * + * @packageDocumentation + */ +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { CompleteFn } from '@firebase/util'; +import { EmulatorMockTokenOptions } from '@firebase/util'; +import { FirebaseApp } from '@firebase/app'; +import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; +import { FirebaseError } from '@firebase/util'; +import { NextFn } from '@firebase/util'; +import { Provider } from '@firebase/component'; +import { Subscribe } from '@firebase/util'; +import { Unsubscribe } from '@firebase/util'; +/** + * Modify this {@link FirebaseStorage} instance to communicate with the Cloud Storage emulator. + * + * @param storage - The {@link FirebaseStorage} instance + * @param host - The emulator host (ex: localhost) + * @param port - The emulator port (ex: 5001) + * @param options - Emulator options. `options.mockUserToken` is the mock auth + * token to use for unit testing Security Rules. + * @public + */ +export declare function connectStorageEmulator( + storage: FirebaseStorage, + host: string, + port: number, + options?: { + mockUserToken?: EmulatorMockTokenOptions | string; + } +): void; +/* Excluded from this release type: _dataFromString */ +/** + * Deletes the object at this location. + * @public + * @param ref - {@link StorageReference} for object to delete. + * @returns A `Promise` that resolves if the deletion succeeds. + */ +export declare function deleteObject(ref: StorageReference): Promise; +export { EmulatorMockTokenOptions }; +/* Excluded from this release type: _FbsBlob */ +/* Excluded from this release type: _FirebaseService */ +/** + * A Firebase Storage instance. + * @public + */ +export declare interface FirebaseStorage { + /** + * The {@link @firebase/app#FirebaseApp} associated with this `FirebaseStorage` instance. + */ + readonly app: FirebaseApp; + /** + * The maximum time to retry uploads in milliseconds. + */ + maxUploadRetryTime: number; + /** + * The maximum time to retry operations other than uploads or downloads in + * milliseconds. + */ + maxOperationRetryTime: number; +} +/* Excluded from this release type: _FirebaseStorageImpl */ +/** + * The full set of object metadata, including read-only properties. + * @public + */ +export declare interface FullMetadata extends UploadMetadata { + /** + * The bucket this object is contained in. + */ + bucket: string; + /** + * The full path of this object. + */ + fullPath: string; + /** + * The object's generation. + * {@link https://cloud.google.com/storage/docs/metadata#generation-number} + */ + generation: string; + /** + * The object's metageneration. + * {@link https://cloud.google.com/storage/docs/metadata#generation-number} + */ + metageneration: string; + /** + * The short name of this object, which is the last component of the full path. + * For example, if fullPath is 'full/path/image.png', name is 'image.png'. + */ + name: string; + /** + * The size of this object, in bytes. + */ + size: number; + /** + * A date string representing when this object was created. + */ + timeCreated: string; + /** + * A date string representing when this object was last updated. + */ + updated: string; + /** + * Tokens to allow access to the download URL. + */ + downloadTokens: string[] | undefined; + /** + * `StorageReference` associated with this upload. + */ + ref?: StorageReference | undefined; +} +/** + * Downloads the data at the object's location. Returns an error if the object + * is not found. + * + * To use this functionality, you have to whitelist your app's origin in your + * Cloud Storage bucket. See also + * https://cloud.google.com/storage/docs/configuring-cors + * + * This API is not available in Node. + * + * @public + * @param ref - StorageReference where data should be downloaded. + * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to + * retrieve. + * @returns A Promise that resolves with a Blob containing the object's bytes + */ +export declare function getBlob( + ref: StorageReference, + maxDownloadSizeBytes?: number +): Promise; +/** + * Downloads the data at the object's location. Returns an error if the object + * is not found. + * + * To use this functionality, you have to whitelist your app's origin in your + * Cloud Storage bucket. See also + * https://cloud.google.com/storage/docs/configuring-cors + * + * @public + * @param ref - StorageReference where data should be downloaded. + * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to + * retrieve. + * @returns A Promise containing the object's bytes + */ +export declare function getBytes( + ref: StorageReference, + maxDownloadSizeBytes?: number +): Promise; +/* Excluded from this release type: _getChild */ +/** + * Returns the download URL for the given {@link StorageReference}. + * @public + * @param ref - {@link StorageReference} to get the download URL for. + * @returns A `Promise` that resolves with the download + * URL for this object. + */ +export declare function getDownloadURL(ref: StorageReference): Promise; +/** + * A `Promise` that resolves with the metadata for this object. If this + * object doesn't exist or metadata cannot be retrieved, the promise is + * rejected. + * @public + * @param ref - {@link StorageReference} to get metadata from. + */ +export declare function getMetadata( + ref: StorageReference +): Promise; +/** + * Gets a {@link FirebaseStorage} instance for the given Firebase app. + * @public + * @param app - Firebase app to get {@link FirebaseStorage} instance for. + * @param bucketUrl - The gs:// url to your Firebase Storage Bucket. + * If not passed, uses the app's default Storage Bucket. + * @returns A {@link FirebaseStorage} instance. + */ +export declare function getStorage( + app?: FirebaseApp, + bucketUrl?: string +): FirebaseStorage; +/** + * Downloads the data at the object's location. Raises an error event if the + * object is not found. + * + * This API is only available in Node. + * + * @public + * @param ref - StorageReference where data should be downloaded. + * @param maxDownloadSizeBytes - If set, the maximum allowed size in bytes to + * retrieve. + * @returns A stream with the object's data as bytes + */ +export declare function getStream( + ref: StorageReference, + maxDownloadSizeBytes?: number +): ReadableStream; +/* Excluded from this release type: _invalidArgument */ +/* Excluded from this release type: _invalidRootOperation */ +/** + * List items (files) and prefixes (folders) under this storage reference. + * + * List API is only available for Firebase Rules Version 2. + * + * GCS is a key-blob store. Firebase Storage imposes the semantic of '/' + * delimited folder structure. + * Refer to GCS's List API if you want to learn more. + * + * To adhere to Firebase Rules's Semantics, Firebase Storage does not + * support objects whose paths end with "/" or contain two consecutive + * "/"s. Firebase Storage List API will filter these unsupported objects. + * list() may fail if there are too many unsupported objects in the bucket. + * @public + * + * @param ref - {@link StorageReference} to get list from. + * @param options - See {@link ListOptions} for details. + * @returns A `Promise` that resolves with the items and prefixes. + * `prefixes` contains references to sub-folders and `items` + * contains references to objects in this folder. `nextPageToken` + * can be used to get the rest of the results. + */ +export declare function list( + ref: StorageReference, + options?: ListOptions +): Promise; +/** + * List all items (files) and prefixes (folders) under this storage reference. + * + * This is a helper method for calling list() repeatedly until there are + * no more results. The default pagination size is 1000. + * + * Note: The results may not be consistent if objects are changed while this + * operation is running. + * + * Warning: `listAll` may potentially consume too many resources if there are + * too many results. + * @public + * @param ref - {@link StorageReference} to get list from. + * + * @returns A `Promise` that resolves with all the items and prefixes under + * the current storage reference. `prefixes` contains references to + * sub-directories and `items` contains references to objects in this + * folder. `nextPageToken` is never returned. + */ +export declare function listAll(ref: StorageReference): Promise; +/** + * The options `list()` accepts. + * @public + */ +export declare interface ListOptions { + /** + * If set, limits the total number of `prefixes` and `items` to return. + * The default and maximum maxResults is 1000. + */ + maxResults?: number | null; + /** + * The `nextPageToken` from a previous call to `list()`. If provided, + * listing is resumed from the previous position. + */ + pageToken?: string | null; +} +/** + * Result returned by list(). + * @public + */ +export declare interface ListResult { + /** + * References to prefixes (sub-folders). You can call list() on them to + * get its contents. + * + * Folders are implicit based on '/' in the object paths. + * For example, if a bucket has two objects '/a/b/1' and '/a/b/2', list('/a') + * will return '/a/b' as a prefix. + */ + prefixes: StorageReference[]; + /** + * Objects in this directory. + * You can call getMetadata() and getDownloadUrl() on them. + */ + items: StorageReference[]; + /** + * If set, there might be more results for this list. Use this token to resume the list. + */ + nextPageToken?: string; +} +/** + * Returns a {@link StorageReference} for the given url. + * @param storage - {@link FirebaseStorage} instance. + * @param url - URL. If empty, returns root reference. + * @public + */ +export declare function ref( + storage: FirebaseStorage, + url?: string +): StorageReference; +/** + * Returns a {@link StorageReference} for the given path in the + * default bucket. + * @param storageOrRef - {@link FirebaseStorage} or {@link StorageReference}. + * @param pathOrUrlStorage - path. If empty, returns root reference (if {@link FirebaseStorage} + * instance provided) or returns same reference (if {@link StorageReference} provided). + * @public + */ +export declare function ref( + storageOrRef: FirebaseStorage | StorageReference, + path?: string +): StorageReference; +/** + * Object metadata that can be set at any time. + * @public + */ +export declare interface SettableMetadata { + /** + * Served as the 'Cache-Control' header on object download. + */ + cacheControl?: string | undefined; + /** + * Served as the 'Content-Disposition' header on object download. + */ + contentDisposition?: string | undefined; + /** + * Served as the 'Content-Encoding' header on object download. + */ + contentEncoding?: string | undefined; + /** + * Served as the 'Content-Language' header on object download. + */ + contentLanguage?: string | undefined; + /** + * Served as the 'Content-Type' header on object download. + */ + contentType?: string | undefined; + /** + * Additional user-defined custom metadata. + */ + customMetadata?: + | { + [key: string]: string; + } + | undefined; +} +/** + * An error returned by the Firebase Storage SDK. + * @public + */ +export declare class StorageError extends FirebaseError { + private status_; + /** + * Stores custom error data unique to the `StorageError`. + */ + customData: { + serverResponse: string | null; + }; + /** + * @param code - A `StorageErrorCode` string to be prefixed with 'storage/' and + * added to the end of the message. + * @param message - Error message. + * @param status_ - Corresponding HTTP Status Code + */ + constructor(code: StorageErrorCode, message: string, status_?: number); + get status(): number; + set status(status: number); + /** + * Optional response message that was added by the server. + */ + get serverResponse(): null | string; + set serverResponse(serverResponse: string | null); +} +/** + * @public + * Error codes that can be attached to `StorageError` objects. + */ +export declare enum StorageErrorCode { + UNKNOWN = 'unknown', + OBJECT_NOT_FOUND = 'object-not-found', + BUCKET_NOT_FOUND = 'bucket-not-found', + PROJECT_NOT_FOUND = 'project-not-found', + QUOTA_EXCEEDED = 'quota-exceeded', + UNAUTHENTICATED = 'unauthenticated', + UNAUTHORIZED = 'unauthorized', + UNAUTHORIZED_APP = 'unauthorized-app', + RETRY_LIMIT_EXCEEDED = 'retry-limit-exceeded', + INVALID_CHECKSUM = 'invalid-checksum', + CANCELED = 'canceled', + INVALID_EVENT_NAME = 'invalid-event-name', + INVALID_URL = 'invalid-url', + INVALID_DEFAULT_BUCKET = 'invalid-default-bucket', + NO_DEFAULT_BUCKET = 'no-default-bucket', + CANNOT_SLICE_BLOB = 'cannot-slice-blob', + SERVER_FILE_WRONG_SIZE = 'server-file-wrong-size', + NO_DOWNLOAD_URL = 'no-download-url', + INVALID_ARGUMENT = 'invalid-argument', + INVALID_ARGUMENT_COUNT = 'invalid-argument-count', + APP_DELETED = 'app-deleted', + INVALID_ROOT_OPERATION = 'invalid-root-operation', + INVALID_FORMAT = 'invalid-format', + INTERNAL_ERROR = 'internal-error', + UNSUPPORTED_ENVIRONMENT = 'unsupported-environment' +} +/** + * A stream observer for Firebase Storage. + * @public + */ +export declare interface StorageObserver { + next?: NextFn | null; + error?: (error: StorageError) => void | null; + complete?: CompleteFn | null; +} +/** + * Represents a reference to a Google Cloud Storage object. Developers can + * upload, download, and delete objects, as well as get/set object metadata. + * @public + */ +export declare interface StorageReference { + /** + * Returns a gs:// URL for this object in the form + * `gs://///` + * @returns The gs:// URL. + */ + toString(): string; + /** + * A reference to the root of this object's bucket. + */ + root: StorageReference; + /** + * The name of the bucket containing this reference's object. + */ + bucket: string; + /** + * The full path of this object. + */ + fullPath: string; + /** + * The short name of this object, which is the last component of the full path. + * For example, if fullPath is 'full/path/image.png', name is 'image.png'. + */ + name: string; + /** + * The {@link FirebaseStorage} instance associated with this reference. + */ + storage: FirebaseStorage; + /** + * A reference pointing to the parent location of this reference, or null if + * this reference is the root. + */ + parent: StorageReference | null; +} +/** + * @license + * Copyright 2017 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. + */ +/** + * An enumeration of the possible string formats for upload. + * @public + */ +export declare type StringFormat = + (typeof StringFormat)[keyof typeof StringFormat]; +/** + * An enumeration of the possible string formats for upload. + * @public + */ +export declare const StringFormat: { + /** + * Indicates the string should be interpreted "raw", that is, as normal text. + * The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte + * sequence. + * Example: The string 'Hello! \\ud83d\\ude0a' becomes the byte sequence + * 48 65 6c 6c 6f 21 20 f0 9f 98 8a + */ + readonly RAW: 'raw'; + /** + * Indicates the string should be interpreted as base64-encoded data. + * Padding characters (trailing '='s) are optional. + * Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence + * ad 69 8e fb e1 3a b7 bf eb 97 + */ + readonly BASE64: 'base64'; + /** + * Indicates the string should be interpreted as base64url-encoded data. + * Padding characters (trailing '='s) are optional. + * Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence + * ad 69 8e fb e1 3a b7 bf eb 97 + */ + readonly BASE64URL: 'base64url'; + /** + * Indicates the string is a data URL, such as one obtained from + * canvas.toDataURL(). + * Example: the string 'data:application/octet-stream;base64,aaaa' + * becomes the byte sequence + * 69 a6 9a + * (the content-type "application/octet-stream" is also applied, but can + * be overridden in the metadata object). + */ + readonly DATA_URL: 'data_url'; +}; +/** + * An event that is triggered on a task. + * @public + */ +export declare type TaskEvent = 'state_changed'; +/* Excluded from this release type: _TaskEvent */ +/** + * Represents the current state of a running upload. + * @public + */ +export declare type TaskState = + | 'running' + | 'paused' + | 'success' + | 'canceled' + | 'error'; +/** + * Updates the metadata for this object. + * @public + * @param ref - {@link StorageReference} to update metadata for. + * @param metadata - The new metadata for the object. + * Only values that have been explicitly set will be changed. Explicitly + * setting a value to null will remove the metadata. + * @returns A `Promise` that resolves with the new metadata for this object. + */ +export declare function updateMetadata( + ref: StorageReference, + metadata: SettableMetadata +): Promise; +/** + * Uploads data to this object's location. + * The upload is not resumable. + * @public + * @param ref - {@link StorageReference} where data should be uploaded. + * @param data - The data to upload. + * @param metadata - Metadata for the data to upload. + * @returns A Promise containing an UploadResult + */ +export declare function uploadBytes( + ref: StorageReference, + data: Blob | Uint8Array | ArrayBuffer, + metadata?: UploadMetadata +): Promise; +/** + * Uploads data to this object's location. + * The upload can be paused and resumed, and exposes progress updates. + * @public + * @param ref - {@link StorageReference} where data should be uploaded. + * @param data - The data to upload. + * @param metadata - Metadata for the data to upload. + * @returns An UploadTask + */ +export declare function uploadBytesResumable( + ref: StorageReference, + data: Blob | Uint8Array | ArrayBuffer, + metadata?: UploadMetadata +): UploadTask; +/** + * Object metadata that can be set at upload. + * @public + */ +export declare interface UploadMetadata extends SettableMetadata { + /** + * A Base64-encoded MD5 hash of the object being uploaded. + */ + md5Hash?: string | undefined; +} +/** + * Result returned from a non-resumable upload. + * @public + */ +export declare interface UploadResult { + /** + * Contains the metadata sent back from the server. + */ + readonly metadata: FullMetadata; + /** + * The reference that spawned this upload. + */ + readonly ref: StorageReference; +} +/** + * Uploads a string to this object's location. + * The upload is not resumable. + * @public + * @param ref - {@link StorageReference} where string should be uploaded. + * @param value - The string to upload. + * @param format - The format of the string to upload. + * @param metadata - Metadata for the string to upload. + * @returns A Promise containing an UploadResult + */ +export declare function uploadString( + ref: StorageReference, + value: string, + format?: StringFormat, + metadata?: UploadMetadata +): Promise; +/** + * Represents the process of uploading an object. Allows you to monitor and + * manage the upload. + * @public + */ +export declare interface UploadTask { + /** + * Cancels a running task. Has no effect on a complete or failed task. + * @returns True if the cancel had an effect. + */ + cancel(): boolean; + /** + * Equivalent to calling `then(null, onRejected)`. + */ + catch(onRejected: (error: StorageError) => unknown): Promise; + /** + * Listens for events on this task. + * + * Events have three callback functions (referred to as `next`, `error`, and + * `complete`). + * + * If only the event is passed, a function that can be used to register the + * callbacks is returned. Otherwise, the callbacks are passed after the event. + * + * Callbacks can be passed either as three separate arguments or as the + * `next`, `error`, and `complete` properties of an object. Any of the three + * callbacks is optional, as long as at least one is specified. In addition, + * when you add your callbacks, you get a function back. You can call this + * function to unregister the associated callbacks. + * + * @example **Pass callbacks separately or in an object.** + * ```javascript + * var next = function(snapshot) {}; + * var error = function(error) {}; + * var complete = function() {}; + * + * // The first example. + * uploadTask.on( + * firebase.storage.TaskEvent.STATE_CHANGED, + * next, + * error, + * complete); + * + * // This is equivalent to the first example. + * uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, { + * 'next': next, + * 'error': error, + * 'complete': complete + * }); + * + * // This is equivalent to the first example. + * var subscribe = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED); + * subscribe(next, error, complete); + * + * // This is equivalent to the first example. + * var subscribe = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED); + * subscribe({ + * 'next': next, + * 'error': error, + * 'complete': complete + * }); + * ``` + * + * @example **Any callback is optional.** + * ```javascript + * // Just listening for completion, this is legal. + * uploadTask.on( + * firebase.storage.TaskEvent.STATE_CHANGED, + * null, + * null, + * function() { + * console.log('upload complete!'); + * }); + * + * // Just listening for progress/state changes, this is legal. + * uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, function(snapshot) { + * var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100; + * console.log(percent + "% done"); + * }); + * + * // This is also legal. + * uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, { + * 'complete': function() { + * console.log('upload complete!'); + * } + * }); + * ``` + * + * @example **Use the returned function to remove callbacks.** + * ```javascript + * var unsubscribe = uploadTask.on( + * firebase.storage.TaskEvent.STATE_CHANGED, + * function(snapshot) { + * var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100; + * console.log(percent + "% done"); + * // Stop after receiving one update. + * unsubscribe(); + * }); + * + * // This code is equivalent to the above. + * var handle = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED); + * unsubscribe = handle(function(snapshot) { + * var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100; + * console.log(percent + "% done"); + * // Stop after receiving one update. + * unsubscribe(); + * }); + * ``` + * + * @param event - The type of event to listen for. + * @param nextOrObserver - + * The `next` function, which gets called for each item in + * the event stream, or an observer object with some or all of these three + * properties (`next`, `error`, `complete`). + * @param error - A function that gets called with a `StorageError` + * if the event stream ends due to an error. + * @param completed - A function that gets called if the + * event stream ends normally. + * @returns + * If only the event argument is passed, returns a function you can use to + * add callbacks (see the examples above). If more than just the event + * argument is passed, returns a function you can call to unregister the + * callbacks. + */ + on( + event: TaskEvent, + nextOrObserver?: + | StorageObserver + | null + | ((snapshot: UploadTaskSnapshot) => unknown), + error?: ((a: StorageError) => unknown) | null, + complete?: Unsubscribe | null + ): Unsubscribe | Subscribe; + /** + * Pauses a currently running task. Has no effect on a paused or failed task. + * @returns True if the operation took effect, false if ignored. + */ + pause(): boolean; + /** + * Resumes a paused task. Has no effect on a currently running or failed task. + * @returns True if the operation took effect, false if ignored. + */ + resume(): boolean; + /** + * A snapshot of the current task state. + */ + snapshot: UploadTaskSnapshot; + /** + * This object behaves like a Promise, and resolves with its snapshot data + * when the upload completes. + * @param onFulfilled - The fulfillment callback. Promise chaining works as normal. + * @param onRejected - The rejection callback. + */ + then( + onFulfilled?: ((snapshot: UploadTaskSnapshot) => unknown) | null, + onRejected?: ((error: StorageError) => unknown) | null + ): Promise; +} +/* Excluded from this release type: _UploadTask */ +/** + * Holds data about the current state of the upload task. + * @public + */ +export declare interface UploadTaskSnapshot { + /** + * The number of bytes that have been successfully uploaded so far. + */ + bytesTransferred: number; + /** + * Before the upload completes, contains the metadata sent to the server. + * After the upload completes, contains the metadata sent back from the server. + */ + metadata: FullMetadata; + /** + * The reference that spawned this snapshot's upload task. + */ + ref: StorageReference; + /** + * The current state of the task. + */ + state: TaskState; + /** + * The task of which this is a snapshot. + */ + task: UploadTask; + /** + * The total number of bytes to be uploaded. + */ + totalBytes: number; +} +export {}; diff --git a/repo-scripts/prune-dts/tsconfig.json b/repo-scripts/prune-dts/tsconfig.json index 236dfb5b9d8..14618a434b0 100644 --- a/repo-scripts/prune-dts/tsconfig.json +++ b/repo-scripts/prune-dts/tsconfig.json @@ -8,7 +8,8 @@ "target": "es2017", "esModuleInterop": true, "declaration": true, - "strict": true + "strict": true, + "sourceMap": true }, "exclude": ["dist/**/*"] } diff --git a/repo-scripts/size-analysis/package.json b/repo-scripts/size-analysis/package.json index 191901f5a6c..ed133f94fff 100644 --- a/repo-scripts/size-analysis/package.json +++ b/repo-scripts/size-analysis/package.json @@ -32,17 +32,17 @@ "child-process-promise": "2.2.1", "memfs": "3.5.3", "tmp": "0.2.1", - "typescript": "4.7.4", + "typescript": "5.5.4", "terser": "5.16.1", "yargs": "17.7.2", - "@firebase/util": "1.10.0", + "@firebase/util": "1.10.1", "gzip-size": "6.0.0", "glob": "7.2.3" }, "license": "Apache-2.0", "devDependencies": { - "@firebase/logger": "0.4.2", - "@firebase/app": "0.10.11" + "@firebase/logger": "0.4.3", + "@firebase/app": "0.10.15" }, "repository": { "directory": "repo-scripts/size-analysis", @@ -57,5 +57,8 @@ ".ts" ], "reportDir": "./coverage/node" + }, + "engines": { + "node": ">=18.0.0" } } diff --git a/scripts/build/create-overloads.ts b/scripts/build/create-overloads.ts index b3a9ada28e7..eafcf164948 100644 --- a/scripts/build/create-overloads.ts +++ b/scripts/build/create-overloads.ts @@ -149,8 +149,10 @@ function keepPublicFunctionsTransformer( ) { return factory.updateParameterDeclaration( param, - param.decorators, - param.modifiers, + [ + ...(ts.getDecorators(param) || []), + ...(ts.getModifiers(param) || []) + ], param.dotDotDotToken, param.name, param.questionToken, @@ -176,8 +178,7 @@ function keepPublicFunctionsTransformer( overloads.push( factory.updateFunctionDeclaration( node, - node.decorators, - [], + ts.canHaveDecorators(node) ? ts.getDecorators(node) : [], node.asteriskToken, node.name, node.typeParameters, @@ -216,7 +217,6 @@ function keepPublicFunctionsTransformer( // hardcode adding `import { FirebaseApp as FirebaseAppCompat } from '@firebase/app-compat'` const appCompatImport = factory.createImportDeclaration( - undefined, undefined, factory.createImportClause( false, @@ -233,7 +233,6 @@ function keepPublicFunctionsTransformer( ); const importStatement = factory.createImportDeclaration( - undefined, undefined, factory.createImportClause( false, @@ -251,7 +250,6 @@ function keepPublicFunctionsTransformer( factory.createStringLiteral(moduleNameToEnhance) ); const moduleToEnhance = factory.createModuleDeclaration( - undefined, [factory.createModifier(ts.SyntaxKind.DeclareKeyword)], factory.createStringLiteral(moduleNameToEnhance), factory.createModuleBlock(overloads) diff --git a/scripts/ci-test/check-paths.ts b/scripts/ci-test/check-paths.ts index 236e63d310f..d3af878f286 100644 --- a/scripts/ci-test/check-paths.ts +++ b/scripts/ci-test/check-paths.ts @@ -31,7 +31,6 @@ const TOP_LEVEL_FIELDS = [ 'typings', 'react-native', 'cordova', - 'esm5', 'webworker', 'main-esm' ]; diff --git a/scripts/ci-test/testConfig.ts b/scripts/ci-test/testConfig.ts index 5f458a07605..0202c699154 100644 --- a/scripts/ci-test/testConfig.ts +++ b/scripts/ci-test/testConfig.ts @@ -28,11 +28,25 @@ export interface TestConfig { alwaysIncludePackages?: string[]; } +// These tests are flaky on WebkitHeadless for some reason, so skip them. +// TODO (dlarocque): Fix the flakes and remove this +const ignoredWebkitCoreTests = process.env?.BROWSERS?.includes('WebkitHeadless') + ? [ + '@firebase/app-check', + '@firebase/installations', + '@firebase/storage', + '@firebase/storage-compat', + '@firebase/database', + '@firebase/database-compat' + ] + : []; + export const testConfig: { [key: string]: TestConfig | undefined; } = { 'core': { 'ignorePackages': [ + ...ignoredWebkitCoreTests, '@firebase/firestore', '@firebase/firestore-compat', 'firebase-firestore-integration-test', diff --git a/scripts/docgen/docgen.ts b/scripts/docgen/docgen.ts index 3b3b10c8714..113e4a6b339 100644 --- a/scripts/docgen/docgen.ts +++ b/scripts/docgen/docgen.ts @@ -63,6 +63,9 @@ const PREFERRED_PARAMS = [ 'vertexAI' ]; +let authApiReportOriginal: string; +let authApiConfigOriginal: string; + yargs .command( '$0', @@ -98,9 +101,6 @@ yargs process.on('exit', cleanup); process.on('SIGINT', cleanup); -let authApiReportOriginal: string; -let authApiConfigOriginal: string; - function cleanup() { try { // Restore original auth api-extractor.json contents. @@ -194,8 +194,8 @@ async function generateDocs( 'utf8' ); const authApiConfigModified = authApiConfigOriginal.replace( - `"mainEntryPointFilePath": "/dist/esm5/index.d.ts"`, - `"mainEntryPointFilePath": "/dist/esm5/index.doc.d.ts"` + `"mainEntryPointFilePath": "/dist/esm2017/index.d.ts"`, + `"mainEntryPointFilePath": "/dist/esm2017/index.doc.d.ts"` ); try { diff --git a/scripts/emulator-testing/emulators/emulator.ts b/scripts/emulator-testing/emulators/emulator.ts index 6f88c9769e4..f149debca14 100644 --- a/scripts/emulator-testing/emulators/emulator.ts +++ b/scripts/emulator-testing/emulators/emulator.ts @@ -25,7 +25,6 @@ import { ChildProcess } from 'child_process'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; -import fetch from 'node-fetch'; // @ts-ignore import * as tmp from 'tmp'; @@ -57,35 +56,69 @@ export abstract class Emulator { return new Promise((resolve, reject) => { tmp.dir((err: Error | null, dir: string) => { if (err) reject(err); - console.log(`Created temporary directory at [${dir}].`); const filepath: string = path.resolve(dir, this.binaryName); - const writeStream: fs.WriteStream = fs.createWriteStream(filepath); - + const writer = fs.createWriteStream(filepath); console.log(`Downloading emulator from [${this.binaryUrl}] ...`); - fetch(this.binaryUrl).then(resp => { - resp.body - .pipe(writeStream) - .on('finish', () => { - console.log(`Saved emulator binary file to [${filepath}].`); - // Change emulator binary file permission to 'rwxr-xr-x'. - // The execute permission is required for it to be able to start - // with 'java -jar'. - fs.chmod(filepath, 0o755, err => { - if (err) reject(err); - console.log( - `Changed emulator file permissions to 'rwxr-xr-x'.` - ); - this.binaryPath = filepath; - - if (this.copyToCache()) { - console.log(`Cached emulator at ${this.cacheBinaryPath}`); + // Map the DOM's fetch Reader to node's streaming file system + // operations. We will need to access class members `binaryPath` and `copyToCache` after the + // download completes. It's a compilation error to pass `this` into the named function + // `readChunk`, so the download operation is wrapped in a promise that we wait upon. + const downloadPromise = new Promise( + (downloadComplete, downloadFailed) => { + fetch(this.binaryUrl) + .then(resp => { + if (resp.status !== 200 || resp.body === null) { + console.log('Download of emulator failed: ', resp.statusText); + downloadFailed(); + } else { + const reader = resp.body.getReader(); + reader.read().then(function readChunk({ done, value }): any { + if (done) { + console.log('Emulator download is done.'); + writer.close(err => { + if (err) { + downloadFailed( + `Failed to close the downloaded emulator file: ${err}` + ); + } + + console.log('Closed downloaded emulator file.'); + downloadComplete(); + }); + } else { + writer.write(value); + return reader.read().then(readChunk); + } + }); } - resolve(); + }) + .catch(e => { + console.log(`Download of emulator failed: ${e}`); + downloadFailed(); }); - }) - .on('error', reject); - }); + } + ); + + downloadPromise.then( + () => { + // Change emulator binary file permission to 'rwxr-xr-x'. + // The execute permission is required for it to be able to start + // with 'java -jar'. + fs.chmod(filepath, 0o755, err => { + if (err) reject(err); + console.log(`Changed emulator file permissions to 'rwxr-xr-x'.`); + this.binaryPath = filepath; + if (this.copyToCache()) { + console.log(`Cached emulator at ${this.cacheBinaryPath}`); + } + resolve(); + }); + }, + () => { + reject(); + } + ); }); }); } diff --git a/scripts/size_report/report_binary_size.ts b/scripts/size_report/report_binary_size.ts index 444e45dd978..da1ad166702 100644 --- a/scripts/size_report/report_binary_size.ts +++ b/scripts/size_report/report_binary_size.ts @@ -49,7 +49,6 @@ function generateReportForCDNScripts(): Report[] { const compatPkgJson = require(`${firebaseRoot}/compat/package.json`); const special_files = [ - 'firebase-performance-standalone-compat.es2017.js', 'firebase-performance-standalone-compat.js', 'firebase-compat.js' ]; @@ -118,11 +117,9 @@ async function collectBinarySize(pkg: string): Promise { 'main', 'module', 'browser', - 'esm5', 'react-native', 'cordova', - 'lite', - 'lite-esm5' + 'lite' ]; const json = require(pkg); for (const field of fields) { diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 826691796fc..75f1741329a 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -8,7 +8,7 @@ "moduleResolution": "node", "esModuleInterop": true, "resolveJsonModule": true, - "target": "es5", + "target": "es2017", "typeRoots": [ "../node_modules/@types" ], diff --git a/scripts/update_vertexai_responses.sh b/scripts/update_vertexai_responses.sh index 27c32a09ead..101eac90d9f 100755 --- a/scripts/update_vertexai_responses.sh +++ b/scripts/update_vertexai_responses.sh @@ -17,7 +17,7 @@ # This script replaces mock response files for Vertex AI unit tests with a fresh # clone of the shared repository of Vertex AI test data. -RESPONSES_VERSION='v3.*' # The major version of mock responses to use +RESPONSES_VERSION='v5.*' # The major version of mock responses to use REPO_NAME="vertexai-sdk-test-data" REPO_LINK="https://github.com/FirebaseExtended/$REPO_NAME.git" diff --git a/yarn.lock b/yarn.lock index 9a6fab0f336..bd59a038213 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3480,14 +3480,6 @@ dependencies: "@types/node" "*" -"@types/node-fetch@2.6.4": - version "2.6.4" - resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - "@types/node@*", "@types/node@>=10.0.0", "@types/node@^12.7.1": version "12.20.50" resolved "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz" @@ -3498,15 +3490,10 @@ resolved "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz" integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== -"@types/node@16.18.68": - version "16.18.68" - resolved "https://registry.npmjs.org/@types/node/-/node-16.18.68.tgz#3155f64a961b3d8d10246c80657f9a7292e3421a" - integrity sha512-sG3hPIQwJLoewrN7cr0dwEy+yF5nD4D/4FxtQpFciRD/xwUzgD+G05uxZHv5mhfXo4F9Jkp13jjn0CC2q325sg== - -"@types/node@20.8.10": - version "20.8.10" - resolved "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz#a5448b895c753ae929c26ce85cab557c6d4a365e" - integrity sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w== +"@types/node@18.19.57": + version "18.19.57" + resolved "https://registry.npmjs.org/@types/node/-/node-18.19.57.tgz#a075ff6bb71a947d410a9d7ad2b6cb010a0c5230" + integrity sha512-I2ioBd/IPrYDMv9UNR5NlPElOZ68QB7yY5V2EsLtSrTO0LM0PnCEFF9biLWHf5k+sIy4ohueCV9t4gk1AEdlVA== dependencies: undici-types "~5.26.4" @@ -3659,9 +3646,9 @@ integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw== "@types/vinyl@^2.0.4": - version "2.0.6" - resolved "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.6.tgz" - integrity sha512-ayJ0iOCDNHnKpKTgBG6Q6JOnHTj9zFta+3j2b8Ejza0e4cvRyMn0ZoLEmbPrTHe5YYRlDYPvPWVdV4cTaRyH7g== + version "2.0.12" + resolved "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.12.tgz#17642ca9a8ae10f3db018e9f885da4188db4c6e6" + integrity sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw== dependencies: "@types/expect" "^1.20.4" "@types/node" "*" @@ -5525,9 +5512,9 @@ camelcase@^6.0.0, camelcase@^6.2.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001259, caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001587: - version "1.0.30001611" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001611.tgz" - integrity sha512-19NuN1/3PjA3QI8Eki55N8my4LzfkMCRLgCVfrl/slbSAchQfV0+GwjPrK3rq37As4UCLlM/DHajbKkAqbv92Q== + version "1.0.30001669" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz" + integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== cardinal@^2.1.1: version "2.1.1" @@ -8512,15 +8499,6 @@ form-data@^2.5.0: combined-stream "^1.0.6" mime-types "^2.1.12" -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz" @@ -8653,6 +8631,11 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +fsevents@2.3.2, fsevents@^2.3.2, fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + fsevents@^1.2.7: version "1.2.13" resolved "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz" @@ -8661,11 +8644,6 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@^2.3.2, fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - ftp@^0.3.10: version "0.3.10" resolved "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz" @@ -11339,11 +11317,6 @@ karma-mocha@2.0.1: dependencies: minimist "^1.2.3" -karma-safari-launcher@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/karma-safari-launcher/-/karma-safari-launcher-1.0.0.tgz" - integrity sha1-lpgqLMR9BmquccVTursoMZEVos4= - karma-sourcemap-loader@0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.4.0.tgz" @@ -11414,6 +11387,14 @@ karma-typescript@5.5.4: util "^0.12.1" vm-browserify "^1.1.2" +karma-webkit-launcher@2.6.0: + version "2.6.0" + resolved "https://registry.npmjs.org/karma-webkit-launcher/-/karma-webkit-launcher-2.6.0.tgz#2e3ba096b69139e608d9ce6e89816a17f358b700" + integrity sha512-IDURopxJ1SbuqnvPaE+lP2qiP2Ie7I+ojwJRBpr0tfGwObsaVdjMkUkmZ1BcXUtYRt5ogs9cyCH2Wb9sNv0BbQ== + dependencies: + is-ci "^3.0.1" + uuid "^10.0.0" + karma-webpack@5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz" @@ -12859,13 +12840,6 @@ node-emoji@^1.11.0: dependencies: lodash "^4.17.21" -node-fetch@2.6.7, node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - node-fetch@^2.5.0, node-fetch@^2.6.1: version "2.6.5" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz" @@ -12873,6 +12847,13 @@ node-fetch@^2.5.0, node-fetch@^2.6.1: dependencies: whatwg-url "^5.0.0" +node-fetch@^2.6.7: + version "2.6.7" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + 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" @@ -14119,6 +14100,20 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +playwright-core@1.46.1: + version "1.46.1" + resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.46.1.tgz#28f3ab35312135dda75b0c92a3e5c0e7edb9cc8b" + integrity sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A== + +playwright@1.46.1: + version "1.46.1" + resolved "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz#ea562bc48373648e10420a10c16842f0b227c218" + integrity sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng== + dependencies: + playwright-core "1.46.1" + optionalDependencies: + fsevents "2.3.2" + plugin-error@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz" @@ -16986,6 +16981,11 @@ ts-api-utils@^1.0.1, ts-api-utils@^1.3.0: resolved "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== +ts-essentials@10.0.2: + version "10.0.2" + resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-10.0.2.tgz#8c7aa74ed79580ffe49df5ca28d06cc6bea0ff3c" + integrity sha512-Xwag0TULqriaugXqVdDiGZ5wuZpqABZlpwQ2Ho4GDyiu/R2Xjkp/9+zcFxL7uzeLl/QCPrflnvpVYyS3ouT7Zw== + ts-essentials@9.3.0: version "9.3.0" resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-9.3.0.tgz" @@ -17290,15 +17290,10 @@ typescript@3.7.x: resolved "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz" integrity sha512-MmQdgo/XenfZPvVLtKZOq9jQQvzaUAUpcKW8Z43x9B2fOm4S5g//tPtMweZUIP+SoBqrVPEIm+dJeQ9dfO0QdA== -typescript@4.2.2: - version "4.2.2" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.2.tgz" - integrity sha512-tbb+NVrLfnsJy3M59lsDgrzWIflR4d4TIUjz+heUnHZwdF7YsrMTKoRERiIvI2lvBG95dfpLxB21WZhys1bgaQ== - -typescript@4.7.4: - version "4.7.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== +typescript@5.5.4: + version "5.5.4" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" + integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== typescript@~4.1.3: version "4.1.6" @@ -17395,11 +17390,6 @@ undici-types@~5.26.4: resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici@6.19.7: - version "6.19.7" - resolved "https://registry.npmjs.org/undici/-/undici-6.19.7.tgz#7d4cf26dc689838aa8b6753a3c5c4288fc1e0216" - integrity sha512-HR3W/bMGPSr90i8AAp2C4DM3wChFdJPLrWYpIS++LxS8K+W535qftjt+4MyjNYHeWabMj1nvtmLIi7l++iq91A== - unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" @@ -17657,6 +17647,11 @@ utils-merge@1.0.1: resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= +uuid@^10.0.0: + version "10.0.0" + resolved "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294" + integrity sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ== + uuid@^3.3.2, uuid@^3.3.3: version "3.4.0" resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz"