@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
|
@@ -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.20-canary.
|
|
7
|
+
const version = "1.0.20-canary.f11b55294";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
@@ -717,9 +717,9 @@ class AppCheckTokenProvider {
|
|
|
717
717
|
if (_isFirebaseServerApp(app) && app.settings.appCheckToken) {
|
|
718
718
|
this.serverAppAppCheckToken = app.settings.appCheckToken;
|
|
719
719
|
}
|
|
720
|
-
this.appCheck = appCheckProvider
|
|
720
|
+
this.appCheck = appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.getImmediate({ optional: true });
|
|
721
721
|
if (!this.appCheck) {
|
|
722
|
-
appCheckProvider
|
|
722
|
+
appCheckProvider === null || appCheckProvider === void 0 ? void 0 : appCheckProvider.get().then(appCheck => (this.appCheck = appCheck));
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
getToken(forceRefresh) {
|
|
@@ -748,9 +748,8 @@ class AppCheckTokenProvider {
|
|
|
748
748
|
return this.appCheck.getToken(forceRefresh);
|
|
749
749
|
}
|
|
750
750
|
addTokenChangeListener(listener) {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
.then(appCheck => appCheck.addTokenListener(listener));
|
|
751
|
+
var _a;
|
|
752
|
+
(_a = this.appCheckProvider) === null || _a === void 0 ? void 0 : _a.get().then(appCheck => appCheck.addTokenListener(listener));
|
|
754
753
|
}
|
|
755
754
|
notifyForInvalidToken() {
|
|
756
755
|
warn(`Provided AppCheck credentials for the app named "${this.appName}" ` +
|
|
@@ -2477,9 +2476,7 @@ class Connection {
|
|
|
2477
2476
|
if (MESSAGE_DATA in controlData) {
|
|
2478
2477
|
const payload = controlData[MESSAGE_DATA];
|
|
2479
2478
|
if (cmd === SERVER_HELLO) {
|
|
2480
|
-
const handshakePayload = {
|
|
2481
|
-
...payload
|
|
2482
|
-
};
|
|
2479
|
+
const handshakePayload = Object.assign({}, payload);
|
|
2483
2480
|
if (this.repoInfo_.isUsingEmulator) {
|
|
2484
2481
|
// 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.
|
|
2485
2482
|
handshakePayload.h = this.repoInfo_.host;
|
|
@@ -5295,9 +5292,9 @@ class IndexMap {
|
|
|
5295
5292
|
newIndex = fallbackObject;
|
|
5296
5293
|
}
|
|
5297
5294
|
const indexName = indexDefinition.toString();
|
|
5298
|
-
const newIndexSet = {
|
|
5295
|
+
const newIndexSet = Object.assign({}, this.indexSet_);
|
|
5299
5296
|
newIndexSet[indexName] = indexDefinition;
|
|
5300
|
-
const newIndexes = {
|
|
5297
|
+
const newIndexes = Object.assign({}, this.indexes_);
|
|
5301
5298
|
newIndexes[indexName] = newIndex;
|
|
5302
5299
|
return new IndexMap(newIndexes, newIndexSet);
|
|
5303
5300
|
}
|
|
@@ -7101,7 +7098,7 @@ class StatsListener {
|
|
|
7101
7098
|
}
|
|
7102
7099
|
get() {
|
|
7103
7100
|
const newStats = this.collection_.get();
|
|
7104
|
-
const delta = {
|
|
7101
|
+
const delta = Object.assign({}, newStats);
|
|
7105
7102
|
if (this.last_) {
|
|
7106
7103
|
each(this.last_, (stat, value) => {
|
|
7107
7104
|
delta[stat] = delta[stat] - value;
|
|
@@ -13784,8 +13781,8 @@ function registerDatabase(variant) {
|
|
|
13784
13781
|
return repoManagerDatabaseFromApp(app, authProvider, appCheckProvider, url);
|
|
13785
13782
|
}, "PUBLIC" /* ComponentType.PUBLIC */).setMultipleInstances(true));
|
|
13786
13783
|
registerVersion(name, version, variant);
|
|
13787
|
-
// BUILD_TARGET will be replaced by values like
|
|
13788
|
-
registerVersion(name, version, '
|
|
13784
|
+
// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
|
|
13785
|
+
registerVersion(name, version, 'esm2017');
|
|
13789
13786
|
}
|
|
13790
13787
|
|
|
13791
13788
|
/**
|
|
@@ -13904,12 +13901,13 @@ class TransactionResult {
|
|
|
13904
13901
|
function runTransaction(ref,
|
|
13905
13902
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13906
13903
|
transactionUpdate, options) {
|
|
13904
|
+
var _a;
|
|
13907
13905
|
ref = getModularInstance(ref);
|
|
13908
13906
|
validateWritablePath('Reference.transaction', ref._path);
|
|
13909
13907
|
if (ref.key === '.length' || ref.key === '.keys') {
|
|
13910
13908
|
throw ('Reference.transaction failed: ' + ref.key + ' is a read-only object.');
|
|
13911
13909
|
}
|
|
13912
|
-
const applyLocally = options
|
|
13910
|
+
const applyLocally = (_a = options === null || options === void 0 ? void 0 : options.applyLocally) !== null && _a !== void 0 ? _a : true;
|
|
13913
13911
|
const deferred = new Deferred();
|
|
13914
13912
|
const promiseComplete = (error, committed, node) => {
|
|
13915
13913
|
let dataSnapshot = null;
|
|
@@ -14029,4 +14027,4 @@ function _initStandalone({ app, url, version, customAuthImpl, customAppCheckImpl
|
|
|
14029
14027
|
registerDatabase();
|
|
14030
14028
|
|
|
14031
14029
|
export { DataSnapshot, Database, OnDisconnect, QueryConstraint, TransactionResult, QueryImpl as _QueryImpl, QueryParams as _QueryParams, ReferenceImpl as _ReferenceImpl, forceRestClient as _TEST_ACCESS_forceRestClient, hijackHash as _TEST_ACCESS_hijackHash, _initStandalone, repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp, setSDKVersion as _setSDKVersion, validatePathString as _validatePathString, validateWritablePath as _validateWritablePath, child, connectDatabaseEmulator, enableLogging, endAt, endBefore, equalTo, forceLongPolling, forceWebSockets, get, getDatabase, goOffline, goOnline, increment, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, runTransaction, serverTimestamp, set, setPriority, setWithPriority, startAfter, startAt, update };
|
|
14032
|
-
//# sourceMappingURL=index.
|
|
14030
|
+
//# sourceMappingURL=index.esm2017.js.map
|