@firebase/database 1.0.20-canary.d91169f06 → 1.0.20-canary.f11b55294
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 +13 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/{index.esm.js → index.esm2017.js} +14 -16
- package/dist/index.esm2017.js.map +1 -0
- package/dist/index.node.cjs.js +13 -15
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +10 -12
- package/dist/index.standalone.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +13 -15
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +11 -11
- package/dist/index.esm.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ var util = require('@firebase/util');
|
|
|
8
8
|
var logger$1 = require('@firebase/logger');
|
|
9
9
|
|
|
10
10
|
const name = "@firebase/database";
|
|
11
|
-
const version = "1.0.20-canary.
|
|
11
|
+
const version = "1.0.20-canary.f11b55294";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
@@ -721,9 +721,9 @@ class AppCheckTokenProvider {
|
|
|
721
721
|
if (app._isFirebaseServerApp(app$1) && app$1.settings.appCheckToken) {
|
|
722
722
|
this.serverAppAppCheckToken = app$1.settings.appCheckToken;
|
|
723
723
|
}
|
|
724
|
-
this.appCheck = appCheckProvider
|
|
724
|
+
this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true });
|
|
725
725
|
if (!this.appCheck) {
|
|
726
|
-
appCheckProvider
|
|
726
|
+
appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(appCheck => (this.appCheck = appCheck));
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
getToken(forceRefresh) {
|
|
@@ -752,9 +752,8 @@ class AppCheckTokenProvider {
|
|
|
752
752
|
return this.appCheck.getToken(forceRefresh);
|
|
753
753
|
}
|
|
754
754
|
addTokenChangeListener(listener) {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
.then(appCheck => appCheck.addTokenListener(listener));
|
|
755
|
+
var _a;
|
|
756
|
+
(_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(appCheck => appCheck.addTokenListener(listener));
|
|
758
757
|
}
|
|
759
758
|
notifyForInvalidToken() {
|
|
760
759
|
warn(`Provided AppCheck credentials for the app named "${this.appName}" ` +
|
|
@@ -2481,9 +2480,7 @@ class Connection {
|
|
|
2481
2480
|
if (MESSAGE_DATA in controlData) {
|
|
2482
2481
|
const payload = controlData[MESSAGE_DATA];
|
|
2483
2482
|
if (cmd === SERVER_HELLO) {
|
|
2484
|
-
const handshakePayload = {
|
|
2485
|
-
...payload
|
|
2486
|
-
};
|
|
2483
|
+
const handshakePayload = Object.assign({}, payload);
|
|
2487
2484
|
if (this.repoInfo_.isUsingEmulator) {
|
|
2488
2485
|
// 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.
|
|
2489
2486
|
handshakePayload.h = this.repoInfo_.host;
|
|
@@ -5299,9 +5296,9 @@ class IndexMap {
|
|
|
5299
5296
|
newIndex = fallbackObject;
|
|
5300
5297
|
}
|
|
5301
5298
|
const indexName = indexDefinition.toString();
|
|
5302
|
-
const newIndexSet = {
|
|
5299
|
+
const newIndexSet = Object.assign({}, this.indexSet_);
|
|
5303
5300
|
newIndexSet[indexName] = indexDefinition;
|
|
5304
|
-
const newIndexes = {
|
|
5301
|
+
const newIndexes = Object.assign({}, this.indexes_);
|
|
5305
5302
|
newIndexes[indexName] = newIndex;
|
|
5306
5303
|
return new IndexMap(newIndexes, newIndexSet);
|
|
5307
5304
|
}
|
|
@@ -7105,7 +7102,7 @@ class StatsListener {
|
|
|
7105
7102
|
}
|
|
7106
7103
|
get() {
|
|
7107
7104
|
const newStats = this.collection_.get();
|
|
7108
|
-
const delta = {
|
|
7105
|
+
const delta = Object.assign({}, newStats);
|
|
7109
7106
|
if (this.last_) {
|
|
7110
7107
|
each(this.last_, (stat, value) => {
|
|
7111
7108
|
delta[stat] = delta[stat] - value;
|
|
@@ -13788,8 +13785,8 @@ function registerDatabase(variant) {
|
|
|
13788
13785
|
return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url);
|
|
13789
13786
|
}, "PUBLIC" /* ComponentType.PUBLIC */).setMultipleInstances(true));
|
|
13790
13787
|
app.registerVersion(name, version, variant);
|
|
13791
|
-
// BUILD_TARGET will be replaced by values like
|
|
13792
|
-
app.registerVersion(name, version, '
|
|
13788
|
+
// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
|
|
13789
|
+
app.registerVersion(name, version, 'cjs2017');
|
|
13793
13790
|
}
|
|
13794
13791
|
|
|
13795
13792
|
/**
|
|
@@ -13908,12 +13905,13 @@ class TransactionResult {
|
|
|
13908
13905
|
function runTransaction(ref,
|
|
13909
13906
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13910
13907
|
transactionUpdate, options) {
|
|
13908
|
+
var _a;
|
|
13911
13909
|
ref = util.getModularInstance(ref);
|
|
13912
13910
|
validateWritablePath('Reference.transaction', ref._path);
|
|
13913
13911
|
if (ref.key === '.length' || ref.key === '.keys') {
|
|
13914
13912
|
throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.');
|
|
13915
13913
|
}
|
|
13916
|
-
const applyLocally = options
|
|
13914
|
+
const applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true;
|
|
13917
13915
|
const deferred = new util.Deferred();
|
|
13918
13916
|
const promiseComplete = (error, committed, node) => {
|
|
13919
13917
|
let dataSnapshot = null;
|