@firebase/firestore 3.7.3-canary.37dd6f6f4 → 3.7.3-canary.7e237cd47
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/dist/firestore/lite/index.d.ts +1 -1
- package/dist/firestore/src/api/filter.d.ts +1 -1
- package/dist/firestore/src/api.d.ts +1 -1
- package/dist/firestore/src/core/bound.d.ts +49 -0
- package/dist/firestore/src/core/filter.d.ts +134 -0
- package/dist/firestore/src/core/order_by.d.ts +35 -0
- package/dist/firestore/src/core/query.d.ts +5 -6
- package/dist/firestore/src/core/target.d.ts +4 -120
- package/dist/firestore/src/lite-api/query.d.ts +273 -66
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
- package/dist/firestore/src/protos/firestore_proto_api.d.ts +1 -1
- package/dist/firestore/src/remote/serializer.d.ts +10 -3
- package/dist/firestore/src/util/logic_utils.d.ts +52 -0
- package/dist/firestore/src/util/types.d.ts +1 -1
- package/dist/firestore/test/lite/helpers.d.ts +1 -1
- package/dist/firestore/test/unit/core/filter.test.d.ts +17 -0
- package/dist/firestore/test/unit/specs/spec_test_runner.d.ts +1 -1
- package/dist/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +5 -1
- package/dist/firestore/test/util/test_platform.d.ts +2 -2
- package/dist/index.d.ts +138 -62
- package/dist/index.esm2017.js +4271 -3734
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +4959 -4404
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +1609 -874
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +1602 -875
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +4496 -3959
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +320 -65
- package/dist/lite/firestore/lite/index.d.ts +1 -1
- package/dist/lite/firestore/src/api/filter.d.ts +1 -1
- package/dist/lite/firestore/src/api.d.ts +1 -1
- package/dist/lite/firestore/src/core/bound.d.ts +49 -0
- package/dist/lite/firestore/src/core/filter.d.ts +134 -0
- package/dist/lite/firestore/src/core/order_by.d.ts +35 -0
- package/dist/lite/firestore/src/core/query.d.ts +5 -6
- package/dist/lite/firestore/src/core/target.d.ts +4 -120
- package/dist/lite/firestore/src/lite-api/query.d.ts +273 -66
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
- package/dist/lite/firestore/src/protos/firestore_proto_api.d.ts +1 -1
- package/dist/lite/firestore/src/remote/serializer.d.ts +10 -3
- package/dist/lite/firestore/src/util/logic_utils.d.ts +52 -0
- package/dist/lite/firestore/src/util/types.d.ts +1 -1
- package/dist/lite/firestore/test/lite/helpers.d.ts +1 -1
- package/dist/lite/firestore/test/unit/core/filter.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/specs/spec_test_runner.d.ts +1 -1
- package/dist/lite/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +5 -1
- package/dist/lite/firestore/test/util/test_platform.d.ts +2 -2
- package/dist/lite/index.browser.esm2017.js +2059 -1779
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +2218 -1997
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +138 -62
- package/dist/lite/index.node.cjs.js +2165 -1788
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +2158 -1789
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +2203 -1922
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +320 -65
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +322 -174
- package/dist/lite/packages/firestore/lite/index.d.ts +1 -1
- package/dist/lite/packages/firestore/rollup.config.debug.d.ts +1 -1
- package/dist/lite/packages/firestore/src/api/filter.d.ts +1 -1
- package/dist/lite/packages/firestore/src/api.d.ts +1 -1
- package/dist/lite/packages/firestore/src/core/bound.d.ts +49 -0
- package/dist/lite/packages/firestore/src/core/filter.d.ts +134 -0
- package/dist/lite/packages/firestore/src/core/order_by.d.ts +35 -0
- package/dist/lite/packages/firestore/src/core/query.d.ts +5 -6
- package/dist/lite/packages/firestore/src/core/target.d.ts +4 -120
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +273 -66
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
- package/dist/lite/packages/firestore/src/protos/firestore_proto_api.d.ts +1 -1
- package/dist/lite/packages/firestore/src/remote/serializer.d.ts +10 -3
- package/dist/lite/packages/firestore/src/util/logic_utils.d.ts +52 -0
- package/dist/lite/packages/firestore/src/util/types.d.ts +1 -1
- package/dist/lite/packages/firestore/test/lite/helpers.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/core/filter.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_test_runner.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +5 -1
- package/dist/lite/packages/firestore/test/util/test_platform.d.ts +2 -2
- package/dist/lite/private.d.ts +232 -65
- package/dist/packages/firestore/dist/index.esm2017.d.ts +368 -208
- package/dist/packages/firestore/lite/index.d.ts +1 -1
- package/dist/packages/firestore/rollup.config.debug.d.ts +1 -1
- package/dist/packages/firestore/src/api/filter.d.ts +1 -1
- package/dist/packages/firestore/src/api.d.ts +1 -1
- package/dist/packages/firestore/src/core/bound.d.ts +49 -0
- package/dist/packages/firestore/src/core/filter.d.ts +134 -0
- package/dist/packages/firestore/src/core/order_by.d.ts +35 -0
- package/dist/packages/firestore/src/core/query.d.ts +5 -6
- package/dist/packages/firestore/src/core/target.d.ts +4 -120
- package/dist/packages/firestore/src/lite-api/query.d.ts +273 -66
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
- package/dist/packages/firestore/src/protos/firestore_proto_api.d.ts +1 -1
- package/dist/packages/firestore/src/remote/serializer.d.ts +10 -3
- package/dist/packages/firestore/src/util/logic_utils.d.ts +52 -0
- package/dist/packages/firestore/src/util/types.d.ts +1 -1
- package/dist/packages/firestore/test/lite/helpers.d.ts +1 -1
- package/dist/packages/firestore/test/unit/core/filter.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/specs/spec_test_runner.d.ts +1 -1
- package/dist/packages/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +5 -1
- package/dist/packages/firestore/test/util/test_platform.d.ts +2 -2
- package/dist/private.d.ts +232 -65
- package/package.json +13 -11
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { Bytes, DocumentReference } from '../../src';
|
|
18
|
+
import { Bound } from '../../src/core/bound';
|
|
18
19
|
import { BundledDocuments } from '../../src/core/bundle';
|
|
19
20
|
import { DatabaseId } from '../../src/core/database_info';
|
|
21
|
+
import { FieldFilter, CompositeFilter, Filter } from '../../src/core/filter';
|
|
22
|
+
import { OrderBy } from '../../src/core/order_by';
|
|
20
23
|
import { Query } from '../../src/core/query';
|
|
21
24
|
import { SnapshotVersion } from '../../src/core/snapshot_version';
|
|
22
|
-
import { Bound, FieldFilter, Filter, OrderBy } from '../../src/core/target';
|
|
23
25
|
import { TargetId } from '../../src/core/types';
|
|
24
26
|
import { LimboDocumentChange, View, ViewChange } from '../../src/core/view';
|
|
25
27
|
import { UserDataReader } from '../../src/lite-api/user_data_reader';
|
|
@@ -68,6 +70,8 @@ export declare function fieldIndex(collectionGroup: string, options?: {
|
|
|
68
70
|
export declare function mask(...paths: string[]): FieldMask;
|
|
69
71
|
export declare function blob(...bytes: number[]): Bytes;
|
|
70
72
|
export declare function filter(path: string, op: string, value: unknown): FieldFilter;
|
|
73
|
+
export declare function andFilter(...filters: Filter[]): CompositeFilter;
|
|
74
|
+
export declare function orFilter(...filters: Filter[]): CompositeFilter;
|
|
71
75
|
export declare function setMutation(keyStr: string, json: JsonObject<unknown>): SetMutation;
|
|
72
76
|
export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
|
|
73
77
|
export declare function mergeMutation(keyStr: string, json: JsonObject<unknown>, updateMask: FieldPath[]): PatchMutation;
|
|
@@ -36,10 +36,10 @@ export declare function testWindow(sharedWebStorage?: SharedFakeWebStorage): Fak
|
|
|
36
36
|
export declare class FakeDocument implements DocumentLike {
|
|
37
37
|
private _visibilityState;
|
|
38
38
|
private visibilityListener;
|
|
39
|
-
get visibilityState():
|
|
39
|
+
get visibilityState(): DocumentVisibilityState;
|
|
40
40
|
addEventListener(type: string, listener: EventListener): void;
|
|
41
41
|
removeEventListener(type: string, listener: EventListener): void;
|
|
42
|
-
raiseVisibilityEvent(visibility:
|
|
42
|
+
raiseVisibilityEvent(visibility: DocumentVisibilityState): void;
|
|
43
43
|
}
|
|
44
44
|
export declare function testDocument(): FakeDocument;
|
|
45
45
|
/**
|
package/dist/private.d.ts
CHANGED
|
@@ -110,10 +110,24 @@ export declare type AggregateSpecData<T extends AggregateSpec> = {
|
|
|
110
110
|
[P in keyof T]: T[P] extends AggregateField<infer U> ? U : never;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
/* Excluded from this release type: and */
|
|
114
|
+
|
|
113
115
|
declare interface ApiClientObjectMap<T> {
|
|
114
116
|
[k: string]: T;
|
|
115
117
|
}
|
|
116
118
|
|
|
119
|
+
/**
|
|
120
|
+
* An `AppliableConstraint` is an abstraction of a constraint that can be applied
|
|
121
|
+
* to a Firestore query.
|
|
122
|
+
*/
|
|
123
|
+
declare abstract class AppliableConstraint {
|
|
124
|
+
/**
|
|
125
|
+
* Takes the provided {@link Query} and returns a copy of the {@link Query} with this
|
|
126
|
+
* {@link AppliableConstraint} applied.
|
|
127
|
+
*/
|
|
128
|
+
abstract _apply<T>(query: Query<T>): Query<T>;
|
|
129
|
+
}
|
|
130
|
+
|
|
117
131
|
/**
|
|
118
132
|
* Returns a special value that can be used with {@link (setDoc:1)} or {@link
|
|
119
133
|
* updateDoc:1} that tells the server to remove the given elements from any
|
|
@@ -572,7 +586,12 @@ declare interface ComponentConfiguration {
|
|
|
572
586
|
maxConcurrentLimboResolutions: number;
|
|
573
587
|
}
|
|
574
588
|
|
|
575
|
-
declare type CompositeFilterOp = 'OPERATOR_UNSPECIFIED' | 'AND';
|
|
589
|
+
declare type CompositeFilterOp = 'OPERATOR_UNSPECIFIED' | 'AND' | 'OR';
|
|
590
|
+
|
|
591
|
+
declare const enum CompositeOperator {
|
|
592
|
+
OR = "or",
|
|
593
|
+
AND = "and"
|
|
594
|
+
}
|
|
576
595
|
|
|
577
596
|
/**
|
|
578
597
|
* Modify this instance to communicate with the Cloud Firestore emulator.
|
|
@@ -1253,48 +1272,48 @@ export declare function enableMultiTabIndexedDbPersistence(firestore: Firestore)
|
|
|
1253
1272
|
export declare function enableNetwork(firestore: Firestore): Promise<void>;
|
|
1254
1273
|
|
|
1255
1274
|
/**
|
|
1256
|
-
* Creates a {@link
|
|
1257
|
-
* provided document (inclusive). The end position is relative to the order
|
|
1258
|
-
* the query. The document must contain all of the fields provided in the
|
|
1275
|
+
* Creates a {@link QueryEndAtConstraint} that modifies the result set to end at
|
|
1276
|
+
* the provided document (inclusive). The end position is relative to the order
|
|
1277
|
+
* of the query. The document must contain all of the fields provided in the
|
|
1259
1278
|
* orderBy of the query.
|
|
1260
1279
|
*
|
|
1261
1280
|
* @param snapshot - The snapshot of the document to end at.
|
|
1262
|
-
* @returns A {@link
|
|
1281
|
+
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
|
|
1263
1282
|
*/
|
|
1264
|
-
export declare function endAt(snapshot: DocumentSnapshot_2<unknown>):
|
|
1283
|
+
export declare function endAt(snapshot: DocumentSnapshot_2<unknown>): QueryEndAtConstraint;
|
|
1265
1284
|
|
|
1266
1285
|
/**
|
|
1267
|
-
* Creates a {@link
|
|
1268
|
-
* provided fields relative to the order of the query. The order of the field
|
|
1286
|
+
* Creates a {@link QueryEndAtConstraint} that modifies the result set to end at
|
|
1287
|
+
* the provided fields relative to the order of the query. The order of the field
|
|
1269
1288
|
* values must match the order of the order by clauses of the query.
|
|
1270
1289
|
*
|
|
1271
1290
|
* @param fieldValues - The field values to end this query at, in order
|
|
1272
1291
|
* of the query's order by.
|
|
1273
|
-
* @returns A {@link
|
|
1292
|
+
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
|
|
1274
1293
|
*/
|
|
1275
|
-
export declare function endAt(...fieldValues: unknown[]):
|
|
1294
|
+
export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;
|
|
1276
1295
|
|
|
1277
1296
|
/**
|
|
1278
|
-
* Creates a {@link
|
|
1279
|
-
* provided document (exclusive). The end position is relative to the
|
|
1280
|
-
* the query. The document must contain all of the fields provided in
|
|
1281
|
-
* orderBy of the query.
|
|
1297
|
+
* Creates a {@link QueryEndAtConstraint} that modifies the result set to end
|
|
1298
|
+
* before the provided document (exclusive). The end position is relative to the
|
|
1299
|
+
* order of the query. The document must contain all of the fields provided in
|
|
1300
|
+
* the orderBy of the query.
|
|
1282
1301
|
*
|
|
1283
1302
|
* @param snapshot - The snapshot of the document to end before.
|
|
1284
|
-
* @returns A {@link
|
|
1303
|
+
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
|
|
1285
1304
|
*/
|
|
1286
|
-
export declare function endBefore(snapshot: DocumentSnapshot_2<unknown>):
|
|
1305
|
+
export declare function endBefore(snapshot: DocumentSnapshot_2<unknown>): QueryEndAtConstraint;
|
|
1287
1306
|
|
|
1288
1307
|
/**
|
|
1289
|
-
* Creates a {@link
|
|
1290
|
-
* provided fields relative to the order of the query. The order of
|
|
1291
|
-
* values must match the order of the order by clauses of the query.
|
|
1308
|
+
* Creates a {@link QueryEndAtConstraint} that modifies the result set to end
|
|
1309
|
+
* before the provided fields relative to the order of the query. The order of
|
|
1310
|
+
* the field values must match the order of the order by clauses of the query.
|
|
1292
1311
|
*
|
|
1293
1312
|
* @param fieldValues - The field values to end this query before, in order
|
|
1294
1313
|
* of the query's order by.
|
|
1295
|
-
* @returns A {@link
|
|
1314
|
+
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
|
|
1296
1315
|
*/
|
|
1297
|
-
export declare function endBefore(...fieldValues: unknown[]):
|
|
1316
|
+
export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;
|
|
1298
1317
|
|
|
1299
1318
|
/* Excluded from this release type: ensureFirestoreConfigured */
|
|
1300
1319
|
|
|
@@ -1319,6 +1338,24 @@ declare interface EventManager {
|
|
|
1319
1338
|
|
|
1320
1339
|
/* Excluded from this release type: executeWrite */
|
|
1321
1340
|
|
|
1341
|
+
declare class FieldFilter extends Filter {
|
|
1342
|
+
readonly field: _FieldPath;
|
|
1343
|
+
readonly op: Operator;
|
|
1344
|
+
readonly value: Value;
|
|
1345
|
+
protected constructor(field: _FieldPath, op: Operator, value: Value);
|
|
1346
|
+
/**
|
|
1347
|
+
* Creates a filter based on the provided arguments.
|
|
1348
|
+
*/
|
|
1349
|
+
static create(field: _FieldPath, op: Operator, value: Value): FieldFilter;
|
|
1350
|
+
private static createKeyFieldInFilter;
|
|
1351
|
+
matches(doc: Document_2): boolean;
|
|
1352
|
+
protected matchesComparison(comparison: number): boolean;
|
|
1353
|
+
isInequality(): boolean;
|
|
1354
|
+
getFlattenedFilters(): readonly FieldFilter[];
|
|
1355
|
+
getFilters(): Filter[];
|
|
1356
|
+
getFirstInequalityField(): _FieldPath | null;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1322
1359
|
declare type FieldFilterOp = 'OPERATOR_UNSPECIFIED' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'EQUAL' | 'NOT_EQUAL' | 'ARRAY_CONTAINS' | 'IN' | 'ARRAY_CONTAINS_ANY' | 'NOT_IN';
|
|
1323
1360
|
|
|
1324
1361
|
/**
|
|
@@ -1445,6 +1482,9 @@ export declare abstract class FieldValue {
|
|
|
1445
1482
|
|
|
1446
1483
|
declare abstract class Filter {
|
|
1447
1484
|
abstract matches(doc: Document_2): boolean;
|
|
1485
|
+
abstract getFlattenedFilters(): readonly FieldFilter[];
|
|
1486
|
+
abstract getFilters(): Filter[];
|
|
1487
|
+
abstract getFirstInequalityField(): _FieldPath | null;
|
|
1448
1488
|
}
|
|
1449
1489
|
|
|
1450
1490
|
/* Excluded from this release type: _FirebaseService */
|
|
@@ -2625,23 +2665,25 @@ export declare function initializeFirestore(app: FirebaseApp, settings: Firestor
|
|
|
2625
2665
|
/* Excluded from this release type: _isBase64Available */
|
|
2626
2666
|
|
|
2627
2667
|
/**
|
|
2628
|
-
* Creates a {@link
|
|
2668
|
+
* Creates a {@link QueryLimitConstraint} that only returns the first matching
|
|
2669
|
+
* documents.
|
|
2629
2670
|
*
|
|
2630
2671
|
* @param limit - The maximum number of items to return.
|
|
2631
|
-
* @returns The created {@link
|
|
2672
|
+
* @returns The created {@link QueryLimitConstraint}.
|
|
2632
2673
|
*/
|
|
2633
|
-
export declare function limit(limit: number):
|
|
2674
|
+
export declare function limit(limit: number): QueryLimitConstraint;
|
|
2634
2675
|
|
|
2635
2676
|
/**
|
|
2636
|
-
* Creates a {@link
|
|
2677
|
+
* Creates a {@link QueryLimitConstraint} that only returns the last matching
|
|
2678
|
+
* documents.
|
|
2637
2679
|
*
|
|
2638
2680
|
* You must specify at least one `orderBy` clause for `limitToLast` queries,
|
|
2639
2681
|
* otherwise an exception will be thrown during execution.
|
|
2640
2682
|
*
|
|
2641
2683
|
* @param limit - The maximum number of items to return.
|
|
2642
|
-
* @returns The created {@link
|
|
2684
|
+
* @returns The created {@link QueryLimitConstraint}.
|
|
2643
2685
|
*/
|
|
2644
|
-
export declare function limitToLast(limit: number):
|
|
2686
|
+
export declare function limitToLast(limit: number): QueryLimitConstraint;
|
|
2645
2687
|
|
|
2646
2688
|
declare const enum LimitType {
|
|
2647
2689
|
First = "F",
|
|
@@ -3716,6 +3758,21 @@ export declare function onSnapshotsInSync(firestore: Firestore, observer: {
|
|
|
3716
3758
|
*/
|
|
3717
3759
|
export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe;
|
|
3718
3760
|
|
|
3761
|
+
declare const enum Operator {
|
|
3762
|
+
LESS_THAN = "<",
|
|
3763
|
+
LESS_THAN_OR_EQUAL = "<=",
|
|
3764
|
+
EQUAL = "==",
|
|
3765
|
+
NOT_EQUAL = "!=",
|
|
3766
|
+
GREATER_THAN = ">",
|
|
3767
|
+
GREATER_THAN_OR_EQUAL = ">=",
|
|
3768
|
+
ARRAY_CONTAINS = "array-contains",
|
|
3769
|
+
IN = "in",
|
|
3770
|
+
NOT_IN = "not-in",
|
|
3771
|
+
ARRAY_CONTAINS_ANY = "array-contains-any"
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
/* Excluded from this release type: or */
|
|
3775
|
+
|
|
3719
3776
|
/**
|
|
3720
3777
|
* An ordering on a field, in some Direction. Direction defaults to ASCENDING.
|
|
3721
3778
|
*/
|
|
@@ -3726,15 +3783,18 @@ declare class OrderBy {
|
|
|
3726
3783
|
}
|
|
3727
3784
|
|
|
3728
3785
|
/**
|
|
3729
|
-
* Creates a {@link
|
|
3786
|
+
* Creates a {@link QueryOrderByConstraint} that sorts the query result by the
|
|
3730
3787
|
* specified field, optionally in descending order instead of ascending.
|
|
3731
3788
|
*
|
|
3789
|
+
* Note: Documents that do not contain the specified field will not be present
|
|
3790
|
+
* in the query result.
|
|
3791
|
+
*
|
|
3732
3792
|
* @param fieldPath - The field to sort by.
|
|
3733
3793
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
3734
3794
|
* not specified, order will be ascending.
|
|
3735
|
-
* @returns The created {@link
|
|
3795
|
+
* @returns The created {@link QueryOrderByConstraint}.
|
|
3736
3796
|
*/
|
|
3737
|
-
export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection):
|
|
3797
|
+
export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint;
|
|
3738
3798
|
|
|
3739
3799
|
/**
|
|
3740
3800
|
* The direction of a {@link orderBy} clause is specified as 'desc' or 'asc'
|
|
@@ -4128,11 +4188,14 @@ export declare class Query<T = DocumentData> {
|
|
|
4128
4188
|
withConverter<U>(converter: FirestoreDataConverter_2<U>): Query<U>;
|
|
4129
4189
|
}
|
|
4130
4190
|
|
|
4191
|
+
/* Excluded declaration from this release type: query */
|
|
4192
|
+
|
|
4131
4193
|
/**
|
|
4132
|
-
* Creates a new immutable instance of {@link Query} that is extended to also
|
|
4133
|
-
* additional query constraints.
|
|
4194
|
+
* Creates a new immutable instance of {@link Query} that is extended to also
|
|
4195
|
+
* include additional query constraints.
|
|
4134
4196
|
*
|
|
4135
|
-
* @param query - The {@link Query} instance to use as a base for the new
|
|
4197
|
+
* @param query - The {@link Query} instance to use as a base for the new
|
|
4198
|
+
* constraints.
|
|
4136
4199
|
* @param queryConstraints - The list of {@link QueryConstraint}s to apply.
|
|
4137
4200
|
* @throws if any of the provided query constraints cannot be combined with the
|
|
4138
4201
|
* existing or new constraints.
|
|
@@ -4156,20 +4219,22 @@ declare interface Query_2 {
|
|
|
4156
4219
|
readonly endAt: Bound | null;
|
|
4157
4220
|
}
|
|
4158
4221
|
|
|
4222
|
+
/* Excluded from this release type: QueryCompositeFilterConstraint */
|
|
4223
|
+
|
|
4159
4224
|
/**
|
|
4160
4225
|
* A `QueryConstraint` is used to narrow the set of documents returned by a
|
|
4161
4226
|
* Firestore query. `QueryConstraint`s are created by invoking {@link where},
|
|
4162
|
-
* {@link orderBy}, {@link
|
|
4163
|
-
* endBefore
|
|
4227
|
+
* {@link orderBy}, {@link startAt}, {@link startAfter}, {@link
|
|
4228
|
+
* endBefore}, {@link endAt}, {@link limit}, {@link limitToLast} and
|
|
4164
4229
|
* can then be passed to {@link query} to create a new query instance that
|
|
4165
4230
|
* also contains this `QueryConstraint`.
|
|
4166
4231
|
*/
|
|
4167
|
-
export declare abstract class QueryConstraint {
|
|
4168
|
-
/** The type of this query
|
|
4232
|
+
export declare abstract class QueryConstraint extends AppliableConstraint {
|
|
4233
|
+
/** The type of this query constraint */
|
|
4169
4234
|
abstract readonly type: QueryConstraintType;
|
|
4170
4235
|
/**
|
|
4171
4236
|
* Takes the provided {@link Query} and returns a copy of the {@link Query} with this
|
|
4172
|
-
* {@link
|
|
4237
|
+
* {@link AppliableConstraint} applied.
|
|
4173
4238
|
*/
|
|
4174
4239
|
abstract _apply<T>(query: Query<T>): Query<T>;
|
|
4175
4240
|
}
|
|
@@ -4226,6 +4291,23 @@ declare class QueryDocumentSnapshot_2<T = DocumentData> extends DocumentSnapshot
|
|
|
4226
4291
|
data(): T;
|
|
4227
4292
|
}
|
|
4228
4293
|
|
|
4294
|
+
/**
|
|
4295
|
+
* A `QueryEndAtConstraint` is used to exclude documents from the end of a
|
|
4296
|
+
* result set returned by a Firestore query.
|
|
4297
|
+
* `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
|
|
4298
|
+
* {@link (endBefore:1)} and can then be passed to {@link query} to create a new
|
|
4299
|
+
* query instance that also contains this `QueryEndAtConstraint`.
|
|
4300
|
+
*/
|
|
4301
|
+
export declare class QueryEndAtConstraint extends QueryConstraint {
|
|
4302
|
+
/** The type of this query constraint */
|
|
4303
|
+
readonly type: 'endBefore' | 'endAt';
|
|
4304
|
+
private readonly _docOrFields;
|
|
4305
|
+
private readonly _inclusive;
|
|
4306
|
+
/* Excluded from this release type: __constructor */
|
|
4307
|
+
static _create(type: 'endBefore' | 'endAt', _docOrFields: Array<unknown | DocumentSnapshot_2<unknown>>, _inclusive: boolean): QueryEndAtConstraint;
|
|
4308
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
4309
|
+
}
|
|
4310
|
+
|
|
4229
4311
|
/**
|
|
4230
4312
|
* Returns true if the provided queries point to the same collection and apply
|
|
4231
4313
|
* the same constraints.
|
|
@@ -4237,6 +4319,74 @@ declare class QueryDocumentSnapshot_2<T = DocumentData> extends DocumentSnapshot
|
|
|
4237
4319
|
*/
|
|
4238
4320
|
export declare function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;
|
|
4239
4321
|
|
|
4322
|
+
/**
|
|
4323
|
+
* A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by
|
|
4324
|
+
* a Firestore query by filtering on one or more document fields.
|
|
4325
|
+
* `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then
|
|
4326
|
+
* be passed to {@link query} to create a new query instance that also contains
|
|
4327
|
+
* this `QueryFieldFilterConstraint`.
|
|
4328
|
+
*/
|
|
4329
|
+
export declare class QueryFieldFilterConstraint extends QueryConstraint {
|
|
4330
|
+
private readonly _field;
|
|
4331
|
+
private _op;
|
|
4332
|
+
private _value;
|
|
4333
|
+
/** The type of this query constraint */
|
|
4334
|
+
readonly type = "where";
|
|
4335
|
+
/* Excluded from this release type: __constructor */
|
|
4336
|
+
static _create(_field: _FieldPath, _op: Operator, _value: unknown): QueryFieldFilterConstraint;
|
|
4337
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
4338
|
+
_parse<T>(query: Query<T>): FieldFilter;
|
|
4339
|
+
}
|
|
4340
|
+
|
|
4341
|
+
/* Excluded from this release type: QueryFilterConstraint */
|
|
4342
|
+
|
|
4343
|
+
/**
|
|
4344
|
+
* A `QueryLimitConstraint` is used to limit the number of documents returned by
|
|
4345
|
+
* a Firestore query.
|
|
4346
|
+
* `QueryLimitConstraint`s are created by invoking {@link limit} or
|
|
4347
|
+
* {@link limitToLast} and can then be passed to {@link query} to create a new
|
|
4348
|
+
* query instance that also contains this `QueryLimitConstraint`.
|
|
4349
|
+
*/
|
|
4350
|
+
export declare class QueryLimitConstraint extends QueryConstraint {
|
|
4351
|
+
/** The type of this query constraint */
|
|
4352
|
+
readonly type: 'limit' | 'limitToLast';
|
|
4353
|
+
private readonly _limit;
|
|
4354
|
+
private readonly _limitType;
|
|
4355
|
+
/* Excluded from this release type: __constructor */
|
|
4356
|
+
static _create(type: 'limit' | 'limitToLast', _limit: number, _limitType: LimitType): QueryLimitConstraint;
|
|
4357
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
/**
|
|
4361
|
+
* `QueryNonFilterConstraint` is a helper union type that represents
|
|
4362
|
+
* QueryConstraints which are used to narrow or order the set of documents,
|
|
4363
|
+
* but that do not explicitly filter on a document field.
|
|
4364
|
+
* `QueryNonFilterConstraint`s are created by invoking {@link orderBy},
|
|
4365
|
+
* {@link startAt}, {@link startAfter}, {@link endBefore}, {@link endAt},
|
|
4366
|
+
* {@link limit} or {@link limitToLast} and can then be passed to {@link query}
|
|
4367
|
+
* to create a new query instance that also contains the `QueryConstraint`.
|
|
4368
|
+
*/
|
|
4369
|
+
export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;
|
|
4370
|
+
|
|
4371
|
+
/**
|
|
4372
|
+
* A `QueryOrderByConstraint` is used to sort the set of documents returned by a
|
|
4373
|
+
* Firestore query. `QueryOrderByConstraint`s are created by invoking
|
|
4374
|
+
* {@link orderBy} and can then be passed to {@link query} to create a new query
|
|
4375
|
+
* instance that also contains this `QueryOrderByConstraint`.
|
|
4376
|
+
*
|
|
4377
|
+
* Note: Documents that do not contain the orderBy field will not be present in
|
|
4378
|
+
* the query result.
|
|
4379
|
+
*/
|
|
4380
|
+
export declare class QueryOrderByConstraint extends QueryConstraint {
|
|
4381
|
+
private readonly _field;
|
|
4382
|
+
private _direction;
|
|
4383
|
+
/** The type of this query constraint */
|
|
4384
|
+
readonly type = "orderBy";
|
|
4385
|
+
/* Excluded from this release type: __constructor */
|
|
4386
|
+
static _create(_field: _FieldPath, _direction: Direction): QueryOrderByConstraint;
|
|
4387
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
4388
|
+
}
|
|
4389
|
+
|
|
4240
4390
|
/**
|
|
4241
4391
|
* A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects
|
|
4242
4392
|
* representing the results of a query. The documents can be accessed as an
|
|
@@ -4288,6 +4438,23 @@ export declare class QuerySnapshot<T = DocumentData> {
|
|
|
4288
4438
|
docChanges(options?: SnapshotListenOptions): Array<DocumentChange<T>>;
|
|
4289
4439
|
}
|
|
4290
4440
|
|
|
4441
|
+
/**
|
|
4442
|
+
* A `QueryStartAtConstraint` is used to exclude documents from the start of a
|
|
4443
|
+
* result set returned by a Firestore query.
|
|
4444
|
+
* `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or
|
|
4445
|
+
* {@link (startAfter:1)} and can then be passed to {@link query} to create a
|
|
4446
|
+
* new query instance that also contains this `QueryStartAtConstraint`.
|
|
4447
|
+
*/
|
|
4448
|
+
export declare class QueryStartAtConstraint extends QueryConstraint {
|
|
4449
|
+
/** The type of this query constraint */
|
|
4450
|
+
readonly type: 'startAt' | 'startAfter';
|
|
4451
|
+
private readonly _docOrFields;
|
|
4452
|
+
private readonly _inclusive;
|
|
4453
|
+
/* Excluded from this release type: __constructor */
|
|
4454
|
+
static _create(type: 'startAt' | 'startAfter', _docOrFields: Array<unknown | DocumentSnapshot_2<unknown>>, _inclusive: boolean): QueryStartAtConstraint;
|
|
4455
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
4456
|
+
}
|
|
4457
|
+
|
|
4291
4458
|
/** The different states of a watch target. */
|
|
4292
4459
|
declare type QueryTargetState = 'not-current' | 'current' | 'rejected';
|
|
4293
4460
|
|
|
@@ -5022,48 +5189,48 @@ declare class SortedSetIterator<T> {
|
|
|
5022
5189
|
}
|
|
5023
5190
|
|
|
5024
5191
|
/**
|
|
5025
|
-
* Creates a {@link
|
|
5026
|
-
* provided document (exclusive). The starting position is
|
|
5027
|
-
* of the query. The document must contain all of the
|
|
5028
|
-
* orderBy of the query.
|
|
5192
|
+
* Creates a {@link QueryStartAtConstraint} that modifies the result set to
|
|
5193
|
+
* start after the provided document (exclusive). The starting position is
|
|
5194
|
+
* relative to the order of the query. The document must contain all of the
|
|
5195
|
+
* fields provided in the orderBy of the query.
|
|
5029
5196
|
*
|
|
5030
5197
|
* @param snapshot - The snapshot of the document to start after.
|
|
5031
|
-
* @returns A {@link
|
|
5198
|
+
* @returns A {@link QueryStartAtConstraint} to pass to `query()`
|
|
5032
5199
|
*/
|
|
5033
|
-
export declare function startAfter(snapshot: DocumentSnapshot_2<unknown>):
|
|
5200
|
+
export declare function startAfter(snapshot: DocumentSnapshot_2<unknown>): QueryStartAtConstraint;
|
|
5034
5201
|
|
|
5035
5202
|
/**
|
|
5036
|
-
* Creates a {@link
|
|
5037
|
-
* provided fields relative to the order of the query. The order
|
|
5038
|
-
* values must match the order of the order by clauses of the query.
|
|
5203
|
+
* Creates a {@link QueryStartAtConstraint} that modifies the result set to
|
|
5204
|
+
* start after the provided fields relative to the order of the query. The order
|
|
5205
|
+
* of the field values must match the order of the order by clauses of the query.
|
|
5039
5206
|
*
|
|
5040
5207
|
* @param fieldValues - The field values to start this query after, in order
|
|
5041
5208
|
* of the query's order by.
|
|
5042
|
-
* @returns A {@link
|
|
5209
|
+
* @returns A {@link QueryStartAtConstraint} to pass to `query()`
|
|
5043
5210
|
*/
|
|
5044
|
-
export declare function startAfter(...fieldValues: unknown[]):
|
|
5211
|
+
export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;
|
|
5045
5212
|
|
|
5046
5213
|
/**
|
|
5047
|
-
* Creates a {@link
|
|
5048
|
-
* provided document (inclusive). The starting position is relative
|
|
5049
|
-
* of the query. The document must contain all of the fields
|
|
5050
|
-
* `orderBy` of this query.
|
|
5214
|
+
* Creates a {@link QueryStartAtConstraint} that modifies the result set to
|
|
5215
|
+
* start at the provided document (inclusive). The starting position is relative
|
|
5216
|
+
* to the order of the query. The document must contain all of the fields
|
|
5217
|
+
* provided in the `orderBy` of this query.
|
|
5051
5218
|
*
|
|
5052
5219
|
* @param snapshot - The snapshot of the document to start at.
|
|
5053
|
-
* @returns A {@link
|
|
5220
|
+
* @returns A {@link QueryStartAtConstraint} to pass to `query()`.
|
|
5054
5221
|
*/
|
|
5055
|
-
export declare function startAt(snapshot: DocumentSnapshot_2<unknown>):
|
|
5222
|
+
export declare function startAt(snapshot: DocumentSnapshot_2<unknown>): QueryStartAtConstraint;
|
|
5056
5223
|
|
|
5057
5224
|
/**
|
|
5058
|
-
* Creates a {@link
|
|
5059
|
-
* provided fields relative to the order of the query. The order of
|
|
5060
|
-
* values must match the order of the order by clauses of the query.
|
|
5225
|
+
* Creates a {@link QueryStartAtConstraint} that modifies the result set to
|
|
5226
|
+
* start at the provided fields relative to the order of the query. The order of
|
|
5227
|
+
* the field values must match the order of the order by clauses of the query.
|
|
5061
5228
|
*
|
|
5062
5229
|
* @param fieldValues - The field values to start this query at, in order
|
|
5063
5230
|
* of the query's order by.
|
|
5064
|
-
* @returns A {@link
|
|
5231
|
+
* @returns A {@link QueryStartAtConstraint} to pass to `query()`.
|
|
5065
5232
|
*/
|
|
5066
|
-
export declare function startAt(...fieldValues: unknown[]):
|
|
5233
|
+
export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;
|
|
5067
5234
|
|
|
5068
5235
|
declare type StructuredQuery = firestoreV1ApiClientInterfaces.StructuredQuery;
|
|
5069
5236
|
|
|
@@ -5945,17 +6112,17 @@ declare class ViewSnapshot {
|
|
|
5945
6112
|
export declare function waitForPendingWrites(firestore: Firestore): Promise<void>;
|
|
5946
6113
|
|
|
5947
6114
|
/**
|
|
5948
|
-
* Creates a {@link
|
|
5949
|
-
* specified field and that the value should satisfy the
|
|
5950
|
-
* provided.
|
|
6115
|
+
* Creates a {@link QueryFieldFilterConstraint} that enforces that documents
|
|
6116
|
+
* must contain the specified field and that the value should satisfy the
|
|
6117
|
+
* relation constraint provided.
|
|
5951
6118
|
*
|
|
5952
6119
|
* @param fieldPath - The path to compare
|
|
5953
6120
|
* @param opStr - The operation string (e.g "<", "<=", "==", "<",
|
|
5954
6121
|
* "<=", "!=").
|
|
5955
6122
|
* @param value - The value for comparison
|
|
5956
|
-
* @returns The created {@link
|
|
6123
|
+
* @returns The created {@link QueryFieldFilterConstraint}.
|
|
5957
6124
|
*/
|
|
5958
|
-
export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown):
|
|
6125
|
+
export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint;
|
|
5959
6126
|
|
|
5960
6127
|
/**
|
|
5961
6128
|
* Filter conditions in a {@link where} clause are specified using the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/firestore",
|
|
3
|
-
"version": "3.7.3-canary.
|
|
3
|
+
"version": "3.7.3-canary.7e237cd47",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=10.10.0"
|
|
6
6
|
},
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"test:all:ci": "run-p test:browser test:lite:browser test:travis",
|
|
31
31
|
"test:all": "run-p test:browser test:lite:browser test:travis test:minified",
|
|
32
32
|
"test:browser": "karma start --single-run",
|
|
33
|
+
"test:browser:emulator:debug": "karma start --browsers=Chrome --local",
|
|
34
|
+
"test:browser:emulator": "karma start --single-run --local",
|
|
33
35
|
"test:browser:unit": "karma start --single-run --unit",
|
|
34
36
|
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
|
|
35
37
|
"test:node": "node ./scripts/run-tests.js --main=test/register.ts --emulator 'test/{,!(browser|lite)/**/}*.test.ts'",
|
|
@@ -80,22 +82,22 @@
|
|
|
80
82
|
"lite/package.json"
|
|
81
83
|
],
|
|
82
84
|
"dependencies": {
|
|
83
|
-
"@firebase/component": "0.5.21-canary.
|
|
84
|
-
"@firebase/logger": "0.3.4-canary.
|
|
85
|
-
"@firebase/util": "1.7.3-canary.
|
|
86
|
-
"@firebase/webchannel-wrapper": "0.8.1-canary.
|
|
87
|
-
"@grpc/grpc-js": "
|
|
85
|
+
"@firebase/component": "0.5.21-canary.7e237cd47",
|
|
86
|
+
"@firebase/logger": "0.3.4-canary.7e237cd47",
|
|
87
|
+
"@firebase/util": "1.7.3-canary.7e237cd47",
|
|
88
|
+
"@firebase/webchannel-wrapper": "0.8.1-canary.7e237cd47",
|
|
89
|
+
"@grpc/grpc-js": "~1.7.0",
|
|
88
90
|
"@grpc/proto-loader": "^0.6.13",
|
|
89
91
|
"node-fetch": "2.6.7",
|
|
90
92
|
"tslib": "^2.1.0"
|
|
91
93
|
},
|
|
92
94
|
"peerDependencies": {
|
|
93
|
-
"@firebase/app": "0.8.4-canary.
|
|
95
|
+
"@firebase/app": "0.8.4-canary.7e237cd47"
|
|
94
96
|
},
|
|
95
97
|
"devDependencies": {
|
|
96
|
-
"@firebase/app": "0.8.4-canary.
|
|
97
|
-
"@firebase/app-compat": "0.1.39-canary.
|
|
98
|
-
"@firebase/auth": "0.20.11-canary.
|
|
98
|
+
"@firebase/app": "0.8.4-canary.7e237cd47",
|
|
99
|
+
"@firebase/app-compat": "0.1.39-canary.7e237cd47",
|
|
100
|
+
"@firebase/auth": "0.20.11-canary.7e237cd47",
|
|
99
101
|
"@rollup/plugin-alias": "3.1.9",
|
|
100
102
|
"@rollup/plugin-json": "4.1.0",
|
|
101
103
|
"@types/eslint": "7.29.0",
|
|
@@ -111,7 +113,7 @@
|
|
|
111
113
|
"rollup-plugin-terser": "7.0.2",
|
|
112
114
|
"rollup-plugin-typescript2": "0.31.2",
|
|
113
115
|
"ts-node": "10.9.1",
|
|
114
|
-
"typescript": "4.
|
|
116
|
+
"typescript": "4.7.4"
|
|
115
117
|
},
|
|
116
118
|
"repository": {
|
|
117
119
|
"directory": "packages/firestore",
|