@firebase/firestore 3.4.4 → 3.4.5-canary.09e62431f
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 +12 -0
- package/dist/firestore/src/api/credentials.d.ts +1 -0
- 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/index/index_byte_encoder.d.ts +18 -1
- package/dist/firestore/src/index/index_entry.d.ts +32 -0
- package/dist/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/firestore/src/local/document_overlay_cache.d.ts +71 -0
- package/dist/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +44 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +87 -2
- package/dist/firestore/src/local/indexeddb_persistence.d.ts +6 -4
- package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/firestore/src/local/indexeddb_schema.d.ts +106 -437
- 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_documents_view.d.ts +0 -1
- package/dist/firestore/src/local/local_serializer.d.ts +20 -3
- package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +36 -0
- package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/memory_persistence.d.ts +6 -2
- package/dist/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/firestore/src/local/persistence.d.ts +8 -2
- package/dist/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/firestore/src/local/simple_db.d.ts +12 -0
- package/dist/firestore/src/model/collections.d.ts +7 -0
- package/dist/firestore/src/model/document.d.ts +7 -0
- package/dist/firestore/src/model/document_key.d.ts +6 -0
- package/dist/firestore/src/model/field_index.d.ts +89 -7
- package/dist/firestore/src/model/overlay.d.ts +32 -0
- package/dist/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/firestore/src/model/type_order.d.ts +2 -1
- package/dist/firestore/src/model/values.d.ts +7 -0
- package/dist/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/firestore/src/platform/node/grpc_connection.d.ts +2 -2
- package/dist/firestore/src/platform/node/load_protos.d.ts +2 -2
- package/dist/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/firestore/src/util/sorted_set.d.ts +18 -0
- package/dist/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
- package/dist/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
- package/dist/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +5 -3
- package/dist/firestore/test/unit/local/test_remote_document_change_buffer.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/unit/model/target_index_matcher.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 +5421 -4355
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +5471 -4495
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +3056 -1181
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +3048 -1194
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +5469 -4445
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +272 -26
- package/dist/lite/firestore/src/api/credentials.d.ts +1 -0
- 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/index/index_byte_encoder.d.ts +18 -1
- package/dist/lite/firestore/src/index/index_entry.d.ts +32 -0
- package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +71 -0
- package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +44 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +87 -2
- package/dist/lite/firestore/src/local/indexeddb_persistence.d.ts +6 -4
- package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +106 -437
- 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_documents_view.d.ts +0 -1
- package/dist/lite/firestore/src/local/local_serializer.d.ts +20 -3
- package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +36 -0
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/memory_persistence.d.ts +6 -2
- package/dist/lite/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/lite/firestore/src/local/persistence.d.ts +8 -2
- package/dist/lite/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/lite/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/firestore/src/local/simple_db.d.ts +12 -0
- package/dist/lite/firestore/src/model/collections.d.ts +7 -0
- package/dist/lite/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/firestore/src/model/document_key.d.ts +6 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +89 -7
- package/dist/lite/firestore/src/model/overlay.d.ts +32 -0
- package/dist/lite/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/lite/firestore/src/model/type_order.d.ts +2 -1
- package/dist/lite/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/lite/firestore/src/platform/node/grpc_connection.d.ts +2 -2
- package/dist/lite/firestore/src/platform/node/load_protos.d.ts +2 -2
- package/dist/lite/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/lite/firestore/src/util/sorted_set.d.ts +18 -0
- package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/lite/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
- package/dist/lite/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
- package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +5 -3
- package/dist/lite/firestore/test/unit/local/test_remote_document_change_buffer.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/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/index.browser.esm2017.js +1198 -1165
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +366 -357
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +83 -41
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +83 -41
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +375 -342
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +16 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +122 -121
- package/dist/lite/packages/firestore/src/api/credentials.d.ts +1 -0
- 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/index/index_byte_encoder.d.ts +18 -1
- package/dist/lite/packages/firestore/src/index/index_entry.d.ts +32 -0
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +71 -0
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +44 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +87 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_persistence.d.ts +6 -4
- package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +106 -437
- 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_documents_view.d.ts +0 -1
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +20 -3
- package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +36 -0
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/memory_persistence.d.ts +6 -2
- package/dist/lite/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/lite/packages/firestore/src/local/persistence.d.ts +8 -2
- package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
- 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 +12 -0
- package/dist/lite/packages/firestore/src/model/collections.d.ts +7 -0
- package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/packages/firestore/src/model/document_key.d.ts +6 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +89 -7
- package/dist/lite/packages/firestore/src/model/overlay.d.ts +32 -0
- package/dist/lite/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/lite/packages/firestore/src/model/type_order.d.ts +2 -1
- package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/packages/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/lite/packages/firestore/src/platform/node/grpc_connection.d.ts +2 -2
- package/dist/lite/packages/firestore/src/platform/node/load_protos.d.ts +2 -2
- package/dist/lite/packages/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/lite/packages/firestore/src/util/sorted_set.d.ts +18 -0
- package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/lite/packages/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
- package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +5 -3
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_change_buffer.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/model/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/unit/model/target_index_matcher.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 +200 -195
- package/dist/packages/firestore/src/api/credentials.d.ts +1 -0
- 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/index/index_byte_encoder.d.ts +18 -1
- package/dist/packages/firestore/src/index/index_entry.d.ts +32 -0
- package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +71 -0
- package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +44 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +87 -2
- package/dist/packages/firestore/src/local/indexeddb_persistence.d.ts +6 -4
- package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +2 -8
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +106 -437
- 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_documents_view.d.ts +0 -1
- package/dist/packages/firestore/src/local/local_serializer.d.ts +20 -3
- package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +36 -0
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/memory_persistence.d.ts +6 -2
- package/dist/packages/firestore/src/local/memory_remote_document_cache.d.ts +1 -3
- package/dist/packages/firestore/src/local/persistence.d.ts +8 -2
- package/dist/packages/firestore/src/local/remote_document_cache.d.ts +7 -9
- package/dist/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/packages/firestore/src/local/simple_db.d.ts +12 -0
- package/dist/packages/firestore/src/model/collections.d.ts +7 -0
- package/dist/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/packages/firestore/src/model/document_key.d.ts +6 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +89 -7
- package/dist/packages/firestore/src/model/overlay.d.ts +32 -0
- package/dist/packages/firestore/src/model/target_index_matcher.d.ts +70 -0
- package/dist/packages/firestore/src/model/type_order.d.ts +2 -1
- package/dist/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/packages/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/packages/firestore/src/platform/node/grpc_connection.d.ts +2 -2
- package/dist/packages/firestore/src/platform/node/load_protos.d.ts +2 -2
- package/dist/packages/firestore/src/util/obj_map.d.ts +3 -0
- package/dist/packages/firestore/src/util/sorted_set.d.ts +18 -0
- package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +3 -3
- package/dist/packages/firestore/test/unit/local/document_overlay_cache.test.d.ts +1 -0
- package/dist/packages/firestore/test/unit/local/persistence_test_helpers.d.ts +1 -0
- package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +38 -0
- package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +11 -0
- package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +5 -3
- package/dist/packages/firestore/test/unit/local/test_remote_document_change_buffer.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/unit/model/target_index_matcher.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/private.d.ts +265 -26
- package/package.json +9 -9
|
@@ -14,11 +14,13 @@
|
|
|
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';
|
|
18
|
-
import {
|
|
17
|
+
import { BatchId, ListenSequenceNumber, TargetId } from '../core/types';
|
|
18
|
+
import { IndexKind } from '../model/field_index';
|
|
19
19
|
import { BundledQuery } from '../protos/firestore_bundle_proto';
|
|
20
20
|
import { Document as ProtoDocument, DocumentsTarget as ProtoDocumentsTarget, QueryTarget as ProtoQueryTarget, Write as ProtoWrite } from '../protos/firestore_proto_api';
|
|
21
21
|
import { EncodedResourcePath } from './encoded_resource_path';
|
|
22
|
+
import { DbTimestampKey } from './indexeddb_sentinels';
|
|
23
|
+
export declare const INDEXING_SCHEMA_VERSION = 13;
|
|
22
24
|
/**
|
|
23
25
|
* Schema Version for the Web client:
|
|
24
26
|
* 1. Initial version including Mutation Queue, Query Cache, and Remote
|
|
@@ -37,19 +39,17 @@ 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 document overlays.
|
|
43
|
+
* 13. Add indexing support.
|
|
40
44
|
*/
|
|
41
|
-
export declare const SCHEMA_VERSION
|
|
45
|
+
export declare const SCHEMA_VERSION: number;
|
|
42
46
|
/**
|
|
43
47
|
* Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.
|
|
44
48
|
*/
|
|
45
|
-
export
|
|
49
|
+
export interface DbTimestamp {
|
|
46
50
|
seconds: number;
|
|
47
51
|
nanoseconds: number;
|
|
48
|
-
constructor(seconds: number, nanoseconds: number);
|
|
49
52
|
}
|
|
50
|
-
/** A timestamp type that can be used in IndexedDb keys. */
|
|
51
|
-
export declare type DbTimestampKey = [/* seconds */ number, /* nanos */ number];
|
|
52
|
-
export declare type DbPrimaryClientKey = typeof DbPrimaryClient.key;
|
|
53
53
|
/**
|
|
54
54
|
* A singleton object to be stored in the 'owner' store in IndexedDb.
|
|
55
55
|
*
|
|
@@ -59,37 +59,19 @@ export declare type DbPrimaryClientKey = typeof DbPrimaryClient.key;
|
|
|
59
59
|
* write an updated timestamp to this lease to prevent other tabs from
|
|
60
60
|
* "stealing" the primary lease
|
|
61
61
|
*/
|
|
62
|
-
export
|
|
62
|
+
export interface DbPrimaryClient {
|
|
63
63
|
ownerId: string;
|
|
64
64
|
/** Whether to allow shared access from multiple tabs. */
|
|
65
65
|
allowTabSynchronization: boolean;
|
|
66
66
|
leaseTimestampMs: number;
|
|
67
|
-
/**
|
|
68
|
-
* Name of the IndexedDb object store.
|
|
69
|
-
*
|
|
70
|
-
* Note that the name 'owner' is chosen to ensure backwards compatibility with
|
|
71
|
-
* older clients that only supported single locked access to the persistence
|
|
72
|
-
* layer.
|
|
73
|
-
*/
|
|
74
|
-
static store: string;
|
|
75
|
-
/**
|
|
76
|
-
* The key string used for the single object that exists in the
|
|
77
|
-
* DbPrimaryClient store.
|
|
78
|
-
*/
|
|
79
|
-
static key: string;
|
|
80
|
-
constructor(ownerId: string,
|
|
81
|
-
/** Whether to allow shared access from multiple tabs. */
|
|
82
|
-
allowTabSynchronization: boolean, leaseTimestampMs: number);
|
|
83
67
|
}
|
|
84
|
-
/** Object keys in the 'mutationQueues' store are userId strings. */
|
|
85
|
-
export declare type DbMutationQueueKey = string;
|
|
86
68
|
/**
|
|
87
69
|
* An object to be stored in the 'mutationQueues' store in IndexedDb.
|
|
88
70
|
*
|
|
89
71
|
* Each user gets a single queue of MutationBatches to apply to the server.
|
|
90
72
|
* DbMutationQueue tracks the metadata about the queue.
|
|
91
73
|
*/
|
|
92
|
-
export
|
|
74
|
+
export interface DbMutationQueue {
|
|
93
75
|
/**
|
|
94
76
|
* The normalized user ID to which this queue belongs.
|
|
95
77
|
*/
|
|
@@ -115,39 +97,7 @@ export declare class DbMutationQueue {
|
|
|
115
97
|
* NOTE: this is deprecated and no longer used by the code.
|
|
116
98
|
*/
|
|
117
99
|
lastStreamToken: string;
|
|
118
|
-
/** Name of the IndexedDb object store. */
|
|
119
|
-
static store: string;
|
|
120
|
-
/** Keys are automatically assigned via the userId property. */
|
|
121
|
-
static keyPath: string;
|
|
122
|
-
constructor(
|
|
123
|
-
/**
|
|
124
|
-
* The normalized user ID to which this queue belongs.
|
|
125
|
-
*/
|
|
126
|
-
userId: string,
|
|
127
|
-
/**
|
|
128
|
-
* An identifier for the highest numbered batch that has been acknowledged
|
|
129
|
-
* by the server. All MutationBatches in this queue with batchIds less
|
|
130
|
-
* than or equal to this value are considered to have been acknowledged by
|
|
131
|
-
* the server.
|
|
132
|
-
*
|
|
133
|
-
* NOTE: this is deprecated and no longer used by the code.
|
|
134
|
-
*/
|
|
135
|
-
lastAcknowledgedBatchId: number,
|
|
136
|
-
/**
|
|
137
|
-
* A stream token that was previously sent by the server.
|
|
138
|
-
*
|
|
139
|
-
* See StreamingWriteRequest in datastore.proto for more details about
|
|
140
|
-
* usage.
|
|
141
|
-
*
|
|
142
|
-
* After sending this token, earlier tokens may not be used anymore so
|
|
143
|
-
* only a single stream token is retained.
|
|
144
|
-
*
|
|
145
|
-
* NOTE: this is deprecated and no longer used by the code.
|
|
146
|
-
*/
|
|
147
|
-
lastStreamToken: string);
|
|
148
100
|
}
|
|
149
|
-
/** The 'mutations' store is keyed by batch ID. */
|
|
150
|
-
export declare type DbMutationBatchKey = BatchId;
|
|
151
101
|
/**
|
|
152
102
|
* An object to be stored in the 'mutations' store in IndexedDb.
|
|
153
103
|
*
|
|
@@ -155,7 +105,7 @@ export declare type DbMutationBatchKey = BatchId;
|
|
|
155
105
|
* in a single write. Each user-level batch gets a separate DbMutationBatch
|
|
156
106
|
* with a new batchId.
|
|
157
107
|
*/
|
|
158
|
-
export
|
|
108
|
+
export interface DbMutationBatch {
|
|
159
109
|
/**
|
|
160
110
|
* The normalized user ID to which this batch belongs.
|
|
161
111
|
*/
|
|
@@ -181,61 +131,14 @@ export declare class DbMutationBatch {
|
|
|
181
131
|
*
|
|
182
132
|
* These mutations are never sent to the backend.
|
|
183
133
|
*/
|
|
184
|
-
baseMutations
|
|
134
|
+
baseMutations?: ProtoWrite[];
|
|
185
135
|
/**
|
|
186
136
|
* A list of mutations to apply. All mutations will be applied atomically.
|
|
187
137
|
*
|
|
188
138
|
* Mutations are serialized via toMutation().
|
|
189
139
|
*/
|
|
190
140
|
mutations: ProtoWrite[];
|
|
191
|
-
/** Name of the IndexedDb object store. */
|
|
192
|
-
static store: string;
|
|
193
|
-
/** Keys are automatically assigned via the userId, batchId properties. */
|
|
194
|
-
static keyPath: string;
|
|
195
|
-
/** The index name for lookup of mutations by user. */
|
|
196
|
-
static userMutationsIndex: string;
|
|
197
|
-
/** The user mutations index is keyed by [userId, batchId] pairs. */
|
|
198
|
-
static userMutationsKeyPath: string[];
|
|
199
|
-
constructor(
|
|
200
|
-
/**
|
|
201
|
-
* The normalized user ID to which this batch belongs.
|
|
202
|
-
*/
|
|
203
|
-
userId: string,
|
|
204
|
-
/**
|
|
205
|
-
* An identifier for this batch, allocated using an auto-generated key.
|
|
206
|
-
*/
|
|
207
|
-
batchId: BatchId,
|
|
208
|
-
/**
|
|
209
|
-
* The local write time of the batch, stored as milliseconds since the
|
|
210
|
-
* epoch.
|
|
211
|
-
*/
|
|
212
|
-
localWriteTimeMs: number,
|
|
213
|
-
/**
|
|
214
|
-
* A list of "mutations" that represent a partial base state from when this
|
|
215
|
-
* write batch was initially created. During local application of the write
|
|
216
|
-
* batch, these baseMutations are applied prior to the real writes in order
|
|
217
|
-
* to override certain document fields from the remote document cache. This
|
|
218
|
-
* is necessary in the case of non-idempotent writes (e.g. `increment()`
|
|
219
|
-
* transforms) to make sure that the local view of the modified documents
|
|
220
|
-
* doesn't flicker if the remote document cache receives the result of the
|
|
221
|
-
* non-idempotent write before the write is removed from the queue.
|
|
222
|
-
*
|
|
223
|
-
* These mutations are never sent to the backend.
|
|
224
|
-
*/
|
|
225
|
-
baseMutations: ProtoWrite[] | undefined,
|
|
226
|
-
/**
|
|
227
|
-
* A list of mutations to apply. All mutations will be applied atomically.
|
|
228
|
-
*
|
|
229
|
-
* Mutations are serialized via toMutation().
|
|
230
|
-
*/
|
|
231
|
-
mutations: ProtoWrite[]);
|
|
232
141
|
}
|
|
233
|
-
/**
|
|
234
|
-
* The key for a db document mutation, which is made up of a userID, path, and
|
|
235
|
-
* batchId. Note that the path must be serialized into a form that indexedDB can
|
|
236
|
-
* sort.
|
|
237
|
-
*/
|
|
238
|
-
export declare type DbDocumentMutationKey = [string, EncodedResourcePath, BatchId];
|
|
239
142
|
/**
|
|
240
143
|
* An object to be stored in the 'documentMutations' store in IndexedDb.
|
|
241
144
|
*
|
|
@@ -243,54 +146,23 @@ export declare type DbDocumentMutationKey = [string, EncodedResourcePath, BatchI
|
|
|
243
146
|
* document key. The rows in this table are references based on the contents of
|
|
244
147
|
* DbMutationBatch.mutations.
|
|
245
148
|
*/
|
|
246
|
-
export
|
|
247
|
-
static store: string;
|
|
248
|
-
/**
|
|
249
|
-
* Creates a [userId] key for use in the DbDocumentMutations index to iterate
|
|
250
|
-
* over all of a user's document mutations.
|
|
251
|
-
*/
|
|
252
|
-
static prefixForUser(userId: string): [string];
|
|
253
|
-
/**
|
|
254
|
-
* Creates a [userId, encodedPath] key for use in the DbDocumentMutations
|
|
255
|
-
* index to iterate over all at document mutations for a given path or lower.
|
|
256
|
-
*/
|
|
257
|
-
static prefixForPath(userId: string, path: ResourcePath): [string, EncodedResourcePath];
|
|
258
|
-
/**
|
|
259
|
-
* Creates a full index key of [userId, encodedPath, batchId] for inserting
|
|
260
|
-
* and deleting into the DbDocumentMutations index.
|
|
261
|
-
*/
|
|
262
|
-
static key(userId: string, path: ResourcePath, batchId: BatchId): DbDocumentMutationKey;
|
|
263
|
-
/**
|
|
264
|
-
* Because we store all the useful information for this store in the key,
|
|
265
|
-
* there is no useful information to store as the value. The raw (unencoded)
|
|
266
|
-
* path cannot be stored because IndexedDb doesn't store prototype
|
|
267
|
-
* information.
|
|
268
|
-
*/
|
|
269
|
-
static PLACEHOLDER: DbDocumentMutation;
|
|
270
|
-
private constructor();
|
|
149
|
+
export interface DbDocumentMutation {
|
|
271
150
|
}
|
|
272
|
-
/**
|
|
273
|
-
* A key in the 'remoteDocuments' object store is a string array containing the
|
|
274
|
-
* segments that make up the path.
|
|
275
|
-
*/
|
|
276
|
-
export declare type DbRemoteDocumentKey = string[];
|
|
277
151
|
/**
|
|
278
152
|
* Represents the known absence of a document at a particular version.
|
|
279
153
|
* Stored in IndexedDb as part of a DbRemoteDocument object.
|
|
280
154
|
*/
|
|
281
|
-
export
|
|
155
|
+
export interface DbNoDocument {
|
|
282
156
|
path: string[];
|
|
283
157
|
readTime: DbTimestamp;
|
|
284
|
-
constructor(path: string[], readTime: DbTimestamp);
|
|
285
158
|
}
|
|
286
159
|
/**
|
|
287
160
|
* Represents a document that is known to exist but whose data is unknown.
|
|
288
161
|
* Stored in IndexedDb as part of a DbRemoteDocument object.
|
|
289
162
|
*/
|
|
290
|
-
export
|
|
163
|
+
export interface DbUnknownDocument {
|
|
291
164
|
path: string[];
|
|
292
165
|
version: DbTimestamp;
|
|
293
|
-
constructor(path: string[], version: DbTimestamp);
|
|
294
166
|
}
|
|
295
167
|
/**
|
|
296
168
|
* An object to be stored in the 'remoteDocuments' store in IndexedDb.
|
|
@@ -305,111 +177,51 @@ export declare class DbUnknownDocument {
|
|
|
305
177
|
* Note: This is the persisted equivalent of a MaybeDocument and could perhaps
|
|
306
178
|
* be made more general if necessary.
|
|
307
179
|
*/
|
|
308
|
-
export
|
|
180
|
+
export interface DbRemoteDocument {
|
|
309
181
|
/**
|
|
310
182
|
* Set to an instance of DbUnknownDocument if the data for a document is
|
|
311
183
|
* not known, but it is known that a document exists at the specified
|
|
312
184
|
* version (e.g. it had a successful update applied to it)
|
|
313
185
|
*/
|
|
314
|
-
unknownDocument
|
|
186
|
+
unknownDocument?: DbUnknownDocument;
|
|
315
187
|
/**
|
|
316
188
|
* Set to an instance of a DbNoDocument if it is known that no document
|
|
317
189
|
* exists.
|
|
318
190
|
*/
|
|
319
|
-
noDocument
|
|
191
|
+
noDocument?: DbNoDocument;
|
|
320
192
|
/**
|
|
321
193
|
* Set to an instance of a Document if there's a cached version of the
|
|
322
194
|
* document.
|
|
323
195
|
*/
|
|
324
|
-
document
|
|
196
|
+
document?: ProtoDocument;
|
|
325
197
|
/**
|
|
326
198
|
* Documents that were written to the remote document store based on
|
|
327
199
|
* a write acknowledgment are marked with `hasCommittedMutations`. These
|
|
328
200
|
* documents are potentially inconsistent with the backend's copy and use
|
|
329
201
|
* the write's commit version as their document version.
|
|
330
202
|
*/
|
|
331
|
-
hasCommittedMutations
|
|
203
|
+
hasCommittedMutations?: boolean;
|
|
332
204
|
/**
|
|
333
205
|
* When the document was read from the backend. Undefined for data written
|
|
334
206
|
* prior to schema version 9.
|
|
335
207
|
*/
|
|
336
|
-
readTime
|
|
208
|
+
readTime?: DbTimestampKey;
|
|
337
209
|
/**
|
|
338
210
|
* The path of the collection this document is part of. Undefined for data
|
|
339
211
|
* written prior to schema version 9.
|
|
340
212
|
*/
|
|
341
|
-
parentPath
|
|
342
|
-
static store: string;
|
|
343
|
-
/**
|
|
344
|
-
* An index that provides access to all entries sorted by read time (which
|
|
345
|
-
* corresponds to the last modification time of each row).
|
|
346
|
-
*
|
|
347
|
-
* This index is used to provide a changelog for Multi-Tab.
|
|
348
|
-
*/
|
|
349
|
-
static readTimeIndex: string;
|
|
350
|
-
static readTimeIndexPath: string;
|
|
351
|
-
/**
|
|
352
|
-
* An index that provides access to documents in a collection sorted by read
|
|
353
|
-
* time.
|
|
354
|
-
*
|
|
355
|
-
* This index is used to allow the RemoteDocumentCache to fetch newly changed
|
|
356
|
-
* documents in a collection.
|
|
357
|
-
*/
|
|
358
|
-
static collectionReadTimeIndex: string;
|
|
359
|
-
static collectionReadTimeIndexPath: string[];
|
|
360
|
-
constructor(
|
|
361
|
-
/**
|
|
362
|
-
* Set to an instance of DbUnknownDocument if the data for a document is
|
|
363
|
-
* not known, but it is known that a document exists at the specified
|
|
364
|
-
* version (e.g. it had a successful update applied to it)
|
|
365
|
-
*/
|
|
366
|
-
unknownDocument: DbUnknownDocument | null | undefined,
|
|
367
|
-
/**
|
|
368
|
-
* Set to an instance of a DbNoDocument if it is known that no document
|
|
369
|
-
* exists.
|
|
370
|
-
*/
|
|
371
|
-
noDocument: DbNoDocument | null,
|
|
372
|
-
/**
|
|
373
|
-
* Set to an instance of a Document if there's a cached version of the
|
|
374
|
-
* document.
|
|
375
|
-
*/
|
|
376
|
-
document: ProtoDocument | null,
|
|
377
|
-
/**
|
|
378
|
-
* Documents that were written to the remote document store based on
|
|
379
|
-
* a write acknowledgment are marked with `hasCommittedMutations`. These
|
|
380
|
-
* documents are potentially inconsistent with the backend's copy and use
|
|
381
|
-
* the write's commit version as their document version.
|
|
382
|
-
*/
|
|
383
|
-
hasCommittedMutations: boolean | undefined,
|
|
384
|
-
/**
|
|
385
|
-
* When the document was read from the backend. Undefined for data written
|
|
386
|
-
* prior to schema version 9.
|
|
387
|
-
*/
|
|
388
|
-
readTime: DbTimestampKey | undefined,
|
|
389
|
-
/**
|
|
390
|
-
* The path of the collection this document is part of. Undefined for data
|
|
391
|
-
* written prior to schema version 9.
|
|
392
|
-
*/
|
|
393
|
-
parentPath: string[] | undefined);
|
|
213
|
+
parentPath?: string[];
|
|
394
214
|
}
|
|
395
215
|
/**
|
|
396
216
|
* Contains a single entry that has metadata about the remote document cache.
|
|
397
217
|
*/
|
|
398
|
-
export
|
|
399
|
-
byteSize: number;
|
|
400
|
-
static store: string;
|
|
401
|
-
static key: string;
|
|
218
|
+
export interface DbRemoteDocumentGlobal {
|
|
402
219
|
/**
|
|
403
|
-
*
|
|
220
|
+
* Approximately the total size in bytes of all the
|
|
404
221
|
* documents in the document cache.
|
|
405
222
|
*/
|
|
406
|
-
|
|
223
|
+
byteSize: number;
|
|
407
224
|
}
|
|
408
|
-
export declare type DbRemoteDocumentGlobalKey = typeof DbRemoteDocumentGlobal.key;
|
|
409
|
-
/**
|
|
410
|
-
* A key in the 'targets' object store is a targetId of the query.
|
|
411
|
-
*/
|
|
412
|
-
export declare type DbTargetKey = TargetId;
|
|
413
225
|
/**
|
|
414
226
|
* The persisted type for a query nested with in the 'targets' store in
|
|
415
227
|
* IndexedDb. We use the proto definitions for these two kinds of queries in
|
|
@@ -425,7 +237,7 @@ export declare type DbQuery = ProtoQueryTarget | ProtoDocumentsTarget;
|
|
|
425
237
|
* Each query the client listens to against the server is tracked on disk so
|
|
426
238
|
* that the query can be efficiently resumed on restart.
|
|
427
239
|
*/
|
|
428
|
-
export
|
|
240
|
+
export interface DbTarget {
|
|
429
241
|
/**
|
|
430
242
|
* An auto-generated sequential numeric identifier for the query.
|
|
431
243
|
*
|
|
@@ -483,7 +295,7 @@ export declare class DbTarget {
|
|
|
483
295
|
* contained no limbo documents. Undefined for data written prior to
|
|
484
296
|
* schema version 9.
|
|
485
297
|
*/
|
|
486
|
-
lastLimboFreeSnapshotVersion
|
|
298
|
+
lastLimboFreeSnapshotVersion?: DbTimestamp;
|
|
487
299
|
/**
|
|
488
300
|
* The query for this target.
|
|
489
301
|
*
|
|
@@ -492,90 +304,7 @@ export declare class DbTarget {
|
|
|
492
304
|
* duplicate translation logic to and from a `Query` object.
|
|
493
305
|
*/
|
|
494
306
|
query: DbQuery;
|
|
495
|
-
static store: string;
|
|
496
|
-
/** Keys are automatically assigned via the targetId property. */
|
|
497
|
-
static keyPath: string;
|
|
498
|
-
/** The name of the queryTargets index. */
|
|
499
|
-
static queryTargetsIndexName: string;
|
|
500
|
-
/**
|
|
501
|
-
* The index of all canonicalIds to the targets that they match. This is not
|
|
502
|
-
* a unique mapping because canonicalId does not promise a unique name for all
|
|
503
|
-
* possible queries, so we append the targetId to make the mapping unique.
|
|
504
|
-
*/
|
|
505
|
-
static queryTargetsKeyPath: string[];
|
|
506
|
-
constructor(
|
|
507
|
-
/**
|
|
508
|
-
* An auto-generated sequential numeric identifier for the query.
|
|
509
|
-
*
|
|
510
|
-
* Queries are stored using their canonicalId as the key, but these
|
|
511
|
-
* canonicalIds can be quite long so we additionally assign a unique
|
|
512
|
-
* queryId which can be used by referenced data structures (e.g.
|
|
513
|
-
* indexes) to minimize the on-disk cost.
|
|
514
|
-
*/
|
|
515
|
-
targetId: TargetId,
|
|
516
|
-
/**
|
|
517
|
-
* The canonical string representing this query. This is not unique.
|
|
518
|
-
*/
|
|
519
|
-
canonicalId: string,
|
|
520
|
-
/**
|
|
521
|
-
* The last readTime received from the Watch Service for this query.
|
|
522
|
-
*
|
|
523
|
-
* This is the same value as TargetChange.read_time in the protos.
|
|
524
|
-
*/
|
|
525
|
-
readTime: DbTimestamp,
|
|
526
|
-
/**
|
|
527
|
-
* An opaque, server-assigned token that allows watching a query to be
|
|
528
|
-
* resumed after disconnecting without retransmitting all the data
|
|
529
|
-
* that matches the query. The resume token essentially identifies a
|
|
530
|
-
* point in time from which the server should resume sending results.
|
|
531
|
-
*
|
|
532
|
-
* This is related to the snapshotVersion in that the resumeToken
|
|
533
|
-
* effectively also encodes that value, but the resumeToken is opaque
|
|
534
|
-
* and sometimes encodes additional information.
|
|
535
|
-
*
|
|
536
|
-
* A consequence of this is that the resumeToken should be used when
|
|
537
|
-
* asking the server to reason about where this client is in the watch
|
|
538
|
-
* stream, but the client should use the snapshotVersion for its own
|
|
539
|
-
* purposes.
|
|
540
|
-
*
|
|
541
|
-
* This is the same value as TargetChange.resume_token in the protos.
|
|
542
|
-
*/
|
|
543
|
-
resumeToken: string,
|
|
544
|
-
/**
|
|
545
|
-
* A sequence number representing the last time this query was
|
|
546
|
-
* listened to, used for garbage collection purposes.
|
|
547
|
-
*
|
|
548
|
-
* Conventionally this would be a timestamp value, but device-local
|
|
549
|
-
* clocks are unreliable and they must be able to create new listens
|
|
550
|
-
* even while disconnected. Instead this should be a monotonically
|
|
551
|
-
* increasing number that's incremented on each listen call.
|
|
552
|
-
*
|
|
553
|
-
* This is different from the queryId since the queryId is an
|
|
554
|
-
* immutable identifier assigned to the Query on first use while
|
|
555
|
-
* lastListenSequenceNumber is updated every time the query is
|
|
556
|
-
* listened to.
|
|
557
|
-
*/
|
|
558
|
-
lastListenSequenceNumber: number,
|
|
559
|
-
/**
|
|
560
|
-
* Denotes the maximum snapshot version at which the associated query view
|
|
561
|
-
* contained no limbo documents. Undefined for data written prior to
|
|
562
|
-
* schema version 9.
|
|
563
|
-
*/
|
|
564
|
-
lastLimboFreeSnapshotVersion: DbTimestamp | undefined,
|
|
565
|
-
/**
|
|
566
|
-
* The query for this target.
|
|
567
|
-
*
|
|
568
|
-
* Because canonical ids are not unique we must store the actual query. We
|
|
569
|
-
* use the proto to have an object we can persist without having to
|
|
570
|
-
* duplicate translation logic to and from a `Query` object.
|
|
571
|
-
*/
|
|
572
|
-
query: DbQuery);
|
|
573
307
|
}
|
|
574
|
-
/**
|
|
575
|
-
* The key for a DbTargetDocument, containing a targetId and an encoded resource
|
|
576
|
-
* path.
|
|
577
|
-
*/
|
|
578
|
-
export declare type DbTargetDocumentKey = [TargetId, EncodedResourcePath];
|
|
579
308
|
/**
|
|
580
309
|
* An object representing an association between a target and a document, or a
|
|
581
310
|
* sentinel row marking the last sequence number at which a document was used.
|
|
@@ -586,7 +315,7 @@ export declare type DbTargetDocumentKey = [TargetId, EncodedResourcePath];
|
|
|
586
315
|
* documents and their sequence numbers can be identified efficiently via a scan
|
|
587
316
|
* of this store.
|
|
588
317
|
*/
|
|
589
|
-
export
|
|
318
|
+
export interface DbTargetDocument {
|
|
590
319
|
/**
|
|
591
320
|
* The targetId identifying a target or 0 for a sentinel row.
|
|
592
321
|
*/
|
|
@@ -600,42 +329,15 @@ export declare class DbTargetDocument {
|
|
|
600
329
|
* time the document specified by `path` was used. Otherwise, it should be
|
|
601
330
|
* `undefined`.
|
|
602
331
|
*/
|
|
603
|
-
sequenceNumber?:
|
|
604
|
-
/** Name of the IndexedDb object store. */
|
|
605
|
-
static store: string;
|
|
606
|
-
/** Keys are automatically assigned via the targetId, path properties. */
|
|
607
|
-
static keyPath: string[];
|
|
608
|
-
/** The index name for the reverse index. */
|
|
609
|
-
static documentTargetsIndex: string;
|
|
610
|
-
/** We also need to create the reverse index for these properties. */
|
|
611
|
-
static documentTargetsKeyPath: string[];
|
|
612
|
-
constructor(
|
|
613
|
-
/**
|
|
614
|
-
* The targetId identifying a target or 0 for a sentinel row.
|
|
615
|
-
*/
|
|
616
|
-
targetId: TargetId,
|
|
617
|
-
/**
|
|
618
|
-
* The path to the document, as encoded in the key.
|
|
619
|
-
*/
|
|
620
|
-
path: EncodedResourcePath,
|
|
621
|
-
/**
|
|
622
|
-
* If this is a sentinel row, this should be the sequence number of the last
|
|
623
|
-
* time the document specified by `path` was used. Otherwise, it should be
|
|
624
|
-
* `undefined`.
|
|
625
|
-
*/
|
|
626
|
-
sequenceNumber?: number | undefined);
|
|
332
|
+
sequenceNumber?: ListenSequenceNumber;
|
|
627
333
|
}
|
|
628
|
-
/**
|
|
629
|
-
* The type to represent the single allowed key for the DbTargetGlobal store.
|
|
630
|
-
*/
|
|
631
|
-
export declare type DbTargetGlobalKey = typeof DbTargetGlobal.key;
|
|
632
334
|
/**
|
|
633
335
|
* A record of global state tracked across all Targets, tracked separately
|
|
634
336
|
* to avoid the need for extra indexes.
|
|
635
337
|
*
|
|
636
338
|
* This should be kept in-sync with the proto used in the iOS client.
|
|
637
339
|
*/
|
|
638
|
-
export
|
|
340
|
+
export interface DbTargetGlobal {
|
|
639
341
|
/**
|
|
640
342
|
* The highest numbered target id across all targets.
|
|
641
343
|
*
|
|
@@ -661,52 +363,14 @@ export declare class DbTargetGlobal {
|
|
|
661
363
|
* The number of targets persisted.
|
|
662
364
|
*/
|
|
663
365
|
targetCount: number;
|
|
664
|
-
/**
|
|
665
|
-
* The key string used for the single object that exists in the
|
|
666
|
-
* DbTargetGlobal store.
|
|
667
|
-
*/
|
|
668
|
-
static key: string;
|
|
669
|
-
static store: string;
|
|
670
|
-
constructor(
|
|
671
|
-
/**
|
|
672
|
-
* The highest numbered target id across all targets.
|
|
673
|
-
*
|
|
674
|
-
* See DbTarget.targetId.
|
|
675
|
-
*/
|
|
676
|
-
highestTargetId: TargetId,
|
|
677
|
-
/**
|
|
678
|
-
* The highest numbered lastListenSequenceNumber across all targets.
|
|
679
|
-
*
|
|
680
|
-
* See DbTarget.lastListenSequenceNumber.
|
|
681
|
-
*/
|
|
682
|
-
highestListenSequenceNumber: number,
|
|
683
|
-
/**
|
|
684
|
-
* A global snapshot version representing the last consistent snapshot we
|
|
685
|
-
* received from the backend. This is monotonically increasing and any
|
|
686
|
-
* snapshots received from the backend prior to this version (e.g. for
|
|
687
|
-
* targets resumed with a resumeToken) should be suppressed (buffered)
|
|
688
|
-
* until the backend has caught up to this snapshot version again. This
|
|
689
|
-
* prevents our cache from ever going backwards in time.
|
|
690
|
-
*/
|
|
691
|
-
lastRemoteSnapshotVersion: DbTimestamp,
|
|
692
|
-
/**
|
|
693
|
-
* The number of targets persisted.
|
|
694
|
-
*/
|
|
695
|
-
targetCount: number);
|
|
696
366
|
}
|
|
697
|
-
/**
|
|
698
|
-
* The key for a DbCollectionParent entry, containing the collection ID
|
|
699
|
-
* and the parent path that contains it. Note that the parent path will be an
|
|
700
|
-
* empty path in the case of root-level collections.
|
|
701
|
-
*/
|
|
702
|
-
export declare type DbCollectionParentKey = [string, EncodedResourcePath];
|
|
703
367
|
/**
|
|
704
368
|
* An object representing an association between a Collection id (e.g. 'messages')
|
|
705
369
|
* to a parent path (e.g. '/chats/123') that contains it as a (sub)collection.
|
|
706
370
|
* This is used to efficiently find all collections to query when performing
|
|
707
371
|
* a Collection Group query.
|
|
708
372
|
*/
|
|
709
|
-
export
|
|
373
|
+
export interface DbCollectionParent {
|
|
710
374
|
/**
|
|
711
375
|
* The collectionId (e.g. 'messages')
|
|
712
376
|
*/
|
|
@@ -716,20 +380,6 @@ export declare class DbCollectionParent {
|
|
|
716
380
|
* a root-level collection).
|
|
717
381
|
*/
|
|
718
382
|
parent: EncodedResourcePath;
|
|
719
|
-
/** Name of the IndexedDb object store. */
|
|
720
|
-
static store: string;
|
|
721
|
-
/** Keys are automatically assigned via the collectionId, parent properties. */
|
|
722
|
-
static keyPath: string[];
|
|
723
|
-
constructor(
|
|
724
|
-
/**
|
|
725
|
-
* The collectionId (e.g. 'messages')
|
|
726
|
-
*/
|
|
727
|
-
collectionId: string,
|
|
728
|
-
/**
|
|
729
|
-
* The path to the parent (either a document location or an empty path for
|
|
730
|
-
* a root-level collection).
|
|
731
|
-
*/
|
|
732
|
-
parent: EncodedResourcePath);
|
|
733
383
|
}
|
|
734
384
|
/**
|
|
735
385
|
* A record of the metadata state of each client.
|
|
@@ -737,7 +387,7 @@ export declare class DbCollectionParent {
|
|
|
737
387
|
* PORTING NOTE: This is used to synchronize multi-tab state and does not need
|
|
738
388
|
* to be ported to iOS or Android.
|
|
739
389
|
*/
|
|
740
|
-
export
|
|
390
|
+
export interface DbClientMetadata {
|
|
741
391
|
/** The auto-generated client id assigned at client startup. */
|
|
742
392
|
clientId: string;
|
|
743
393
|
/** The last time this state was updated. */
|
|
@@ -746,75 +396,94 @@ export declare class DbClientMetadata {
|
|
|
746
396
|
networkEnabled: boolean;
|
|
747
397
|
/** Whether this client is running in a foreground tab. */
|
|
748
398
|
inForeground: boolean;
|
|
749
|
-
/** Name of the IndexedDb object store. */
|
|
750
|
-
static store: string;
|
|
751
|
-
/** Keys are automatically assigned via the clientId properties. */
|
|
752
|
-
static keyPath: string;
|
|
753
|
-
constructor(
|
|
754
|
-
/** The auto-generated client id assigned at client startup. */
|
|
755
|
-
clientId: string,
|
|
756
|
-
/** The last time this state was updated. */
|
|
757
|
-
updateTimeMs: number,
|
|
758
|
-
/** Whether the client's network connection is enabled. */
|
|
759
|
-
networkEnabled: boolean,
|
|
760
|
-
/** Whether this client is running in a foreground tab. */
|
|
761
|
-
inForeground: boolean);
|
|
762
399
|
}
|
|
763
|
-
/**
|
|
764
|
-
export
|
|
765
|
-
export declare type DbBundlesKey = string;
|
|
766
|
-
/**
|
|
767
|
-
* A object representing a bundle loaded by the SDK.
|
|
768
|
-
*/
|
|
769
|
-
export declare class DbBundle {
|
|
400
|
+
/** An object representing a bundle loaded by the SDK. */
|
|
401
|
+
export interface DbBundle {
|
|
770
402
|
/** The ID of the loaded bundle. */
|
|
771
403
|
bundleId: string;
|
|
772
404
|
/** The create time of the loaded bundle. */
|
|
773
405
|
createTime: DbTimestamp;
|
|
774
406
|
/** The schema version of the loaded bundle. */
|
|
775
407
|
version: number;
|
|
776
|
-
/** Name of the IndexedDb object store. */
|
|
777
|
-
static store: string;
|
|
778
|
-
static keyPath: string;
|
|
779
|
-
constructor(
|
|
780
|
-
/** The ID of the loaded bundle. */
|
|
781
|
-
bundleId: string,
|
|
782
|
-
/** The create time of the loaded bundle. */
|
|
783
|
-
createTime: DbTimestamp,
|
|
784
|
-
/** The schema version of the loaded bundle. */
|
|
785
|
-
version: number);
|
|
786
408
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
* A object representing a named query loaded by the SDK via a bundle.
|
|
790
|
-
*/
|
|
791
|
-
export declare class DbNamedQuery {
|
|
409
|
+
/** An object representing a named query loaded by the SDK via a bundle. */
|
|
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
|
-
|
|
810
|
-
export
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
418
|
+
/** An object representing the global configuration for a field index. */
|
|
419
|
+
export interface DbIndexConfiguration {
|
|
420
|
+
/**
|
|
421
|
+
* The index id for this entry. Undefined for indexes that are not yet
|
|
422
|
+
* persisted.
|
|
423
|
+
*/
|
|
424
|
+
indexId?: number;
|
|
425
|
+
/** The collection group this index belongs to. */
|
|
426
|
+
collectionGroup: string;
|
|
427
|
+
/** The fields to index for this index. */
|
|
428
|
+
fields: Array<[name: string, kind: IndexKind]>;
|
|
429
|
+
}
|
|
815
430
|
/**
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
* atomically.
|
|
431
|
+
* An object describing how up-to-date the index backfill is for each user and
|
|
432
|
+
* index.
|
|
819
433
|
*/
|
|
820
|
-
export
|
|
434
|
+
export interface DbIndexState {
|
|
435
|
+
/** The index id for this entry. */
|
|
436
|
+
indexId: number;
|
|
437
|
+
/** The user id for this entry. */
|
|
438
|
+
uid: string;
|
|
439
|
+
/**
|
|
440
|
+
* A number that indicates when the index was last updated (relative to
|
|
441
|
+
* other indexes).
|
|
442
|
+
*/
|
|
443
|
+
sequenceNumber: number;
|
|
444
|
+
/**
|
|
445
|
+
* The latest read time that has been indexed by Firestore for this field
|
|
446
|
+
* index. Set to `{seconds: 0, nanos: 0}` if no documents have been indexed.
|
|
447
|
+
*/
|
|
448
|
+
readTime: DbTimestamp;
|
|
449
|
+
/**
|
|
450
|
+
* The last document that has been indexed for this field index. Empty if
|
|
451
|
+
* no documents have been indexed.
|
|
452
|
+
*/
|
|
453
|
+
documentKey: EncodedResourcePath;
|
|
454
|
+
/**
|
|
455
|
+
* The largest mutation batch id that has been processed for this index. -1
|
|
456
|
+
* if no mutations have been indexed.
|
|
457
|
+
*/
|
|
458
|
+
largestBatchId: number;
|
|
459
|
+
}
|
|
460
|
+
/** An object that stores the encoded entries for all documents and fields. */
|
|
461
|
+
export interface DbIndexEntry {
|
|
462
|
+
/** The index id for this entry. */
|
|
463
|
+
indexId: number;
|
|
464
|
+
/** The user id for this entry. */
|
|
465
|
+
uid: string;
|
|
466
|
+
/** The encoded array index value for this entry. */
|
|
467
|
+
arrayValue: Uint8Array;
|
|
468
|
+
/** The encoded directional value for equality and inequality filters. */
|
|
469
|
+
directionalValue: Uint8Array;
|
|
470
|
+
/** The document key this entry points to. */
|
|
471
|
+
documentKey: EncodedResourcePath;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* An object representing a document overlay.
|
|
475
|
+
*/
|
|
476
|
+
export interface DbDocumentOverlay {
|
|
477
|
+
/** The user ID to whom this overlay belongs. */
|
|
478
|
+
userId: string;
|
|
479
|
+
/** The path to the collection that contains the document. */
|
|
480
|
+
collectionPath: string;
|
|
481
|
+
/** The ID (key) of the document within the collection. */
|
|
482
|
+
documentId: string;
|
|
483
|
+
/** The collection group to which the document belongs. */
|
|
484
|
+
collectionGroup: string;
|
|
485
|
+
/** The largest batch ID that's been applied for this overlay. */
|
|
486
|
+
largestBatchId: number;
|
|
487
|
+
/** The overlay mutation. */
|
|
488
|
+
overlayMutation: ProtoWrite;
|
|
489
|
+
}
|