@firebase/firestore 3.8.0 → 3.8.1

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 (44) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/firestore/src/api/reference_impl.d.ts +2 -1
  3. package/dist/firestore/src/lite-api/query.d.ts +14 -12
  4. package/dist/firestore/src/local/overlayed_document.d.ts +8 -4
  5. package/dist/firestore/test/unit/local/counting_query_engine.d.ts +12 -21
  6. package/dist/index.d.ts +2 -1
  7. package/dist/index.esm2017.js +36 -20
  8. package/dist/index.esm2017.js.map +1 -1
  9. package/dist/index.esm5.js +38 -20
  10. package/dist/index.esm5.js.map +1 -1
  11. package/dist/index.node.cjs.js +36 -17
  12. package/dist/index.node.cjs.js.map +1 -1
  13. package/dist/index.node.mjs +36 -17
  14. package/dist/index.node.mjs.map +1 -1
  15. package/dist/index.rn.js +36 -20
  16. package/dist/index.rn.js.map +1 -1
  17. package/dist/internal.d.ts +25 -18
  18. package/dist/lite/firestore/src/api/reference_impl.d.ts +2 -1
  19. package/dist/lite/firestore/src/lite-api/query.d.ts +14 -12
  20. package/dist/lite/firestore/src/local/overlayed_document.d.ts +8 -4
  21. package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +12 -21
  22. package/dist/lite/index.browser.esm2017.js +16 -14
  23. package/dist/lite/index.browser.esm2017.js.map +1 -1
  24. package/dist/lite/index.browser.esm5.js +17 -15
  25. package/dist/lite/index.browser.esm5.js.map +1 -1
  26. package/dist/lite/index.node.cjs.js +16 -14
  27. package/dist/lite/index.node.cjs.js.map +1 -1
  28. package/dist/lite/index.node.mjs +16 -14
  29. package/dist/lite/index.node.mjs.map +1 -1
  30. package/dist/lite/index.rn.esm2017.js +16 -14
  31. package/dist/lite/index.rn.esm2017.js.map +1 -1
  32. package/dist/lite/internal.d.ts +15 -13
  33. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +15 -13
  34. package/dist/lite/packages/firestore/src/api/reference_impl.d.ts +2 -1
  35. package/dist/lite/packages/firestore/src/lite-api/query.d.ts +14 -12
  36. package/dist/lite/packages/firestore/src/local/overlayed_document.d.ts +8 -4
  37. package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +12 -21
  38. package/dist/packages/firestore/dist/index.esm2017.d.ts +17 -14
  39. package/dist/packages/firestore/src/api/reference_impl.d.ts +2 -1
  40. package/dist/packages/firestore/src/lite-api/query.d.ts +14 -12
  41. package/dist/packages/firestore/src/local/overlayed_document.d.ts +8 -4
  42. package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +12 -21
  43. package/dist/private.d.ts +10 -5
  44. package/package.json +6 -6
@@ -128,13 +128,14 @@ export declare type AggregateSpecData<T extends AggregateSpec> = {
128
128
  };
129
129
 
130
130
  /**
131
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical AND
132
- * of all the provided {@link QueryFilterConstraint}s.
133
- *
134
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
135
- * for AND operation. These must be created with calls to {@link where},
136
- * {@link or}, or {@link and}.
137
- * @returns The created {@link QueryCompositeFilterConstraint}.
131
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of
132
+ * the given filter constraints. A conjunction filter includes a document if it
133
+ * satisfies all of the given filters.
134
+ *
135
+ * @param queryConstraints - Optional. The list of
136
+ * {@link QueryFilterConstraint}s to perform a conjunction for. These must be
137
+ * created with calls to {@link where}, {@link or}, or {@link and}.
138
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
138
139
  * @internal TODO remove this internal tag with OR Query support in the server
139
140
  */
140
141
  export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint;
@@ -2540,7 +2541,8 @@ export declare function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
2540
2541
 
2541
2542
  /**
2542
2543
  * Executes the query and returns the results as a `QuerySnapshot` from cache.
2543
- * Returns an error if the document is not currently cached.
2544
+ * Returns an empty result set if no documents matching the query are currently
2545
+ * cached.
2544
2546
  *
2545
2547
  * @returns A `Promise` that will be resolved with the results of the query.
2546
2548
  */
@@ -3982,13 +3984,14 @@ declare const enum Operator {
3982
3984
  }
3983
3985
 
3984
3986
  /**
3985
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical OR
3986
- * of all the provided {@link QueryFilterConstraint}s.
3987
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of
3988
+ * the given filter constraints. A disjunction filter includes a document if it
3989
+ * satisfies any of the given filters.
3987
3990
  *
3988
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
3989
- * for OR operation. These must be created with calls to {@link where},
3990
- * {@link or}, or {@link and}.
3991
- * @returns The created {@link QueryCompositeFilterConstraint}.
3991
+ * @param queryConstraints - Optional. The list of
3992
+ * {@link QueryFilterConstraint}s to perform a disjunction for. These must be
3993
+ * created with calls to {@link where}, {@link or}, or {@link and}.
3994
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
3992
3995
  * @internal TODO remove this internal tag with OR Query support in the server
3993
3996
  */
3994
3997
  export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint;
@@ -4046,14 +4049,18 @@ declare class Overlay {
4046
4049
  declare class OverlayedDocument {
4047
4050
  readonly overlayedDocument: Document_2;
4048
4051
  /**
4049
- * The fields that are locally mutated by patch mutations. If the overlayed
4050
- * document is from set or delete mutations, this returns null.
4052
+ * The fields that are locally mutated by patch mutations.
4053
+ *
4054
+ * If the overlayed document is from set or delete mutations, this is `null`.
4055
+ * If there is no overlay (mutation) for the document, this is an empty `FieldMask`.
4051
4056
  */
4052
4057
  readonly mutatedFields: FieldMask | null;
4053
4058
  constructor(overlayedDocument: Document_2,
4054
4059
  /**
4055
- * The fields that are locally mutated by patch mutations. If the overlayed
4056
- * document is from set or delete mutations, this returns null.
4060
+ * The fields that are locally mutated by patch mutations.
4061
+ *
4062
+ * If the overlayed document is from set or delete mutations, this is `null`.
4063
+ * If there is no overlay (mutation) for the document, this is an empty `FieldMask`.
4057
4064
  */
4058
4065
  mutatedFields: FieldMask | null);
4059
4066
  }
@@ -83,7 +83,8 @@ export declare function getDocFromServer<T>(reference: DocumentReference<T>): Pr
83
83
  export declare function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
84
84
  /**
85
85
  * Executes the query and returns the results as a `QuerySnapshot` from cache.
86
- * Returns an error if the document is not currently cached.
86
+ * Returns an empty result set if no documents matching the query are currently
87
+ * cached.
87
88
  *
88
89
  * @returns A `Promise` that will be resolved with the results of the query.
89
90
  */
@@ -167,24 +167,26 @@ export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLim
167
167
  */
168
168
  export declare type QueryFilterConstraint = QueryFieldFilterConstraint | QueryCompositeFilterConstraint;
169
169
  /**
170
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical OR
171
- * of all the provided {@link QueryFilterConstraint}s.
170
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of
171
+ * the given filter constraints. A disjunction filter includes a document if it
172
+ * satisfies any of the given filters.
172
173
  *
173
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
174
- * for OR operation. These must be created with calls to {@link where},
175
- * {@link or}, or {@link and}.
176
- * @returns The created {@link QueryCompositeFilterConstraint}.
174
+ * @param queryConstraints - Optional. The list of
175
+ * {@link QueryFilterConstraint}s to perform a disjunction for. These must be
176
+ * created with calls to {@link where}, {@link or}, or {@link and}.
177
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
177
178
  * @internal TODO remove this internal tag with OR Query support in the server
178
179
  */
179
180
  export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint;
180
181
  /**
181
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical AND
182
- * of all the provided {@link QueryFilterConstraint}s.
182
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of
183
+ * the given filter constraints. A conjunction filter includes a document if it
184
+ * satisfies all of the given filters.
183
185
  *
184
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
185
- * for AND operation. These must be created with calls to {@link where},
186
- * {@link or}, or {@link and}.
187
- * @returns The created {@link QueryCompositeFilterConstraint}.
186
+ * @param queryConstraints - Optional. The list of
187
+ * {@link QueryFilterConstraint}s to perform a conjunction for. These must be
188
+ * created with calls to {@link where}, {@link or}, or {@link and}.
189
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
188
190
  * @internal TODO remove this internal tag with OR Query support in the server
189
191
  */
190
192
  export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint;
@@ -23,14 +23,18 @@ import { FieldMask } from '../model/field_mask';
23
23
  export declare class OverlayedDocument {
24
24
  readonly overlayedDocument: Document;
25
25
  /**
26
- * The fields that are locally mutated by patch mutations. If the overlayed
27
- * document is from set or delete mutations, this returns null.
26
+ * The fields that are locally mutated by patch mutations.
27
+ *
28
+ * If the overlayed document is from set or delete mutations, this is `null`.
29
+ * If there is no overlay (mutation) for the document, this is an empty `FieldMask`.
28
30
  */
29
31
  readonly mutatedFields: FieldMask | null;
30
32
  constructor(overlayedDocument: Document,
31
33
  /**
32
- * The fields that are locally mutated by patch mutations. If the overlayed
33
- * document is from set or delete mutations, this returns null.
34
+ * The fields that are locally mutated by patch mutations.
35
+ *
36
+ * If the overlayed document is from set or delete mutations, this is `null`.
37
+ * If there is no overlay (mutation) for the document, this is an empty `FieldMask`.
34
38
  */
35
39
  mutatedFields: FieldMask | null);
36
40
  }
@@ -22,27 +22,29 @@ import { PersistencePromise } from '../../../src/local/persistence_promise';
22
22
  import { PersistenceTransaction } from '../../../src/local/persistence_transaction';
23
23
  import { QueryEngine } from '../../../src/local/query_engine';
24
24
  import { DocumentKeySet, DocumentMap } from '../../../src/model/collections';
25
+ import { MutationType } from '../../../src/model/mutation';
25
26
  /**
26
27
  * A test-only query engine that forwards all API calls and exposes the number
27
28
  * of documents and mutations read.
28
29
  */
29
30
  export declare class CountingQueryEngine extends QueryEngine {
30
31
  /**
31
- * The number of mutations returned by the MutationQueue's
32
- * `getAllMutationBatchesAffectingQuery()` API (since the last call to
32
+ * The number of overlays returned by the DocumentOverlayCache's
33
+ * `getOverlaysByCollection(Group)` API (since the last call to
33
34
  * `resetCounts()`)
34
35
  */
35
- mutationsReadByCollection: number;
36
+ overlaysReadByCollection: number;
36
37
  /**
37
- * The number of mutations returned by the MutationQueue's
38
- * `getAllMutationBatchesAffectingDocumentKey()` and
39
- * `getAllMutationBatchesAffectingDocumentKeys()` APIs (since the last call
40
- * to `resetCounts()`)
38
+ * The number of overlays returned by the DocumentOverlayCache's
39
+ * `getOverlay(s)` APIs (since the last call to `resetCounts()`)
41
40
  */
42
- mutationsReadByKey: number;
41
+ overlaysReadByKey: number;
42
+ overlayTypes: {
43
+ [k: string]: MutationType;
44
+ };
43
45
  /**
44
46
  * The number of documents returned by the RemoteDocumentCache's
45
- * `getAll()` API (since the last call to `resetCounts()`)
47
+ * `getAll()` API (since the last call to `resetCounts()`).
46
48
  */
47
49
  documentsReadByCollection: number;
48
50
  /**
@@ -50,20 +52,9 @@ export declare class CountingQueryEngine extends QueryEngine {
50
52
  * and `getEntries()` APIs (since the last call to `resetCounts()`)
51
53
  */
52
54
  documentsReadByKey: number;
53
- /**
54
- * The number of documents returned by the OverlayCache's `getOverlays()`
55
- * API (since the last call to `resetCounts()`)
56
- */
57
- overlaysReadByCollection: number;
58
- /**
59
- * The number of documents returned by the OverlayCache's `getOverlay()`
60
- * APIs (since the last call to `resetCounts()`)
61
- */
62
- overlaysReadByKey: number;
63
55
  resetCounts(): void;
64
56
  getDocumentsMatchingQuery(transaction: PersistenceTransaction, query: Query, lastLimboFreeSnapshotVersion: SnapshotVersion, remoteKeys: DocumentKeySet): PersistencePromise<DocumentMap>;
65
57
  initialize(localDocuments: LocalDocumentsView, indexManager: IndexManager): void;
66
58
  private wrapRemoteDocumentCache;
67
- private wrapMutationQueue;
68
- private wrapDocumentOverlayCache;
59
+ private wrapOverlayCache;
69
60
  }
@@ -63,7 +63,7 @@ d.MOCK_USER = new d("mock-user");
63
63
  * See the License for the specific language governing permissions and
64
64
  * limitations under the License.
65
65
  */
66
- let w = "9.15.0";
66
+ let w = "9.16.0";
67
67
 
68
68
  /**
69
69
  * @license
@@ -5446,13 +5446,14 @@ function _r(t, e, ...n) {
5446
5446
  }
5447
5447
 
5448
5448
  /**
5449
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical OR
5450
- * of all the provided {@link QueryFilterConstraint}s.
5449
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a disjunction of
5450
+ * the given filter constraints. A disjunction filter includes a document if it
5451
+ * satisfies any of the given filters.
5451
5452
  *
5452
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
5453
- * for OR operation. These must be created with calls to {@link where},
5454
- * {@link or}, or {@link and}.
5455
- * @returns The created {@link QueryCompositeFilterConstraint}.
5453
+ * @param queryConstraints - Optional. The list of
5454
+ * {@link QueryFilterConstraint}s to perform a disjunction for. These must be
5455
+ * created with calls to {@link where}, {@link or}, or {@link and}.
5456
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
5456
5457
  * @internal TODO remove this internal tag with OR Query support in the server
5457
5458
  */ function Ir(...t) {
5458
5459
  // Only support QueryFilterConstraints
@@ -5460,13 +5461,14 @@ function _r(t, e, ...n) {
5460
5461
  }
5461
5462
 
5462
5463
  /**
5463
- * Creates a {@link QueryCompositeFilterConstraint} that performs a logical AND
5464
- * of all the provided {@link QueryFilterConstraint}s.
5464
+ * Creates a new {@link QueryCompositeFilterConstraint} that is a conjunction of
5465
+ * the given filter constraints. A conjunction filter includes a document if it
5466
+ * satisfies all of the given filters.
5465
5467
  *
5466
- * @param queryConstraints - Optional. The {@link QueryFilterConstraint}s
5467
- * for AND operation. These must be created with calls to {@link where},
5468
- * {@link or}, or {@link and}.
5469
- * @returns The created {@link QueryCompositeFilterConstraint}.
5468
+ * @param queryConstraints - Optional. The list of
5469
+ * {@link QueryFilterConstraint}s to perform a conjunction for. These must be
5470
+ * created with calls to {@link where}, {@link or}, or {@link and}.
5471
+ * @returns The newly created {@link QueryCompositeFilterConstraint}.
5470
5472
  * @internal TODO remove this internal tag with OR Query support in the server
5471
5473
  */ function Tr(...t) {
5472
5474
  // Only support QueryFilterConstraints
@@ -6946,7 +6948,7 @@ class fs {
6946
6948
  return n && s._setSettings(n), s;
6947
6949
  }), "PUBLIC").setMultipleInstances(!0)),
6948
6950
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
6949
- registerVersion("firestore-lite", "3.8.0", ""), registerVersion("firestore-lite", "3.8.0", "esm2017");
6951
+ registerVersion("firestore-lite", "3.8.1", ""), registerVersion("firestore-lite", "3.8.1", "esm2017");
6950
6952
 
6951
6953
  export { Tn as AggregateField, An as AggregateQuerySnapshot, qn as Bytes, $n as CollectionReference, Pn as DocumentReference, fr as DocumentSnapshot, On as FieldPath, Cn as FieldValue, _n as Firestore, U as FirestoreError, Ln as GeoPoint, Vn as Query, Er as QueryCompositeFilterConstraint, gr as QueryConstraint, dr as QueryDocumentSnapshot, xr as QueryEndAtConstraint, vr as QueryFieldFilterConstraint, Pr as QueryLimitConstraint, Ar as QueryOrderByConstraint, wr as QuerySnapshot, Nr as QueryStartAtConstraint, Vt as Timestamp, fs as Transaction, rs as WriteBatch, Yr as addDoc, Jr as aggregateQuerySnapshotEqual, Tr as and, es as arrayRemove, ts as arrayUnion, Nn as collection, Dn as collectionGroup, En as connectFirestoreEmulator, Kr as deleteDoc, Xr as deleteField, Fn as doc, kn as documentId, qr as endAt, Sr as endBefore, Hr as getCount, Qr as getDoc, zr as getDocs, bn as getFirestore, ns as increment, vn as initializeFirestore, Vr as limit, $r as limitToLast, Ir as or, Rr as orderBy, _r as query, Sn as queryEqual, xn as refEqual, ds as runTransaction, Zr as serverTimestamp, Wr as setDoc, p as setLogLevel, mr as snapshotEqual, Fr as startAfter, Dr as startAt, In as terminate, Gr as updateDoc, br as where, is as writeBatch };
6952
6954
  //# sourceMappingURL=index.browser.esm2017.js.map