@firebase/firestore 3.4.4-canary.b02927e2e → 3.4.4-canary.e8972ef49
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/core/target.d.ts +8 -4
- 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/memory_index_manager.d.ts +11 -0
- package/dist/firestore/test/util/helpers.d.ts +1 -1
- package/dist/index.esm2017.js +2501 -2348
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3212 -3112
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +263 -90
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +263 -90
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +2548 -2391
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +170 -2
- package/dist/lite/firestore/src/core/target.d.ts +8 -4
- 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/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +1 -1
- package/dist/lite/index.browser.esm2017.js +346 -343
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +331 -330
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +36 -29
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +36 -29
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +357 -354
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +97 -97
- package/dist/lite/packages/firestore/src/core/target.d.ts +8 -4
- 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/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +1 -1
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +79 -79
- package/dist/packages/firestore/src/core/target.d.ts +8 -4
- 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/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +1 -1
- package/dist/private.d.ts +170 -2
- package/package.json +9 -9
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { BatchId, TargetId } from '../core/types';
|
|
18
|
+
import { IndexKind } from '../model/field_index';
|
|
18
19
|
import { ResourcePath } from '../model/path';
|
|
19
20
|
import { BundledQuery } from '../protos/firestore_bundle_proto';
|
|
20
21
|
import { Document as ProtoDocument, DocumentsTarget as ProtoDocumentsTarget, QueryTarget as ProtoQueryTarget, Write as ProtoWrite } from '../protos/firestore_proto_api';
|
|
21
22
|
import { EncodedResourcePath } from './encoded_resource_path';
|
|
23
|
+
export declare const INDEXING_SCHEMA_VERSION = 12;
|
|
22
24
|
/**
|
|
23
25
|
* Schema Version for the Web client:
|
|
24
26
|
* 1. Initial version including Mutation Queue, Query Cache, and Remote
|
|
@@ -37,8 +39,9 @@ import { EncodedResourcePath } from './encoded_resource_path';
|
|
|
37
39
|
* an auto-incrementing ID. This is required for Index-Free queries.
|
|
38
40
|
* 10. Rewrite the canonical IDs to the explicit Protobuf-based format.
|
|
39
41
|
* 11. Add bundles and named_queries for bundle support.
|
|
42
|
+
* 12. Add indexing support.
|
|
40
43
|
*/
|
|
41
|
-
export declare const SCHEMA_VERSION
|
|
44
|
+
export declare const SCHEMA_VERSION: number;
|
|
42
45
|
/**
|
|
43
46
|
* Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.
|
|
44
47
|
*/
|
|
@@ -763,9 +766,7 @@ export declare class DbClientMetadata {
|
|
|
763
766
|
/** Object keys in the 'clientMetadata' store are clientId strings. */
|
|
764
767
|
export declare type DbClientMetadataKey = string;
|
|
765
768
|
export declare type DbBundlesKey = string;
|
|
766
|
-
/**
|
|
767
|
-
* A object representing a bundle loaded by the SDK.
|
|
768
|
-
*/
|
|
769
|
+
/** An object representing a bundle loaded by the SDK. */
|
|
769
770
|
export declare class DbBundle {
|
|
770
771
|
/** The ID of the loaded bundle. */
|
|
771
772
|
bundleId: string;
|
|
@@ -785,9 +786,7 @@ export declare class DbBundle {
|
|
|
785
786
|
version: number);
|
|
786
787
|
}
|
|
787
788
|
export declare type DbNamedQueriesKey = string;
|
|
788
|
-
/**
|
|
789
|
-
* A object representing a named query loaded by the SDK via a bundle.
|
|
790
|
-
*/
|
|
789
|
+
/** An object representing a named query loaded by the SDK via a bundle. */
|
|
791
790
|
export declare class DbNamedQuery {
|
|
792
791
|
/** The name of the query. */
|
|
793
792
|
name: string;
|
|
@@ -806,12 +805,127 @@ export declare class DbNamedQuery {
|
|
|
806
805
|
/** The query saved in the bundle. */
|
|
807
806
|
bundledQuery: BundledQuery);
|
|
808
807
|
}
|
|
808
|
+
/** The key for each index consisting of just the index id. */
|
|
809
|
+
export declare type DbIndexConfigurationKey = number;
|
|
810
|
+
/** An object representing the global configuration for a field index. */
|
|
811
|
+
export declare class DbIndexConfiguration {
|
|
812
|
+
/** The index id for this entry. */
|
|
813
|
+
indexId: number;
|
|
814
|
+
/** The collection group this index belongs to. */
|
|
815
|
+
collectionGroup: string;
|
|
816
|
+
/** The fields to index for this index. */
|
|
817
|
+
fields: [[name: string, kind: IndexKind]];
|
|
818
|
+
/** Name of the IndexedDb object store. */
|
|
819
|
+
static store: string;
|
|
820
|
+
static keyPath: string;
|
|
821
|
+
constructor(
|
|
822
|
+
/** The index id for this entry. */
|
|
823
|
+
indexId: number,
|
|
824
|
+
/** The collection group this index belongs to. */
|
|
825
|
+
collectionGroup: string,
|
|
826
|
+
/** The fields to index for this index. */
|
|
827
|
+
fields: [[name: string, kind: IndexKind]]);
|
|
828
|
+
}
|
|
829
|
+
/** The key for each index state consisting of the index id and its user id. */
|
|
830
|
+
export declare type DbIndexStateKey = [number, string];
|
|
831
|
+
/**
|
|
832
|
+
* An object describing how up-to-date the index backfill is for each user and
|
|
833
|
+
* index.
|
|
834
|
+
*/
|
|
835
|
+
export declare class DbIndexState {
|
|
836
|
+
/** The index id for this entry. */
|
|
837
|
+
indexId: number;
|
|
838
|
+
/** The user id for this entry. */
|
|
839
|
+
uid: string;
|
|
840
|
+
/**
|
|
841
|
+
* A number that indicates when the index was last updated (relative to
|
|
842
|
+
* other indexes).
|
|
843
|
+
*/
|
|
844
|
+
sequenceNumber: number;
|
|
845
|
+
/**
|
|
846
|
+
* The latest read time that has been indexed by Firestore for this field
|
|
847
|
+
* index. Set to `{seconds: 0, nanos: 0}` if no documents have been indexed.
|
|
848
|
+
*/
|
|
849
|
+
readTime: DbTimestamp;
|
|
850
|
+
/**
|
|
851
|
+
* The last document that has been indexed for this field index. Empty if
|
|
852
|
+
* no documents have been indexed.
|
|
853
|
+
*/
|
|
854
|
+
documentKey: EncodedResourcePath;
|
|
855
|
+
/**
|
|
856
|
+
* The largest mutation batch id that has been processed for this index. -1
|
|
857
|
+
* if no mutations have been indexed.
|
|
858
|
+
*/
|
|
859
|
+
largestBatchId: number;
|
|
860
|
+
/** Name of the IndexedDb object store. */
|
|
861
|
+
static store: string;
|
|
862
|
+
static keyPath: string[];
|
|
863
|
+
constructor(
|
|
864
|
+
/** The index id for this entry. */
|
|
865
|
+
indexId: number,
|
|
866
|
+
/** The user id for this entry. */
|
|
867
|
+
uid: string,
|
|
868
|
+
/**
|
|
869
|
+
* A number that indicates when the index was last updated (relative to
|
|
870
|
+
* other indexes).
|
|
871
|
+
*/
|
|
872
|
+
sequenceNumber: number,
|
|
873
|
+
/**
|
|
874
|
+
* The latest read time that has been indexed by Firestore for this field
|
|
875
|
+
* index. Set to `{seconds: 0, nanos: 0}` if no documents have been indexed.
|
|
876
|
+
*/
|
|
877
|
+
readTime: DbTimestamp,
|
|
878
|
+
/**
|
|
879
|
+
* The last document that has been indexed for this field index. Empty if
|
|
880
|
+
* no documents have been indexed.
|
|
881
|
+
*/
|
|
882
|
+
documentKey: EncodedResourcePath,
|
|
883
|
+
/**
|
|
884
|
+
* The largest mutation batch id that has been processed for this index. -1
|
|
885
|
+
* if no mutations have been indexed.
|
|
886
|
+
*/
|
|
887
|
+
largestBatchId: number);
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* The key for each index entry consists of the index id and its user id,
|
|
891
|
+
* the encoded array and directional value for the indexed fields as well as
|
|
892
|
+
* the encoded document path for the indexed document.
|
|
893
|
+
*/
|
|
894
|
+
export declare type DbIndexEntryKey = [number, string, Uint8Array, Uint8Array, string];
|
|
895
|
+
/** An object that stores the encoded entries for all documents and fields. */
|
|
896
|
+
export declare class DbIndexEntries {
|
|
897
|
+
/** The index id for this entry. */
|
|
898
|
+
indexId: number;
|
|
899
|
+
/** The user id for this entry. */
|
|
900
|
+
uid: string;
|
|
901
|
+
/** The encoded array index value for this entry. */
|
|
902
|
+
arrayValue: Uint8Array;
|
|
903
|
+
/** The encoded directional value for equality and inequality filters. */
|
|
904
|
+
directionalValue: Uint8Array;
|
|
905
|
+
/** The document key this entry points to. */
|
|
906
|
+
documentKey: EncodedResourcePath;
|
|
907
|
+
/** Name of the IndexedDb object store. */
|
|
908
|
+
static store: string;
|
|
909
|
+
static keyPath: string[];
|
|
910
|
+
constructor(
|
|
911
|
+
/** The index id for this entry. */
|
|
912
|
+
indexId: number,
|
|
913
|
+
/** The user id for this entry. */
|
|
914
|
+
uid: string,
|
|
915
|
+
/** The encoded array index value for this entry. */
|
|
916
|
+
arrayValue: Uint8Array,
|
|
917
|
+
/** The encoded directional value for equality and inequality filters. */
|
|
918
|
+
directionalValue: Uint8Array,
|
|
919
|
+
/** The document key this entry points to. */
|
|
920
|
+
documentKey: EncodedResourcePath);
|
|
921
|
+
}
|
|
809
922
|
export declare const V1_STORES: string[];
|
|
810
923
|
export declare const V3_STORES: string[];
|
|
811
924
|
export declare const V4_STORES: string[];
|
|
812
925
|
export declare const V6_STORES: string[];
|
|
813
926
|
export declare const V8_STORES: string[];
|
|
814
927
|
export declare const V11_STORES: string[];
|
|
928
|
+
export declare const V12_STORES: string[];
|
|
815
929
|
/**
|
|
816
930
|
* The list of all default IndexedDB stores used throughout the SDK. This is
|
|
817
931
|
* used when creating transactions so that access across all stores is done
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { Target } from '../core/target';
|
|
18
|
+
import { DocumentKeySet, DocumentMap } from '../model/collections';
|
|
19
|
+
import { FieldIndex, IndexOffset } from '../model/field_index';
|
|
17
20
|
import { ResourcePath } from '../model/path';
|
|
18
21
|
import { IndexManager } from './index_manager';
|
|
19
22
|
import { PersistencePromise } from './persistence_promise';
|
|
@@ -25,6 +28,14 @@ export declare class MemoryIndexManager implements IndexManager {
|
|
|
25
28
|
private collectionParentIndex;
|
|
26
29
|
addToCollectionParentIndex(transaction: PersistenceTransaction, collectionPath: ResourcePath): PersistencePromise<void>;
|
|
27
30
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<ResourcePath[]>;
|
|
31
|
+
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
32
|
+
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
33
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
|
|
34
|
+
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
35
|
+
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup?: string): PersistencePromise<FieldIndex[]>;
|
|
36
|
+
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
37
|
+
updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
|
|
38
|
+
updateIndexEntries(transaction: PersistenceTransaction, documents: DocumentMap): PersistencePromise<void>;
|
|
28
39
|
}
|
|
29
40
|
/**
|
|
30
41
|
* Internal implementation of the collection-parent index exposed by MemoryIndexManager.
|
|
@@ -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: unknown[],
|
|
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/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
|
/**
|
|
@@ -1192,6 +1192,45 @@ declare interface EventManager {
|
|
|
1192
1192
|
|
|
1193
1193
|
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';
|
|
1194
1194
|
|
|
1195
|
+
/**
|
|
1196
|
+
* An index definition for field indexes in Firestore.
|
|
1197
|
+
*
|
|
1198
|
+
* Every index is associated with a collection. The definition contains a list
|
|
1199
|
+
* of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or
|
|
1200
|
+
* `CONTAINS` for ArrayContains/ArrayContainsAny queries).
|
|
1201
|
+
*
|
|
1202
|
+
* Unlike the backend, the SDK does not differentiate between collection or
|
|
1203
|
+
* collection group-scoped indices. Every index can be used for both single
|
|
1204
|
+
* collection and collection group queries.
|
|
1205
|
+
*/
|
|
1206
|
+
declare class FieldIndex {
|
|
1207
|
+
/**
|
|
1208
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
1209
|
+
* has not yet been persisted).
|
|
1210
|
+
*/
|
|
1211
|
+
readonly indexId: number;
|
|
1212
|
+
/** The collection ID this index applies to. */
|
|
1213
|
+
readonly collectionGroup: string;
|
|
1214
|
+
/** The field segments for this index. */
|
|
1215
|
+
readonly segments: IndexSegment[];
|
|
1216
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
1217
|
+
readonly indexState: IndexState_2;
|
|
1218
|
+
/** An ID for an index that has not yet been added to persistence. */
|
|
1219
|
+
static UNKNOWN_ID: number;
|
|
1220
|
+
constructor(
|
|
1221
|
+
/**
|
|
1222
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
1223
|
+
* has not yet been persisted).
|
|
1224
|
+
*/
|
|
1225
|
+
indexId: number,
|
|
1226
|
+
/** The collection ID this index applies to. */
|
|
1227
|
+
collectionGroup: string,
|
|
1228
|
+
/** The field segments for this index. */
|
|
1229
|
+
segments: IndexSegment[],
|
|
1230
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
1231
|
+
indexState: IndexState_2);
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1195
1234
|
/**
|
|
1196
1235
|
* Provides a set of fields that can be used to partially patch a document.
|
|
1197
1236
|
* FieldMask is used in conjunction with ObjectValue.
|
|
@@ -2154,6 +2193,20 @@ export declare function increment(n: number): FieldValue;
|
|
|
2154
2193
|
|
|
2155
2194
|
declare type IndexFieldMode = 'MODE_UNSPECIFIED' | 'ASCENDING' | 'DESCENDING';
|
|
2156
2195
|
|
|
2196
|
+
/** The type of the index, e.g. for which type of query it can be used. */
|
|
2197
|
+
declare const enum IndexKind {
|
|
2198
|
+
/**
|
|
2199
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
2200
|
+
*/
|
|
2201
|
+
ASCENDING = 0,
|
|
2202
|
+
/**
|
|
2203
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
2204
|
+
*/
|
|
2205
|
+
DESCENDING = 1,
|
|
2206
|
+
/** Contains index. Can be used for ArrayContains and ArrayContainsAny. */
|
|
2207
|
+
CONTAINS = 2
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2157
2210
|
/**
|
|
2158
2211
|
* Represents a set of indexes that are used to execute queries efficiently.
|
|
2159
2212
|
*
|
|
@@ -2177,10 +2230,125 @@ declare interface IndexManager {
|
|
|
2177
2230
|
* path for a root-level collection).
|
|
2178
2231
|
*/
|
|
2179
2232
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<_ResourcePath[]>;
|
|
2233
|
+
/**
|
|
2234
|
+
* Adds a field path index.
|
|
2235
|
+
*
|
|
2236
|
+
* Values for this index are persisted via the index backfill, which runs
|
|
2237
|
+
* asynchronously in the background. Once the first values are written,
|
|
2238
|
+
* an index can be used to serve partial results for any matching queries.
|
|
2239
|
+
* Any unindexed portion of the database will continue to be served via
|
|
2240
|
+
* collection scons.
|
|
2241
|
+
*/
|
|
2242
|
+
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
2243
|
+
/** Removes the given field index and deletes all index values. */
|
|
2244
|
+
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
2245
|
+
/**
|
|
2246
|
+
* Returns a list of field indexes that correspond to the specified collection
|
|
2247
|
+
* group.
|
|
2248
|
+
*
|
|
2249
|
+
* @param collectionGroup The collection group to get matching field indexes
|
|
2250
|
+
* for.
|
|
2251
|
+
* @return A collection of field indexes for the specified collection group.
|
|
2252
|
+
*/
|
|
2253
|
+
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup: string): PersistencePromise<FieldIndex[]>;
|
|
2254
|
+
/** Returns all configured field indexes. */
|
|
2255
|
+
getFieldIndexes(transaction: PersistenceTransaction): PersistencePromise<FieldIndex[]>;
|
|
2256
|
+
/**
|
|
2257
|
+
* Returns an index that can be used to serve the provided target. Returns
|
|
2258
|
+
* `null` if no index is configured.
|
|
2259
|
+
*/
|
|
2260
|
+
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
2261
|
+
/**
|
|
2262
|
+
* Returns the documents that match the given target based on the provided
|
|
2263
|
+
* index.
|
|
2264
|
+
*/
|
|
2265
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
|
|
2266
|
+
/**
|
|
2267
|
+
* Returns the next collection group to update. Returns `null` if no group
|
|
2268
|
+
* exists.
|
|
2269
|
+
*/
|
|
2270
|
+
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
2271
|
+
/**
|
|
2272
|
+
* Sets the collection group's latest read time.
|
|
2273
|
+
*
|
|
2274
|
+
* This method updates the index offset for all field indices for the
|
|
2275
|
+
* collection group and increments their sequence number. Subsequent calls to
|
|
2276
|
+
* `getNextCollectionGroupToUpdate()` will return a different collection group
|
|
2277
|
+
* (unless only one collection group is configured).
|
|
2278
|
+
*/
|
|
2279
|
+
updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
|
|
2280
|
+
/** Updates the index entries for the provided documents. */
|
|
2281
|
+
updateIndexEntries(transaction: PersistenceTransaction, documents: DocumentMap): PersistencePromise<void>;
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
/**
|
|
2285
|
+
* Stores the latest read time, document and batch ID that were processed for an
|
|
2286
|
+
* index.
|
|
2287
|
+
*/
|
|
2288
|
+
declare class IndexOffset {
|
|
2289
|
+
/**
|
|
2290
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
2291
|
+
* field index.
|
|
2292
|
+
*/
|
|
2293
|
+
readonly readTime: SnapshotVersion;
|
|
2294
|
+
/**
|
|
2295
|
+
* The key of the last document that was indexed for this query. Use
|
|
2296
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
2297
|
+
*/
|
|
2298
|
+
readonly documentKey: _DocumentKey;
|
|
2299
|
+
readonly largestBatchId: number;
|
|
2300
|
+
constructor(
|
|
2301
|
+
/**
|
|
2302
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
2303
|
+
* field index.
|
|
2304
|
+
*/
|
|
2305
|
+
readTime: SnapshotVersion,
|
|
2306
|
+
/**
|
|
2307
|
+
* The key of the last document that was indexed for this query. Use
|
|
2308
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
2309
|
+
*/
|
|
2310
|
+
documentKey: _DocumentKey, largestBatchId: number);
|
|
2311
|
+
/** The state of an index that has not yet been backfilled. */
|
|
2312
|
+
static min(): IndexOffset;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
/** An index component consisting of field path and index type. */
|
|
2316
|
+
declare class IndexSegment {
|
|
2317
|
+
/** The field path of the component. */
|
|
2318
|
+
readonly fieldPath: _FieldPath;
|
|
2319
|
+
/** The fields sorting order. */
|
|
2320
|
+
readonly kind: IndexKind;
|
|
2321
|
+
constructor(
|
|
2322
|
+
/** The field path of the component. */
|
|
2323
|
+
fieldPath: _FieldPath,
|
|
2324
|
+
/** The fields sorting order. */
|
|
2325
|
+
kind: IndexKind);
|
|
2180
2326
|
}
|
|
2181
2327
|
|
|
2182
2328
|
declare type IndexState = 'STATE_UNSPECIFIED' | 'CREATING' | 'READY' | 'ERROR';
|
|
2183
2329
|
|
|
2330
|
+
/**
|
|
2331
|
+
* Stores the "high water mark" that indicates how updated the Index is for the
|
|
2332
|
+
* current user.
|
|
2333
|
+
*/
|
|
2334
|
+
declare class IndexState_2 {
|
|
2335
|
+
/**
|
|
2336
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
2337
|
+
*/
|
|
2338
|
+
readonly sequenceNumber: number;
|
|
2339
|
+
/** The the latest indexed read time, document and batch id. */
|
|
2340
|
+
readonly offset: IndexOffset;
|
|
2341
|
+
constructor(
|
|
2342
|
+
/**
|
|
2343
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
2344
|
+
*/
|
|
2345
|
+
sequenceNumber: number,
|
|
2346
|
+
/** The the latest indexed read time, document and batch id. */
|
|
2347
|
+
offset: IndexOffset);
|
|
2348
|
+
/** The state of an index that has not yet been backfilled. */
|
|
2349
|
+
static empty(): IndexState_2;
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2184
2352
|
/**
|
|
2185
2353
|
* Initializes a new instance of {@link Firestore} with the provided settings.
|
|
2186
2354
|
* Can only be called before any other function, including
|
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.e8972ef49",
|
|
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.e8972ef49",
|
|
81
|
+
"@firebase/logger": "0.3.2-canary.e8972ef49",
|
|
82
|
+
"@firebase/util": "1.4.3-canary.e8972ef49",
|
|
83
|
+
"@firebase/webchannel-wrapper": "0.6.1-canary.e8972ef49",
|
|
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.15-canary.
|
|
90
|
+
"@firebase/app": "0.7.15-canary.e8972ef49"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@firebase/app": "0.7.15-canary.
|
|
94
|
-
"@firebase/app-compat": "0.1.16-canary.
|
|
95
|
-
"@firebase/auth": "0.19.7-canary.
|
|
93
|
+
"@firebase/app": "0.7.15-canary.e8972ef49",
|
|
94
|
+
"@firebase/app-compat": "0.1.16-canary.e8972ef49",
|
|
95
|
+
"@firebase/auth": "0.19.7-canary.e8972ef49",
|
|
96
96
|
"@rollup/plugin-alias": "3.1.5",
|
|
97
97
|
"@rollup/plugin-json": "4.1.0",
|
|
98
98
|
"@types/eslint": "7.28.0",
|