@firebase/database 1.0.6-canary.f58d48cd4 → 1.0.6-dataconnect-preview.d986d4bf2
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 +14 -21
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +14 -21
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +14 -21
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +14 -21
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +10 -16
- package/dist/index.standalone.js.map +1 -1
- package/dist/internal.d.ts +4 -5
- package/dist/node-esm/index.node.esm.js +14 -21
- 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 +7 -8
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-
|
|
8
|
+
var version = "1.0.6-dataconnect-preview.d986d4bf2";
|
|
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,8 +1576,6 @@ 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.
|
|
1581
1579
|
this.myIFrame.doc.write(iframeContents);
|
|
1582
1580
|
this.myIFrame.doc.close();
|
|
1583
1581
|
}
|
|
@@ -1803,10 +1801,6 @@ var FirebaseIFrameScriptHolder = /** @class */ (function () {
|
|
|
1803
1801
|
var newScript_1 = _this.myIFrame.doc.createElement('script');
|
|
1804
1802
|
newScript_1.type = 'text/javascript';
|
|
1805
1803
|
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.
|
|
1810
1804
|
newScript_1.src = url;
|
|
1811
1805
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1812
1806
|
newScript_1.onload = newScript_1.onreadystatechange =
|
|
@@ -10648,7 +10642,7 @@ function treeHasChildren(tree) {
|
|
|
10648
10642
|
return tree.node.childCount > 0;
|
|
10649
10643
|
}
|
|
10650
10644
|
/**
|
|
10651
|
-
* @returns
|
|
10645
|
+
* @returns Whether the tree is empty (no value or children).
|
|
10652
10646
|
*/
|
|
10653
10647
|
function treeIsEmpty(tree) {
|
|
10654
10648
|
return treeGetValue(tree) === undefined && !treeHasChildren(tree);
|
|
@@ -13059,7 +13053,7 @@ function push(parent, value) {
|
|
|
13059
13053
|
// then() and catch() methods and is used as the return value of push(). The
|
|
13060
13054
|
// second remains a regular Reference and is used as the fulfilled value of
|
|
13061
13055
|
// the first ThennableReference.
|
|
13062
|
-
var
|
|
13056
|
+
var thenablePushRef = child(parent, name);
|
|
13063
13057
|
var pushRef = child(parent, name);
|
|
13064
13058
|
var promise;
|
|
13065
13059
|
if (value != null) {
|
|
@@ -13068,9 +13062,9 @@ function push(parent, value) {
|
|
|
13068
13062
|
else {
|
|
13069
13063
|
promise = Promise.resolve(pushRef);
|
|
13070
13064
|
}
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
return
|
|
13065
|
+
thenablePushRef.then = promise.then.bind(promise);
|
|
13066
|
+
thenablePushRef.catch = promise.then.bind(promise, undefined);
|
|
13067
|
+
return thenablePushRef;
|
|
13074
13068
|
}
|
|
13075
13069
|
/**
|
|
13076
13070
|
* Removes the data at this Database location.
|
|
@@ -14102,10 +14096,9 @@ function forceLongPolling() {
|
|
|
14102
14096
|
BrowserPollConnection.forceAllow();
|
|
14103
14097
|
}
|
|
14104
14098
|
/**
|
|
14105
|
-
* Returns the instance of the Realtime Database SDK that is associated
|
|
14106
|
-
*
|
|
14107
|
-
*
|
|
14108
|
-
* a custom database URL.
|
|
14099
|
+
* Returns the instance of the Realtime Database SDK that is associated with the provided
|
|
14100
|
+
* {@link @firebase/app#FirebaseApp}. Initializes a new instance with default settings if
|
|
14101
|
+
* no instance exists or if the existing instance uses a custom database URL.
|
|
14109
14102
|
*
|
|
14110
14103
|
* @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime
|
|
14111
14104
|
* Database instance is associated with.
|