@firebase/database 1.0.6-canary.4b4db85ff → 1.0.6-canary.62661245f
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 +20 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +20 -15
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +20 -15
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +20 -15
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +16 -10
- package/dist/index.standalone.js.map +1 -1
- package/dist/internal.d.ts +4 -5
- package/dist/node-esm/index.node.esm.js +20 -15
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api/Database.d.ts +3 -4
- package/dist/node-esm/src/core/WriteTree.d.ts +1 -1
- package/dist/node-esm/src/core/util/Tree.d.ts +1 -1
- package/dist/node-esm/src/core/util/util.d.ts +2 -2
- package/dist/node-esm/src/realtime/BrowserPollConnection.d.ts +1 -1
- package/dist/private.d.ts +4 -5
- package/dist/public.d.ts +3 -4
- package/dist/src/api/Database.d.ts +3 -4
- package/dist/src/core/WriteTree.d.ts +1 -1
- package/dist/src/core/util/Tree.d.ts +1 -1
- package/dist/src/core/util/util.d.ts +2 -2
- package/dist/src/realtime/BrowserPollConnection.d.ts +1 -1
- package/package.json +8 -7
package/dist/index.esm5.js
CHANGED
|
@@ -5,7 +5,7 @@ import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sh
|
|
|
5
5
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
6
6
|
|
|
7
7
|
var name = "@firebase/database";
|
|
8
|
-
var version = "1.0.6-canary.
|
|
8
|
+
var version = "1.0.6-canary.62661245f";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @license
|
|
@@ -598,7 +598,7 @@ var isWindowsStoreApp = function () {
|
|
|
598
598
|
return typeof Windows === 'object' && typeof Windows.UI === 'object';
|
|
599
599
|
};
|
|
600
600
|
/**
|
|
601
|
-
* Converts a server error code to a
|
|
601
|
+
* Converts a server error code to a JavaScript Error
|
|
602
602
|
*/
|
|
603
603
|
function errorForServerCode(code, query) {
|
|
604
604
|
var reason = 'Unknown Error';
|
|
@@ -627,7 +627,7 @@ var INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$');
|
|
|
627
627
|
*/
|
|
628
628
|
var INTEGER_32_MIN = -2147483648;
|
|
629
629
|
/**
|
|
630
|
-
* For use in
|
|
630
|
+
* For use in keys, the maximum possible 32-bit integer.
|
|
631
631
|
*/
|
|
632
632
|
var INTEGER_32_MAX = 2147483647;
|
|
633
633
|
/**
|
|
@@ -754,7 +754,7 @@ var AppCheckTokenProvider = /** @class */ (function () {
|
|
|
754
754
|
// Support delayed initialization of FirebaseAppCheck. This allows our
|
|
755
755
|
// customers to initialize the RTDB SDK before initializing Firebase
|
|
756
756
|
// AppCheck and ensures that all requests are authenticated if a token
|
|
757
|
-
// becomes available before the
|
|
757
|
+
// becomes available before the timeout below expires.
|
|
758
758
|
setTimeout(function () {
|
|
759
759
|
if (_this.appCheck) {
|
|
760
760
|
_this.getToken(forceRefresh).then(resolve, reject);
|
|
@@ -816,7 +816,7 @@ var FirebaseAuthTokenProvider = /** @class */ (function () {
|
|
|
816
816
|
// Support delayed initialization of FirebaseAuth. This allows our
|
|
817
817
|
// customers to initialize the RTDB SDK before initializing Firebase
|
|
818
818
|
// Auth and ensures that all requests are authenticated if a token
|
|
819
|
-
// becomes available before the
|
|
819
|
+
// becomes available before the timeout below expires.
|
|
820
820
|
setTimeout(function () {
|
|
821
821
|
if (_this.auth_) {
|
|
822
822
|
_this.getToken(forceRefresh).then(resolve, reject);
|
|
@@ -1531,7 +1531,7 @@ var BrowserPollConnection = /** @class */ (function () {
|
|
|
1531
1531
|
*********************************************************************************************/
|
|
1532
1532
|
var FirebaseIFrameScriptHolder = /** @class */ (function () {
|
|
1533
1533
|
/**
|
|
1534
|
-
* @param commandCB - The callback to be called when control commands are
|
|
1534
|
+
* @param commandCB - The callback to be called when control commands are received from the server.
|
|
1535
1535
|
* @param onMessageCB - The callback to be triggered when responses arrive from the server.
|
|
1536
1536
|
* @param onDisconnect - The callback to be triggered when this tag holder is closed
|
|
1537
1537
|
* @param urlFn - A function that provides the URL of the endpoint to send data to.
|
|
@@ -1576,6 +1576,8 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
|
|
|
1576
1576
|
var iframeContents = '<html><body>' + script + '</body></html>';
|
|
1577
1577
|
try {
|
|
1578
1578
|
this.myIFrame.doc.open();
|
|
1579
|
+
// TODO: Do not use document.write, since it can lead to XSS. Instead, use the safevalues
|
|
1580
|
+
// library to sanitize the HTML in the iframeContents.
|
|
1579
1581
|
this.myIFrame.doc.write(iframeContents);
|
|
1580
1582
|
this.myIFrame.doc.close();
|
|
1581
1583
|
}
|
|
@@ -1801,6 +1803,10 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
|
|
|
1801
1803
|
var newScript_1 = _this.myIFrame.doc.createElement('script');
|
|
1802
1804
|
newScript_1.type = 'text/javascript';
|
|
1803
1805
|
newScript_1.async = true;
|
|
1806
|
+
// TODO: We cannot assign an arbitrary URL to a script attached to the DOM, since it is
|
|
1807
|
+
// at risk of XSS. We should use the safevalues library to create a safeScriptEl, and
|
|
1808
|
+
// assign a sanitized trustedResourceURL to it. Since the URL must be a template string
|
|
1809
|
+
// literal, this could require some heavy refactoring.
|
|
1804
1810
|
newScript_1.src = url;
|
|
1805
1811
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1806
1812
|
newScript_1.onload = newScript_1.onreadystatechange =
|
|
@@ -10642,7 +10648,7 @@ function treeHasChildren(tree) {
|
|
|
10642
10648
|
return tree.node.childCount > 0;
|
|
10643
10649
|
}
|
|
10644
10650
|
/**
|
|
10645
|
-
* @returns
|
|
10651
|
+
* @returns Whether the tree is empty (no value or children).
|
|
10646
10652
|
*/
|
|
10647
10653
|
function treeIsEmpty(tree) {
|
|
10648
10654
|
return treeGetValue(tree) === undefined && !treeHasChildren(tree);
|
|
@@ -13053,7 +13059,7 @@ function push(parent, value) {
|
|
|
13053
13059
|
// then() and catch() methods and is used as the return value of push(). The
|
|
13054
13060
|
// second remains a regular Reference and is used as the fulfilled value of
|
|
13055
13061
|
// the first ThennableReference.
|
|
13056
|
-
var
|
|
13062
|
+
var thenablePushRef = child(parent, name);
|
|
13057
13063
|
var pushRef = child(parent, name);
|
|
13058
13064
|
var promise;
|
|
13059
13065
|
if (value != null) {
|
|
@@ -13062,9 +13068,9 @@ function push(parent, value) {
|
|
|
13062
13068
|
else {
|
|
13063
13069
|
promise = Promise.resolve(pushRef);
|
|
13064
13070
|
}
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
return
|
|
13071
|
+
thenablePushRef.then = promise.then.bind(promise);
|
|
13072
|
+
thenablePushRef.catch = promise.then.bind(promise, undefined);
|
|
13073
|
+
return thenablePushRef;
|
|
13068
13074
|
}
|
|
13069
13075
|
/**
|
|
13070
13076
|
* Removes the data at this Database location.
|
|
@@ -14096,10 +14102,9 @@ function forceLongPolling() {
|
|
|
14096
14102
|
BrowserPollConnection.forceAllow();
|
|
14097
14103
|
}
|
|
14098
14104
|
/**
|
|
14099
|
-
* Returns the instance of the Realtime Database SDK that is associated
|
|
14100
|
-
*
|
|
14101
|
-
*
|
|
14102
|
-
* a custom database URL.
|
|
14105
|
+
* Returns the instance of the Realtime Database SDK that is associated with the provided
|
|
14106
|
+
* {@link @firebase/app#FirebaseApp}. Initializes a new instance with default settings if
|
|
14107
|
+
* no instance exists or if the existing instance uses a custom database URL.
|
|
14103
14108
|
*
|
|
14104
14109
|
* @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime
|
|
14105
14110
|
* Database instance is associated with.
|