@firebase/database 1.0.6-canary.fd8bd4b02 → 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.esm2017.js
CHANGED
|
@@ -4,7 +4,7 @@ import { stringify, jsonEval, contains, assert, isNodeSdk, stringToByteArray, Sh
|
|
|
4
4
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
5
5
|
|
|
6
6
|
const name = "@firebase/database";
|
|
7
|
-
const version = "1.0.6-
|
|
7
|
+
const version = "1.0.6-dataconnect-preview.d986d4bf2";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
@@ -571,7 +571,7 @@ const isWindowsStoreApp = function () {
|
|
|
571
571
|
return typeof Windows === 'object' && typeof Windows.UI === 'object';
|
|
572
572
|
};
|
|
573
573
|
/**
|
|
574
|
-
* Converts a server error code to a
|
|
574
|
+
* Converts a server error code to a JavaScript Error
|
|
575
575
|
*/
|
|
576
576
|
function errorForServerCode(code, query) {
|
|
577
577
|
let reason = 'Unknown Error';
|
|
@@ -600,7 +600,7 @@ const INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$');
|
|
|
600
600
|
*/
|
|
601
601
|
const INTEGER_32_MIN = -2147483648;
|
|
602
602
|
/**
|
|
603
|
-
* For use in
|
|
603
|
+
* For use in keys, the maximum possible 32-bit integer.
|
|
604
604
|
*/
|
|
605
605
|
const INTEGER_32_MAX = 2147483647;
|
|
606
606
|
/**
|
|
@@ -725,7 +725,7 @@ class AppCheckTokenProvider {
|
|
|
725
725
|
// Support delayed initialization of FirebaseAppCheck. This allows our
|
|
726
726
|
// customers to initialize the RTDB SDK before initializing Firebase
|
|
727
727
|
// AppCheck and ensures that all requests are authenticated if a token
|
|
728
|
-
// becomes available before the
|
|
728
|
+
// becomes available before the timeout below expires.
|
|
729
729
|
setTimeout(() => {
|
|
730
730
|
if (this.appCheck) {
|
|
731
731
|
this.getToken(forceRefresh).then(resolve, reject);
|
|
@@ -784,7 +784,7 @@ class FirebaseAuthTokenProvider {
|
|
|
784
784
|
// Support delayed initialization of FirebaseAuth. This allows our
|
|
785
785
|
// customers to initialize the RTDB SDK before initializing Firebase
|
|
786
786
|
// Auth and ensures that all requests are authenticated if a token
|
|
787
|
-
// becomes available before the
|
|
787
|
+
// becomes available before the timeout below expires.
|
|
788
788
|
setTimeout(() => {
|
|
789
789
|
if (this.auth_) {
|
|
790
790
|
this.getToken(forceRefresh).then(resolve, reject);
|
|
@@ -1464,7 +1464,7 @@ class BrowserPollConnection {
|
|
|
1464
1464
|
*********************************************************************************************/
|
|
1465
1465
|
class FirebaseIFrameScriptHolder {
|
|
1466
1466
|
/**
|
|
1467
|
-
* @param commandCB - The callback to be called when control commands are
|
|
1467
|
+
* @param commandCB - The callback to be called when control commands are received from the server.
|
|
1468
1468
|
* @param onMessageCB - The callback to be triggered when responses arrive from the server.
|
|
1469
1469
|
* @param onDisconnect - The callback to be triggered when this tag holder is closed
|
|
1470
1470
|
* @param urlFn - A function that provides the URL of the endpoint to send data to.
|
|
@@ -1509,8 +1509,6 @@ class FirebaseIFrameScriptHolder {
|
|
|
1509
1509
|
const iframeContents = '<html><body>' + script + '</body></html>';
|
|
1510
1510
|
try {
|
|
1511
1511
|
this.myIFrame.doc.open();
|
|
1512
|
-
// TODO: Do not use document.write, since it can lead to XSS. Instead, use the safevalues
|
|
1513
|
-
// library to sanitize the HTML in the iframeContents.
|
|
1514
1512
|
this.myIFrame.doc.write(iframeContents);
|
|
1515
1513
|
this.myIFrame.doc.close();
|
|
1516
1514
|
}
|
|
@@ -1733,10 +1731,6 @@ class FirebaseIFrameScriptHolder {
|
|
|
1733
1731
|
const newScript = this.myIFrame.doc.createElement('script');
|
|
1734
1732
|
newScript.type = 'text/javascript';
|
|
1735
1733
|
newScript.async = true;
|
|
1736
|
-
// TODO: We cannot assign an arbitrary URL to a script attached to the DOM, since it is
|
|
1737
|
-
// at risk of XSS. We should use the safevalues library to create a safeScriptEl, and
|
|
1738
|
-
// assign a sanitized trustedResourceURL to it. Since the URL must be a template string
|
|
1739
|
-
// literal, this could require some heavy refactoring.
|
|
1740
1734
|
newScript.src = url;
|
|
1741
1735
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1742
1736
|
newScript.onload = newScript.onreadystatechange =
|
|
@@ -10321,7 +10315,7 @@ function treeHasChildren(tree) {
|
|
|
10321
10315
|
return tree.node.childCount > 0;
|
|
10322
10316
|
}
|
|
10323
10317
|
/**
|
|
10324
|
-
* @returns
|
|
10318
|
+
* @returns Whether the tree is empty (no value or children).
|
|
10325
10319
|
*/
|
|
10326
10320
|
function treeIsEmpty(tree) {
|
|
10327
10321
|
return treeGetValue(tree) === undefined && !treeHasChildren(tree);
|
|
@@ -12649,7 +12643,7 @@ function push(parent, value) {
|
|
|
12649
12643
|
// then() and catch() methods and is used as the return value of push(). The
|
|
12650
12644
|
// second remains a regular Reference and is used as the fulfilled value of
|
|
12651
12645
|
// the first ThennableReference.
|
|
12652
|
-
const
|
|
12646
|
+
const thenablePushRef = child(parent, name);
|
|
12653
12647
|
const pushRef = child(parent, name);
|
|
12654
12648
|
let promise;
|
|
12655
12649
|
if (value != null) {
|
|
@@ -12658,9 +12652,9 @@ function push(parent, value) {
|
|
|
12658
12652
|
else {
|
|
12659
12653
|
promise = Promise.resolve(pushRef);
|
|
12660
12654
|
}
|
|
12661
|
-
|
|
12662
|
-
|
|
12663
|
-
return
|
|
12655
|
+
thenablePushRef.then = promise.then.bind(promise);
|
|
12656
|
+
thenablePushRef.catch = promise.then.bind(promise, undefined);
|
|
12657
|
+
return thenablePushRef;
|
|
12664
12658
|
}
|
|
12665
12659
|
/**
|
|
12666
12660
|
* Removes the data at this Database location.
|
|
@@ -13635,10 +13629,9 @@ function forceLongPolling() {
|
|
|
13635
13629
|
BrowserPollConnection.forceAllow();
|
|
13636
13630
|
}
|
|
13637
13631
|
/**
|
|
13638
|
-
* Returns the instance of the Realtime Database SDK that is associated
|
|
13639
|
-
*
|
|
13640
|
-
*
|
|
13641
|
-
* a custom database URL.
|
|
13632
|
+
* Returns the instance of the Realtime Database SDK that is associated with the provided
|
|
13633
|
+
* {@link @firebase/app#FirebaseApp}. Initializes a new instance with default settings if
|
|
13634
|
+
* no instance exists or if the existing instance uses a custom database URL.
|
|
13642
13635
|
*
|
|
13643
13636
|
* @param app - The {@link @firebase/app#FirebaseApp} instance that the returned Realtime
|
|
13644
13637
|
* Database instance is associated with.
|