@firebase/database 1.0.20-canary.2b5731292 → 1.0.20-canary.2d720995d
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 +15 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/{index.esm2017.js → index.esm.js} +16 -14
- package/dist/index.esm.js.map +1 -0
- package/dist/index.node.cjs.js +15 -13
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +12 -10
- package/dist/index.standalone.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +15 -13
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +11 -11
- package/dist/index.esm2017.js.map +0 -1
package/dist/index.standalone.js
CHANGED
|
@@ -1285,9 +1285,9 @@ class AppCheckTokenProvider {
|
|
|
1285
1285
|
if (app._isFirebaseServerApp(app$1) && app$1.settings.appCheckToken) {
|
|
1286
1286
|
this.serverAppAppCheckToken = app$1.settings.appCheckToken;
|
|
1287
1287
|
}
|
|
1288
|
-
this.appCheck = appCheckProvider
|
|
1288
|
+
this.appCheck = appCheckProvider?.getImmediate({ optional: true });
|
|
1289
1289
|
if (!this.appCheck) {
|
|
1290
|
-
appCheckProvider
|
|
1290
|
+
appCheckProvider?.get().then(appCheck => (this.appCheck = appCheck));
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
1293
|
getToken(forceRefresh) {
|
|
@@ -1316,8 +1316,9 @@ class AppCheckTokenProvider {
|
|
|
1316
1316
|
return this.appCheck.getToken(forceRefresh);
|
|
1317
1317
|
}
|
|
1318
1318
|
addTokenChangeListener(listener) {
|
|
1319
|
-
|
|
1320
|
-
|
|
1319
|
+
this.appCheckProvider
|
|
1320
|
+
?.get()
|
|
1321
|
+
.then(appCheck => appCheck.addTokenListener(listener));
|
|
1321
1322
|
}
|
|
1322
1323
|
notifyForInvalidToken() {
|
|
1323
1324
|
warn(`Provided AppCheck credentials for the app named "${this.appName}" ` +
|
|
@@ -2485,7 +2486,9 @@ class Connection {
|
|
|
2485
2486
|
if (MESSAGE_DATA in controlData) {
|
|
2486
2487
|
const payload = controlData[MESSAGE_DATA];
|
|
2487
2488
|
if (cmd === SERVER_HELLO) {
|
|
2488
|
-
const handshakePayload =
|
|
2489
|
+
const handshakePayload = {
|
|
2490
|
+
...payload
|
|
2491
|
+
};
|
|
2489
2492
|
if (this.repoInfo_.isUsingEmulator) {
|
|
2490
2493
|
// 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.
|
|
2491
2494
|
handshakePayload.h = this.repoInfo_.host;
|
|
@@ -5301,9 +5304,9 @@ class IndexMap {
|
|
|
5301
5304
|
newIndex = fallbackObject;
|
|
5302
5305
|
}
|
|
5303
5306
|
const indexName = indexDefinition.toString();
|
|
5304
|
-
const newIndexSet =
|
|
5307
|
+
const newIndexSet = { ...this.indexSet_ };
|
|
5305
5308
|
newIndexSet[indexName] = indexDefinition;
|
|
5306
|
-
const newIndexes =
|
|
5309
|
+
const newIndexes = { ...this.indexes_ };
|
|
5307
5310
|
newIndexes[indexName] = newIndex;
|
|
5308
5311
|
return new IndexMap(newIndexes, newIndexSet);
|
|
5309
5312
|
}
|
|
@@ -7107,7 +7110,7 @@ class StatsListener {
|
|
|
7107
7110
|
}
|
|
7108
7111
|
get() {
|
|
7109
7112
|
const newStats = this.collection_.get();
|
|
7110
|
-
const delta =
|
|
7113
|
+
const delta = { ...newStats };
|
|
7111
7114
|
if (this.last_) {
|
|
7112
7115
|
each(this.last_, (stat, value) => {
|
|
7113
7116
|
delta[stat] = delta[stat] - value;
|
|
@@ -13858,13 +13861,12 @@ class TransactionResult {
|
|
|
13858
13861
|
function runTransaction(ref,
|
|
13859
13862
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13860
13863
|
transactionUpdate, options) {
|
|
13861
|
-
var _a;
|
|
13862
13864
|
ref = util.getModularInstance(ref);
|
|
13863
13865
|
validateWritablePath('Reference.transaction', ref._path);
|
|
13864
13866
|
if (ref.key === '.length' || ref.key === '.keys') {
|
|
13865
13867
|
throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.');
|
|
13866
13868
|
}
|
|
13867
|
-
const applyLocally =
|
|
13869
|
+
const applyLocally = options?.applyLocally ?? true;
|
|
13868
13870
|
const deferred = new util.Deferred();
|
|
13869
13871
|
const promiseComplete = (error, committed, node) => {
|
|
13870
13872
|
let dataSnapshot = null;
|