@firebase/firestore 3.4.7-canary.e9e5f6b3c → 3.4.8-canary.38da5d9be

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/firestore/src/core/target.d.ts +2 -0
  3. package/dist/firestore/src/local/index_manager.d.ts +19 -3
  4. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +3 -2
  5. package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
  6. package/dist/firestore/src/local/memory_index_manager.d.ts +2 -2
  7. package/dist/firestore/src/local/simple_db.d.ts +2 -0
  8. package/dist/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  9. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
  10. package/dist/index.esm2017.js +2998 -2965
  11. package/dist/index.esm2017.js.map +1 -1
  12. package/dist/index.esm5.js +3303 -3272
  13. package/dist/index.esm5.js.map +1 -1
  14. package/dist/index.node.cjs.js +1575 -1508
  15. package/dist/index.node.cjs.js.map +1 -1
  16. package/dist/index.node.mjs +1575 -1508
  17. package/dist/index.node.mjs.map +1 -1
  18. package/dist/index.rn.js +3065 -3032
  19. package/dist/index.rn.js.map +1 -1
  20. package/dist/internal.d.ts +20 -3
  21. package/dist/lite/firestore/src/core/target.d.ts +2 -0
  22. package/dist/lite/firestore/src/local/index_manager.d.ts +19 -3
  23. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +3 -2
  24. package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
  25. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +2 -2
  26. package/dist/lite/firestore/src/local/simple_db.d.ts +2 -0
  27. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  28. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
  29. package/dist/lite/index.browser.esm2017.js +2 -2
  30. package/dist/lite/index.browser.esm2017.js.map +1 -1
  31. package/dist/lite/index.browser.esm5.js +2 -2
  32. package/dist/lite/index.browser.esm5.js.map +1 -1
  33. package/dist/lite/index.node.cjs.js +2 -2
  34. package/dist/lite/index.node.cjs.js.map +1 -1
  35. package/dist/lite/index.node.mjs +2 -2
  36. package/dist/lite/index.node.mjs.map +1 -1
  37. package/dist/lite/index.rn.esm2017.js +1112 -1112
  38. package/dist/lite/index.rn.esm2017.js.map +1 -1
  39. package/dist/lite/packages/firestore/src/core/target.d.ts +2 -0
  40. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +19 -3
  41. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +3 -2
  42. package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
  43. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +2 -2
  44. package/dist/lite/packages/firestore/src/local/simple_db.d.ts +2 -0
  45. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  46. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
  47. package/dist/packages/firestore/dist/index.esm2017.d.ts +53 -53
  48. package/dist/packages/firestore/src/core/target.d.ts +2 -0
  49. package/dist/packages/firestore/src/local/index_manager.d.ts +19 -3
  50. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +3 -2
  51. package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +9 -0
  52. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +2 -2
  53. package/dist/packages/firestore/src/local/simple_db.d.ts +2 -0
  54. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  55. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +0 -4
  56. package/dist/private.d.ts +20 -3
  57. package/package.json +9 -9
@@ -2517,10 +2517,10 @@ declare interface IndexManager {
2517
2517
  /** Returns all configured field indexes. */
2518
2518
  getFieldIndexes(transaction: PersistenceTransaction): PersistencePromise<FieldIndex[]>;
2519
2519
  /**
2520
- * Returns an index that can be used to serve the provided target. Returns
2521
- * `null` if no index is configured.
2520
+ * Returns the type of index (if any) that can be used to serve the given
2521
+ * target.
2522
2522
  */
2523
- getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
2523
+ getIndexType(transaction: PersistenceTransaction, target: Target): PersistencePromise<IndexType>;
2524
2524
  /**
2525
2525
  * Returns the documents that match the given target based on the provided
2526
2526
  * index or `null` if the target does not have a matching index.
@@ -2614,6 +2614,23 @@ declare class IndexState_2 {
2614
2614
  static empty(): IndexState_2;
2615
2615
  }
2616
2616
 
2617
+ /** Represents the index state as it relates to a particular target. */
2618
+ declare const enum IndexType {
2619
+ /** Indicates that no index could be found for serving the target. */
2620
+ NONE = 0,
2621
+ /**
2622
+ * Indicates that only a "partial index" could be found for serving the
2623
+ * target. A partial index is one which does not have a segment for every
2624
+ * filter/orderBy in the target.
2625
+ */
2626
+ PARTIAL = 1,
2627
+ /**
2628
+ * Indicates that a "full index" could be found for serving the target. A full
2629
+ * index is one which has a segment for every filter/orderBy in the target.
2630
+ */
2631
+ FULL = 2
2632
+ }
2633
+
2617
2634
  /**
2618
2635
  * Initializes a new instance of {@link Firestore} with the provided settings.
2619
2636
  * Can only be called before any other function, including
@@ -82,6 +82,8 @@ export declare function targetGetLowerBound(target: Target, fieldIndex: FieldInd
82
82
  * upper bound exists.
83
83
  */
84
84
  export declare function targetGetUpperBound(target: Target, fieldIndex: FieldIndex): Bound | null;
85
+ /** Returns the number of segments of a perfect index for this target. */
86
+ export declare function targetGetSegmentCount(target: Target): number;
85
87
  export declare abstract class Filter {
86
88
  abstract matches(doc: Document): boolean;
87
89
  }
@@ -21,6 +21,22 @@ import { FieldIndex, IndexOffset } from '../model/field_index';
21
21
  import { ResourcePath } from '../model/path';
22
22
  import { PersistencePromise } from './persistence_promise';
23
23
  import { PersistenceTransaction } from './persistence_transaction';
24
+ /** Represents the index state as it relates to a particular target. */
25
+ export declare const enum IndexType {
26
+ /** Indicates that no index could be found for serving the target. */
27
+ NONE = 0,
28
+ /**
29
+ * Indicates that only a "partial index" could be found for serving the
30
+ * target. A partial index is one which does not have a segment for every
31
+ * filter/orderBy in the target.
32
+ */
33
+ PARTIAL = 1,
34
+ /**
35
+ * Indicates that a "full index" could be found for serving the target. A full
36
+ * index is one which has a segment for every filter/orderBy in the target.
37
+ */
38
+ FULL = 2
39
+ }
24
40
  /**
25
41
  * Represents a set of indexes that are used to execute queries efficiently.
26
42
  *
@@ -68,10 +84,10 @@ export interface IndexManager {
68
84
  /** Returns all configured field indexes. */
69
85
  getFieldIndexes(transaction: PersistenceTransaction): PersistencePromise<FieldIndex[]>;
70
86
  /**
71
- * Returns an index that can be used to serve the provided target. Returns
72
- * `null` if no index is configured.
87
+ * Returns the type of index (if any) that can be used to serve the given
88
+ * target.
73
89
  */
74
- getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
90
+ getIndexType(transaction: PersistenceTransaction, target: Target): PersistencePromise<IndexType>;
75
91
  /**
76
92
  * Returns the documents that match the given target based on the provided
77
93
  * index or `null` if the target does not have a matching index.
@@ -21,7 +21,7 @@ import { DocumentMap } from '../model/collections';
21
21
  import { DocumentKey } from '../model/document_key';
22
22
  import { FieldIndex, IndexOffset } from '../model/field_index';
23
23
  import { ResourcePath } from '../model/path';
24
- import { IndexManager } from './index_manager';
24
+ import { IndexManager, IndexType } from './index_manager';
25
25
  import { PersistencePromise } from './persistence_promise';
26
26
  import { PersistenceTransaction } from './persistence_transaction';
27
27
  /**
@@ -75,7 +75,8 @@ export declare class IndexedDbIndexManager implements IndexManager {
75
75
  * and user.
76
76
  */
77
77
  private generateEmptyBound;
78
- getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
78
+ private getFieldIndex;
79
+ getIndexType(transaction: PersistenceTransaction, target: Target): PersistencePromise<IndexType>;
79
80
  /**
80
81
  * Returns the byte encoded form of the directional values in the field index.
81
82
  * Returns `null` if the document does not have all fields specified in the
@@ -15,6 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { MutableDocument } from '../model/document';
18
+ import { DocumentKey } from '../model/document_key';
18
19
  import { LocalSerializer } from './local_serializer';
19
20
  import { RemoteDocumentCache } from './remote_document_cache';
20
21
  export interface DocumentSizeEntry {
@@ -25,3 +26,11 @@ export interface IndexedDbRemoteDocumentCache extends RemoteDocumentCache {
25
26
  }
26
27
  /** Creates a new IndexedDbRemoteDocumentCache. */
27
28
  export declare function newIndexedDbRemoteDocumentCache(serializer: LocalSerializer): IndexedDbRemoteDocumentCache;
29
+ /**
30
+ * Comparator that compares document keys according to the primary key sorting
31
+ * used by the `DbRemoteDocumentDocument` store (by prefix path, collection id
32
+ * and then document ID).
33
+ *
34
+ * Visible for testing.
35
+ */
36
+ export declare function dbKeyComparator(l: DocumentKey, r: DocumentKey): number;
@@ -19,7 +19,7 @@ import { DocumentMap } from '../model/collections';
19
19
  import { DocumentKey } from '../model/document_key';
20
20
  import { FieldIndex, IndexOffset } from '../model/field_index';
21
21
  import { ResourcePath } from '../model/path';
22
- import { IndexManager } from './index_manager';
22
+ import { IndexManager, IndexType } from './index_manager';
23
23
  import { PersistencePromise } from './persistence_promise';
24
24
  import { PersistenceTransaction } from './persistence_transaction';
25
25
  /**
@@ -32,7 +32,7 @@ export declare class MemoryIndexManager implements IndexManager {
32
32
  addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
33
33
  deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
34
34
  getDocumentsMatchingTarget(transaction: PersistenceTransaction, target: Target): PersistencePromise<DocumentKey[] | null>;
35
- getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
35
+ getIndexType(transaction: PersistenceTransaction, target: Target): PersistencePromise<IndexType>;
36
36
  getFieldIndexes(transaction: PersistenceTransaction, collectionGroup?: string): PersistencePromise<FieldIndex[]>;
37
37
  getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
38
38
  updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
@@ -186,6 +186,8 @@ export declare class SimpleDbStore<KeyType extends IDBValidKey, ValueType extend
186
186
  loadAll(): PersistencePromise<ValueType[]>;
187
187
  /** Loads all elements for the index range from the object store. */
188
188
  loadAll(range: IDBKeyRange): PersistencePromise<ValueType[]>;
189
+ /** Loads all elements ordered by the given index. */
190
+ loadAll(index: string): PersistencePromise<ValueType[]>;
189
191
  /**
190
192
  * Loads all elements from the object store that fall into the provided in the
191
193
  * index range for the given index.
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { Target } from '../../../src/core/target';
18
- import { IndexManager } from '../../../src/local/index_manager';
18
+ import { IndexManager, IndexType } from '../../../src/local/index_manager';
19
19
  import { Persistence } from '../../../src/local/persistence';
20
20
  import { DocumentMap } from '../../../src/model/collections';
21
21
  import { DocumentKey } from '../../../src/model/document_key';
@@ -34,7 +34,7 @@ export declare class TestIndexManager {
34
34
  addFieldIndex(index: FieldIndex): Promise<void>;
35
35
  deleteFieldIndex(index: FieldIndex): Promise<void>;
36
36
  getFieldIndexes(collectionGroup?: string): Promise<FieldIndex[]>;
37
- getFieldIndex(target: Target): Promise<FieldIndex | null>;
37
+ getIndexType(target: Target): Promise<IndexType>;
38
38
  getDocumentsMatchingTarget(target: Target): Promise<DocumentKey[] | null>;
39
39
  getNextCollectionGroupToUpdate(): Promise<string | null>;
40
40
  updateCollectionGroup(collectionGroup: string, offset: IndexOffset): Promise<void>;
@@ -47,10 +47,6 @@ export declare class TestRemoteDocumentCache {
47
47
  getEntries(documentKeys: DocumentKeySet): Promise<MutableDocumentMap>;
48
48
  getAllFromCollection(collection: ResourcePath, offset: IndexOffset): Promise<MutableDocumentMap>;
49
49
  getAllFromCollectionGroup(collectionGroup: string, offset: IndexOffset, limit: number): Promise<MutableDocumentMap>;
50
- getNewDocumentChanges(sinceReadTime: SnapshotVersion): Promise<{
51
- changedDocs: MutableDocumentMap;
52
- readTime: SnapshotVersion;
53
- }>;
54
50
  getSize(): Promise<number>;
55
51
  newChangeBuffer(options?: {
56
52
  trackRemovals: boolean;
@@ -63,7 +63,7 @@ l.MOCK_USER = new l("mock-user");
63
63
  * See the License for the specific language governing permissions and
64
64
  * limitations under the License.
65
65
  */
66
- let f = "9.6.10-canary.e9e5f6b3c";
66
+ let f = "9.6.11-canary.38da5d9be";
67
67
 
68
68
  /**
69
69
  * @license
@@ -5974,7 +5974,7 @@ class Ur {
5974
5974
  return e && r._setSettings(e), r;
5975
5975
  }), "PUBLIC")),
5976
5976
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5977
- registerVersion("firestore-lite", "3.4.7-canary.e9e5f6b3c", ""), registerVersion("firestore-lite", "3.4.7-canary.e9e5f6b3c", "esm2017");
5977
+ registerVersion("firestore-lite", "3.4.8-canary.38da5d9be", ""), registerVersion("firestore-lite", "3.4.8-canary.38da5d9be", "esm2017");
5978
5978
 
5979
5979
  export { gn as Bytes, ln as CollectionReference, an as DocumentReference, Yn as DocumentSnapshot, yn as FieldPath, bn as FieldValue, rn as Firestore, U as FirestoreError, vn as GeoPoint, hn as Query, Zn as QueryConstraint, Hn as QueryDocumentSnapshot, Kn as QuerySnapshot, gt as Timestamp, Ur as Transaction, $r as WriteBatch, Ar as addDoc, Dr as arrayRemove, Vr as arrayUnion, fn as collection, dn as collectionGroup, un as connectFirestoreEmulator, Ir as deleteDoc, Rr as deleteField, wn as doc, _n as documentId, dr as endAt, fr as endBefore, br as getDoc, vr as getDocs, on as getFirestore, Nr as increment, sn as initializeFirestore, or as limit, ur as limitToLast, sr as orderBy, tr as query, pn as queryEqual, mn as refEqual, kr as runTransaction, Pr as serverTimestamp, Er as setDoc, w as setLogLevel, Jn as snapshotEqual, hr as startAfter, ar as startAt, cn as terminate, Tr as updateDoc, nr as where, Fr as writeBatch };
5980
5980
  //# sourceMappingURL=index.browser.esm2017.js.map