@firebase/database 0.8.3-canary.fb90580e5 → 0.8.3
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.d.ts +0 -16
- package/dist/index.esm.js +34 -163
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm2017.js +34 -161
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +34 -163
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/src/api/Query.d.ts +0 -2
- package/dist/src/core/AuthTokenProvider.d.ts +2 -2
- package/dist/src/core/Repo.d.ts +21 -10
- package/dist/src/core/RepoManager.d.ts +2 -8
- package/dist/src/core/util/NextPushId.d.ts +0 -2
- package/dist/src/core/util/util.d.ts +0 -8
- package/dist/src/core/view/QueryParams.d.ts +0 -6
- package/package.json +13 -16
- package/dist/exp/exp/index.d.ts +0 -29
- package/dist/exp/index.d.ts +0 -49
- package/dist/exp/index.esm.js +0 -15735
- package/dist/exp/index.esm.js.map +0 -1
- package/dist/exp/index.esm2017.js +0 -15139
- package/dist/exp/index.esm2017.js.map +0 -1
- package/dist/exp/index.node.cjs.js +0 -15746
- package/dist/exp/index.node.cjs.js.map +0 -1
- package/dist/exp/index.node.d.ts +0 -83
- package/dist/exp/src/api/DataSnapshot.d.ts +0 -99
- package/dist/exp/src/api/Database.d.ts +0 -87
- package/dist/exp/src/api/Query.d.ts +0 -193
- package/dist/exp/src/api/Reference.d.ts +0 -106
- package/dist/exp/src/api/TransactionResult.d.ts +0 -30
- package/dist/exp/src/api/internal.d.ts +0 -55
- package/dist/exp/src/api/onDisconnect.d.ts +0 -60
- package/dist/exp/src/api/test_access.d.ts +0 -42
- package/dist/exp/src/core/AuthTokenProvider.d.ts +0 -50
- package/dist/exp/src/core/CompoundWrite.d.ts +0 -77
- package/dist/exp/src/core/PersistentConnection.d.ts +0 -148
- package/dist/exp/src/core/ReadonlyRestClient.d.ts +0 -73
- package/dist/exp/src/core/Repo.d.ts +0 -121
- package/dist/exp/src/core/RepoInfo.d.ts +0 -59
- package/dist/exp/src/core/RepoManager.d.ts +0 -78
- package/dist/exp/src/core/Repo_transaction.d.ts +0 -33
- package/dist/exp/src/core/ServerActions.d.ts +0 -85
- package/dist/exp/src/core/SnapshotHolder.d.ts +0 -28
- package/dist/exp/src/core/SparseSnapshotTree.d.ts +0 -61
- package/dist/exp/src/core/SyncPoint.d.ts +0 -84
- package/dist/exp/src/core/SyncTree.d.ts +0 -236
- package/dist/exp/src/core/WriteTree.d.ts +0 -295
- package/dist/exp/src/core/operation/AckUserWrite.d.ts +0 -42
- package/dist/exp/src/core/operation/ListenComplete.d.ts +0 -32
- package/dist/exp/src/core/operation/Merge.d.ts +0 -46
- package/dist/exp/src/core/operation/Operation.d.ts +0 -78
- package/dist/exp/src/core/operation/Overwrite.d.ts +0 -35
- package/dist/exp/src/core/snap/ChildrenNode.d.ts +0 -180
- package/dist/exp/src/core/snap/IndexMap.d.ts +0 -43
- package/dist/exp/src/core/snap/LeafNode.d.ts +0 -107
- package/dist/exp/src/core/snap/Node.d.ts +0 -148
- package/dist/exp/src/core/snap/childSet.d.ts +0 -34
- package/dist/exp/src/core/snap/comparators.d.ts +0 -19
- package/dist/exp/src/core/snap/indexes/Index.d.ts +0 -69
- package/dist/exp/src/core/snap/indexes/KeyIndex.d.ts +0 -54
- package/dist/exp/src/core/snap/indexes/PathIndex.d.ts +0 -54
- package/dist/exp/src/core/snap/indexes/PriorityIndex.d.ts +0 -58
- package/dist/exp/src/core/snap/indexes/ValueIndex.d.ts +0 -56
- package/dist/exp/src/core/snap/nodeFromJSON.d.ts +0 -25
- package/dist/exp/src/core/snap/snap.d.ts +0 -29
- package/dist/exp/src/core/stats/StatsCollection.d.ts +0 -28
- package/dist/exp/src/core/stats/StatsListener.d.ts +0 -31
- package/dist/exp/src/core/stats/StatsManager.d.ts +0 -24
- package/dist/exp/src/core/stats/StatsReporter.d.ts +0 -33
- package/dist/exp/src/core/storage/DOMStorageWrapper.d.ts +0 -55
- package/dist/exp/src/core/storage/MemoryStorage.d.ts +0 -29
- package/dist/exp/src/core/storage/storage.d.ts +0 -22
- package/dist/exp/src/core/util/EventEmitter.d.ts +0 -45
- package/dist/exp/src/core/util/ImmutableTree.d.ts +0 -157
- package/dist/exp/src/core/util/NextPushId.d.ts +0 -33
- package/dist/exp/src/core/util/OnlineMonitor.d.ts +0 -40
- package/dist/exp/src/core/util/Path.d.ts +0 -132
- package/dist/exp/src/core/util/ServerValues.d.ts +0 -66
- package/dist/exp/src/core/util/SortedMap.d.ts +0 -362
- package/dist/exp/src/core/util/Tree.d.ts +0 -134
- package/dist/exp/src/core/util/VisibilityMonitor.d.ts +0 -30
- package/dist/exp/src/core/util/libs/parser.d.ts +0 -37
- package/dist/exp/src/core/util/misc.d.ts +0 -19
- package/dist/exp/src/core/util/util.d.ts +0 -232
- package/dist/exp/src/core/util/validation.d.ts +0 -108
- package/dist/exp/src/core/version.d.ts +0 -19
- package/dist/exp/src/core/view/CacheNode.d.ts +0 -59
- package/dist/exp/src/core/view/Change.d.ts +0 -74
- package/dist/exp/src/core/view/ChildChangeAccumulator.d.ts +0 -22
- package/dist/exp/src/core/view/CompleteChildSource.d.ts +0 -91
- package/dist/exp/src/core/view/Event.d.ts +0 -102
- package/dist/exp/src/core/view/EventGenerator.d.ts +0 -77
- package/dist/exp/src/core/view/EventQueue.d.ts +0 -99
- package/dist/exp/src/core/view/EventRegistration.d.ts +0 -154
- package/dist/exp/src/core/view/QueryParams.d.ts +0 -176
- package/dist/exp/src/core/view/View.d.ts +0 -97
- package/dist/exp/src/core/view/ViewCache.d.ts +0 -70
- package/dist/exp/src/core/view/ViewProcessor.d.ts +0 -166
- package/dist/exp/src/core/view/filter/IndexedFilter.d.ts +0 -54
- package/dist/exp/src/core/view/filter/LimitedFilter.d.ts +0 -94
- package/dist/exp/src/core/view/filter/NodeFilter.d.ts +0 -75
- package/dist/exp/src/core/view/filter/RangedFilter.d.ts +0 -109
- package/dist/exp/src/exp/Database.d.ts +0 -95
- package/dist/exp/src/realtime/BrowserPollConnection.d.ts +0 -208
- package/dist/exp/src/realtime/Connection.d.ts +0 -119
- package/dist/exp/src/realtime/Constants.d.ts +0 -26
- package/dist/exp/src/realtime/Transport.d.ts +0 -62
- package/dist/exp/src/realtime/TransportManager.d.ts +0 -55
- package/dist/exp/src/realtime/WebSocketConnection.d.ts +0 -133
- package/dist/exp/src/realtime/polling/PacketReceiver.d.ts +0 -41
- package/dist/exp/test/browser/crawler_support.test.d.ts +0 -17
- package/dist/exp/test/compound_write.test.d.ts +0 -17
- package/dist/exp/test/connection.test.d.ts +0 -17
- package/dist/exp/test/database.test.d.ts +0 -17
- package/dist/exp/test/datasnapshot.test.d.ts +0 -17
- package/dist/exp/test/exp/integration.test.d.ts +0 -17
- package/dist/exp/test/helpers/EventAccumulator.d.ts +0 -34
- package/dist/exp/test/helpers/events.d.ts +0 -37
- package/dist/exp/test/helpers/util.d.ts +0 -50
- package/dist/exp/test/info.test.d.ts +0 -17
- package/dist/exp/test/node.test.d.ts +0 -17
- package/dist/exp/test/order.test.d.ts +0 -17
- package/dist/exp/test/order_by.test.d.ts +0 -17
- package/dist/exp/test/path.test.d.ts +0 -17
- package/dist/exp/test/promise.test.d.ts +0 -17
- package/dist/exp/test/pushid.test.d.ts +0 -17
- package/dist/exp/test/query.test.d.ts +0 -17
- package/dist/exp/test/repoinfo.test.d.ts +0 -17
- package/dist/exp/test/servervalues.test.d.ts +0 -17
- package/dist/exp/test/sortedmap.test.d.ts +0 -17
- package/dist/exp/test/sparsesnapshottree.test.d.ts +0 -17
- package/dist/exp/test/transaction.test.d.ts +0 -17
- package/dist/src/exp/Database.d.ts +0 -95
- package/dist/test/exp/integration.test.d.ts +0 -17
- package/dist/test/pushid.test.d.ts +0 -17
package/dist/index.esm2017.js
CHANGED
|
@@ -631,14 +631,6 @@ const errorForServerCode = function (code, query) {
|
|
|
631
631
|
* @private
|
|
632
632
|
*/
|
|
633
633
|
const INTEGER_REGEXP_ = new RegExp('^-?(0*)\\d{1,10}$');
|
|
634
|
-
/**
|
|
635
|
-
* For use in keys, the minimum possible 32-bit integer.
|
|
636
|
-
*/
|
|
637
|
-
const INTEGER_32_MIN = -2147483648;
|
|
638
|
-
/**
|
|
639
|
-
* For use in kyes, the maximum possible 32-bit integer.
|
|
640
|
-
*/
|
|
641
|
-
const INTEGER_32_MAX = 2147483647;
|
|
642
634
|
/**
|
|
643
635
|
* If the string contains a 32-bit integer, return it. Else return null.
|
|
644
636
|
* @param {!string} str
|
|
@@ -647,7 +639,7 @@ const INTEGER_32_MAX = 2147483647;
|
|
|
647
639
|
const tryParseInt = function (str) {
|
|
648
640
|
if (INTEGER_REGEXP_.test(str)) {
|
|
649
641
|
const intVal = Number(str);
|
|
650
|
-
if (intVal >=
|
|
642
|
+
if (intVal >= -2147483648 && intVal <= 2147483647) {
|
|
651
643
|
return intVal;
|
|
652
644
|
}
|
|
653
645
|
}
|
|
@@ -1816,11 +1808,6 @@ class TransactionResult {
|
|
|
1816
1808
|
* See the License for the specific language governing permissions and
|
|
1817
1809
|
* limitations under the License.
|
|
1818
1810
|
*/
|
|
1819
|
-
// Modeled after base64 web-safe chars, but ordered by ASCII.
|
|
1820
|
-
const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
|
|
1821
|
-
const MIN_PUSH_CHAR = '-';
|
|
1822
|
-
const MAX_PUSH_CHAR = 'z';
|
|
1823
|
-
const MAX_KEY_LEN = 786;
|
|
1824
1811
|
/**
|
|
1825
1812
|
* Fancy ID generator that creates 20-character string identifiers with the
|
|
1826
1813
|
* following properties:
|
|
@@ -1836,6 +1823,8 @@ const MAX_KEY_LEN = 786;
|
|
|
1836
1823
|
* in the case of a timestamp collision).
|
|
1837
1824
|
*/
|
|
1838
1825
|
const nextPushId = (function () {
|
|
1826
|
+
// Modeled after base64 web-safe chars, but ordered by ASCII.
|
|
1827
|
+
const PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
|
|
1839
1828
|
// Timestamp of last push, used to prevent local collisions if you push twice
|
|
1840
1829
|
// in one ms.
|
|
1841
1830
|
let lastPushTime = 0;
|
|
@@ -1876,76 +1865,7 @@ const nextPushId = (function () {
|
|
|
1876
1865
|
assert(id.length === 20, 'nextPushId: Length should be 20.');
|
|
1877
1866
|
return id;
|
|
1878
1867
|
};
|
|
1879
|
-
})();
|
|
1880
|
-
const successor = function (key) {
|
|
1881
|
-
if (key === '' + INTEGER_32_MAX) {
|
|
1882
|
-
// See https://firebase.google.com/docs/database/web/lists-of-data#data-order
|
|
1883
|
-
return MIN_PUSH_CHAR;
|
|
1884
|
-
}
|
|
1885
|
-
const keyAsInt = tryParseInt(key);
|
|
1886
|
-
if (keyAsInt != null) {
|
|
1887
|
-
return '' + (keyAsInt + 1);
|
|
1888
|
-
}
|
|
1889
|
-
const next = new Array(key.length);
|
|
1890
|
-
for (let i = 0; i < next.length; i++) {
|
|
1891
|
-
next[i] = key.charAt(i);
|
|
1892
|
-
}
|
|
1893
|
-
if (next.length < MAX_KEY_LEN) {
|
|
1894
|
-
next.push(MIN_PUSH_CHAR);
|
|
1895
|
-
return next.join('');
|
|
1896
|
-
}
|
|
1897
|
-
let i = next.length - 1;
|
|
1898
|
-
while (i >= 0 && next[i] === MAX_PUSH_CHAR) {
|
|
1899
|
-
i--;
|
|
1900
|
-
}
|
|
1901
|
-
// `successor` was called on the largest possible key, so return the
|
|
1902
|
-
// MAX_NAME, which sorts larger than all keys.
|
|
1903
|
-
if (i === -1) {
|
|
1904
|
-
return MAX_NAME;
|
|
1905
|
-
}
|
|
1906
|
-
const source = next[i];
|
|
1907
|
-
const sourcePlusOne = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(source) + 1);
|
|
1908
|
-
next[i] = sourcePlusOne;
|
|
1909
|
-
return next.slice(0, i + 1).join('');
|
|
1910
|
-
};
|
|
1911
|
-
// `key` is assumed to be non-empty.
|
|
1912
|
-
const predecessor = function (key) {
|
|
1913
|
-
if (key === '' + INTEGER_32_MIN) {
|
|
1914
|
-
return MIN_NAME;
|
|
1915
|
-
}
|
|
1916
|
-
const keyAsInt = tryParseInt(key);
|
|
1917
|
-
if (keyAsInt != null) {
|
|
1918
|
-
return '' + (keyAsInt - 1);
|
|
1919
|
-
}
|
|
1920
|
-
const next = new Array(key.length);
|
|
1921
|
-
for (let i = 0; i < next.length; i++) {
|
|
1922
|
-
next[i] = key.charAt(i);
|
|
1923
|
-
}
|
|
1924
|
-
// If `key` ends in `MIN_PUSH_CHAR`, the largest key lexicographically
|
|
1925
|
-
// smaller than `key`, is `key[0:key.length - 1]`. The next key smaller
|
|
1926
|
-
// than that, `predecessor(predecessor(key))`, is
|
|
1927
|
-
//
|
|
1928
|
-
// `key[0:key.length - 2] + (key[key.length - 1] - 1) + \
|
|
1929
|
-
// { MAX_PUSH_CHAR repeated MAX_KEY_LEN - (key.length - 1) times }
|
|
1930
|
-
//
|
|
1931
|
-
// analogous to increment/decrement for base-10 integers.
|
|
1932
|
-
//
|
|
1933
|
-
// This works because lexigographic comparison works character-by-character,
|
|
1934
|
-
// using length as a tie-breaker if one key is a prefix of the other.
|
|
1935
|
-
if (next[next.length - 1] === MIN_PUSH_CHAR) {
|
|
1936
|
-
if (next.length === 1) {
|
|
1937
|
-
// See https://firebase.google.com/docs/database/web/lists-of-data#orderbykey
|
|
1938
|
-
return '' + INTEGER_32_MAX;
|
|
1939
|
-
}
|
|
1940
|
-
delete next[next.length - 1];
|
|
1941
|
-
return next.join('');
|
|
1942
|
-
}
|
|
1943
|
-
// Replace the last character with it's immediate predecessor, and
|
|
1944
|
-
// fill the suffix of the key with MAX_PUSH_CHAR. This is the
|
|
1945
|
-
// lexicographically largest possible key smaller than `key`.
|
|
1946
|
-
next[next.length - 1] = PUSH_CHARS.charAt(PUSH_CHARS.indexOf(next[next.length - 1]) - 1);
|
|
1947
|
-
return next.join('') + MAX_PUSH_CHAR.repeat(MAX_KEY_LEN - next.length);
|
|
1948
|
-
};
|
|
1868
|
+
})();
|
|
1949
1869
|
|
|
1950
1870
|
/**
|
|
1951
1871
|
* @license
|
|
@@ -4707,8 +4627,7 @@ class Query {
|
|
|
4707
4627
|
'or equalTo() must be a string.';
|
|
4708
4628
|
if (params.hasStart()) {
|
|
4709
4629
|
const startName = params.getIndexStartName();
|
|
4710
|
-
if (startName !== MIN_NAME
|
|
4711
|
-
!(params.hasStartAfter() && startName === MAX_NAME)) {
|
|
4630
|
+
if (startName !== MIN_NAME) {
|
|
4712
4631
|
throw new Error(tooManyArgsError);
|
|
4713
4632
|
}
|
|
4714
4633
|
else if (typeof startNode !== 'string') {
|
|
@@ -4717,8 +4636,7 @@ class Query {
|
|
|
4717
4636
|
}
|
|
4718
4637
|
if (params.hasEnd()) {
|
|
4719
4638
|
const endName = params.getIndexEndName();
|
|
4720
|
-
if (endName !== MAX_NAME
|
|
4721
|
-
!(params.hasEndBefore() && endName === MIN_NAME)) {
|
|
4639
|
+
if (endName !== MAX_NAME) {
|
|
4722
4640
|
throw new Error(tooManyArgsError);
|
|
4723
4641
|
}
|
|
4724
4642
|
else if (typeof endNode !== 'string') {
|
|
@@ -5017,19 +4935,6 @@ class Query {
|
|
|
5017
4935
|
}
|
|
5018
4936
|
return new Query(this.repo, this.path, newParams, this.orderByCalled_);
|
|
5019
4937
|
}
|
|
5020
|
-
startAfter(value = null, name) {
|
|
5021
|
-
validateArgCount('Query.startAfter', 0, 2, arguments.length);
|
|
5022
|
-
validateFirebaseDataArg('Query.startAfter', 1, value, this.path, false);
|
|
5023
|
-
validateKey('Query.startAfter', 2, name, true);
|
|
5024
|
-
const newParams = this.queryParams_.startAfter(value, name);
|
|
5025
|
-
Query.validateLimit_(newParams);
|
|
5026
|
-
Query.validateQueryEndpoints_(newParams);
|
|
5027
|
-
if (this.queryParams_.hasStart()) {
|
|
5028
|
-
throw new Error('Query.startAfter: Starting point was already set (by another call to startAt, startAfter ' +
|
|
5029
|
-
'or equalTo).');
|
|
5030
|
-
}
|
|
5031
|
-
return new Query(this.repo, this.path, newParams, this.orderByCalled_);
|
|
5032
|
-
}
|
|
5033
4938
|
/**
|
|
5034
4939
|
* @param {number|string|boolean|null} value
|
|
5035
4940
|
* @param {?string=} name
|
|
@@ -5043,20 +4948,7 @@ class Query {
|
|
|
5043
4948
|
Query.validateLimit_(newParams);
|
|
5044
4949
|
Query.validateQueryEndpoints_(newParams);
|
|
5045
4950
|
if (this.queryParams_.hasEnd()) {
|
|
5046
|
-
throw new Error('Query.endAt: Ending point was already set (by another call to endAt
|
|
5047
|
-
'equalTo).');
|
|
5048
|
-
}
|
|
5049
|
-
return new Query(this.repo, this.path, newParams, this.orderByCalled_);
|
|
5050
|
-
}
|
|
5051
|
-
endBefore(value = null, name) {
|
|
5052
|
-
validateArgCount('Query.endBefore', 0, 2, arguments.length);
|
|
5053
|
-
validateFirebaseDataArg('Query.endBefore', 1, value, this.path, false);
|
|
5054
|
-
validateKey('Query.endBefore', 2, name, true);
|
|
5055
|
-
const newParams = this.queryParams_.endBefore(value, name);
|
|
5056
|
-
Query.validateLimit_(newParams);
|
|
5057
|
-
Query.validateQueryEndpoints_(newParams);
|
|
5058
|
-
if (this.queryParams_.hasEnd()) {
|
|
5059
|
-
throw new Error('Query.endBefore: Ending point was already set (by another call to endAt, endBefore, or ' +
|
|
4951
|
+
throw new Error('Query.endAt: Ending point was already set (by another call to endAt or ' +
|
|
5060
4952
|
'equalTo).');
|
|
5061
4953
|
}
|
|
5062
4954
|
return new Query(this.repo, this.path, newParams, this.orderByCalled_);
|
|
@@ -12512,30 +12404,43 @@ class Repo {
|
|
|
12512
12404
|
* The purpose of `getValue` is to return the latest known value
|
|
12513
12405
|
* satisfying `query`.
|
|
12514
12406
|
*
|
|
12515
|
-
*
|
|
12516
|
-
*
|
|
12517
|
-
*
|
|
12407
|
+
* If the client is connected, this method will send a request
|
|
12408
|
+
* to the server. If the client is not connected, then either:
|
|
12409
|
+
*
|
|
12410
|
+
* 1. The client was once connected, but not anymore.
|
|
12411
|
+
* 2. The client has never connected, this is the first operation
|
|
12412
|
+
* this repo is handling.
|
|
12413
|
+
*
|
|
12414
|
+
* In case (1), it's possible that the client still has an active
|
|
12415
|
+
* listener, with cached data. Since this is the latest known
|
|
12416
|
+
* value satisfying the query, that's what getValue will return.
|
|
12417
|
+
* If there is no cached data, `getValue` surfaces an "offline"
|
|
12418
|
+
* error.
|
|
12518
12419
|
*
|
|
12519
|
-
*
|
|
12520
|
-
*
|
|
12521
|
-
*
|
|
12522
|
-
*
|
|
12420
|
+
* In case (2), `getValue` will trigger a time-limited connection
|
|
12421
|
+
* attempt. If the client is unable to connect to the server, it
|
|
12422
|
+
* will surface an "offline" error because there cannot be any
|
|
12423
|
+
* cached data. On the other hand, if the client is able to connect,
|
|
12424
|
+
* `getValue` will return the server's value for the query, if one
|
|
12425
|
+
* exists.
|
|
12523
12426
|
*
|
|
12524
12427
|
* @param query - The query to surface a value for.
|
|
12525
12428
|
*/
|
|
12526
12429
|
getValue(query) {
|
|
12527
|
-
// Only active queries are cached. There is no persisted cache.
|
|
12528
|
-
const cached = this.serverSyncTree_.calcCompleteEventCache(query.path);
|
|
12529
|
-
if (!cached.isEmpty()) {
|
|
12530
|
-
return Promise.resolve(new DataSnapshot(cached, query.getRef(), query.getQueryParams().getIndex()));
|
|
12531
|
-
}
|
|
12532
12430
|
return this.server_.get(query).then(payload => {
|
|
12533
12431
|
const node = nodeFromJSON$1(payload);
|
|
12534
12432
|
const events = this.serverSyncTree_.applyServerOverwrite(query.path, node);
|
|
12535
12433
|
this.eventQueue_.raiseEventsAtPath(query.path, events);
|
|
12536
12434
|
return Promise.resolve(new DataSnapshot(node, query.getRef(), query.getQueryParams().getIndex()));
|
|
12537
12435
|
}, err => {
|
|
12538
|
-
this.log_('get for query ' +
|
|
12436
|
+
this.log_('get for query ' +
|
|
12437
|
+
stringify(query) +
|
|
12438
|
+
' falling back to cache after error: ' +
|
|
12439
|
+
err);
|
|
12440
|
+
const cached = this.serverSyncTree_.calcCompleteEventCache(query.path);
|
|
12441
|
+
if (!cached.isEmpty()) {
|
|
12442
|
+
return Promise.resolve(new DataSnapshot(cached, query.getRef(), query.getQueryParams().getIndex()));
|
|
12443
|
+
}
|
|
12539
12444
|
return Promise.reject(new Error(err));
|
|
12540
12445
|
});
|
|
12541
12446
|
}
|
|
@@ -13170,10 +13075,8 @@ class QueryParams {
|
|
|
13170
13075
|
this.limitSet_ = false;
|
|
13171
13076
|
this.startSet_ = false;
|
|
13172
13077
|
this.startNameSet_ = false;
|
|
13173
|
-
this.startAfterSet_ = false;
|
|
13174
13078
|
this.endSet_ = false;
|
|
13175
13079
|
this.endNameSet_ = false;
|
|
13176
|
-
this.endBeforeSet_ = false;
|
|
13177
13080
|
this.limit_ = 0;
|
|
13178
13081
|
this.viewFrom_ = '';
|
|
13179
13082
|
this.indexStartValue_ = null;
|
|
@@ -13188,12 +13091,6 @@ class QueryParams {
|
|
|
13188
13091
|
hasStart() {
|
|
13189
13092
|
return this.startSet_;
|
|
13190
13093
|
}
|
|
13191
|
-
hasStartAfter() {
|
|
13192
|
-
return this.startAfterSet_;
|
|
13193
|
-
}
|
|
13194
|
-
hasEndBefore() {
|
|
13195
|
-
return this.endBeforeSet_;
|
|
13196
|
-
}
|
|
13197
13094
|
/**
|
|
13198
13095
|
* @return {boolean} True if it would return from left.
|
|
13199
13096
|
*/
|
|
@@ -13360,18 +13257,6 @@ class QueryParams {
|
|
|
13360
13257
|
}
|
|
13361
13258
|
return newParams;
|
|
13362
13259
|
}
|
|
13363
|
-
startAfter(indexValue, key) {
|
|
13364
|
-
let childKey;
|
|
13365
|
-
if (key == null) {
|
|
13366
|
-
childKey = MAX_NAME;
|
|
13367
|
-
}
|
|
13368
|
-
else {
|
|
13369
|
-
childKey = successor(key);
|
|
13370
|
-
}
|
|
13371
|
-
const params = this.startAt(indexValue, childKey);
|
|
13372
|
-
params.startAfterSet_ = true;
|
|
13373
|
-
return params;
|
|
13374
|
-
}
|
|
13375
13260
|
/**
|
|
13376
13261
|
* @param {*} indexValue
|
|
13377
13262
|
* @param {?string=} key
|
|
@@ -13394,18 +13279,6 @@ class QueryParams {
|
|
|
13394
13279
|
}
|
|
13395
13280
|
return newParams;
|
|
13396
13281
|
}
|
|
13397
|
-
endBefore(indexValue, key) {
|
|
13398
|
-
let childKey;
|
|
13399
|
-
if (key == null) {
|
|
13400
|
-
childKey = MIN_NAME;
|
|
13401
|
-
}
|
|
13402
|
-
else {
|
|
13403
|
-
childKey = predecessor(key);
|
|
13404
|
-
}
|
|
13405
|
-
const params = this.endAt(indexValue, childKey);
|
|
13406
|
-
params.endBeforeSet_ = true;
|
|
13407
|
-
return params;
|
|
13408
|
-
}
|
|
13409
13282
|
/**
|
|
13410
13283
|
* @param {!Index} index
|
|
13411
13284
|
* @return {!QueryParams}
|
|
@@ -15197,7 +15070,7 @@ var TEST_ACCESS = /*#__PURE__*/Object.freeze({
|
|
|
15197
15070
|
});
|
|
15198
15071
|
|
|
15199
15072
|
const name = "@firebase/database";
|
|
15200
|
-
const version = "0.8.3
|
|
15073
|
+
const version = "0.8.3";
|
|
15201
15074
|
|
|
15202
15075
|
/**
|
|
15203
15076
|
* @license
|