@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.standalone.js
CHANGED
|
@@ -607,7 +607,7 @@ var isWindowsStoreApp = function () {
|
|
|
607
607
|
return typeof Windows === 'object' && typeof Windows.UI === 'object';
|
|
608
608
|
};
|
|
609
609
|
/**
|
|
610
|
-
* Converts a server error code to a
|
|
610
|
+
* Converts a server error code to a JavaScript Error
|
|
611
611
|
*/
|
|
612
612
|
function errorForServerCode(code, query) {
|
|
613
613
|
var reason = 'Unknown Error';
|
|
@@ -636,7 +636,7 @@ var INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$');
|
|
|
636
636
|
*/
|
|
637
637
|
var INTEGER_32_MIN = -2147483648;
|
|
638
638
|
/**
|
|
639
|
-
* For use in
|
|
639
|
+
* For use in keys, the maximum possible 32-bit integer.
|
|
640
640
|
*/
|
|
641
641
|
var INTEGER_32_MAX = 2147483647;
|
|
642
642
|
/**
|
|
@@ -1334,7 +1334,7 @@ var AppCheckTokenProvider = /** @class */ (function () {
|
|
|
1334
1334
|
// Support delayed initialization of FirebaseAppCheck. This allows our
|
|
1335
1335
|
// customers to initialize the RTDB SDK before initializing Firebase
|
|
1336
1336
|
// AppCheck and ensures that all requests are authenticated if a token
|
|
1337
|
-
// becomes available before the
|
|
1337
|
+
// becomes available before the timeout below expires.
|
|
1338
1338
|
setTimeout(function () {
|
|
1339
1339
|
if (_this.appCheck) {
|
|
1340
1340
|
_this.getToken(forceRefresh).then(resolve, reject);
|
|
@@ -1396,7 +1396,7 @@ var FirebaseAuthTokenProvider = /** @class */ (function () {
|
|
|
1396
1396
|
// Support delayed initialization of FirebaseAuth. This allows our
|
|
1397
1397
|
// customers to initialize the RTDB SDK before initializing Firebase
|
|
1398
1398
|
// Auth and ensures that all requests are authenticated if a token
|
|
1399
|
-
// becomes available before the
|
|
1399
|
+
// becomes available before the timeout below expires.
|
|
1400
1400
|
setTimeout(function () {
|
|
1401
1401
|
if (_this.auth_) {
|
|
1402
1402
|
_this.getToken(forceRefresh).then(resolve, reject);
|
|
@@ -1890,7 +1890,7 @@ var BrowserPollConnection = /** @class */ (function () {
|
|
|
1890
1890
|
*********************************************************************************************/
|
|
1891
1891
|
var FirebaseIFrameScriptHolder = /** @class */ (function () {
|
|
1892
1892
|
/**
|
|
1893
|
-
* @param commandCB - The callback to be called when control commands are
|
|
1893
|
+
* @param commandCB - The callback to be called when control commands are received from the server.
|
|
1894
1894
|
* @param onMessageCB - The callback to be triggered when responses arrive from the server.
|
|
1895
1895
|
* @param onDisconnect - The callback to be triggered when this tag holder is closed
|
|
1896
1896
|
* @param urlFn - A function that provides the URL of the endpoint to send data to.
|
|
@@ -1935,6 +1935,8 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
|
|
|
1935
1935
|
var iframeContents = '<html><body>' + script + '</body></html>';
|
|
1936
1936
|
try {
|
|
1937
1937
|
this.myIFrame.doc.open();
|
|
1938
|
+
// TODO: Do not use document.write, since it can lead to XSS. Instead, use the safevalues
|
|
1939
|
+
// library to sanitize the HTML in the iframeContents.
|
|
1938
1940
|
this.myIFrame.doc.write(iframeContents);
|
|
1939
1941
|
this.myIFrame.doc.close();
|
|
1940
1942
|
}
|
|
@@ -2160,6 +2162,10 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
|
|
|
2160
2162
|
var newScript_1 = _this.myIFrame.doc.createElement('script');
|
|
2161
2163
|
newScript_1.type = 'text/javascript';
|
|
2162
2164
|
newScript_1.async = true;
|
|
2165
|
+
// TODO: We cannot assign an arbitrary URL to a script attached to the DOM, since it is
|
|
2166
|
+
// at risk of XSS. We should use the safevalues library to create a safeScriptEl, and
|
|
2167
|
+
// assign a sanitized trustedResourceURL to it. Since the URL must be a template string
|
|
2168
|
+
// literal, this could require some heavy refactoring.
|
|
2163
2169
|
newScript_1.src = url;
|
|
2164
2170
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2165
2171
|
newScript_1.onload = newScript_1.onreadystatechange =
|
|
@@ -10650,7 +10656,7 @@ function treeHasChildren(tree) {
|
|
|
10650
10656
|
return tree.node.childCount > 0;
|
|
10651
10657
|
}
|
|
10652
10658
|
/**
|
|
10653
|
-
* @returns
|
|
10659
|
+
* @returns Whether the tree is empty (no value or children).
|
|
10654
10660
|
*/
|
|
10655
10661
|
function treeIsEmpty(tree) {
|
|
10656
10662
|
return treeGetValue(tree) === undefined && !treeHasChildren(tree);
|
|
@@ -13061,7 +13067,7 @@ function push(parent, value) {
|
|
|
13061
13067
|
// then() and catch() methods and is used as the return value of push(). The
|
|
13062
13068
|
// second remains a regular Reference and is used as the fulfilled value of
|
|
13063
13069
|
// the first ThennableReference.
|
|
13064
|
-
var
|
|
13070
|
+
var thenablePushRef = child(parent, name);
|
|
13065
13071
|
var pushRef = child(parent, name);
|
|
13066
13072
|
var promise;
|
|
13067
13073
|
if (value != null) {
|
|
@@ -13070,9 +13076,9 @@ function push(parent, value) {
|
|
|
13070
13076
|
else {
|
|
13071
13077
|
promise = Promise.resolve(pushRef);
|
|
13072
13078
|
}
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
return
|
|
13079
|
+
thenablePushRef.then = promise.then.bind(promise);
|
|
13080
|
+
thenablePushRef.catch = promise.then.bind(promise, undefined);
|
|
13081
|
+
return thenablePushRef;
|
|
13076
13082
|
}
|
|
13077
13083
|
/**
|
|
13078
13084
|
* Removes the data at this Database location.
|