@firebase/database 1.0.12-canary.554c7bdc1 → 1.0.12-canary.69c33266d

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/dist/index.cjs.js CHANGED
@@ -8,7 +8,7 @@ var util = require('@firebase/util');
8
8
  var logger$1 = require('@firebase/logger');
9
9
 
10
10
  const name = "@firebase/database";
11
- const version = "1.0.12-canary.554c7bdc1";
11
+ const version = "1.0.12-canary.69c33266d";
12
12
 
13
13
  /**
14
14
  * @license
@@ -942,7 +942,7 @@ class RepoInfo {
942
942
  * @param nodeAdmin - Whether this instance uses Admin SDK credentials
943
943
  * @param persistenceKey - Override the default session persistence storage key
944
944
  */
945
- constructor(host, secure, namespace, webSocketOnly, nodeAdmin = false, persistenceKey = '', includeNamespaceInQueryParams = false, isUsingEmulator = false, emulatorOptions = null) {
945
+ constructor(host, secure, namespace, webSocketOnly, nodeAdmin = false, persistenceKey = '', includeNamespaceInQueryParams = false, isUsingEmulator = false) {
946
946
  this.secure = secure;
947
947
  this.namespace = namespace;
948
948
  this.webSocketOnly = webSocketOnly;
@@ -950,7 +950,6 @@ class RepoInfo {
950
950
  this.persistenceKey = persistenceKey;
951
951
  this.includeNamespaceInQueryParams = includeNamespaceInQueryParams;
952
952
  this.isUsingEmulator = isUsingEmulator;
953
- this.emulatorOptions = emulatorOptions;
954
953
  this._host = host.toLowerCase();
955
954
  this._domain = this._host.substr(this._host.indexOf('.') + 1);
956
955
  this.internalHost =
@@ -13491,10 +13490,10 @@ let useRestClient = false;
13491
13490
  /**
13492
13491
  * Update an existing `Repo` in place to point to a new host/port.
13493
13492
  */
13494
- function repoManagerApplyEmulatorSettings(repo, hostAndPort, emulatorOptions, tokenProvider) {
13495
- repo.repoInfo_ = new RepoInfo(hostAndPort,
13493
+ function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) {
13494
+ repo.repoInfo_ = new RepoInfo(`${host}:${port}`,
13496
13495
  /* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams,
13497
- /*isUsingEmulator=*/ true, emulatorOptions);
13496
+ /*isUsingEmulator=*/ true);
13498
13497
  if (tokenProvider) {
13499
13498
  repo.authTokenProvider_ = tokenProvider;
13500
13499
  }
@@ -13679,17 +13678,10 @@ function getDatabase(app$1 = app.getApp(), url) {
13679
13678
  function connectDatabaseEmulator(db, host, port, options = {}) {
13680
13679
  db = util.getModularInstance(db);
13681
13680
  db._checkNotDeleted('useEmulator');
13682
- const hostAndPort = `${host}:${port}`;
13683
- const repo = db._repoInternal;
13684
13681
  if (db._instanceStarted) {
13685
- // If the instance has already been started, then silenty fail if this function is called again
13686
- // with the same parameters. If the parameters differ then assert.
13687
- if (hostAndPort === db._repoInternal.repoInfo_.host &&
13688
- util.deepEqual(options, repo.repoInfo_.emulatorOptions)) {
13689
- return;
13690
- }
13691
- fatal('connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.');
13682
+ fatal('Cannot call useEmulator() after instance has already been initialized.');
13692
13683
  }
13684
+ const repo = db._repoInternal;
13693
13685
  let tokenProvider = undefined;
13694
13686
  if (repo.repoInfo_.nodeAdmin) {
13695
13687
  if (options.mockUserToken) {
@@ -13704,7 +13696,7 @@ function connectDatabaseEmulator(db, host, port, options = {}) {
13704
13696
  tokenProvider = new EmulatorTokenProvider(token);
13705
13697
  }
13706
13698
  // Modify the repo to apply emulator settings
13707
- repoManagerApplyEmulatorSettings(repo, hostAndPort, options, tokenProvider);
13699
+ repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider);
13708
13700
  }
13709
13701
  /**
13710
13702
  * Disconnects from the server (all Database operations will be completed