@firebase/firestore 3.4.4-canary.aaeab08ac → 3.4.4-canary.c1b9cf120
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/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/firestore/src/api.d.ts +1 -1
- package/dist/firestore/src/core/database_info.d.ts +1 -0
- package/dist/firestore/src/core/target.d.ts +34 -5
- package/dist/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
- package/dist/firestore/src/local/indexeddb_persistence.d.ts +4 -4
- package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/firestore/src/local/indexeddb_schema.d.ts +149 -7
- package/dist/firestore/src/local/local_documents_view.d.ts +0 -1
- package/dist/firestore/src/local/local_serializer.d.ts +7 -2
- package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/memory_persistence.d.ts +3 -2
- package/dist/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/firestore/src/local/persistence.d.ts +2 -2
- package/dist/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/firestore/src/model/field_index.d.ts +6 -2
- package/dist/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/firestore/src/model/values.d.ts +7 -0
- package/dist/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
- package/dist/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +2 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.esm2017.js +3655 -3412
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3737 -3538
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +689 -406
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +689 -406
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3881 -3638
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +179 -14
- package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/firestore/src/api.d.ts +1 -1
- package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
- package/dist/lite/firestore/src/local/indexeddb_persistence.d.ts +4 -4
- package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +149 -7
- package/dist/lite/firestore/src/local/local_documents_view.d.ts +0 -1
- package/dist/lite/firestore/src/local/local_serializer.d.ts +7 -2
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/memory_persistence.d.ts +3 -2
- package/dist/lite/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/lite/firestore/src/local/persistence.d.ts +2 -2
- package/dist/lite/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/lite/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +6 -2
- package/dist/lite/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/lite/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/lite/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
- package/dist/lite/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +2 -2
- package/dist/lite/index.browser.esm2017.js +304 -297
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +302 -299
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +39 -28
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +39 -28
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +360 -353
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +3 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +91 -90
- package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/packages/firestore/src/api.d.ts +1 -1
- package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_persistence.d.ts +4 -4
- package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +149 -7
- package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +0 -1
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +7 -2
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/memory_persistence.d.ts +3 -2
- package/dist/lite/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/lite/packages/firestore/src/local/persistence.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/lite/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +6 -2
- package/dist/lite/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/lite/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +2 -2
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +184 -183
- package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/packages/firestore/src/api.d.ts +1 -1
- package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +21 -2
- package/dist/packages/firestore/src/local/indexeddb_persistence.d.ts +4 -4
- package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +149 -7
- package/dist/packages/firestore/src/local/local_documents_view.d.ts +0 -1
- package/dist/packages/firestore/src/local/local_serializer.d.ts +7 -2
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/memory_persistence.d.ts +3 -2
- package/dist/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/packages/firestore/src/local/persistence.d.ts +2 -2
- package/dist/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +6 -2
- package/dist/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +4 -2
- package/dist/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +2 -2
- package/dist/private.d.ts +178 -14
- package/package.json +9 -9
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { Query } from '../core/query';
|
|
18
17
|
import { SnapshotVersion } from '../core/snapshot_version';
|
|
19
18
|
import { DocumentKeySet, MutableDocumentMap } from '../model/collections';
|
|
20
19
|
import { MutableDocument } from '../model/document';
|
|
21
20
|
import { DocumentKey } from '../model/document_key';
|
|
21
|
+
import { ResourcePath } from '../model/path';
|
|
22
|
+
import { IndexManager } from './index_manager';
|
|
22
23
|
import { PersistencePromise } from './persistence_promise';
|
|
23
24
|
import { PersistenceTransaction } from './persistence_transaction';
|
|
24
25
|
import { RemoteDocumentChangeBuffer } from './remote_document_change_buffer';
|
|
@@ -30,6 +31,8 @@ import { RemoteDocumentChangeBuffer } from './remote_document_change_buffer';
|
|
|
30
31
|
* documents that are known to not exist.
|
|
31
32
|
*/
|
|
32
33
|
export interface RemoteDocumentCache {
|
|
34
|
+
/** Sets the index manager to use for managing the collectionGroup index. */
|
|
35
|
+
setIndexManager(indexManager: IndexManager): void;
|
|
33
36
|
/**
|
|
34
37
|
* Looks up an entry in the cache.
|
|
35
38
|
*
|
|
@@ -47,19 +50,14 @@ export interface RemoteDocumentCache {
|
|
|
47
50
|
*/
|
|
48
51
|
getEntries(transaction: PersistenceTransaction, documentKeys: DocumentKeySet): PersistencePromise<MutableDocumentMap>;
|
|
49
52
|
/**
|
|
50
|
-
*
|
|
53
|
+
* Returns the documents from the provided collection.
|
|
51
54
|
*
|
|
52
|
-
*
|
|
53
|
-
* should be re-filtered by the consumer before presenting them to the user.
|
|
54
|
-
*
|
|
55
|
-
* Cached NoDocument entries have no bearing on query results.
|
|
56
|
-
*
|
|
57
|
-
* @param query - The query to match documents against.
|
|
55
|
+
* @param collection - The collection to read.
|
|
58
56
|
* @param sinceReadTime - If not set to SnapshotVersion.min(), return only
|
|
59
57
|
* documents that have been read since this snapshot version (exclusive).
|
|
60
58
|
* @returns The set of matching documents.
|
|
61
59
|
*/
|
|
62
|
-
|
|
60
|
+
getAll(transaction: PersistenceTransaction, collection: ResourcePath, sinceReadTime: SnapshotVersion): PersistencePromise<MutableDocumentMap>;
|
|
63
61
|
/**
|
|
64
62
|
* Provides access to add or update the contents of the cache. The buffer
|
|
65
63
|
* handles proper size accounting for the change.
|
|
@@ -36,6 +36,7 @@ export declare class SimpleDbTransaction {
|
|
|
36
36
|
constructor(action: string, transaction: IDBTransaction);
|
|
37
37
|
get completionPromise(): Promise<void>;
|
|
38
38
|
abort(error?: Error): void;
|
|
39
|
+
maybeCommit(): void;
|
|
39
40
|
/**
|
|
40
41
|
* Returns a SimpleDbStore<KeyType, ValueType> for the specified store. All
|
|
41
42
|
* operations performed on the SimpleDbStore happen within the context of this
|
|
@@ -43,7 +43,7 @@ export declare class FieldIndex {
|
|
|
43
43
|
/** The collection ID this index applies to. */
|
|
44
44
|
readonly collectionGroup: string;
|
|
45
45
|
/** The field segments for this index. */
|
|
46
|
-
readonly
|
|
46
|
+
readonly fields: IndexSegment[];
|
|
47
47
|
/** Shows how up-to-date the index is for the current user. */
|
|
48
48
|
readonly indexState: IndexState;
|
|
49
49
|
/** An ID for an index that has not yet been added to persistence. */
|
|
@@ -57,10 +57,14 @@ export declare class FieldIndex {
|
|
|
57
57
|
/** The collection ID this index applies to. */
|
|
58
58
|
collectionGroup: string,
|
|
59
59
|
/** The field segments for this index. */
|
|
60
|
-
|
|
60
|
+
fields: IndexSegment[],
|
|
61
61
|
/** Shows how up-to-date the index is for the current user. */
|
|
62
62
|
indexState: IndexState);
|
|
63
63
|
}
|
|
64
|
+
/** Returns the ArrayContains/ArrayContainsAny segment for this index. */
|
|
65
|
+
export declare function fieldIndexGetArraySegment(fieldIndex: FieldIndex): IndexSegment | undefined;
|
|
66
|
+
/** Returns all directional (ascending/descending) segments for this index. */
|
|
67
|
+
export declare function fieldIndexGetDirectionalSegments(fieldIndex: FieldIndex): IndexSegment[];
|
|
64
68
|
/**
|
|
65
69
|
* Compares indexes by collection group and segments. Ignores update time and
|
|
66
70
|
* index ID.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Target } from '../core/target';
|
|
18
|
+
import { FieldIndex } from './field_index';
|
|
19
|
+
/**
|
|
20
|
+
* A light query planner for Firestore.
|
|
21
|
+
*
|
|
22
|
+
* This class matches a `FieldIndex` against a Firestore Query `Target`. It
|
|
23
|
+
* determines whether a given index can be used to serve the specified target.
|
|
24
|
+
*
|
|
25
|
+
* The following table showcases some possible index configurations:
|
|
26
|
+
*
|
|
27
|
+
* Query | Index
|
|
28
|
+
* -----------------------------------------------------------------------------
|
|
29
|
+
* where('a', '==', 'a').where('b', '==', 'b') | a ASC, b DESC
|
|
30
|
+
* where('a', '==', 'a').where('b', '==', 'b') | a ASC
|
|
31
|
+
* where('a', '==', 'a').where('b', '==', 'b') | b DESC
|
|
32
|
+
* where('a', '>=', 'a').orderBy('a') | a ASC
|
|
33
|
+
* where('a', '>=', 'a').orderBy('a', 'desc') | a DESC
|
|
34
|
+
* where('a', '>=', 'a').orderBy('a').orderBy('b') | a ASC, b ASC
|
|
35
|
+
* where('a', '>=', 'a').orderBy('a').orderBy('b') | a ASC
|
|
36
|
+
* where('a', 'array-contains', 'a').orderBy('b') | a CONTAINS, b ASCENDING
|
|
37
|
+
* where('a', 'array-contains', 'a').orderBy('b') | a CONTAINS
|
|
38
|
+
*/
|
|
39
|
+
export declare class TargetIndexMatcher {
|
|
40
|
+
private readonly collectionId;
|
|
41
|
+
private readonly inequalityFilter?;
|
|
42
|
+
private readonly equalityFilters;
|
|
43
|
+
private readonly orderBys;
|
|
44
|
+
constructor(target: Target);
|
|
45
|
+
/**
|
|
46
|
+
* Returns whether the index can be used to serve the TargetIndexMatcher's
|
|
47
|
+
* target.
|
|
48
|
+
*
|
|
49
|
+
* An index is considered capable of serving the target when:
|
|
50
|
+
* - The target uses all index segments for its filters and orderBy clauses.
|
|
51
|
+
* The target can have additional filter and orderBy clauses, but not
|
|
52
|
+
* fewer.
|
|
53
|
+
* - If an ArrayContains/ArrayContainsAnyfilter is used, the index must also
|
|
54
|
+
* have a corresponding `CONTAINS` segment.
|
|
55
|
+
* - All directional index segments can be mapped to the target as a series of
|
|
56
|
+
* equality filters, a single inequality filter and a series of orderBy
|
|
57
|
+
* clauses.
|
|
58
|
+
* - The segments that represent the equality filters may appear out of order.
|
|
59
|
+
* - The optional segment for the inequality filter must appear after all
|
|
60
|
+
* equality segments.
|
|
61
|
+
* - The segments that represent that orderBy clause of the target must appear
|
|
62
|
+
* in order after all equality and inequality segments. Single orderBy
|
|
63
|
+
* clauses cannot be skipped, but a continuous orderBy suffix may be
|
|
64
|
+
* omitted.
|
|
65
|
+
*/
|
|
66
|
+
servedByIndex(index: FieldIndex): boolean;
|
|
67
|
+
private hasMatchingEqualityFilter;
|
|
68
|
+
private matchesFilter;
|
|
69
|
+
private matchesOrderBy;
|
|
70
|
+
}
|
|
@@ -19,6 +19,7 @@ import { ArrayValue, MapValue, Value } from '../protos/firestore_proto_api';
|
|
|
19
19
|
import { DocumentKey } from './document_key';
|
|
20
20
|
import { TypeOrder } from './type_order';
|
|
21
21
|
export declare const MAX_VALUE: Value;
|
|
22
|
+
export declare const MIN_VALUE: Value;
|
|
22
23
|
/** Extracts the backend's type order for the provided value. */
|
|
23
24
|
export declare function typeOrder(value: Value): TypeOrder;
|
|
24
25
|
/** Tests `left` and `right` for equality based on the backend semantics. */
|
|
@@ -76,3 +77,9 @@ export declare function isMapValue(value?: Value | null): value is {
|
|
|
76
77
|
export declare function deepClone(source: Value): Value;
|
|
77
78
|
/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
|
|
78
79
|
export declare function isMaxValue(value: Value): boolean;
|
|
80
|
+
/** Returns the lowest value for the given value type (inclusive). */
|
|
81
|
+
export declare function valuesGetLowerBound(value: Value): Value;
|
|
82
|
+
/** Returns the largest value for the given value type (exclusive). */
|
|
83
|
+
export declare function valuesGetUpperBound(value: Value): Value;
|
|
84
|
+
export declare function valuesMax(left: Value | undefined, right: Value | undefined): Value | undefined;
|
|
85
|
+
export declare function valuesMin(left: Value | undefined, right: Value | undefined): Value | undefined;
|
|
@@ -31,7 +31,7 @@ export declare class CountingQueryEngine extends QueryEngine {
|
|
|
31
31
|
* `getAllMutationBatchesAffectingQuery()` API (since the last call to
|
|
32
32
|
* `resetCounts()`)
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
mutationsReadByCollection: number;
|
|
35
35
|
/**
|
|
36
36
|
* The number of mutations returned by the MutationQueue's
|
|
37
37
|
* `getAllMutationBatchesAffectingDocumentKey()` and
|
|
@@ -41,9 +41,9 @@ export declare class CountingQueryEngine extends QueryEngine {
|
|
|
41
41
|
mutationsReadByKey: number;
|
|
42
42
|
/**
|
|
43
43
|
* The number of documents returned by the RemoteDocumentCache's
|
|
44
|
-
* `
|
|
44
|
+
* `getAll()` API (since the last call to `resetCounts()`)
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
documentsReadByCollection: number;
|
|
47
47
|
/**
|
|
48
48
|
* The number of documents returned by the RemoteDocumentCache's `getEntry()`
|
|
49
49
|
* and `getEntries()` APIs (since the last call to `resetCounts()`)
|
|
@@ -54,6 +54,7 @@ export declare function testIndexedDbPersistence(options?: {
|
|
|
54
54
|
dontPurgeData?: boolean;
|
|
55
55
|
synchronizeTabs?: boolean;
|
|
56
56
|
queue?: AsyncQueue;
|
|
57
|
+
schemaVersion?: number;
|
|
57
58
|
}, lruParams?: LruParams): Promise<IndexedDbPersistence>;
|
|
58
59
|
/** Creates and starts a MemoryPersistence instance for testing. */
|
|
59
60
|
export declare function testMemoryEagerPersistence(): Promise<MemoryPersistence>;
|
|
@@ -14,8 +14,11 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { Target } from '../../../src/core/target';
|
|
17
18
|
import { IndexManager } from '../../../src/local/index_manager';
|
|
18
19
|
import { Persistence } from '../../../src/local/persistence';
|
|
20
|
+
import { DocumentKeySet, DocumentMap } from '../../../src/model/collections';
|
|
21
|
+
import { FieldIndex, IndexOffset } from '../../../src/model/field_index';
|
|
19
22
|
import { ResourcePath } from '../../../src/model/path';
|
|
20
23
|
/**
|
|
21
24
|
* A wrapper around IndexManager that automatically creates a
|
|
@@ -27,4 +30,12 @@ export declare class TestIndexManager {
|
|
|
27
30
|
constructor(persistence: Persistence, indexManager: IndexManager);
|
|
28
31
|
addToCollectionParentIndex(collectionPath: ResourcePath): Promise<void>;
|
|
29
32
|
getCollectionParents(collectionId: string): Promise<ResourcePath[]>;
|
|
33
|
+
addFieldIndex(index: FieldIndex): Promise<void>;
|
|
34
|
+
deleteFieldIndex(index: FieldIndex): Promise<void>;
|
|
35
|
+
getFieldIndexes(collectionGroup?: string): Promise<FieldIndex[]>;
|
|
36
|
+
getFieldIndex(target: Target): Promise<FieldIndex | null>;
|
|
37
|
+
getDocumentsMatchingTarget(fieldIndex: FieldIndex, target: Target): Promise<DocumentKeySet>;
|
|
38
|
+
getNextCollectionGroupToUpdate(): Promise<string | null>;
|
|
39
|
+
updateCollectionGroup(collectionGroup: string, offset: IndexOffset): Promise<void>;
|
|
40
|
+
updateIndexEntries(documents: DocumentMap): Promise<void>;
|
|
30
41
|
}
|
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { Query } from '../../../src/core/query';
|
|
18
17
|
import { SnapshotVersion } from '../../../src/core/snapshot_version';
|
|
18
|
+
import { IndexManager } from '../../../src/local/index_manager';
|
|
19
19
|
import { Persistence } from '../../../src/local/persistence';
|
|
20
20
|
import { RemoteDocumentChangeBuffer } from '../../../src/local/remote_document_change_buffer';
|
|
21
21
|
import { DocumentKeySet, MutableDocumentMap } from '../../../src/model/collections';
|
|
22
22
|
import { MutableDocument } from '../../../src/model/document';
|
|
23
23
|
import { DocumentKey } from '../../../src/model/document_key';
|
|
24
|
+
import { ResourcePath } from '../../../src/model/path';
|
|
24
25
|
/**
|
|
25
26
|
* A wrapper around a RemoteDocumentCache that automatically creates a
|
|
26
27
|
* transaction around every operation to reduce test boilerplate.
|
|
@@ -29,6 +30,7 @@ export declare class TestRemoteDocumentCache {
|
|
|
29
30
|
private readonly persistence;
|
|
30
31
|
private readonly cache;
|
|
31
32
|
constructor(persistence: Persistence);
|
|
33
|
+
setIndexManager(indexManager: IndexManager): void;
|
|
32
34
|
/**
|
|
33
35
|
* Reads all of the documents first so we can safely add them and keep the size calculation in
|
|
34
36
|
* sync.
|
|
@@ -42,7 +44,7 @@ export declare class TestRemoteDocumentCache {
|
|
|
42
44
|
removeEntry(documentKey: DocumentKey, version?: SnapshotVersion): Promise<void>;
|
|
43
45
|
getEntry(documentKey: DocumentKey): Promise<MutableDocument>;
|
|
44
46
|
getEntries(documentKeys: DocumentKeySet): Promise<MutableDocumentMap>;
|
|
45
|
-
|
|
47
|
+
getAll(collection: ResourcePath, sinceReadTime: SnapshotVersion): Promise<MutableDocumentMap>;
|
|
46
48
|
getNewDocumentChanges(sinceReadTime: SnapshotVersion): Promise<{
|
|
47
49
|
changedDocs: MutableDocumentMap;
|
|
48
50
|
readTime: SnapshotVersion;
|
|
@@ -28,7 +28,7 @@ export declare class TestRemoteDocumentChangeBuffer {
|
|
|
28
28
|
buffer: RemoteDocumentChangeBuffer;
|
|
29
29
|
constructor(persistence: Persistence, buffer: RemoteDocumentChangeBuffer);
|
|
30
30
|
addEntry(document: MutableDocument, readTime: SnapshotVersion): void;
|
|
31
|
-
removeEntry(key: DocumentKey): void;
|
|
31
|
+
removeEntry(key: DocumentKey, readTime: SnapshotVersion): void;
|
|
32
32
|
getEntry(documentKey: DocumentKey): Promise<MutableDocument>;
|
|
33
33
|
apply(): Promise<void>;
|
|
34
34
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { Bytes, DocumentReference
|
|
17
|
+
import { Bytes, DocumentReference } from '../../src';
|
|
18
18
|
import { BundledDocuments } from '../../src/core/bundle';
|
|
19
19
|
import { DatabaseId } from '../../src/core/database_info';
|
|
20
20
|
import { Query } from '../../src/core/query';
|
|
@@ -71,7 +71,7 @@ export declare function setMutation(keyStr: string, json: JsonObject<unknown>):
|
|
|
71
71
|
export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
|
|
72
72
|
export declare function deleteMutation(keyStr: string): DeleteMutation;
|
|
73
73
|
export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult;
|
|
74
|
-
export declare function bound(values:
|
|
74
|
+
export declare function bound(values: unknown[], inclusive: boolean): Bound;
|
|
75
75
|
export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
|
|
76
76
|
export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
|
|
77
77
|
export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
|
package/dist/index.d.ts
CHANGED
|
@@ -413,8 +413,7 @@ export declare class DocumentSnapshot<T = DocumentData> {
|
|
|
413
413
|
readonly metadata: SnapshotMetadata;
|
|
414
414
|
protected constructor();
|
|
415
415
|
/**
|
|
416
|
-
*
|
|
417
|
-
* exists. True if the document exists.
|
|
416
|
+
* Returns whether or not the data exists. True if the document exists.
|
|
418
417
|
*/
|
|
419
418
|
exists(): this is QueryDocumentSnapshot<T>;
|
|
420
419
|
/**
|