@firebase/firestore 4.7.11-firebase-studio-sdk-integration.226be0bb1 → 4.7.11-firebase-studio-sdk-integration.9de25069c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,11 +2,11 @@ import { _getProvider, getApp, _removeServiceInstance, _registerComponent, regis
2
2
  import { Component } from '@firebase/component';
3
3
  import { Logger, LogLevel } from '@firebase/logger';
4
4
  import { inspect } from 'util';
5
- import { FirebaseError, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, testConnectionAlive, deepEqual, createMockUserToken, getModularInstance } from '@firebase/util';
5
+ import { FirebaseError, getDefaultEmulatorHostnameAndPort, isCloudWorkstation, pingServer, deepEqual, createMockUserToken, getModularInstance } from '@firebase/util';
6
6
  import { Integer } from '@firebase/webchannel-wrapper/bloom-blob';
7
7
  import { randomBytes as randomBytes$1 } from 'crypto';
8
8
 
9
- const version$1 = "4.7.11-firebase-studio-sdk-integration.226be0bb1";
9
+ const version$1 = "4.7.11-firebase-studio-sdk-integration.9de25069c";
10
10
 
11
11
  /**
12
12
  * @license
@@ -59,7 +59,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
59
59
  User.FIRST_PARTY = new User('first-party-uid');
60
60
  User.MOCK_USER = new User('mock-user');
61
61
 
62
- const version = "11.6.1-firebase-studio-sdk-integration.226be0bb1";
62
+ const version = "11.6.1-firebase-studio-sdk-integration.9de25069c";
63
63
 
64
64
  /**
65
65
  * @license
@@ -1554,7 +1554,9 @@ class RestConnection {
1554
1554
  'x-goog-request-params': this.requestParams
1555
1555
  };
1556
1556
  this.modifyHeadersForRequest(headers, authToken, appCheckToken);
1557
- return this.performRPCRequest(rpcName, url, headers, req, this.databaseInfo.isUsingEmulator).then(response => {
1557
+ const { host } = new URL(url);
1558
+ const forwardCredentials = isCloudWorkstation(host);
1559
+ return this.performRPCRequest(rpcName, url, headers, req, forwardCredentials).then(response => {
1558
1560
  logDebug(LOG_TAG$3, `Received RPC '${rpcName}' ${streamId}: `, response);
1559
1561
  return response;
1560
1562
  }, (err) => {
@@ -1776,7 +1778,7 @@ class FetchConnection extends RestConnection {
1776
1778
  openStream(rpcName, token) {
1777
1779
  throw new Error('Not supported by FetchConnection');
1778
1780
  }
1779
- async performRPCRequest(rpcName, url, headers, body, isUsingEmulator) {
1781
+ async performRPCRequest(rpcName, url, headers, body, forwardCredentials) {
1780
1782
  var _a;
1781
1783
  const requestJson = JSON.stringify(body);
1782
1784
  let response;
@@ -1786,7 +1788,7 @@ class FetchConnection extends RestConnection {
1786
1788
  headers,
1787
1789
  body: requestJson
1788
1790
  };
1789
- if (isCloudWorkstation(new URL(url).host) && isUsingEmulator) {
1791
+ if (forwardCredentials) {
1790
1792
  fetchArgs.credentials = 'include';
1791
1793
  }
1792
1794
  response = await fetch(url, fetchArgs);
@@ -5926,7 +5928,7 @@ function connectFirestoreEmulator(firestore, host, port, options = {}) {
5926
5928
  const existingConfig = Object.assign(Object.assign({}, settings), { emulatorOptions: firestore._getEmulatorOptions() });
5927
5929
  const newHostSetting = `${host}:${port}`;
5928
5930
  if (useSsl) {
5929
- void testConnectionAlive(`https://${newHostSetting}`);
5931
+ void pingServer(`https://${newHostSetting}`);
5930
5932
  }
5931
5933
  if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) {
5932
5934
  logWarn('Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' +