@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 +8 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +9 -17
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +8 -16
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +7 -15
- package/dist/index.standalone.js.map +1 -1
- package/dist/internal.d.ts +17 -6
- package/dist/node-esm/index.node.esm.js +9 -17
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/core/RepoInfo.d.ts +1 -6
- package/dist/node-esm/test/helpers/util.d.ts +0 -2
- package/dist/private.d.ts +17 -6
- package/dist/src/core/RepoInfo.d.ts +1 -6
- package/dist/test/helpers/util.d.ts +0 -2
- package/package.json +7 -7
package/dist/index.esm2017.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _isFirebaseServerApp, _getProvider, getApp, SDK_VERSION as SDK_VERSION$1, _registerComponent, registerVersion } from '@firebase/app';
|
|
2
2
|
import { Component, ComponentContainer, Provider } from '@firebase/component';
|
|
3
|
-
import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sha1, base64, deepCopy, base64Encode, isMobileCordova, stringLength, Deferred, safeGet, isAdmin, isValidFormat, isEmpty, isReactNative, assertionError, map, querystring, errorPrefix, getModularInstance, getDefaultEmulatorHostnameAndPort,
|
|
3
|
+
import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sha1, base64, deepCopy, base64Encode, isMobileCordova, stringLength, Deferred, safeGet, isAdmin, isValidFormat, isEmpty, isReactNative, assertionError, map, querystring, errorPrefix, getModularInstance, getDefaultEmulatorHostnameAndPort, createMockUserToken } from '@firebase/util';
|
|
4
4
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
5
5
|
|
|
6
6
|
const name = "@firebase/database";
|
|
7
|
-
const version = "1.0.12-canary.
|
|
7
|
+
const version = "1.0.12-canary.69c33266d";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
@@ -938,7 +938,7 @@ class RepoInfo {
|
|
|
938
938
|
* @param nodeAdmin - Whether this instance uses Admin SDK credentials
|
|
939
939
|
* @param persistenceKey - Override the default session persistence storage key
|
|
940
940
|
*/
|
|
941
|
-
constructor(host, secure, namespace, webSocketOnly, nodeAdmin = false, persistenceKey = '', includeNamespaceInQueryParams = false, isUsingEmulator = false
|
|
941
|
+
constructor(host, secure, namespace, webSocketOnly, nodeAdmin = false, persistenceKey = '', includeNamespaceInQueryParams = false, isUsingEmulator = false) {
|
|
942
942
|
this.secure = secure;
|
|
943
943
|
this.namespace = namespace;
|
|
944
944
|
this.webSocketOnly = webSocketOnly;
|
|
@@ -946,7 +946,6 @@ class RepoInfo {
|
|
|
946
946
|
this.persistenceKey = persistenceKey;
|
|
947
947
|
this.includeNamespaceInQueryParams = includeNamespaceInQueryParams;
|
|
948
948
|
this.isUsingEmulator = isUsingEmulator;
|
|
949
|
-
this.emulatorOptions = emulatorOptions;
|
|
950
949
|
this._host = host.toLowerCase();
|
|
951
950
|
this._domain = this._host.substr(this._host.indexOf('.') + 1);
|
|
952
951
|
this.internalHost =
|
|
@@ -13487,10 +13486,10 @@ let useRestClient = false;
|
|
|
13487
13486
|
/**
|
|
13488
13487
|
* Update an existing `Repo` in place to point to a new host/port.
|
|
13489
13488
|
*/
|
|
13490
|
-
function repoManagerApplyEmulatorSettings(repo,
|
|
13491
|
-
repo.repoInfo_ = new RepoInfo(
|
|
13489
|
+
function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) {
|
|
13490
|
+
repo.repoInfo_ = new RepoInfo(`${host}:${port}`,
|
|
13492
13491
|
/* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams,
|
|
13493
|
-
/*isUsingEmulator=*/ true
|
|
13492
|
+
/*isUsingEmulator=*/ true);
|
|
13494
13493
|
if (tokenProvider) {
|
|
13495
13494
|
repo.authTokenProvider_ = tokenProvider;
|
|
13496
13495
|
}
|
|
@@ -13675,17 +13674,10 @@ function getDatabase(app = getApp(), url) {
|
|
|
13675
13674
|
function connectDatabaseEmulator(db, host, port, options = {}) {
|
|
13676
13675
|
db = getModularInstance(db);
|
|
13677
13676
|
db._checkNotDeleted('useEmulator');
|
|
13678
|
-
const hostAndPort = `${host}:${port}`;
|
|
13679
|
-
const repo = db._repoInternal;
|
|
13680
13677
|
if (db._instanceStarted) {
|
|
13681
|
-
|
|
13682
|
-
// with the same parameters. If the parameters differ then assert.
|
|
13683
|
-
if (hostAndPort === db._repoInternal.repoInfo_.host &&
|
|
13684
|
-
deepEqual(options, repo.repoInfo_.emulatorOptions)) {
|
|
13685
|
-
return;
|
|
13686
|
-
}
|
|
13687
|
-
fatal('connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.');
|
|
13678
|
+
fatal('Cannot call useEmulator() after instance has already been initialized.');
|
|
13688
13679
|
}
|
|
13680
|
+
const repo = db._repoInternal;
|
|
13689
13681
|
let tokenProvider = undefined;
|
|
13690
13682
|
if (repo.repoInfo_.nodeAdmin) {
|
|
13691
13683
|
if (options.mockUserToken) {
|
|
@@ -13700,7 +13692,7 @@ function connectDatabaseEmulator(db, host, port, options = {}) {
|
|
|
13700
13692
|
tokenProvider = new EmulatorTokenProvider(token);
|
|
13701
13693
|
}
|
|
13702
13694
|
// Modify the repo to apply emulator settings
|
|
13703
|
-
repoManagerApplyEmulatorSettings(repo,
|
|
13695
|
+
repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider);
|
|
13704
13696
|
}
|
|
13705
13697
|
/**
|
|
13706
13698
|
* Disconnects from the server (all Database operations will be completed
|