@firebase/database 0.14.0 → 0.14.1-canary.68369740a
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 +13 -0
- package/dist/index.esm2017.js +18 -9
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +20 -10
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +19 -9
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +13 -5
- package/dist/index.standalone.js.map +1 -1
- package/dist/internal.d.ts +2 -1
- package/dist/node-esm/index.node.esm.js +18 -9
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/core/RepoInfo.d.ts +2 -1
- package/dist/private.d.ts +2 -1
- package/dist/src/core/RepoInfo.d.ts +2 -1
- package/package.json +6 -6
package/dist/index.standalone.js
CHANGED
|
@@ -754,16 +754,18 @@ var RepoInfo = /** @class */ (function () {
|
|
|
754
754
|
* @param nodeAdmin - Whether this instance uses Admin SDK credentials
|
|
755
755
|
* @param persistenceKey - Override the default session persistence storage key
|
|
756
756
|
*/
|
|
757
|
-
function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams) {
|
|
757
|
+
function RepoInfo(host, secure, namespace, webSocketOnly, nodeAdmin, persistenceKey, includeNamespaceInQueryParams, isUsingEmulator) {
|
|
758
758
|
if (nodeAdmin === void 0) { nodeAdmin = false; }
|
|
759
759
|
if (persistenceKey === void 0) { persistenceKey = ''; }
|
|
760
760
|
if (includeNamespaceInQueryParams === void 0) { includeNamespaceInQueryParams = false; }
|
|
761
|
+
if (isUsingEmulator === void 0) { isUsingEmulator = false; }
|
|
761
762
|
this.secure = secure;
|
|
762
763
|
this.namespace = namespace;
|
|
763
764
|
this.webSocketOnly = webSocketOnly;
|
|
764
765
|
this.nodeAdmin = nodeAdmin;
|
|
765
766
|
this.persistenceKey = persistenceKey;
|
|
766
767
|
this.includeNamespaceInQueryParams = includeNamespaceInQueryParams;
|
|
768
|
+
this.isUsingEmulator = isUsingEmulator;
|
|
767
769
|
this._host = host.toLowerCase();
|
|
768
770
|
this._domain = this._host.substr(this._host.indexOf('.') + 1);
|
|
769
771
|
this.internalHost =
|
|
@@ -2005,8 +2007,8 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
|
|
|
2005
2007
|
if (this.myIFrame) {
|
|
2006
2008
|
//We have to actually remove all of the html inside this iframe before removing it from the
|
|
2007
2009
|
//window, or IE will continue loading and executing the script tags we've already added, which
|
|
2008
|
-
//can lead to some errors being thrown. Setting
|
|
2009
|
-
this.myIFrame.doc.body.
|
|
2010
|
+
//can lead to some errors being thrown. Setting textContent seems to be the safest way to do this.
|
|
2011
|
+
this.myIFrame.doc.body.textContent = '';
|
|
2010
2012
|
setTimeout(function () {
|
|
2011
2013
|
if (_this.myIFrame !== null) {
|
|
2012
2014
|
document.body.removeChild(_this.myIFrame);
|
|
@@ -2568,7 +2570,12 @@ var Connection = /** @class */ (function () {
|
|
|
2568
2570
|
if (MESSAGE_DATA in controlData) {
|
|
2569
2571
|
var payload = controlData[MESSAGE_DATA];
|
|
2570
2572
|
if (cmd === SERVER_HELLO) {
|
|
2571
|
-
|
|
2573
|
+
var handshakePayload = tslib.__assign({}, payload);
|
|
2574
|
+
if (this.repoInfo_.isUsingEmulator) {
|
|
2575
|
+
// 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.
|
|
2576
|
+
handshakePayload.h = this.repoInfo_.host;
|
|
2577
|
+
}
|
|
2578
|
+
this.onHandshake_(handshakePayload);
|
|
2572
2579
|
}
|
|
2573
2580
|
else if (cmd === END_TRANSMISSION) {
|
|
2574
2581
|
this.log_('recvd end transmission on primary');
|
|
@@ -13923,7 +13930,8 @@ var useRestClient = false;
|
|
|
13923
13930
|
*/
|
|
13924
13931
|
function repoManagerApplyEmulatorSettings(repo, host, port, tokenProvider) {
|
|
13925
13932
|
repo.repoInfo_ = new RepoInfo("".concat(host, ":").concat(port),
|
|
13926
|
-
/* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams
|
|
13933
|
+
/* secure= */ false, repo.repoInfo_.namespace, repo.repoInfo_.webSocketOnly, repo.repoInfo_.nodeAdmin, repo.repoInfo_.persistenceKey, repo.repoInfo_.includeNamespaceInQueryParams,
|
|
13934
|
+
/*isUsingEmulator=*/ true);
|
|
13927
13935
|
if (tokenProvider) {
|
|
13928
13936
|
repo.authTokenProvider_ = tokenProvider;
|
|
13929
13937
|
}
|