@firebase/firestore 3.4.4-canary.222f264ff → 3.4.4-canary.6c8eabfc5
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 +11 -0
- package/dist/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/firestore/src/model/document.d.ts +7 -0
- package/dist/firestore/src/model/document_key.d.ts +1 -0
- package/dist/firestore/src/model/field_index.d.ts +87 -7
- package/dist/firestore/src/model/values.d.ts +7 -0
- package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +8 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.esm2017.js +3451 -3194
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3430 -3264
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +543 -242
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +543 -242
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3520 -3301
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +183 -16
- 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 +11 -0
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/firestore/src/model/document_key.d.ts +1 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +87 -7
- package/dist/lite/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/lite/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/index.browser.esm2017.js +1166 -1152
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +367 -359
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +53 -34
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +53 -34
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +318 -304
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +11 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +125 -124
- 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 +11 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/packages/firestore/src/model/document_key.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +87 -7
- package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/private.d.ts +9 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +175 -173
- 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 +11 -0
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/packages/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/packages/firestore/src/local/simple_db.d.ts +1 -0
- package/dist/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/packages/firestore/src/model/document_key.d.ts +1 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +87 -7
- package/dist/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/private.d.ts +181 -16
- package/package.json +9 -9
|
@@ -33,7 +33,7 @@ export declare class TestRemoteDocumentCache {
|
|
|
33
33
|
* Reads all of the documents first so we can safely add them and keep the size calculation in
|
|
34
34
|
* sync.
|
|
35
35
|
*/
|
|
36
|
-
addEntries(documents: MutableDocument[]
|
|
36
|
+
addEntries(documents: MutableDocument[]): Promise<void>;
|
|
37
37
|
/**
|
|
38
38
|
* Adds a single document using the document's version as its read time.
|
|
39
39
|
* Reads the document first to track the document size internally.
|
|
@@ -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';
|
|
@@ -30,6 +30,7 @@ import { Document, MutableDocument } from '../../src/model/document';
|
|
|
30
30
|
import { DocumentComparator } from '../../src/model/document_comparator';
|
|
31
31
|
import { DocumentKey } from '../../src/model/document_key';
|
|
32
32
|
import { DocumentSet } from '../../src/model/document_set';
|
|
33
|
+
import { FieldIndex, IndexKind, IndexOffset } from '../../src/model/field_index';
|
|
33
34
|
import { FieldMask } from '../../src/model/field_mask';
|
|
34
35
|
import { DeleteMutation, MutationResult, PatchMutation, Precondition, SetMutation } from '../../src/model/mutation';
|
|
35
36
|
import { JsonObject, ObjectValue } from '../../src/model/object_value';
|
|
@@ -58,6 +59,11 @@ export declare function key(path: string): DocumentKey;
|
|
|
58
59
|
export declare function keys(...documents: Array<Document | string>): DocumentKeySet;
|
|
59
60
|
export declare function path(path: string, offset?: number): ResourcePath;
|
|
60
61
|
export declare function field(path: string): FieldPath;
|
|
62
|
+
export declare function fieldIndex(collectionGroup: string, options?: {
|
|
63
|
+
id?: number;
|
|
64
|
+
fields?: Array<[field: string, kind: IndexKind]>;
|
|
65
|
+
offset?: IndexOffset;
|
|
66
|
+
}): FieldIndex;
|
|
61
67
|
export declare function mask(...paths: string[]): FieldMask;
|
|
62
68
|
export declare function blob(...bytes: number[]): Bytes;
|
|
63
69
|
export declare function filter(path: string, op: string, value: unknown): FieldFilter;
|
|
@@ -65,7 +71,7 @@ export declare function setMutation(keyStr: string, json: JsonObject<unknown>):
|
|
|
65
71
|
export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
|
|
66
72
|
export declare function deleteMutation(keyStr: string): DeleteMutation;
|
|
67
73
|
export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult;
|
|
68
|
-
export declare function bound(values:
|
|
74
|
+
export declare function bound(values: unknown[], inclusive: boolean): Bound;
|
|
69
75
|
export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
|
|
70
76
|
export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
|
|
71
77
|
export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
|
package/dist/private.d.ts
CHANGED
|
@@ -197,8 +197,8 @@ declare type BatchId = number;
|
|
|
197
197
|
*/
|
|
198
198
|
declare class Bound {
|
|
199
199
|
readonly position: Value[];
|
|
200
|
-
readonly
|
|
201
|
-
constructor(position: Value[],
|
|
200
|
+
readonly inclusive: boolean;
|
|
201
|
+
constructor(position: Value[], inclusive: boolean);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
/**
|
|
@@ -757,6 +757,11 @@ declare interface Document_2 {
|
|
|
757
757
|
* document was guaranteed to not exist.
|
|
758
758
|
*/
|
|
759
759
|
readonly version: SnapshotVersion;
|
|
760
|
+
/**
|
|
761
|
+
* The timestamp at which this document was read from the remote server. Uses
|
|
762
|
+
* `SnapshotVersion.min()` for documents created by the user.
|
|
763
|
+
*/
|
|
764
|
+
readonly readTime: SnapshotVersion;
|
|
760
765
|
/** The underlying data of this document or an empty value if no data exists. */
|
|
761
766
|
readonly data: ObjectValue;
|
|
762
767
|
/** Returns whether local mutations were applied via the mutation queue. */
|
|
@@ -962,8 +967,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends DocumentSnapshot
|
|
|
962
967
|
/** @hideconstructor protected */
|
|
963
968
|
constructor(_firestore: Firestore, userDataWriter: AbstractUserDataWriter, key: _DocumentKey, document: Document_2 | null, metadata: SnapshotMetadata, converter: UntypedFirestoreDataConverter<T> | null);
|
|
964
969
|
/**
|
|
965
|
-
*
|
|
966
|
-
* exists. True if the document exists.
|
|
970
|
+
* Returns whether or not the data exists. True if the document exists.
|
|
967
971
|
*/
|
|
968
972
|
exists(): this is QueryDocumentSnapshot<T>;
|
|
969
973
|
/**
|
|
@@ -1187,6 +1191,45 @@ declare interface EventManager {
|
|
|
1187
1191
|
|
|
1188
1192
|
declare type FieldFilterOp = 'OPERATOR_UNSPECIFIED' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'EQUAL' | 'NOT_EQUAL' | 'ARRAY_CONTAINS' | 'IN' | 'ARRAY_CONTAINS_ANY' | 'NOT_IN';
|
|
1189
1193
|
|
|
1194
|
+
/**
|
|
1195
|
+
* An index definition for field indexes in Firestore.
|
|
1196
|
+
*
|
|
1197
|
+
* Every index is associated with a collection. The definition contains a list
|
|
1198
|
+
* of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or
|
|
1199
|
+
* `CONTAINS` for ArrayContains/ArrayContainsAny queries).
|
|
1200
|
+
*
|
|
1201
|
+
* Unlike the backend, the SDK does not differentiate between collection or
|
|
1202
|
+
* collection group-scoped indices. Every index can be used for both single
|
|
1203
|
+
* collection and collection group queries.
|
|
1204
|
+
*/
|
|
1205
|
+
declare class FieldIndex {
|
|
1206
|
+
/**
|
|
1207
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
1208
|
+
* has not yet been persisted).
|
|
1209
|
+
*/
|
|
1210
|
+
readonly indexId: number;
|
|
1211
|
+
/** The collection ID this index applies to. */
|
|
1212
|
+
readonly collectionGroup: string;
|
|
1213
|
+
/** The field segments for this index. */
|
|
1214
|
+
readonly segments: IndexSegment[];
|
|
1215
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
1216
|
+
readonly indexState: IndexState_2;
|
|
1217
|
+
/** An ID for an index that has not yet been added to persistence. */
|
|
1218
|
+
static UNKNOWN_ID: number;
|
|
1219
|
+
constructor(
|
|
1220
|
+
/**
|
|
1221
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
1222
|
+
* has not yet been persisted).
|
|
1223
|
+
*/
|
|
1224
|
+
indexId: number,
|
|
1225
|
+
/** The collection ID this index applies to. */
|
|
1226
|
+
collectionGroup: string,
|
|
1227
|
+
/** The field segments for this index. */
|
|
1228
|
+
segments: IndexSegment[],
|
|
1229
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
1230
|
+
indexState: IndexState_2);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1190
1233
|
/**
|
|
1191
1234
|
* Provides a set of fields that can be used to partially patch a document.
|
|
1192
1235
|
* FieldMask is used in conjunction with ObjectValue.
|
|
@@ -2149,6 +2192,20 @@ export declare function increment(n: number): FieldValue;
|
|
|
2149
2192
|
|
|
2150
2193
|
declare type IndexFieldMode = 'MODE_UNSPECIFIED' | 'ASCENDING' | 'DESCENDING';
|
|
2151
2194
|
|
|
2195
|
+
/** The type of the index, e.g. for which type of query it can be used. */
|
|
2196
|
+
declare const enum IndexKind {
|
|
2197
|
+
/**
|
|
2198
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
2199
|
+
*/
|
|
2200
|
+
ASCENDING = 0,
|
|
2201
|
+
/**
|
|
2202
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
2203
|
+
*/
|
|
2204
|
+
DESCENDING = 1,
|
|
2205
|
+
/** Contains index. Can be used for ArrayContains and ArrayContainsAny. */
|
|
2206
|
+
CONTAINS = 2
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2152
2209
|
/**
|
|
2153
2210
|
* Represents a set of indexes that are used to execute queries efficiently.
|
|
2154
2211
|
*
|
|
@@ -2172,10 +2229,125 @@ declare interface IndexManager {
|
|
|
2172
2229
|
* path for a root-level collection).
|
|
2173
2230
|
*/
|
|
2174
2231
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<_ResourcePath[]>;
|
|
2232
|
+
/**
|
|
2233
|
+
* Adds a field path index.
|
|
2234
|
+
*
|
|
2235
|
+
* Values for this index are persisted via the index backfill, which runs
|
|
2236
|
+
* asynchronously in the background. Once the first values are written,
|
|
2237
|
+
* an index can be used to serve partial results for any matching queries.
|
|
2238
|
+
* Any unindexed portion of the database will continue to be served via
|
|
2239
|
+
* collection scons.
|
|
2240
|
+
*/
|
|
2241
|
+
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
2242
|
+
/** Removes the given field index and deletes all index values. */
|
|
2243
|
+
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
2244
|
+
/**
|
|
2245
|
+
* Returns a list of field indexes that correspond to the specified collection
|
|
2246
|
+
* group.
|
|
2247
|
+
*
|
|
2248
|
+
* @param collectionGroup The collection group to get matching field indexes
|
|
2249
|
+
* for.
|
|
2250
|
+
* @return A collection of field indexes for the specified collection group.
|
|
2251
|
+
*/
|
|
2252
|
+
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup: string): PersistencePromise<FieldIndex[]>;
|
|
2253
|
+
/** Returns all configured field indexes. */
|
|
2254
|
+
getFieldIndexes(transaction: PersistenceTransaction): PersistencePromise<FieldIndex[]>;
|
|
2255
|
+
/**
|
|
2256
|
+
* Returns an index that can be used to serve the provided target. Returns
|
|
2257
|
+
* `null` if no index is configured.
|
|
2258
|
+
*/
|
|
2259
|
+
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
2260
|
+
/**
|
|
2261
|
+
* Returns the documents that match the given target based on the provided
|
|
2262
|
+
* index.
|
|
2263
|
+
*/
|
|
2264
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
|
|
2265
|
+
/**
|
|
2266
|
+
* Returns the next collection group to update. Returns `null` if no group
|
|
2267
|
+
* exists.
|
|
2268
|
+
*/
|
|
2269
|
+
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
2270
|
+
/**
|
|
2271
|
+
* Sets the collection group's latest read time.
|
|
2272
|
+
*
|
|
2273
|
+
* This method updates the index offset for all field indices for the
|
|
2274
|
+
* collection group and increments their sequence number. Subsequent calls to
|
|
2275
|
+
* `getNextCollectionGroupToUpdate()` will return a different collection group
|
|
2276
|
+
* (unless only one collection group is configured).
|
|
2277
|
+
*/
|
|
2278
|
+
updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
|
|
2279
|
+
/** Updates the index entries for the provided documents. */
|
|
2280
|
+
updateIndexEntries(transaction: PersistenceTransaction, documents: DocumentMap): PersistencePromise<void>;
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
/**
|
|
2284
|
+
* Stores the latest read time, document and batch ID that were processed for an
|
|
2285
|
+
* index.
|
|
2286
|
+
*/
|
|
2287
|
+
declare class IndexOffset {
|
|
2288
|
+
/**
|
|
2289
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
2290
|
+
* field index.
|
|
2291
|
+
*/
|
|
2292
|
+
readonly readTime: SnapshotVersion;
|
|
2293
|
+
/**
|
|
2294
|
+
* The key of the last document that was indexed for this query. Use
|
|
2295
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
2296
|
+
*/
|
|
2297
|
+
readonly documentKey: _DocumentKey;
|
|
2298
|
+
readonly largestBatchId: number;
|
|
2299
|
+
constructor(
|
|
2300
|
+
/**
|
|
2301
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
2302
|
+
* field index.
|
|
2303
|
+
*/
|
|
2304
|
+
readTime: SnapshotVersion,
|
|
2305
|
+
/**
|
|
2306
|
+
* The key of the last document that was indexed for this query. Use
|
|
2307
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
2308
|
+
*/
|
|
2309
|
+
documentKey: _DocumentKey, largestBatchId: number);
|
|
2310
|
+
/** The state of an index that has not yet been backfilled. */
|
|
2311
|
+
static min(): IndexOffset;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
/** An index component consisting of field path and index type. */
|
|
2315
|
+
declare class IndexSegment {
|
|
2316
|
+
/** The field path of the component. */
|
|
2317
|
+
readonly fieldPath: _FieldPath;
|
|
2318
|
+
/** The fields sorting order. */
|
|
2319
|
+
readonly kind: IndexKind;
|
|
2320
|
+
constructor(
|
|
2321
|
+
/** The field path of the component. */
|
|
2322
|
+
fieldPath: _FieldPath,
|
|
2323
|
+
/** The fields sorting order. */
|
|
2324
|
+
kind: IndexKind);
|
|
2175
2325
|
}
|
|
2176
2326
|
|
|
2177
2327
|
declare type IndexState = 'STATE_UNSPECIFIED' | 'CREATING' | 'READY' | 'ERROR';
|
|
2178
2328
|
|
|
2329
|
+
/**
|
|
2330
|
+
* Stores the "high water mark" that indicates how updated the Index is for the
|
|
2331
|
+
* current user.
|
|
2332
|
+
*/
|
|
2333
|
+
declare class IndexState_2 {
|
|
2334
|
+
/**
|
|
2335
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
2336
|
+
*/
|
|
2337
|
+
readonly sequenceNumber: number;
|
|
2338
|
+
/** The the latest indexed read time, document and batch id. */
|
|
2339
|
+
readonly offset: IndexOffset;
|
|
2340
|
+
constructor(
|
|
2341
|
+
/**
|
|
2342
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
2343
|
+
*/
|
|
2344
|
+
sequenceNumber: number,
|
|
2345
|
+
/** The the latest indexed read time, document and batch id. */
|
|
2346
|
+
offset: IndexOffset);
|
|
2347
|
+
/** The state of an index that has not yet been backfilled. */
|
|
2348
|
+
static empty(): IndexState_2;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2179
2351
|
/**
|
|
2180
2352
|
* Initializes a new instance of {@link Firestore} with the provided settings.
|
|
2181
2353
|
* Can only be called before any other function, including
|
|
@@ -2425,6 +2597,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
2425
2597
|
readonly key: _DocumentKey;
|
|
2426
2598
|
private documentType;
|
|
2427
2599
|
version: SnapshotVersion;
|
|
2600
|
+
readTime: SnapshotVersion;
|
|
2428
2601
|
data: ObjectValue;
|
|
2429
2602
|
private documentState;
|
|
2430
2603
|
private constructor();
|
|
@@ -2464,6 +2637,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
2464
2637
|
convertToUnknownDocument(version: SnapshotVersion): MutableDocument;
|
|
2465
2638
|
setHasCommittedMutations(): MutableDocument;
|
|
2466
2639
|
setHasLocalMutations(): MutableDocument;
|
|
2640
|
+
setReadTime(readTime: SnapshotVersion): MutableDocument;
|
|
2467
2641
|
get hasLocalMutations(): boolean;
|
|
2468
2642
|
get hasCommittedMutations(): boolean;
|
|
2469
2643
|
get hasPendingWrites(): boolean;
|
|
@@ -3780,14 +3954,6 @@ declare interface RemoteDocumentCache {
|
|
|
3780
3954
|
getSize(transaction: PersistenceTransaction): PersistencePromise<number>;
|
|
3781
3955
|
}
|
|
3782
3956
|
|
|
3783
|
-
/**
|
|
3784
|
-
* Represents a document change to be applied to remote document cache.
|
|
3785
|
-
*/
|
|
3786
|
-
declare interface RemoteDocumentChange {
|
|
3787
|
-
readonly document: MutableDocument;
|
|
3788
|
-
readonly readTime: SnapshotVersion | null;
|
|
3789
|
-
}
|
|
3790
|
-
|
|
3791
3957
|
/**
|
|
3792
3958
|
* An in-memory buffer of entries to be written to a RemoteDocumentCache.
|
|
3793
3959
|
* It can be used to batch up a set of changes to be written to the cache, but
|
|
@@ -3803,26 +3969,25 @@ declare interface RemoteDocumentChange {
|
|
|
3803
3969
|
* porting this class as part of that implementation work.
|
|
3804
3970
|
*/
|
|
3805
3971
|
declare abstract class RemoteDocumentChangeBuffer {
|
|
3806
|
-
protected changes: ObjectMap<_DocumentKey,
|
|
3972
|
+
protected changes: ObjectMap<_DocumentKey, MutableDocument>;
|
|
3807
3973
|
private changesApplied;
|
|
3808
3974
|
protected abstract getFromCache(transaction: PersistenceTransaction, documentKey: _DocumentKey): PersistencePromise<MutableDocument>;
|
|
3809
3975
|
protected abstract getAllFromCache(transaction: PersistenceTransaction, documentKeys: DocumentKeySet): PersistencePromise<MutableDocumentMap>;
|
|
3810
3976
|
protected abstract applyChanges(transaction: PersistenceTransaction): PersistencePromise<void>;
|
|
3811
|
-
protected getReadTime(key: _DocumentKey): SnapshotVersion;
|
|
3812
3977
|
/**
|
|
3813
3978
|
* Buffers a `RemoteDocumentCache.addEntry()` call.
|
|
3814
3979
|
*
|
|
3815
3980
|
* You can only modify documents that have already been retrieved via
|
|
3816
3981
|
* `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).
|
|
3817
3982
|
*/
|
|
3818
|
-
addEntry(document: MutableDocument
|
|
3983
|
+
addEntry(document: MutableDocument): void;
|
|
3819
3984
|
/**
|
|
3820
3985
|
* Buffers a `RemoteDocumentCache.removeEntry()` call.
|
|
3821
3986
|
*
|
|
3822
3987
|
* You can only remove documents that have already been retrieved via
|
|
3823
3988
|
* `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).
|
|
3824
3989
|
*/
|
|
3825
|
-
removeEntry(key: _DocumentKey, readTime
|
|
3990
|
+
removeEntry(key: _DocumentKey, readTime: SnapshotVersion): void;
|
|
3826
3991
|
/**
|
|
3827
3992
|
* Looks up an entry in the cache. The buffered changes will first be checked,
|
|
3828
3993
|
* and if no buffered change applies, this will forward to
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/firestore",
|
|
3
|
-
"version": "3.4.4-canary.
|
|
3
|
+
"version": "3.4.4-canary.6c8eabfc5",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=10.10.0"
|
|
6
6
|
},
|
|
@@ -77,22 +77,22 @@
|
|
|
77
77
|
"lite/package.json"
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@firebase/component": "0.5.10-canary.
|
|
81
|
-
"@firebase/logger": "0.3.2-canary.
|
|
82
|
-
"@firebase/util": "1.4.3-canary.
|
|
83
|
-
"@firebase/webchannel-wrapper": "0.6.1-canary.
|
|
80
|
+
"@firebase/component": "0.5.10-canary.6c8eabfc5",
|
|
81
|
+
"@firebase/logger": "0.3.2-canary.6c8eabfc5",
|
|
82
|
+
"@firebase/util": "1.4.3-canary.6c8eabfc5",
|
|
83
|
+
"@firebase/webchannel-wrapper": "0.6.1-canary.6c8eabfc5",
|
|
84
84
|
"@grpc/grpc-js": "^1.3.2",
|
|
85
85
|
"@grpc/proto-loader": "^0.6.0",
|
|
86
86
|
"node-fetch": "2.6.7",
|
|
87
87
|
"tslib": "^2.1.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"@firebase/app": "0.7.
|
|
90
|
+
"@firebase/app": "0.7.16-canary.6c8eabfc5"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@firebase/app": "0.7.
|
|
94
|
-
"@firebase/app-compat": "0.1.
|
|
95
|
-
"@firebase/auth": "0.19.
|
|
93
|
+
"@firebase/app": "0.7.16-canary.6c8eabfc5",
|
|
94
|
+
"@firebase/app-compat": "0.1.17-canary.6c8eabfc5",
|
|
95
|
+
"@firebase/auth": "0.19.8-canary.6c8eabfc5",
|
|
96
96
|
"@rollup/plugin-alias": "3.1.5",
|
|
97
97
|
"@rollup/plugin-json": "4.1.0",
|
|
98
98
|
"@types/eslint": "7.28.0",
|