@firebase/firestore 3.4.5 → 3.4.6-2022216223411
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/CHANGELOG.md +9 -0
- package/dist/firestore/src/index/index_entry.d.ts +6 -0
- package/dist/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/local/index_manager.d.ts +2 -2
- package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
- package/dist/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/firestore/src/local/memory_index_manager.d.ts +1 -1
- package/dist/firestore/src/local/simple_db.d.ts +11 -0
- package/dist/firestore/src/model/collections.d.ts +7 -0
- package/dist/firestore/src/model/field_index.d.ts +2 -0
- package/dist/firestore/src/model/type_order.d.ts +2 -1
- package/dist/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/firestore/test/unit/local/test_index_manager.d.ts +1 -1
- package/dist/index.esm2017.js +4160 -4201
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +4332 -4311
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +1223 -956
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +1223 -956
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +4157 -4198
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +12 -5
- package/dist/lite/firestore/src/index/index_entry.d.ts +6 -0
- package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/local/index_manager.d.ts +2 -2
- package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/lite/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/lite/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +1 -1
- package/dist/lite/firestore/src/local/simple_db.d.ts +11 -0
- package/dist/lite/firestore/src/model/collections.d.ts +7 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +2 -0
- package/dist/lite/firestore/src/model/type_order.d.ts +2 -1
- package/dist/lite/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/lite/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +1 -1
- package/dist/lite/index.browser.esm2017.js +34 -24
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +12 -23
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +21 -9
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +21 -9
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +34 -24
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/packages/firestore/src/index/index_entry.d.ts +6 -0
- package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/simple_db.d.ts +11 -0
- package/dist/lite/packages/firestore/src/model/collections.d.ts +7 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +2 -0
- package/dist/lite/packages/firestore/src/model/type_order.d.ts +2 -1
- package/dist/lite/packages/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/lite/packages/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +191 -191
- package/dist/packages/firestore/src/index/index_entry.d.ts +6 -0
- package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/local/index_manager.d.ts +2 -2
- package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +34 -553
- package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +238 -0
- package/dist/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
- package/dist/packages/firestore/src/local/local_serializer.d.ts +2 -1
- package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +1 -1
- package/dist/packages/firestore/src/local/simple_db.d.ts +11 -0
- package/dist/packages/firestore/src/model/collections.d.ts +7 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +2 -0
- package/dist/packages/firestore/src/model/type_order.d.ts +2 -1
- package/dist/packages/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/packages/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
- package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +1 -1
- package/dist/private.d.ts +12 -5
- package/package.json +7 -7
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { BatchId, TargetId } from '../core/types';
|
|
17
|
+
import { BatchId, ListenSequenceNumber, TargetId } from '../core/types';
|
|
18
18
|
import { IndexKind } from '../model/field_index';
|
|
19
|
-
import { ResourcePath } from '../model/path';
|
|
20
19
|
import { BundledQuery } from '../protos/firestore_bundle_proto';
|
|
21
20
|
import { Document as ProtoDocument, DocumentsTarget as ProtoDocumentsTarget, QueryTarget as ProtoQueryTarget, Write as ProtoWrite } from '../protos/firestore_proto_api';
|
|
22
21
|
import { EncodedResourcePath } from './encoded_resource_path';
|
|
22
|
+
import { DbTimestampKey } from './indexeddb_sentinels';
|
|
23
23
|
export declare const INDEXING_SCHEMA_VERSION = 13;
|
|
24
24
|
/**
|
|
25
25
|
* Schema Version for the Web client:
|
|
@@ -46,14 +46,10 @@ export declare const SCHEMA_VERSION: number;
|
|
|
46
46
|
/**
|
|
47
47
|
* Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.
|
|
48
48
|
*/
|
|
49
|
-
export
|
|
49
|
+
export interface DbTimestamp {
|
|
50
50
|
seconds: number;
|
|
51
51
|
nanoseconds: number;
|
|
52
|
-
constructor(seconds: number, nanoseconds: number);
|
|
53
52
|
}
|
|
54
|
-
/** A timestamp type that can be used in IndexedDb keys. */
|
|
55
|
-
export declare type DbTimestampKey = [/* seconds */ number, /* nanos */ number];
|
|
56
|
-
export declare type DbPrimaryClientKey = typeof DbPrimaryClient.key;
|
|
57
53
|
/**
|
|
58
54
|
* A singleton object to be stored in the 'owner' store in IndexedDb.
|
|
59
55
|
*
|
|
@@ -63,37 +59,19 @@ export declare type DbPrimaryClientKey = typeof DbPrimaryClient.key;
|
|
|
63
59
|
* write an updated timestamp to this lease to prevent other tabs from
|
|
64
60
|
* "stealing" the primary lease
|
|
65
61
|
*/
|
|
66
|
-
export
|
|
62
|
+
export interface DbPrimaryClient {
|
|
67
63
|
ownerId: string;
|
|
68
64
|
/** Whether to allow shared access from multiple tabs. */
|
|
69
65
|
allowTabSynchronization: boolean;
|
|
70
66
|
leaseTimestampMs: number;
|
|
71
|
-
/**
|
|
72
|
-
* Name of the IndexedDb object store.
|
|
73
|
-
*
|
|
74
|
-
* Note that the name 'owner' is chosen to ensure backwards compatibility with
|
|
75
|
-
* older clients that only supported single locked access to the persistence
|
|
76
|
-
* layer.
|
|
77
|
-
*/
|
|
78
|
-
static store: string;
|
|
79
|
-
/**
|
|
80
|
-
* The key string used for the single object that exists in the
|
|
81
|
-
* DbPrimaryClient store.
|
|
82
|
-
*/
|
|
83
|
-
static key: string;
|
|
84
|
-
constructor(ownerId: string,
|
|
85
|
-
/** Whether to allow shared access from multiple tabs. */
|
|
86
|
-
allowTabSynchronization: boolean, leaseTimestampMs: number);
|
|
87
67
|
}
|
|
88
|
-
/** Object keys in the 'mutationQueues' store are userId strings. */
|
|
89
|
-
export declare type DbMutationQueueKey = string;
|
|
90
68
|
/**
|
|
91
69
|
* An object to be stored in the 'mutationQueues' store in IndexedDb.
|
|
92
70
|
*
|
|
93
71
|
* Each user gets a single queue of MutationBatches to apply to the server.
|
|
94
72
|
* DbMutationQueue tracks the metadata about the queue.
|
|
95
73
|
*/
|
|
96
|
-
export
|
|
74
|
+
export interface DbMutationQueue {
|
|
97
75
|
/**
|
|
98
76
|
* The normalized user ID to which this queue belongs.
|
|
99
77
|
*/
|
|
@@ -119,39 +97,7 @@ export declare class DbMutationQueue {
|
|
|
119
97
|
* NOTE: this is deprecated and no longer used by the code.
|
|
120
98
|
*/
|
|
121
99
|
lastStreamToken: string;
|
|
122
|
-
/** Name of the IndexedDb object store. */
|
|
123
|
-
static store: string;
|
|
124
|
-
/** Keys are automatically assigned via the userId property. */
|
|
125
|
-
static keyPath: string;
|
|
126
|
-
constructor(
|
|
127
|
-
/**
|
|
128
|
-
* The normalized user ID to which this queue belongs.
|
|
129
|
-
*/
|
|
130
|
-
userId: string,
|
|
131
|
-
/**
|
|
132
|
-
* An identifier for the highest numbered batch that has been acknowledged
|
|
133
|
-
* by the server. All MutationBatches in this queue with batchIds less
|
|
134
|
-
* than or equal to this value are considered to have been acknowledged by
|
|
135
|
-
* the server.
|
|
136
|
-
*
|
|
137
|
-
* NOTE: this is deprecated and no longer used by the code.
|
|
138
|
-
*/
|
|
139
|
-
lastAcknowledgedBatchId: number,
|
|
140
|
-
/**
|
|
141
|
-
* A stream token that was previously sent by the server.
|
|
142
|
-
*
|
|
143
|
-
* See StreamingWriteRequest in datastore.proto for more details about
|
|
144
|
-
* usage.
|
|
145
|
-
*
|
|
146
|
-
* After sending this token, earlier tokens may not be used anymore so
|
|
147
|
-
* only a single stream token is retained.
|
|
148
|
-
*
|
|
149
|
-
* NOTE: this is deprecated and no longer used by the code.
|
|
150
|
-
*/
|
|
151
|
-
lastStreamToken: string);
|
|
152
100
|
}
|
|
153
|
-
/** The 'mutations' store is keyed by batch ID. */
|
|
154
|
-
export declare type DbMutationBatchKey = BatchId;
|
|
155
101
|
/**
|
|
156
102
|
* An object to be stored in the 'mutations' store in IndexedDb.
|
|
157
103
|
*
|
|
@@ -159,7 +105,7 @@ export declare type DbMutationBatchKey = BatchId;
|
|
|
159
105
|
* in a single write. Each user-level batch gets a separate DbMutationBatch
|
|
160
106
|
* with a new batchId.
|
|
161
107
|
*/
|
|
162
|
-
export
|
|
108
|
+
export interface DbMutationBatch {
|
|
163
109
|
/**
|
|
164
110
|
* The normalized user ID to which this batch belongs.
|
|
165
111
|
*/
|
|
@@ -185,61 +131,14 @@ export declare class DbMutationBatch {
|
|
|
185
131
|
*
|
|
186
132
|
* These mutations are never sent to the backend.
|
|
187
133
|
*/
|
|
188
|
-
baseMutations
|
|
134
|
+
baseMutations?: ProtoWrite[];
|
|
189
135
|
/**
|
|
190
136
|
* A list of mutations to apply. All mutations will be applied atomically.
|
|
191
137
|
*
|
|
192
138
|
* Mutations are serialized via toMutation().
|
|
193
139
|
*/
|
|
194
140
|
mutations: ProtoWrite[];
|
|
195
|
-
/** Name of the IndexedDb object store. */
|
|
196
|
-
static store: string;
|
|
197
|
-
/** Keys are automatically assigned via the userId, batchId properties. */
|
|
198
|
-
static keyPath: string;
|
|
199
|
-
/** The index name for lookup of mutations by user. */
|
|
200
|
-
static userMutationsIndex: string;
|
|
201
|
-
/** The user mutations index is keyed by [userId, batchId] pairs. */
|
|
202
|
-
static userMutationsKeyPath: string[];
|
|
203
|
-
constructor(
|
|
204
|
-
/**
|
|
205
|
-
* The normalized user ID to which this batch belongs.
|
|
206
|
-
*/
|
|
207
|
-
userId: string,
|
|
208
|
-
/**
|
|
209
|
-
* An identifier for this batch, allocated using an auto-generated key.
|
|
210
|
-
*/
|
|
211
|
-
batchId: BatchId,
|
|
212
|
-
/**
|
|
213
|
-
* The local write time of the batch, stored as milliseconds since the
|
|
214
|
-
* epoch.
|
|
215
|
-
*/
|
|
216
|
-
localWriteTimeMs: number,
|
|
217
|
-
/**
|
|
218
|
-
* A list of "mutations" that represent a partial base state from when this
|
|
219
|
-
* write batch was initially created. During local application of the write
|
|
220
|
-
* batch, these baseMutations are applied prior to the real writes in order
|
|
221
|
-
* to override certain document fields from the remote document cache. This
|
|
222
|
-
* is necessary in the case of non-idempotent writes (e.g. `increment()`
|
|
223
|
-
* transforms) to make sure that the local view of the modified documents
|
|
224
|
-
* doesn't flicker if the remote document cache receives the result of the
|
|
225
|
-
* non-idempotent write before the write is removed from the queue.
|
|
226
|
-
*
|
|
227
|
-
* These mutations are never sent to the backend.
|
|
228
|
-
*/
|
|
229
|
-
baseMutations: ProtoWrite[] | undefined,
|
|
230
|
-
/**
|
|
231
|
-
* A list of mutations to apply. All mutations will be applied atomically.
|
|
232
|
-
*
|
|
233
|
-
* Mutations are serialized via toMutation().
|
|
234
|
-
*/
|
|
235
|
-
mutations: ProtoWrite[]);
|
|
236
141
|
}
|
|
237
|
-
/**
|
|
238
|
-
* The key for a db document mutation, which is made up of a userID, path, and
|
|
239
|
-
* batchId. Note that the path must be serialized into a form that indexedDB can
|
|
240
|
-
* sort.
|
|
241
|
-
*/
|
|
242
|
-
export declare type DbDocumentMutationKey = [string, EncodedResourcePath, BatchId];
|
|
243
142
|
/**
|
|
244
143
|
* An object to be stored in the 'documentMutations' store in IndexedDb.
|
|
245
144
|
*
|
|
@@ -247,54 +146,23 @@ export declare type DbDocumentMutationKey = [string, EncodedResourcePath, BatchI
|
|
|
247
146
|
* document key. The rows in this table are references based on the contents of
|
|
248
147
|
* DbMutationBatch.mutations.
|
|
249
148
|
*/
|
|
250
|
-
export
|
|
251
|
-
static store: string;
|
|
252
|
-
/**
|
|
253
|
-
* Creates a [userId] key for use in the DbDocumentMutations index to iterate
|
|
254
|
-
* over all of a user's document mutations.
|
|
255
|
-
*/
|
|
256
|
-
static prefixForUser(userId: string): [string];
|
|
257
|
-
/**
|
|
258
|
-
* Creates a [userId, encodedPath] key for use in the DbDocumentMutations
|
|
259
|
-
* index to iterate over all at document mutations for a given path or lower.
|
|
260
|
-
*/
|
|
261
|
-
static prefixForPath(userId: string, path: ResourcePath): [string, EncodedResourcePath];
|
|
262
|
-
/**
|
|
263
|
-
* Creates a full index key of [userId, encodedPath, batchId] for inserting
|
|
264
|
-
* and deleting into the DbDocumentMutations index.
|
|
265
|
-
*/
|
|
266
|
-
static key(userId: string, path: ResourcePath, batchId: BatchId): DbDocumentMutationKey;
|
|
267
|
-
/**
|
|
268
|
-
* Because we store all the useful information for this store in the key,
|
|
269
|
-
* there is no useful information to store as the value. The raw (unencoded)
|
|
270
|
-
* path cannot be stored because IndexedDb doesn't store prototype
|
|
271
|
-
* information.
|
|
272
|
-
*/
|
|
273
|
-
static PLACEHOLDER: DbDocumentMutation;
|
|
274
|
-
private constructor();
|
|
149
|
+
export interface DbDocumentMutation {
|
|
275
150
|
}
|
|
276
|
-
/**
|
|
277
|
-
* A key in the 'remoteDocuments' object store is a string array containing the
|
|
278
|
-
* segments that make up the path.
|
|
279
|
-
*/
|
|
280
|
-
export declare type DbRemoteDocumentKey = string[];
|
|
281
151
|
/**
|
|
282
152
|
* Represents the known absence of a document at a particular version.
|
|
283
153
|
* Stored in IndexedDb as part of a DbRemoteDocument object.
|
|
284
154
|
*/
|
|
285
|
-
export
|
|
155
|
+
export interface DbNoDocument {
|
|
286
156
|
path: string[];
|
|
287
157
|
readTime: DbTimestamp;
|
|
288
|
-
constructor(path: string[], readTime: DbTimestamp);
|
|
289
158
|
}
|
|
290
159
|
/**
|
|
291
160
|
* Represents a document that is known to exist but whose data is unknown.
|
|
292
161
|
* Stored in IndexedDb as part of a DbRemoteDocument object.
|
|
293
162
|
*/
|
|
294
|
-
export
|
|
163
|
+
export interface DbUnknownDocument {
|
|
295
164
|
path: string[];
|
|
296
165
|
version: DbTimestamp;
|
|
297
|
-
constructor(path: string[], version: DbTimestamp);
|
|
298
166
|
}
|
|
299
167
|
/**
|
|
300
168
|
* An object to be stored in the 'remoteDocuments' store in IndexedDb.
|
|
@@ -309,111 +177,51 @@ export declare class DbUnknownDocument {
|
|
|
309
177
|
* Note: This is the persisted equivalent of a MaybeDocument and could perhaps
|
|
310
178
|
* be made more general if necessary.
|
|
311
179
|
*/
|
|
312
|
-
export
|
|
180
|
+
export interface DbRemoteDocument {
|
|
313
181
|
/**
|
|
314
182
|
* Set to an instance of DbUnknownDocument if the data for a document is
|
|
315
183
|
* not known, but it is known that a document exists at the specified
|
|
316
184
|
* version (e.g. it had a successful update applied to it)
|
|
317
185
|
*/
|
|
318
|
-
unknownDocument
|
|
186
|
+
unknownDocument?: DbUnknownDocument;
|
|
319
187
|
/**
|
|
320
188
|
* Set to an instance of a DbNoDocument if it is known that no document
|
|
321
189
|
* exists.
|
|
322
190
|
*/
|
|
323
|
-
noDocument
|
|
191
|
+
noDocument?: DbNoDocument;
|
|
324
192
|
/**
|
|
325
193
|
* Set to an instance of a Document if there's a cached version of the
|
|
326
194
|
* document.
|
|
327
195
|
*/
|
|
328
|
-
document
|
|
196
|
+
document?: ProtoDocument;
|
|
329
197
|
/**
|
|
330
198
|
* Documents that were written to the remote document store based on
|
|
331
199
|
* a write acknowledgment are marked with `hasCommittedMutations`. These
|
|
332
200
|
* documents are potentially inconsistent with the backend's copy and use
|
|
333
201
|
* the write's commit version as their document version.
|
|
334
202
|
*/
|
|
335
|
-
hasCommittedMutations
|
|
203
|
+
hasCommittedMutations?: boolean;
|
|
336
204
|
/**
|
|
337
205
|
* When the document was read from the backend. Undefined for data written
|
|
338
206
|
* prior to schema version 9.
|
|
339
207
|
*/
|
|
340
|
-
readTime
|
|
208
|
+
readTime?: DbTimestampKey;
|
|
341
209
|
/**
|
|
342
210
|
* The path of the collection this document is part of. Undefined for data
|
|
343
211
|
* written prior to schema version 9.
|
|
344
212
|
*/
|
|
345
|
-
parentPath
|
|
346
|
-
static store: string;
|
|
347
|
-
/**
|
|
348
|
-
* An index that provides access to all entries sorted by read time (which
|
|
349
|
-
* corresponds to the last modification time of each row).
|
|
350
|
-
*
|
|
351
|
-
* This index is used to provide a changelog for Multi-Tab.
|
|
352
|
-
*/
|
|
353
|
-
static readTimeIndex: string;
|
|
354
|
-
static readTimeIndexPath: string;
|
|
355
|
-
/**
|
|
356
|
-
* An index that provides access to documents in a collection sorted by read
|
|
357
|
-
* time.
|
|
358
|
-
*
|
|
359
|
-
* This index is used to allow the RemoteDocumentCache to fetch newly changed
|
|
360
|
-
* documents in a collection.
|
|
361
|
-
*/
|
|
362
|
-
static collectionReadTimeIndex: string;
|
|
363
|
-
static collectionReadTimeIndexPath: string[];
|
|
364
|
-
constructor(
|
|
365
|
-
/**
|
|
366
|
-
* Set to an instance of DbUnknownDocument if the data for a document is
|
|
367
|
-
* not known, but it is known that a document exists at the specified
|
|
368
|
-
* version (e.g. it had a successful update applied to it)
|
|
369
|
-
*/
|
|
370
|
-
unknownDocument: DbUnknownDocument | null | undefined,
|
|
371
|
-
/**
|
|
372
|
-
* Set to an instance of a DbNoDocument if it is known that no document
|
|
373
|
-
* exists.
|
|
374
|
-
*/
|
|
375
|
-
noDocument: DbNoDocument | null,
|
|
376
|
-
/**
|
|
377
|
-
* Set to an instance of a Document if there's a cached version of the
|
|
378
|
-
* document.
|
|
379
|
-
*/
|
|
380
|
-
document: ProtoDocument | null,
|
|
381
|
-
/**
|
|
382
|
-
* Documents that were written to the remote document store based on
|
|
383
|
-
* a write acknowledgment are marked with `hasCommittedMutations`. These
|
|
384
|
-
* documents are potentially inconsistent with the backend's copy and use
|
|
385
|
-
* the write's commit version as their document version.
|
|
386
|
-
*/
|
|
387
|
-
hasCommittedMutations: boolean | undefined,
|
|
388
|
-
/**
|
|
389
|
-
* When the document was read from the backend. Undefined for data written
|
|
390
|
-
* prior to schema version 9.
|
|
391
|
-
*/
|
|
392
|
-
readTime: DbTimestampKey | undefined,
|
|
393
|
-
/**
|
|
394
|
-
* The path of the collection this document is part of. Undefined for data
|
|
395
|
-
* written prior to schema version 9.
|
|
396
|
-
*/
|
|
397
|
-
parentPath: string[] | undefined);
|
|
213
|
+
parentPath?: string[];
|
|
398
214
|
}
|
|
399
215
|
/**
|
|
400
216
|
* Contains a single entry that has metadata about the remote document cache.
|
|
401
217
|
*/
|
|
402
|
-
export
|
|
403
|
-
byteSize: number;
|
|
404
|
-
static store: string;
|
|
405
|
-
static key: string;
|
|
218
|
+
export interface DbRemoteDocumentGlobal {
|
|
406
219
|
/**
|
|
407
|
-
*
|
|
220
|
+
* Approximately the total size in bytes of all the
|
|
408
221
|
* documents in the document cache.
|
|
409
222
|
*/
|
|
410
|
-
|
|
223
|
+
byteSize: number;
|
|
411
224
|
}
|
|
412
|
-
export declare type DbRemoteDocumentGlobalKey = typeof DbRemoteDocumentGlobal.key;
|
|
413
|
-
/**
|
|
414
|
-
* A key in the 'targets' object store is a targetId of the query.
|
|
415
|
-
*/
|
|
416
|
-
export declare type DbTargetKey = TargetId;
|
|
417
225
|
/**
|
|
418
226
|
* The persisted type for a query nested with in the 'targets' store in
|
|
419
227
|
* IndexedDb. We use the proto definitions for these two kinds of queries in
|
|
@@ -429,7 +237,7 @@ export declare type DbQuery = ProtoQueryTarget | ProtoDocumentsTarget;
|
|
|
429
237
|
* Each query the client listens to against the server is tracked on disk so
|
|
430
238
|
* that the query can be efficiently resumed on restart.
|
|
431
239
|
*/
|
|
432
|
-
export
|
|
240
|
+
export interface DbTarget {
|
|
433
241
|
/**
|
|
434
242
|
* An auto-generated sequential numeric identifier for the query.
|
|
435
243
|
*
|
|
@@ -487,7 +295,7 @@ export declare class DbTarget {
|
|
|
487
295
|
* contained no limbo documents. Undefined for data written prior to
|
|
488
296
|
* schema version 9.
|
|
489
297
|
*/
|
|
490
|
-
lastLimboFreeSnapshotVersion
|
|
298
|
+
lastLimboFreeSnapshotVersion?: DbTimestamp;
|
|
491
299
|
/**
|
|
492
300
|
* The query for this target.
|
|
493
301
|
*
|
|
@@ -496,90 +304,7 @@ export declare class DbTarget {
|
|
|
496
304
|
* duplicate translation logic to and from a `Query` object.
|
|
497
305
|
*/
|
|
498
306
|
query: DbQuery;
|
|
499
|
-
static store: string;
|
|
500
|
-
/** Keys are automatically assigned via the targetId property. */
|
|
501
|
-
static keyPath: string;
|
|
502
|
-
/** The name of the queryTargets index. */
|
|
503
|
-
static queryTargetsIndexName: string;
|
|
504
|
-
/**
|
|
505
|
-
* The index of all canonicalIds to the targets that they match. This is not
|
|
506
|
-
* a unique mapping because canonicalId does not promise a unique name for all
|
|
507
|
-
* possible queries, so we append the targetId to make the mapping unique.
|
|
508
|
-
*/
|
|
509
|
-
static queryTargetsKeyPath: string[];
|
|
510
|
-
constructor(
|
|
511
|
-
/**
|
|
512
|
-
* An auto-generated sequential numeric identifier for the query.
|
|
513
|
-
*
|
|
514
|
-
* Queries are stored using their canonicalId as the key, but these
|
|
515
|
-
* canonicalIds can be quite long so we additionally assign a unique
|
|
516
|
-
* queryId which can be used by referenced data structures (e.g.
|
|
517
|
-
* indexes) to minimize the on-disk cost.
|
|
518
|
-
*/
|
|
519
|
-
targetId: TargetId,
|
|
520
|
-
/**
|
|
521
|
-
* The canonical string representing this query. This is not unique.
|
|
522
|
-
*/
|
|
523
|
-
canonicalId: string,
|
|
524
|
-
/**
|
|
525
|
-
* The last readTime received from the Watch Service for this query.
|
|
526
|
-
*
|
|
527
|
-
* This is the same value as TargetChange.read_time in the protos.
|
|
528
|
-
*/
|
|
529
|
-
readTime: DbTimestamp,
|
|
530
|
-
/**
|
|
531
|
-
* An opaque, server-assigned token that allows watching a query to be
|
|
532
|
-
* resumed after disconnecting without retransmitting all the data
|
|
533
|
-
* that matches the query. The resume token essentially identifies a
|
|
534
|
-
* point in time from which the server should resume sending results.
|
|
535
|
-
*
|
|
536
|
-
* This is related to the snapshotVersion in that the resumeToken
|
|
537
|
-
* effectively also encodes that value, but the resumeToken is opaque
|
|
538
|
-
* and sometimes encodes additional information.
|
|
539
|
-
*
|
|
540
|
-
* A consequence of this is that the resumeToken should be used when
|
|
541
|
-
* asking the server to reason about where this client is in the watch
|
|
542
|
-
* stream, but the client should use the snapshotVersion for its own
|
|
543
|
-
* purposes.
|
|
544
|
-
*
|
|
545
|
-
* This is the same value as TargetChange.resume_token in the protos.
|
|
546
|
-
*/
|
|
547
|
-
resumeToken: string,
|
|
548
|
-
/**
|
|
549
|
-
* A sequence number representing the last time this query was
|
|
550
|
-
* listened to, used for garbage collection purposes.
|
|
551
|
-
*
|
|
552
|
-
* Conventionally this would be a timestamp value, but device-local
|
|
553
|
-
* clocks are unreliable and they must be able to create new listens
|
|
554
|
-
* even while disconnected. Instead this should be a monotonically
|
|
555
|
-
* increasing number that's incremented on each listen call.
|
|
556
|
-
*
|
|
557
|
-
* This is different from the queryId since the queryId is an
|
|
558
|
-
* immutable identifier assigned to the Query on first use while
|
|
559
|
-
* lastListenSequenceNumber is updated every time the query is
|
|
560
|
-
* listened to.
|
|
561
|
-
*/
|
|
562
|
-
lastListenSequenceNumber: number,
|
|
563
|
-
/**
|
|
564
|
-
* Denotes the maximum snapshot version at which the associated query view
|
|
565
|
-
* contained no limbo documents. Undefined for data written prior to
|
|
566
|
-
* schema version 9.
|
|
567
|
-
*/
|
|
568
|
-
lastLimboFreeSnapshotVersion: DbTimestamp | undefined,
|
|
569
|
-
/**
|
|
570
|
-
* The query for this target.
|
|
571
|
-
*
|
|
572
|
-
* Because canonical ids are not unique we must store the actual query. We
|
|
573
|
-
* use the proto to have an object we can persist without having to
|
|
574
|
-
* duplicate translation logic to and from a `Query` object.
|
|
575
|
-
*/
|
|
576
|
-
query: DbQuery);
|
|
577
307
|
}
|
|
578
|
-
/**
|
|
579
|
-
* The key for a DbTargetDocument, containing a targetId and an encoded resource
|
|
580
|
-
* path.
|
|
581
|
-
*/
|
|
582
|
-
export declare type DbTargetDocumentKey = [TargetId, EncodedResourcePath];
|
|
583
308
|
/**
|
|
584
309
|
* An object representing an association between a target and a document, or a
|
|
585
310
|
* sentinel row marking the last sequence number at which a document was used.
|
|
@@ -590,7 +315,7 @@ export declare type DbTargetDocumentKey = [TargetId, EncodedResourcePath];
|
|
|
590
315
|
* documents and their sequence numbers can be identified efficiently via a scan
|
|
591
316
|
* of this store.
|
|
592
317
|
*/
|
|
593
|
-
export
|
|
318
|
+
export interface DbTargetDocument {
|
|
594
319
|
/**
|
|
595
320
|
* The targetId identifying a target or 0 for a sentinel row.
|
|
596
321
|
*/
|
|
@@ -604,42 +329,15 @@ export declare class DbTargetDocument {
|
|
|
604
329
|
* time the document specified by `path` was used. Otherwise, it should be
|
|
605
330
|
* `undefined`.
|
|
606
331
|
*/
|
|
607
|
-
sequenceNumber?:
|
|
608
|
-
/** Name of the IndexedDb object store. */
|
|
609
|
-
static store: string;
|
|
610
|
-
/** Keys are automatically assigned via the targetId, path properties. */
|
|
611
|
-
static keyPath: string[];
|
|
612
|
-
/** The index name for the reverse index. */
|
|
613
|
-
static documentTargetsIndex: string;
|
|
614
|
-
/** We also need to create the reverse index for these properties. */
|
|
615
|
-
static documentTargetsKeyPath: string[];
|
|
616
|
-
constructor(
|
|
617
|
-
/**
|
|
618
|
-
* The targetId identifying a target or 0 for a sentinel row.
|
|
619
|
-
*/
|
|
620
|
-
targetId: TargetId,
|
|
621
|
-
/**
|
|
622
|
-
* The path to the document, as encoded in the key.
|
|
623
|
-
*/
|
|
624
|
-
path: EncodedResourcePath,
|
|
625
|
-
/**
|
|
626
|
-
* If this is a sentinel row, this should be the sequence number of the last
|
|
627
|
-
* time the document specified by `path` was used. Otherwise, it should be
|
|
628
|
-
* `undefined`.
|
|
629
|
-
*/
|
|
630
|
-
sequenceNumber?: number | undefined);
|
|
332
|
+
sequenceNumber?: ListenSequenceNumber;
|
|
631
333
|
}
|
|
632
|
-
/**
|
|
633
|
-
* The type to represent the single allowed key for the DbTargetGlobal store.
|
|
634
|
-
*/
|
|
635
|
-
export declare type DbTargetGlobalKey = typeof DbTargetGlobal.key;
|
|
636
334
|
/**
|
|
637
335
|
* A record of global state tracked across all Targets, tracked separately
|
|
638
336
|
* to avoid the need for extra indexes.
|
|
639
337
|
*
|
|
640
338
|
* This should be kept in-sync with the proto used in the iOS client.
|
|
641
339
|
*/
|
|
642
|
-
export
|
|
340
|
+
export interface DbTargetGlobal {
|
|
643
341
|
/**
|
|
644
342
|
* The highest numbered target id across all targets.
|
|
645
343
|
*
|
|
@@ -665,52 +363,14 @@ export declare class DbTargetGlobal {
|
|
|
665
363
|
* The number of targets persisted.
|
|
666
364
|
*/
|
|
667
365
|
targetCount: number;
|
|
668
|
-
/**
|
|
669
|
-
* The key string used for the single object that exists in the
|
|
670
|
-
* DbTargetGlobal store.
|
|
671
|
-
*/
|
|
672
|
-
static key: string;
|
|
673
|
-
static store: string;
|
|
674
|
-
constructor(
|
|
675
|
-
/**
|
|
676
|
-
* The highest numbered target id across all targets.
|
|
677
|
-
*
|
|
678
|
-
* See DbTarget.targetId.
|
|
679
|
-
*/
|
|
680
|
-
highestTargetId: TargetId,
|
|
681
|
-
/**
|
|
682
|
-
* The highest numbered lastListenSequenceNumber across all targets.
|
|
683
|
-
*
|
|
684
|
-
* See DbTarget.lastListenSequenceNumber.
|
|
685
|
-
*/
|
|
686
|
-
highestListenSequenceNumber: number,
|
|
687
|
-
/**
|
|
688
|
-
* A global snapshot version representing the last consistent snapshot we
|
|
689
|
-
* received from the backend. This is monotonically increasing and any
|
|
690
|
-
* snapshots received from the backend prior to this version (e.g. for
|
|
691
|
-
* targets resumed with a resumeToken) should be suppressed (buffered)
|
|
692
|
-
* until the backend has caught up to this snapshot version again. This
|
|
693
|
-
* prevents our cache from ever going backwards in time.
|
|
694
|
-
*/
|
|
695
|
-
lastRemoteSnapshotVersion: DbTimestamp,
|
|
696
|
-
/**
|
|
697
|
-
* The number of targets persisted.
|
|
698
|
-
*/
|
|
699
|
-
targetCount: number);
|
|
700
366
|
}
|
|
701
|
-
/**
|
|
702
|
-
* The key for a DbCollectionParent entry, containing the collection ID
|
|
703
|
-
* and the parent path that contains it. Note that the parent path will be an
|
|
704
|
-
* empty path in the case of root-level collections.
|
|
705
|
-
*/
|
|
706
|
-
export declare type DbCollectionParentKey = [string, EncodedResourcePath];
|
|
707
367
|
/**
|
|
708
368
|
* An object representing an association between a Collection id (e.g. 'messages')
|
|
709
369
|
* to a parent path (e.g. '/chats/123') that contains it as a (sub)collection.
|
|
710
370
|
* This is used to efficiently find all collections to query when performing
|
|
711
371
|
* a Collection Group query.
|
|
712
372
|
*/
|
|
713
|
-
export
|
|
373
|
+
export interface DbCollectionParent {
|
|
714
374
|
/**
|
|
715
375
|
* The collectionId (e.g. 'messages')
|
|
716
376
|
*/
|
|
@@ -720,20 +380,6 @@ export declare class DbCollectionParent {
|
|
|
720
380
|
* a root-level collection).
|
|
721
381
|
*/
|
|
722
382
|
parent: EncodedResourcePath;
|
|
723
|
-
/** Name of the IndexedDb object store. */
|
|
724
|
-
static store: string;
|
|
725
|
-
/** Keys are automatically assigned via the collectionId, parent properties. */
|
|
726
|
-
static keyPath: string[];
|
|
727
|
-
constructor(
|
|
728
|
-
/**
|
|
729
|
-
* The collectionId (e.g. 'messages')
|
|
730
|
-
*/
|
|
731
|
-
collectionId: string,
|
|
732
|
-
/**
|
|
733
|
-
* The path to the parent (either a document location or an empty path for
|
|
734
|
-
* a root-level collection).
|
|
735
|
-
*/
|
|
736
|
-
parent: EncodedResourcePath);
|
|
737
383
|
}
|
|
738
384
|
/**
|
|
739
385
|
* A record of the metadata state of each client.
|
|
@@ -741,7 +387,7 @@ export declare class DbCollectionParent {
|
|
|
741
387
|
* PORTING NOTE: This is used to synchronize multi-tab state and does not need
|
|
742
388
|
* to be ported to iOS or Android.
|
|
743
389
|
*/
|
|
744
|
-
export
|
|
390
|
+
export interface DbClientMetadata {
|
|
745
391
|
/** The auto-generated client id assigned at client startup. */
|
|
746
392
|
clientId: string;
|
|
747
393
|
/** The last time this state was updated. */
|
|
@@ -750,106 +396,42 @@ export declare class DbClientMetadata {
|
|
|
750
396
|
networkEnabled: boolean;
|
|
751
397
|
/** Whether this client is running in a foreground tab. */
|
|
752
398
|
inForeground: boolean;
|
|
753
|
-
/** Name of the IndexedDb object store. */
|
|
754
|
-
static store: string;
|
|
755
|
-
/** Keys are automatically assigned via the clientId properties. */
|
|
756
|
-
static keyPath: string;
|
|
757
|
-
constructor(
|
|
758
|
-
/** The auto-generated client id assigned at client startup. */
|
|
759
|
-
clientId: string,
|
|
760
|
-
/** The last time this state was updated. */
|
|
761
|
-
updateTimeMs: number,
|
|
762
|
-
/** Whether the client's network connection is enabled. */
|
|
763
|
-
networkEnabled: boolean,
|
|
764
|
-
/** Whether this client is running in a foreground tab. */
|
|
765
|
-
inForeground: boolean);
|
|
766
399
|
}
|
|
767
|
-
/** Object keys in the 'clientMetadata' store are clientId strings. */
|
|
768
|
-
export declare type DbClientMetadataKey = string;
|
|
769
|
-
export declare type DbBundlesKey = string;
|
|
770
400
|
/** An object representing a bundle loaded by the SDK. */
|
|
771
|
-
export
|
|
401
|
+
export interface DbBundle {
|
|
772
402
|
/** The ID of the loaded bundle. */
|
|
773
403
|
bundleId: string;
|
|
774
404
|
/** The create time of the loaded bundle. */
|
|
775
405
|
createTime: DbTimestamp;
|
|
776
406
|
/** The schema version of the loaded bundle. */
|
|
777
407
|
version: number;
|
|
778
|
-
/** Name of the IndexedDb object store. */
|
|
779
|
-
static store: string;
|
|
780
|
-
static keyPath: string;
|
|
781
|
-
constructor(
|
|
782
|
-
/** The ID of the loaded bundle. */
|
|
783
|
-
bundleId: string,
|
|
784
|
-
/** The create time of the loaded bundle. */
|
|
785
|
-
createTime: DbTimestamp,
|
|
786
|
-
/** The schema version of the loaded bundle. */
|
|
787
|
-
version: number);
|
|
788
408
|
}
|
|
789
|
-
export declare type DbNamedQueriesKey = string;
|
|
790
409
|
/** An object representing a named query loaded by the SDK via a bundle. */
|
|
791
|
-
export
|
|
410
|
+
export interface DbNamedQuery {
|
|
792
411
|
/** The name of the query. */
|
|
793
412
|
name: string;
|
|
794
413
|
/** The read time of the results saved in the bundle from the named query. */
|
|
795
414
|
readTime: DbTimestamp;
|
|
796
415
|
/** The query saved in the bundle. */
|
|
797
416
|
bundledQuery: BundledQuery;
|
|
798
|
-
/** Name of the IndexedDb object store. */
|
|
799
|
-
static store: string;
|
|
800
|
-
static keyPath: string;
|
|
801
|
-
constructor(
|
|
802
|
-
/** The name of the query. */
|
|
803
|
-
name: string,
|
|
804
|
-
/** The read time of the results saved in the bundle from the named query. */
|
|
805
|
-
readTime: DbTimestamp,
|
|
806
|
-
/** The query saved in the bundle. */
|
|
807
|
-
bundledQuery: BundledQuery);
|
|
808
417
|
}
|
|
809
|
-
/** The key for each index consisting of just the index id. */
|
|
810
|
-
export declare type DbIndexConfigurationKey = number;
|
|
811
418
|
/** An object representing the global configuration for a field index. */
|
|
812
|
-
export
|
|
419
|
+
export interface DbIndexConfiguration {
|
|
813
420
|
/**
|
|
814
421
|
* The index id for this entry. Undefined for indexes that are not yet
|
|
815
422
|
* persisted.
|
|
816
423
|
*/
|
|
817
|
-
indexId
|
|
424
|
+
indexId?: number;
|
|
818
425
|
/** The collection group this index belongs to. */
|
|
819
426
|
collectionGroup: string;
|
|
820
427
|
/** The fields to index for this index. */
|
|
821
428
|
fields: Array<[name: string, kind: IndexKind]>;
|
|
822
|
-
/** Name of the IndexedDb object store. */
|
|
823
|
-
static store: string;
|
|
824
|
-
static keyPath: string;
|
|
825
|
-
/**
|
|
826
|
-
* An index that provides access to the index configurations by collection
|
|
827
|
-
* group.
|
|
828
|
-
*
|
|
829
|
-
* PORTING NOTE: iOS and Android maintain this index in-memory, but this is
|
|
830
|
-
* not possible here as the Web client supports concurrent access to
|
|
831
|
-
* persistence via multi-tab.
|
|
832
|
-
*/
|
|
833
|
-
static collectionGroupIndex: string;
|
|
834
|
-
static collectionGroupIndexPath: string;
|
|
835
|
-
constructor(
|
|
836
|
-
/**
|
|
837
|
-
* The index id for this entry. Undefined for indexes that are not yet
|
|
838
|
-
* persisted.
|
|
839
|
-
*/
|
|
840
|
-
indexId: number | undefined,
|
|
841
|
-
/** The collection group this index belongs to. */
|
|
842
|
-
collectionGroup: string,
|
|
843
|
-
/** The fields to index for this index. */
|
|
844
|
-
fields: Array<[name: string, kind: IndexKind]>);
|
|
845
429
|
}
|
|
846
|
-
/** The key for each index state consisting of the index id and its user id. */
|
|
847
|
-
export declare type DbIndexStateKey = [number, string];
|
|
848
430
|
/**
|
|
849
431
|
* An object describing how up-to-date the index backfill is for each user and
|
|
850
432
|
* index.
|
|
851
433
|
*/
|
|
852
|
-
export
|
|
434
|
+
export interface DbIndexState {
|
|
853
435
|
/** The index id for this entry. */
|
|
854
436
|
indexId: number;
|
|
855
437
|
/** The user id for this entry. */
|
|
@@ -874,53 +456,9 @@ export declare class DbIndexState {
|
|
|
874
456
|
* if no mutations have been indexed.
|
|
875
457
|
*/
|
|
876
458
|
largestBatchId: number;
|
|
877
|
-
/** Name of the IndexedDb object store. */
|
|
878
|
-
static store: string;
|
|
879
|
-
static keyPath: string[];
|
|
880
|
-
/**
|
|
881
|
-
* An index that provides access to documents in a collection sorted by last
|
|
882
|
-
* update time. Used by the backfiller.
|
|
883
|
-
*
|
|
884
|
-
* PORTING NOTE: iOS and Android maintain this index in-memory, but this is
|
|
885
|
-
* not possible here as the Web client supports concurrent access to
|
|
886
|
-
* persistence via multi-tab.
|
|
887
|
-
*/
|
|
888
|
-
static sequenceNumberIndex: string;
|
|
889
|
-
static sequenceNumberIndexPath: string[];
|
|
890
|
-
constructor(
|
|
891
|
-
/** The index id for this entry. */
|
|
892
|
-
indexId: number,
|
|
893
|
-
/** The user id for this entry. */
|
|
894
|
-
uid: string,
|
|
895
|
-
/**
|
|
896
|
-
* A number that indicates when the index was last updated (relative to
|
|
897
|
-
* other indexes).
|
|
898
|
-
*/
|
|
899
|
-
sequenceNumber: number,
|
|
900
|
-
/**
|
|
901
|
-
* The latest read time that has been indexed by Firestore for this field
|
|
902
|
-
* index. Set to `{seconds: 0, nanos: 0}` if no documents have been indexed.
|
|
903
|
-
*/
|
|
904
|
-
readTime: DbTimestamp,
|
|
905
|
-
/**
|
|
906
|
-
* The last document that has been indexed for this field index. Empty if
|
|
907
|
-
* no documents have been indexed.
|
|
908
|
-
*/
|
|
909
|
-
documentKey: EncodedResourcePath,
|
|
910
|
-
/**
|
|
911
|
-
* The largest mutation batch id that has been processed for this index. -1
|
|
912
|
-
* if no mutations have been indexed.
|
|
913
|
-
*/
|
|
914
|
-
largestBatchId: number);
|
|
915
459
|
}
|
|
916
|
-
/**
|
|
917
|
-
* The key for each index entry consists of the index id and its user id,
|
|
918
|
-
* the encoded array and directional value for the indexed fields as well as
|
|
919
|
-
* the encoded document path for the indexed document.
|
|
920
|
-
*/
|
|
921
|
-
export declare type DbIndexEntryKey = [number, string, Uint8Array, Uint8Array, string];
|
|
922
460
|
/** An object that stores the encoded entries for all documents and fields. */
|
|
923
|
-
export
|
|
461
|
+
export interface DbIndexEntry {
|
|
924
462
|
/** The index id for this entry. */
|
|
925
463
|
indexId: number;
|
|
926
464
|
/** The user id for this entry. */
|
|
@@ -931,32 +469,11 @@ export declare class DbIndexEntry {
|
|
|
931
469
|
directionalValue: Uint8Array;
|
|
932
470
|
/** The document key this entry points to. */
|
|
933
471
|
documentKey: EncodedResourcePath;
|
|
934
|
-
/** Name of the IndexedDb object store. */
|
|
935
|
-
static store: string;
|
|
936
|
-
static keyPath: string[];
|
|
937
|
-
static documentKeyIndex: string;
|
|
938
|
-
static documentKeyIndexPath: string[];
|
|
939
|
-
constructor(
|
|
940
|
-
/** The index id for this entry. */
|
|
941
|
-
indexId: number,
|
|
942
|
-
/** The user id for this entry. */
|
|
943
|
-
uid: string,
|
|
944
|
-
/** The encoded array index value for this entry. */
|
|
945
|
-
arrayValue: Uint8Array,
|
|
946
|
-
/** The encoded directional value for equality and inequality filters. */
|
|
947
|
-
directionalValue: Uint8Array,
|
|
948
|
-
/** The document key this entry points to. */
|
|
949
|
-
documentKey: EncodedResourcePath);
|
|
950
472
|
}
|
|
951
|
-
export declare type DbDocumentOverlayKey = [
|
|
952
|
-
string,
|
|
953
|
-
string,
|
|
954
|
-
string
|
|
955
|
-
];
|
|
956
473
|
/**
|
|
957
474
|
* An object representing a document overlay.
|
|
958
475
|
*/
|
|
959
|
-
export
|
|
476
|
+
export interface DbDocumentOverlay {
|
|
960
477
|
/** The user ID to whom this overlay belongs. */
|
|
961
478
|
userId: string;
|
|
962
479
|
/** The path to the collection that contains the document. */
|
|
@@ -969,40 +486,4 @@ export declare class DbDocumentOverlay {
|
|
|
969
486
|
largestBatchId: number;
|
|
970
487
|
/** The overlay mutation. */
|
|
971
488
|
overlayMutation: ProtoWrite;
|
|
972
|
-
/** Name of the IndexedDb object store. */
|
|
973
|
-
static store: string;
|
|
974
|
-
static keyPath: string[];
|
|
975
|
-
static collectionPathOverlayIndex: string;
|
|
976
|
-
static collectionPathOverlayIndexPath: string[];
|
|
977
|
-
static collectionGroupOverlayIndex: string;
|
|
978
|
-
static collectionGroupOverlayIndexPath: string[];
|
|
979
|
-
constructor(
|
|
980
|
-
/** The user ID to whom this overlay belongs. */
|
|
981
|
-
userId: string,
|
|
982
|
-
/** The path to the collection that contains the document. */
|
|
983
|
-
collectionPath: string,
|
|
984
|
-
/** The ID (key) of the document within the collection. */
|
|
985
|
-
documentId: string,
|
|
986
|
-
/** The collection group to which the document belongs. */
|
|
987
|
-
collectionGroup: string,
|
|
988
|
-
/** The largest batch ID that's been applied for this overlay. */
|
|
989
|
-
largestBatchId: number,
|
|
990
|
-
/** The overlay mutation. */
|
|
991
|
-
overlayMutation: ProtoWrite);
|
|
992
489
|
}
|
|
993
|
-
export declare const V1_STORES: string[];
|
|
994
|
-
export declare const V3_STORES: string[];
|
|
995
|
-
export declare const V4_STORES: string[];
|
|
996
|
-
export declare const V6_STORES: string[];
|
|
997
|
-
export declare const V8_STORES: string[];
|
|
998
|
-
export declare const V11_STORES: string[];
|
|
999
|
-
export declare const V12_STORES: string[];
|
|
1000
|
-
export declare const V13_STORES: string[];
|
|
1001
|
-
/**
|
|
1002
|
-
* The list of all default IndexedDB stores used throughout the SDK. This is
|
|
1003
|
-
* used when creating transactions so that access across all stores is done
|
|
1004
|
-
* atomically.
|
|
1005
|
-
*/
|
|
1006
|
-
export declare const ALL_STORES: string[];
|
|
1007
|
-
/** Returns the object stores for the provided schema. */
|
|
1008
|
-
export declare function getObjectStores(schemaVersion: number): string[];
|