@firebase/firestore 3.8.4-canary.722325ab2 → 3.8.4-canary.a2505bd72

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 (49) hide show
  1. package/dist/firestore/src/lite-api/query.d.ts +11 -19
  2. package/dist/firestore/src/lite-api/reference.d.ts +1 -1
  3. package/dist/firestore/test/unit/specs/spec_builder.d.ts +3 -0
  4. package/dist/firestore/test/unit/specs/spec_test_components.d.ts +5 -1
  5. package/dist/index.cjs.js +17 -18
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.d.ts +66 -14
  8. package/dist/index.esm2017.js +17 -18
  9. package/dist/index.esm2017.js.map +1 -1
  10. package/dist/index.esm5.js +16 -17
  11. package/dist/index.esm5.js.map +1 -1
  12. package/dist/index.node.cjs.js +17 -17
  13. package/dist/index.node.cjs.js.map +1 -1
  14. package/dist/index.node.mjs +17 -17
  15. package/dist/index.node.mjs.map +1 -1
  16. package/dist/index.rn.js +17 -18
  17. package/dist/index.rn.js.map +1 -1
  18. package/dist/internal.d.ts +12 -20
  19. package/dist/lite/firestore/src/lite-api/query.d.ts +11 -19
  20. package/dist/lite/firestore/src/lite-api/reference.d.ts +1 -1
  21. package/dist/lite/firestore/test/unit/specs/spec_builder.d.ts +3 -0
  22. package/dist/lite/firestore/test/unit/specs/spec_test_components.d.ts +5 -1
  23. package/dist/lite/index.browser.esm2017.js +12 -15
  24. package/dist/lite/index.browser.esm2017.js.map +1 -1
  25. package/dist/lite/index.browser.esm5.js +11 -14
  26. package/dist/lite/index.browser.esm5.js.map +1 -1
  27. package/dist/lite/index.cjs.js +12 -15
  28. package/dist/lite/index.cjs.js.map +1 -1
  29. package/dist/lite/index.d.ts +66 -14
  30. package/dist/lite/index.node.cjs.js +12 -15
  31. package/dist/lite/index.node.cjs.js.map +1 -1
  32. package/dist/lite/index.node.mjs +12 -15
  33. package/dist/lite/index.node.mjs.map +1 -1
  34. package/dist/lite/index.rn.esm2017.js +12 -15
  35. package/dist/lite/index.rn.esm2017.js.map +1 -1
  36. package/dist/lite/internal.d.ts +12 -20
  37. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +10 -13
  38. package/dist/lite/packages/firestore/src/lite-api/query.d.ts +11 -19
  39. package/dist/lite/packages/firestore/src/lite-api/reference.d.ts +1 -1
  40. package/dist/lite/packages/firestore/test/unit/specs/spec_builder.d.ts +3 -0
  41. package/dist/lite/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -1
  42. package/dist/lite/private.d.ts +72 -16
  43. package/dist/packages/firestore/dist/index.esm2017.d.ts +10 -13
  44. package/dist/packages/firestore/src/lite-api/query.d.ts +11 -19
  45. package/dist/packages/firestore/src/lite-api/reference.d.ts +1 -1
  46. package/dist/packages/firestore/test/unit/specs/spec_builder.d.ts +3 -0
  47. package/dist/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -1
  48. package/dist/private.d.ts +72 -16
  49. package/package.json +9 -9
@@ -42,9 +42,9 @@ export declare abstract class AppliableConstraint {
42
42
  /**
43
43
  * A `QueryConstraint` is used to narrow the set of documents returned by a
44
44
  * Firestore query. `QueryConstraint`s are created by invoking {@link where},
45
- * {@link orderBy}, {@link startAt}, {@link startAfter}, {@link
46
- * endBefore}, {@link endAt}, {@link limit}, {@link limitToLast} and
47
- * can then be passed to {@link query} to create a new query instance that
45
+ * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link
46
+ * (endBefore:1)}, {@link (endAt:1)}, {@link limit}, {@link limitToLast} and
47
+ * can then be passed to {@link (query:1)} to create a new query instance that
48
48
  * also contains this `QueryConstraint`.
49
49
  */
50
50
  export declare abstract class QueryConstraint extends AppliableConstraint {
@@ -69,7 +69,6 @@ export declare abstract class QueryConstraint extends AppliableConstraint {
69
69
  * apply (e.g. {@link orderBy}, {@link limit}).
70
70
  * @throws if any of the provided query constraints cannot be combined with the
71
71
  * existing or new constraints.
72
- * @internal TODO remove this internal tag with OR Query support in the server
73
72
  */
74
73
  export declare function query<T>(query: Query<T>, compositeFilter: QueryCompositeFilterConstraint, ...queryConstraints: QueryNonFilterConstraint[]): Query<T>;
75
74
  /**
@@ -87,7 +86,7 @@ export declare function query<T>(query: Query<T>, ...queryConstraints: QueryCons
87
86
  * A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by
88
87
  * a Firestore query by filtering on one or more document fields.
89
88
  * `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then
90
- * be passed to {@link query} to create a new query instance that also contains
89
+ * be passed to {@link (query:1)} to create a new query instance that also contains
91
90
  * this `QueryFieldFilterConstraint`.
92
91
  */
93
92
  export declare class QueryFieldFilterConstraint extends QueryConstraint {
@@ -127,9 +126,8 @@ export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterO
127
126
  * returned by a Firestore query by performing the logical OR or AND of multiple
128
127
  * {@link QueryFieldFilterConstraint}s or {@link QueryCompositeFilterConstraint}s.
129
128
  * `QueryCompositeFilterConstraint`s are created by invoking {@link or} or
130
- * {@link and} and can then be passed to {@link query} to create a new query
129
+ * {@link and} and can then be passed to {@link (query:1)} to create a new query
131
130
  * instance that also contains the `QueryCompositeFilterConstraint`.
132
- * @internal TODO remove this internal tag with OR Query support in the server
133
131
  */
134
132
  export declare class QueryCompositeFilterConstraint extends AppliableConstraint {
135
133
  /** The type of this query constraint */
@@ -152,18 +150,14 @@ export declare class QueryCompositeFilterConstraint extends AppliableConstraint
152
150
  * QueryConstraints which are used to narrow or order the set of documents,
153
151
  * but that do not explicitly filter on a document field.
154
152
  * `QueryNonFilterConstraint`s are created by invoking {@link orderBy},
155
- * {@link startAt}, {@link startAfter}, {@link endBefore}, {@link endAt},
156
- * {@link limit} or {@link limitToLast} and can then be passed to {@link query}
153
+ * {@link (startAt:1)}, {@link (startAfter:1)}, {@link (endBefore:1)}, {@link (endAt:1)},
154
+ * {@link limit} or {@link limitToLast} and can then be passed to {@link (query:1)}
157
155
  * to create a new query instance that also contains the `QueryConstraint`.
158
156
  */
159
157
  export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;
160
158
  /**
161
159
  * `QueryFilterConstraint` is a helper union type that represents
162
160
  * {@link QueryFieldFilterConstraint} and {@link QueryCompositeFilterConstraint}.
163
- * `QueryFilterConstraint`s are created by invoking {@link or} or {@link and}
164
- * and can then be passed to {@link query} to create a new query instance that
165
- * also contains the `QueryConstraint`.
166
- * @internal TODO remove this internal tag with OR Query support in the server
167
161
  */
168
162
  export declare type QueryFilterConstraint = QueryFieldFilterConstraint | QueryCompositeFilterConstraint;
169
163
  /**
@@ -175,7 +169,6 @@ export declare type QueryFilterConstraint = QueryFieldFilterConstraint | QueryCo
175
169
  * {@link QueryFilterConstraint}s to perform a disjunction for. These must be
176
170
  * created with calls to {@link where}, {@link or}, or {@link and}.
177
171
  * @returns The newly created {@link QueryCompositeFilterConstraint}.
178
- * @internal TODO remove this internal tag with OR Query support in the server
179
172
  */
180
173
  export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint;
181
174
  /**
@@ -187,13 +180,12 @@ export declare function or(...queryConstraints: QueryFilterConstraint[]): QueryC
187
180
  * {@link QueryFilterConstraint}s to perform a conjunction for. These must be
188
181
  * created with calls to {@link where}, {@link or}, or {@link and}.
189
182
  * @returns The newly created {@link QueryCompositeFilterConstraint}.
190
- * @internal TODO remove this internal tag with OR Query support in the server
191
183
  */
192
184
  export declare function and(...queryConstraints: QueryFilterConstraint[]): QueryCompositeFilterConstraint;
193
185
  /**
194
186
  * A `QueryOrderByConstraint` is used to sort the set of documents returned by a
195
187
  * Firestore query. `QueryOrderByConstraint`s are created by invoking
196
- * {@link orderBy} and can then be passed to {@link query} to create a new query
188
+ * {@link orderBy} and can then be passed to {@link (query:1)} to create a new query
197
189
  * instance that also contains this `QueryOrderByConstraint`.
198
190
  *
199
191
  * Note: Documents that do not contain the orderBy field will not be present in
@@ -233,7 +225,7 @@ export declare function orderBy(fieldPath: string | FieldPath, directionStr?: Or
233
225
  * A `QueryLimitConstraint` is used to limit the number of documents returned by
234
226
  * a Firestore query.
235
227
  * `QueryLimitConstraint`s are created by invoking {@link limit} or
236
- * {@link limitToLast} and can then be passed to {@link query} to create a new
228
+ * {@link limitToLast} and can then be passed to {@link (query:1)} to create a new
237
229
  * query instance that also contains this `QueryLimitConstraint`.
238
230
  */
239
231
  export declare class QueryLimitConstraint extends QueryConstraint {
@@ -273,7 +265,7 @@ export declare function limitToLast(limit: number): QueryLimitConstraint;
273
265
  * A `QueryStartAtConstraint` is used to exclude documents from the start of a
274
266
  * result set returned by a Firestore query.
275
267
  * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or
276
- * {@link (startAfter:1)} and can then be passed to {@link query} to create a
268
+ * {@link (startAfter:1)} and can then be passed to {@link (query:1)} to create a
277
269
  * new query instance that also contains this `QueryStartAtConstraint`.
278
270
  */
279
271
  export declare class QueryStartAtConstraint extends QueryConstraint {
@@ -334,7 +326,7 @@ export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConst
334
326
  * A `QueryEndAtConstraint` is used to exclude documents from the end of a
335
327
  * result set returned by a Firestore query.
336
328
  * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
337
- * {@link (endBefore:1)} and can then be passed to {@link query} to create a new
329
+ * {@link (endBefore:1)} and can then be passed to {@link (query:1)} to create a new
338
330
  * query instance that also contains this `QueryEndAtConstraint`.
339
331
  */
340
332
  export declare class QueryEndAtConstraint extends QueryConstraint {
@@ -173,7 +173,7 @@ export declare class Query<T = DocumentData> {
173
173
  }
174
174
  /**
175
175
  * A `CollectionReference` object can be used for adding documents, getting
176
- * document references, and querying for documents (using {@link query}).
176
+ * document references, and querying for documents (using {@link (query:1)}).
177
177
  */
178
178
  export declare class CollectionReference<T = DocumentData> extends Query<T> {
179
179
  readonly _path: ResourcePath;
@@ -19,6 +19,7 @@ import { Query } from '../../../src/core/query';
19
19
  import { Target } from '../../../src/core/target';
20
20
  import { TargetIdGenerator } from '../../../src/core/target_id_generator';
21
21
  import { TargetId } from '../../../src/core/types';
22
+ import { TargetPurpose } from '../../../src/local/target_data';
22
23
  import { Document } from '../../../src/model/document';
23
24
  import { DocumentKey } from '../../../src/model/document_key';
24
25
  import { FieldIndex } from '../../../src/model/field_index';
@@ -34,6 +35,7 @@ export interface LimboMap {
34
35
  }
35
36
  export interface ActiveTargetSpec {
36
37
  queries: SpecQuery[];
38
+ targetPurpose?: TargetPurpose;
37
39
  resumeToken?: string;
38
40
  readTime?: TestSnapshotVersion;
39
41
  }
@@ -139,6 +141,7 @@ export declare class SpecBuilder {
139
141
  /** Overrides the currently expected set of active targets. */
140
142
  expectActiveTargets(...targets: Array<{
141
143
  query: Query;
144
+ targetPurpose?: TargetPurpose;
142
145
  resumeToken?: string;
143
146
  readTime?: TestSnapshotVersion;
144
147
  }>): this;
@@ -28,6 +28,7 @@ import { PersistenceTransaction, PersistenceTransactionMode } from '../../../src
28
28
  import { SharedClientState } from '../../../src/local/shared_client_state';
29
29
  import { Mutation } from '../../../src/model/mutation';
30
30
  import * as api from '../../../src/protos/firestore_proto_api';
31
+ import { ApiClientObjectMap } from '../../../src/protos/firestore_proto_api';
31
32
  import { Connection, Stream } from '../../../src/remote/connection';
32
33
  import { Datastore } from '../../../src/remote/datastore';
33
34
  import { StreamBridge } from '../../../src/remote/stream_bridge';
@@ -102,7 +103,10 @@ export declare class MockConnection implements Connection {
102
103
  * stream, as a mapping from target ID to query Target.
103
104
  */
104
105
  activeTargets: {
105
- [targetId: number]: api.Target;
106
+ [targetId: number]: {
107
+ target: api.Target;
108
+ labels?: ApiClientObjectMap<string>;
109
+ };
106
110
  };
107
111
  /** A Deferred that is resolved once watch opens. */
108
112
  watchOpen: Deferred<void>;
package/dist/index.cjs.js CHANGED
@@ -70,7 +70,7 @@ b.MOCK_USER = new b("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- let v = "9.17.2-canary.722325ab2";
73
+ let v = "9.17.2-canary.a2505bd72";
74
74
 
75
75
  /**
76
76
  * @license
@@ -11562,8 +11562,10 @@ class Fo {
11562
11562
  // Note: In theory, this should be scheduled on the AsyncQueue since it
11563
11563
  // accesses internal state. We execute this code directly during shutdown
11564
11564
  // to make sure it gets a chance to run.
11565
- this.Pi(), util.isSafari() && navigator.appVersion.match(/Version\/1[45]/) &&
11566
- // On Safari 14 and 15, we do not run any cleanup actions as it might
11565
+ this.Pi();
11566
+ const t = /(?:Version|Mobile)\/1[456]/;
11567
+ util.isSafari() && (navigator.appVersion.match(t) || navigator.userAgent.match(t)) &&
11568
+ // On Safari 14, 15, and 16, we do not run any cleanup actions as it might
11567
11569
  // trigger a bug that prevents Safari from re-opening IndexedDB during
11568
11570
  // the next page load.
11569
11571
  // See https://bugs.webkit.org/show_bug.cgi?id=226547
@@ -17361,7 +17363,7 @@ class za {
17361
17363
 
17362
17364
  /**
17363
17365
  * A `CollectionReference` object can be used for adding documents, getting
17364
- * document references, and querying for documents (using {@link query}).
17366
+ * document references, and querying for documents (using {@link (query:1)}).
17365
17367
  */ class Za extends Ya {
17366
17368
  /** @hideconstructor */
17367
17369
  constructor(t, e, n) {
@@ -19088,9 +19090,9 @@ function el(t, e, n, s, i) {
19088
19090
  /**
19089
19091
  * A `QueryConstraint` is used to narrow the set of documents returned by a
19090
19092
  * Firestore query. `QueryConstraint`s are created by invoking {@link where},
19091
- * {@link orderBy}, {@link startAt}, {@link startAfter}, {@link
19092
- * endBefore}, {@link endAt}, {@link limit}, {@link limitToLast} and
19093
- * can then be passed to {@link query} to create a new query instance that
19093
+ * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link
19094
+ * (endBefore:1)}, {@link (endAt:1)}, {@link limit}, {@link limitToLast} and
19095
+ * can then be passed to {@link (query:1)} to create a new query instance that
19094
19096
  * also contains this `QueryConstraint`.
19095
19097
  */ class cl extends ul {}
19096
19098
 
@@ -19130,7 +19132,7 @@ function al(t, e, ...n) {
19130
19132
  * A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by
19131
19133
  * a Firestore query by filtering on one or more document fields.
19132
19134
  * `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then
19133
- * be passed to {@link query} to create a new query instance that also contains
19135
+ * be passed to {@link (query:1)} to create a new query instance that also contains
19134
19136
  * this `QueryFieldFilterConstraint`.
19135
19137
  */ class hl extends cl {
19136
19138
  /**
@@ -19192,9 +19194,8 @@ function al(t, e, ...n) {
19192
19194
  * returned by a Firestore query by performing the logical OR or AND of multiple
19193
19195
  * {@link QueryFieldFilterConstraint}s or {@link QueryCompositeFilterConstraint}s.
19194
19196
  * `QueryCompositeFilterConstraint`s are created by invoking {@link or} or
19195
- * {@link and} and can then be passed to {@link query} to create a new query
19197
+ * {@link and} and can then be passed to {@link (query:1)} to create a new query
19196
19198
  * instance that also contains the `QueryCompositeFilterConstraint`.
19197
- * @internal TODO remove this internal tag with OR Query support in the server
19198
19199
  */ class fl extends ul {
19199
19200
  /**
19200
19201
  * @internal
@@ -19239,7 +19240,6 @@ function al(t, e, ...n) {
19239
19240
  * {@link QueryFilterConstraint}s to perform a disjunction for. These must be
19240
19241
  * created with calls to {@link where}, {@link or}, or {@link and}.
19241
19242
  * @returns The newly created {@link QueryCompositeFilterConstraint}.
19242
- * @internal TODO remove this internal tag with OR Query support in the server
19243
19243
  */ function dl(...t) {
19244
19244
  // Only support QueryFilterConstraints
19245
19245
  return t.forEach((t => Cl("or", t))), fl._create("or" /* CompositeOperator.OR */ , t);
@@ -19254,7 +19254,6 @@ function al(t, e, ...n) {
19254
19254
  * {@link QueryFilterConstraint}s to perform a conjunction for. These must be
19255
19255
  * created with calls to {@link where}, {@link or}, or {@link and}.
19256
19256
  * @returns The newly created {@link QueryCompositeFilterConstraint}.
19257
- * @internal TODO remove this internal tag with OR Query support in the server
19258
19257
  */ function _l(...t) {
19259
19258
  // Only support QueryFilterConstraints
19260
19259
  return t.forEach((t => Cl("and", t))), fl._create("and" /* CompositeOperator.AND */ , t);
@@ -19263,7 +19262,7 @@ function al(t, e, ...n) {
19263
19262
  /**
19264
19263
  * A `QueryOrderByConstraint` is used to sort the set of documents returned by a
19265
19264
  * Firestore query. `QueryOrderByConstraint`s are created by invoking
19266
- * {@link orderBy} and can then be passed to {@link query} to create a new query
19265
+ * {@link orderBy} and can then be passed to {@link (query:1)} to create a new query
19267
19266
  * instance that also contains this `QueryOrderByConstraint`.
19268
19267
  *
19269
19268
  * Note: Documents that do not contain the orderBy field will not be present in
@@ -19332,7 +19331,7 @@ function al(t, e, ...n) {
19332
19331
  * A `QueryLimitConstraint` is used to limit the number of documents returned by
19333
19332
  * a Firestore query.
19334
19333
  * `QueryLimitConstraint`s are created by invoking {@link limit} or
19335
- * {@link limitToLast} and can then be passed to {@link query} to create a new
19334
+ * {@link limitToLast} and can then be passed to {@link (query:1)} to create a new
19336
19335
  * query instance that also contains this `QueryLimitConstraint`.
19337
19336
  */ class gl extends cl {
19338
19337
  /**
@@ -19378,7 +19377,7 @@ function al(t, e, ...n) {
19378
19377
  * A `QueryStartAtConstraint` is used to exclude documents from the start of a
19379
19378
  * result set returned by a Firestore query.
19380
19379
  * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or
19381
- * {@link (startAfter:1)} and can then be passed to {@link query} to create a
19380
+ * {@link (startAfter:1)} and can then be passed to {@link (query:1)} to create a
19382
19381
  * new query instance that also contains this `QueryStartAtConstraint`.
19383
19382
  */ class Il extends cl {
19384
19383
  /**
@@ -19414,7 +19413,7 @@ function El(...t) {
19414
19413
  * A `QueryEndAtConstraint` is used to exclude documents from the end of a
19415
19414
  * result set returned by a Firestore query.
19416
19415
  * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
19417
- * {@link (endBefore:1)} and can then be passed to {@link query} to create a new
19416
+ * {@link (endBefore:1)} and can then be passed to {@link (query:1)} to create a new
19418
19417
  * query instance that also contains this `QueryEndAtConstraint`.
19419
19418
  */ class Al extends cl {
19420
19419
  /**
@@ -20795,9 +20794,9 @@ function Ef(t, e) {
20795
20794
  return s = Object.assign({
20796
20795
  useFetchStreams: e
20797
20796
  }, s), r._setSettings(s), r;
20798
- }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(P, "3.8.4-canary.722325ab2", t),
20797
+ }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(P, "3.8.4-canary.a2505bd72", t),
20799
20798
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
20800
- app.registerVersion(P, "3.8.4-canary.722325ab2", "cjs2017");
20799
+ app.registerVersion(P, "3.8.4-canary.a2505bd72", "cjs2017");
20801
20800
  }();
20802
20801
 
20803
20802
  exports.AbstractUserDataWriter = xl;