@firebase/database 1.0.20 → 1.1.0-20250716004940
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 +10 -10
- package/dist/index.esm2017.js.map +0 -1
package/dist/index.node.cjs.js
CHANGED
|
@@ -1260,7 +1260,7 @@ WebSocketConnection.responsesRequiredToBeHealthy = 2;
|
|
|
1260
1260
|
WebSocketConnection.healthyTimeout = 30000;
|
|
1261
1261
|
|
|
1262
1262
|
const name = "@firebase/database";
|
|
1263
|
-
const version = "1.0
|
|
1263
|
+
const version = "1.1.0-20250716004940";
|
|
1264
1264
|
|
|
1265
1265
|
/**
|
|
1266
1266
|
* @license
|
|
@@ -1288,9 +1288,9 @@ class AppCheckTokenProvider {
|
|
|
1288
1288
|
if (app._isFirebaseServerApp(app$1) && app$1.settings.appCheckToken) {
|
|
1289
1289
|
this.serverAppAppCheckToken = app$1.settings.appCheckToken;
|
|
1290
1290
|
}
|
|
1291
|
-
this.appCheck = appCheckProvider
|
|
1291
|
+
this.appCheck = appCheckProvider?.getImmediate({ optional: true });
|
|
1292
1292
|
if (!this.appCheck) {
|
|
1293
|
-
appCheckProvider
|
|
1293
|
+
appCheckProvider?.get().then(appCheck => (this.appCheck = appCheck));
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
1296
1296
|
getToken(forceRefresh) {
|
|
@@ -1319,8 +1319,9 @@ class AppCheckTokenProvider {
|
|
|
1319
1319
|
return this.appCheck.getToken(forceRefresh);
|
|
1320
1320
|
}
|
|
1321
1321
|
addTokenChangeListener(listener) {
|
|
1322
|
-
|
|
1323
|
-
|
|
1322
|
+
this.appCheckProvider
|
|
1323
|
+
?.get()
|
|
1324
|
+
.then(appCheck => appCheck.addTokenListener(listener));
|
|
1324
1325
|
}
|
|
1325
1326
|
notifyForInvalidToken() {
|
|
1326
1327
|
warn(`Provided AppCheck credentials for the app named "${this.appName}" ` +
|
|
@@ -2488,7 +2489,9 @@ class Connection {
|
|
|
2488
2489
|
if (MESSAGE_DATA in controlData) {
|
|
2489
2490
|
const payload = controlData[MESSAGE_DATA];
|
|
2490
2491
|
if (cmd === SERVER_HELLO) {
|
|
2491
|
-
const handshakePayload =
|
|
2492
|
+
const handshakePayload = {
|
|
2493
|
+
...payload
|
|
2494
|
+
};
|
|
2492
2495
|
if (this.repoInfo_.isUsingEmulator) {
|
|
2493
2496
|
// 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.
|
|
2494
2497
|
handshakePayload.h = this.repoInfo_.host;
|
|
@@ -5304,9 +5307,9 @@ class IndexMap {
|
|
|
5304
5307
|
newIndex = fallbackObject;
|
|
5305
5308
|
}
|
|
5306
5309
|
const indexName = indexDefinition.toString();
|
|
5307
|
-
const newIndexSet =
|
|
5310
|
+
const newIndexSet = { ...this.indexSet_ };
|
|
5308
5311
|
newIndexSet[indexName] = indexDefinition;
|
|
5309
|
-
const newIndexes =
|
|
5312
|
+
const newIndexes = { ...this.indexes_ };
|
|
5310
5313
|
newIndexes[indexName] = newIndex;
|
|
5311
5314
|
return new IndexMap(newIndexes, newIndexSet);
|
|
5312
5315
|
}
|
|
@@ -7110,7 +7113,7 @@ class StatsListener {
|
|
|
7110
7113
|
}
|
|
7111
7114
|
get() {
|
|
7112
7115
|
const newStats = this.collection_.get();
|
|
7113
|
-
const delta =
|
|
7116
|
+
const delta = { ...newStats };
|
|
7114
7117
|
if (this.last_) {
|
|
7115
7118
|
each(this.last_, (stat, value) => {
|
|
7116
7119
|
delta[stat] = delta[stat] - value;
|
|
@@ -13793,8 +13796,8 @@ function registerDatabase(variant) {
|
|
|
13793
13796
|
return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url);
|
|
13794
13797
|
}, "PUBLIC" /* ComponentType.PUBLIC */).setMultipleInstances(true));
|
|
13795
13798
|
app.registerVersion(name, version, variant);
|
|
13796
|
-
// BUILD_TARGET will be replaced by values like
|
|
13797
|
-
app.registerVersion(name, version, '
|
|
13799
|
+
// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation
|
|
13800
|
+
app.registerVersion(name, version, 'cjs2020');
|
|
13798
13801
|
}
|
|
13799
13802
|
|
|
13800
13803
|
/**
|
|
@@ -13913,13 +13916,12 @@ class TransactionResult {
|
|
|
13913
13916
|
function runTransaction(ref,
|
|
13914
13917
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13915
13918
|
transactionUpdate, options) {
|
|
13916
|
-
var _a;
|
|
13917
13919
|
ref = util.getModularInstance(ref);
|
|
13918
13920
|
validateWritablePath('Reference.transaction', ref._path);
|
|
13919
13921
|
if (ref.key === '.length' || ref.key === '.keys') {
|
|
13920
13922
|
throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.');
|
|
13921
13923
|
}
|
|
13922
|
-
const applyLocally =
|
|
13924
|
+
const applyLocally = options?.applyLocally ?? true;
|
|
13923
13925
|
const deferred = new util.Deferred();
|
|
13924
13926
|
const promiseComplete = (error, committed, node) => {
|
|
13925
13927
|
let dataSnapshot = null;
|