@firebase/database-compat 0.3.1 → 0.3.2-20230201003102

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @firebase/database-compat
2
2
 
3
+ ## 0.3.2-20230201003102
4
+
5
+ ### Patch Changes
6
+
7
+ - [`49ee786f2`](https://github.com/firebase/firebase-js-sdk/commit/49ee786f2b022e65aef45693e1a8b546d889ec10) [#6912](https://github.com/firebase/firebase-js-sdk/pull/6912) (fixes [#4603](https://github.com/firebase/firebase-js-sdk/issues/4603)) - Fixed issue where hostname set by `connectDatabaseEmulator` was being overridden by longpolling response
8
+
9
+ - [`0bab0b7a7`](https://github.com/firebase/firebase-js-sdk/commit/0bab0b7a786d1563bf665904c7097d1fe06efce5) [#6981](https://github.com/firebase/firebase-js-sdk/pull/6981) - Added browser CJS entry points (expected by Jest when using JSDOM mode).
10
+
11
+ - Updated dependencies [[`49ee786f2`](https://github.com/firebase/firebase-js-sdk/commit/49ee786f2b022e65aef45693e1a8b546d889ec10), [`0bab0b7a7`](https://github.com/firebase/firebase-js-sdk/commit/0bab0b7a786d1563bf665904c7097d1fe06efce5)]:
12
+ - @firebase/database@0.14.2-20230201003102
13
+ - @firebase/util@1.9.1-20230201003102
14
+ - @firebase/component@0.6.2-20230201003102
15
+ - @firebase/database-types@0.10.2-20230201003102
16
+
3
17
  ## 0.3.1
4
18
 
5
19
  ### Patch Changes
@@ -5,7 +5,7 @@ import { errorPrefix, validateArgCount, validateCallback, validateContextObject,
5
5
  import { Logger } from '@firebase/logger';
6
6
 
7
7
  const name = "@firebase/database-compat";
8
- const version = "0.3.1";
8
+ const version = "0.3.2-20230201003102";
9
9
 
10
10
  /**
11
11
  * @license
@@ -6,7 +6,7 @@ import { __extends } from 'tslib';
6
6
  import { Logger } from '@firebase/logger';
7
7
 
8
8
  var name = "@firebase/database-compat";
9
- var version = "0.3.1";
9
+ var version = "0.3.2-20230201003102";
10
10
 
11
11
  /**
12
12
  * @license
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
13
13
 
14
14
  var name = "@firebase/database-compat";
15
- var version = "0.3.1";
15
+ var version = "0.3.2-20230201003102";
16
16
 
17
17
  /**
18
18
  * @license
@@ -4100,16 +4100,18 @@ var RepoInfo = /** @class */ (function () {
4100
4100
  * @param nodeAdmin - Whether this instance uses Admin SDK credentials
4101
4101
  * @param persistenceKey - Override the default session persistence storage key
4102
4102
  */
4103
- function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) {
4103
+ function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams, isUsingEmulator) {
4104
4104
  if (nodeAdmin === void 0) { nodeAdmin = false; }
4105
4105
  if (persistenceKey === void 0) { persistenceKey = ''; }
4106
4106
  if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; }
4107
+ if (isUsingEmulator === void 0) { isUsingEmulator = false; }
4107
4108
  this.secure = secure;
4108
4109
  this.namespace = namespace;
4109
4110
  this.webSocketOnly = webSocketOnly;
4110
4111
  this.nodeAdmin = nodeAdmin;
4111
4112
  this.persistenceKey = persistenceKey;
4112
4113
  this.includeNamespaceInQueryParams = includeNamespaceInQueryParams;
4114
+ this.isUsingEmulator = isUsingEmulator;
4113
4115
  this._host = host.toLowerCase();
4114
4116
  this._domain = this._host.substr(this._host.indexOf('.') + 1);
4115
4117
  this.internalHost =
@@ -5914,7 +5916,12 @@ var Connection = /** @class */ (function () {
5914
5916
  if (MESSAGE_DATA in controlData) {
5915
5917
  var payload = controlData[MESSAGE_DATA];
5916
5918
  if (cmd === SERVER_HELLO) {
5917
- this.onHandshake_(payload);
5919
+ var handshakePayload = tslib.__assign({}, payload);
5920
+ if (this.repoInfo_.isUsingEmulator) {
5921
+ // Upon connecting, the emulator will pass the hostname that it's aware of, but we prefer the user's set hostname via `connectDatabaseEmulator` over what the emulator passes.
5922
+ handshakePayload.h = this.repoInfo_.host;
5923
+ }
5924
+ this.onHandshake_(handshakePayload);
5918
5925
  }
5919
5926
  else if (cmd === END_TRANSMISSION) {
5920
5927
  this.log_('recvd end transmission on primary');
@@ -17269,7 +17276,8 @@ var useRestClient = false;
17269
17276
  */
17270
17277
  function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) {
17271
17278
  repo.repoInfo_ = new RepoInfo("".concat(host, ":").concat(port),
17272
- /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams);
17279
+ /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams,
17280
+ /*isUsingEmulator=*/ true);
17273
17281
  if (tokenProvider) {
17274
17282
  repo.authTokenProvider_ = tokenProvider;
17275
17283
  }