@firebase/firestore 3.7.3 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- 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/local/local_documents_view.d.ts +0 -2
- package/dist/firestore/src/model/document.d.ts +8 -1
- 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 +2 -1
- package/dist/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +6 -2
- package/dist/firestore/test/util/test_platform.d.ts +2 -2
- package/dist/index.d.ts +138 -62
- package/dist/index.esm2017.js +4295 -3742
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +4981 -4410
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +1657 -889
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +1650 -890
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +4520 -3967
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +328 -68
- 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/local/local_documents_view.d.ts +0 -2
- package/dist/lite/firestore/src/model/document.d.ts +8 -1
- 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 +2 -1
- package/dist/lite/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +6 -2
- package/dist/lite/firestore/test/util/test_platform.d.ts +2 -2
- package/dist/lite/index.browser.esm2017.js +2091 -1793
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +2239 -2000
- 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 +2212 -1802
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +2205 -1803
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +2077 -1778
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +328 -66
- 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/local/local_documents_view.d.ts +0 -2
- package/dist/lite/packages/firestore/src/model/document.d.ts +8 -1
- 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 +2 -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 +6 -2
- package/dist/lite/packages/firestore/test/util/test_platform.d.ts +2 -2
- package/dist/lite/private.d.ts +240 -66
- 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/local/local_documents_view.d.ts +0 -2
- package/dist/packages/firestore/src/model/document.d.ts +8 -1
- 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 +2 -1
- package/dist/packages/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +6 -2
- package/dist/packages/firestore/test/util/test_platform.d.ts +2 -2
- package/dist/private.d.ts +240 -68
- package/package.json +13 -11
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -218,7 +218,7 @@ export interface SpecWatchEntity {
|
|
|
218
218
|
}
|
|
219
219
|
export interface SpecClientState {
|
|
220
220
|
/** The visibility state of the browser tab running the client. */
|
|
221
|
-
visibility?:
|
|
221
|
+
visibility?: DocumentVisibilityState;
|
|
222
222
|
/** Whether this tab should try to forcefully become primary. */
|
|
223
223
|
primary?: true;
|
|
224
224
|
}
|
|
@@ -262,6 +262,7 @@ export interface SpecQuery {
|
|
|
262
262
|
export interface SpecDocument {
|
|
263
263
|
key: string;
|
|
264
264
|
version: TestSnapshotVersion;
|
|
265
|
+
createTime: TestSnapshotVersion;
|
|
265
266
|
value: JsonObject<unknown> | null;
|
|
266
267
|
options?: DocumentOptions;
|
|
267
268
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -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';
|
|
@@ -47,7 +49,7 @@ export declare type TestSnapshotVersion = number;
|
|
|
47
49
|
export declare function testUserDataReader(useProto3Json?: boolean): UserDataReader;
|
|
48
50
|
export declare function version(v: TestSnapshotVersion): SnapshotVersion;
|
|
49
51
|
export declare function ref(key: string, offset?: number): DocumentReference;
|
|
50
|
-
export declare function doc(keyStr: string, ver: TestSnapshotVersion, jsonOrObjectValue: JsonObject<unknown> | ObjectValue): MutableDocument;
|
|
52
|
+
export declare function doc(keyStr: string, ver: TestSnapshotVersion, jsonOrObjectValue: JsonObject<unknown> | ObjectValue, createTime?: TestSnapshotVersion): MutableDocument;
|
|
51
53
|
export declare function deletedDoc(keyStr: string, ver: TestSnapshotVersion): MutableDocument;
|
|
52
54
|
export declare function unknownDoc(keyStr: string, ver: TestSnapshotVersion): MutableDocument;
|
|
53
55
|
export declare function removedDoc(keyStr: string): MutableDocument;
|
|
@@ -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/lite/private.d.ts
CHANGED
|
@@ -112,10 +112,24 @@ export declare type AggregateSpecData<T extends AggregateSpec> = {
|
|
|
112
112
|
[P in keyof T]: T[P] extends AggregateField<infer U> ? U : never;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
+
/* Excluded from this release type: and */
|
|
116
|
+
|
|
115
117
|
declare interface ApiClientObjectMap<T> {
|
|
116
118
|
[k: string]: T;
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
/**
|
|
122
|
+
* An `AppliableConstraint` is an abstraction of a constraint that can be applied
|
|
123
|
+
* to a Firestore query.
|
|
124
|
+
*/
|
|
125
|
+
declare abstract class AppliableConstraint {
|
|
126
|
+
/**
|
|
127
|
+
* Takes the provided {@link Query} and returns a copy of the {@link Query} with this
|
|
128
|
+
* {@link AppliableConstraint} applied.
|
|
129
|
+
*/
|
|
130
|
+
abstract _apply<T>(query: Query<T>): Query<T>;
|
|
131
|
+
}
|
|
132
|
+
|
|
119
133
|
/**
|
|
120
134
|
* Returns a special value that can be used with {@link (setDoc:1)} or {@link
|
|
121
135
|
* updateDoc:1} that tells the server to remove the given elements from any
|
|
@@ -412,7 +426,12 @@ export declare class CollectionReference<T = DocumentData> extends Query<T> {
|
|
|
412
426
|
withConverter(converter: null): CollectionReference<DocumentData>;
|
|
413
427
|
}
|
|
414
428
|
|
|
415
|
-
declare type CompositeFilterOp = 'OPERATOR_UNSPECIFIED' | 'AND';
|
|
429
|
+
declare type CompositeFilterOp = 'OPERATOR_UNSPECIFIED' | 'AND' | 'OR';
|
|
430
|
+
|
|
431
|
+
declare const enum CompositeOperator {
|
|
432
|
+
OR = "or",
|
|
433
|
+
AND = "and"
|
|
434
|
+
}
|
|
416
435
|
|
|
417
436
|
/**
|
|
418
437
|
* Modify this instance to communicate with the Cloud Firestore emulator.
|
|
@@ -623,6 +642,12 @@ declare interface Document_2 {
|
|
|
623
642
|
* `SnapshotVersion.min()` for documents created by the user.
|
|
624
643
|
*/
|
|
625
644
|
readonly readTime: SnapshotVersion;
|
|
645
|
+
/**
|
|
646
|
+
* The timestamp at which the document was created. This value increases
|
|
647
|
+
* monotonically when a document is deleted then recreated. It can also be
|
|
648
|
+
* compared to `createTime` of other documents and the `readTime` of a query.
|
|
649
|
+
*/
|
|
650
|
+
readonly createTime: SnapshotVersion;
|
|
626
651
|
/** The underlying data of this document or an empty value if no data exists. */
|
|
627
652
|
readonly data: ObjectValue;
|
|
628
653
|
/** Returns whether local mutations were applied via the mutation queue. */
|
|
@@ -785,48 +810,66 @@ export declare class DocumentSnapshot<T = DocumentData> {
|
|
|
785
810
|
export { EmulatorMockTokenOptions }
|
|
786
811
|
|
|
787
812
|
/**
|
|
788
|
-
* Creates a {@link
|
|
789
|
-
* provided document (inclusive). The end position is relative to the order
|
|
790
|
-
* the query. The document must contain all of the fields provided in the
|
|
813
|
+
* Creates a {@link QueryEndAtConstraint} that modifies the result set to end at
|
|
814
|
+
* the provided document (inclusive). The end position is relative to the order
|
|
815
|
+
* of the query. The document must contain all of the fields provided in the
|
|
791
816
|
* orderBy of the query.
|
|
792
817
|
*
|
|
793
818
|
* @param snapshot - The snapshot of the document to end at.
|
|
794
|
-
* @returns A {@link
|
|
819
|
+
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
|
|
795
820
|
*/
|
|
796
|
-
export declare function endAt(snapshot: DocumentSnapshot<unknown>):
|
|
821
|
+
export declare function endAt(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstraint;
|
|
797
822
|
|
|
798
823
|
/**
|
|
799
|
-
* Creates a {@link
|
|
800
|
-
* provided fields relative to the order of the query. The order of the field
|
|
824
|
+
* Creates a {@link QueryEndAtConstraint} that modifies the result set to end at
|
|
825
|
+
* the provided fields relative to the order of the query. The order of the field
|
|
801
826
|
* values must match the order of the order by clauses of the query.
|
|
802
827
|
*
|
|
803
828
|
* @param fieldValues - The field values to end this query at, in order
|
|
804
829
|
* of the query's order by.
|
|
805
|
-
* @returns A {@link
|
|
830
|
+
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
|
|
806
831
|
*/
|
|
807
|
-
export declare function endAt(...fieldValues: unknown[]):
|
|
832
|
+
export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;
|
|
808
833
|
|
|
809
834
|
/**
|
|
810
|
-
* Creates a {@link
|
|
811
|
-
* provided document (exclusive). The end position is relative to the
|
|
812
|
-
* the query. The document must contain all of the fields provided in
|
|
813
|
-
* orderBy of the query.
|
|
835
|
+
* Creates a {@link QueryEndAtConstraint} that modifies the result set to end
|
|
836
|
+
* before the provided document (exclusive). The end position is relative to the
|
|
837
|
+
* order of the query. The document must contain all of the fields provided in
|
|
838
|
+
* the orderBy of the query.
|
|
814
839
|
*
|
|
815
840
|
* @param snapshot - The snapshot of the document to end before.
|
|
816
|
-
* @returns A {@link
|
|
841
|
+
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
|
|
817
842
|
*/
|
|
818
|
-
export declare function endBefore(snapshot: DocumentSnapshot<unknown>):
|
|
843
|
+
export declare function endBefore(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstraint;
|
|
819
844
|
|
|
820
845
|
/**
|
|
821
|
-
* Creates a {@link
|
|
822
|
-
* provided fields relative to the order of the query. The order of
|
|
823
|
-
* values must match the order of the order by clauses of the query.
|
|
846
|
+
* Creates a {@link QueryEndAtConstraint} that modifies the result set to end
|
|
847
|
+
* before the provided fields relative to the order of the query. The order of
|
|
848
|
+
* the field values must match the order of the order by clauses of the query.
|
|
824
849
|
*
|
|
825
850
|
* @param fieldValues - The field values to end this query before, in order
|
|
826
851
|
* of the query's order by.
|
|
827
|
-
* @returns A {@link
|
|
852
|
+
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
|
|
828
853
|
*/
|
|
829
|
-
export declare function endBefore(...fieldValues: unknown[]):
|
|
854
|
+
export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;
|
|
855
|
+
|
|
856
|
+
declare class FieldFilter extends Filter {
|
|
857
|
+
readonly field: FieldPath_2;
|
|
858
|
+
readonly op: Operator;
|
|
859
|
+
readonly value: Value;
|
|
860
|
+
protected constructor(field: FieldPath_2, op: Operator, value: Value);
|
|
861
|
+
/**
|
|
862
|
+
* Creates a filter based on the provided arguments.
|
|
863
|
+
*/
|
|
864
|
+
static create(field: FieldPath_2, op: Operator, value: Value): FieldFilter;
|
|
865
|
+
private static createKeyFieldInFilter;
|
|
866
|
+
matches(doc: Document_2): boolean;
|
|
867
|
+
protected matchesComparison(comparison: number): boolean;
|
|
868
|
+
isInequality(): boolean;
|
|
869
|
+
getFlattenedFilters(): readonly FieldFilter[];
|
|
870
|
+
getFilters(): Filter[];
|
|
871
|
+
getFirstInequalityField(): FieldPath_2 | null;
|
|
872
|
+
}
|
|
830
873
|
|
|
831
874
|
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';
|
|
832
875
|
|
|
@@ -915,6 +958,9 @@ export declare abstract class FieldValue {
|
|
|
915
958
|
|
|
916
959
|
declare abstract class Filter {
|
|
917
960
|
abstract matches(doc: Document_2): boolean;
|
|
961
|
+
abstract getFlattenedFilters(): readonly FieldFilter[];
|
|
962
|
+
abstract getFilters(): Filter[];
|
|
963
|
+
abstract getFirstInequalityField(): FieldPath_2 | null;
|
|
918
964
|
}
|
|
919
965
|
|
|
920
966
|
/* Excluded from this release type: _FirebaseService */
|
|
@@ -1611,23 +1657,25 @@ export declare function initializeFirestore(app: FirebaseApp, settings: Settings
|
|
|
1611
1657
|
/* Excluded declaration from this release type: initializeFirestore */
|
|
1612
1658
|
|
|
1613
1659
|
/**
|
|
1614
|
-
* Creates a {@link
|
|
1660
|
+
* Creates a {@link QueryLimitConstraint} that only returns the first matching
|
|
1661
|
+
* documents.
|
|
1615
1662
|
*
|
|
1616
1663
|
* @param limit - The maximum number of items to return.
|
|
1617
|
-
* @returns The created {@link
|
|
1664
|
+
* @returns The created {@link QueryLimitConstraint}.
|
|
1618
1665
|
*/
|
|
1619
|
-
export declare function limit(limit: number):
|
|
1666
|
+
export declare function limit(limit: number): QueryLimitConstraint;
|
|
1620
1667
|
|
|
1621
1668
|
/**
|
|
1622
|
-
* Creates a {@link
|
|
1669
|
+
* Creates a {@link QueryLimitConstraint} that only returns the last matching
|
|
1670
|
+
* documents.
|
|
1623
1671
|
*
|
|
1624
1672
|
* You must specify at least one `orderBy` clause for `limitToLast` queries,
|
|
1625
1673
|
* otherwise an exception will be thrown during execution.
|
|
1626
1674
|
*
|
|
1627
1675
|
* @param limit - The maximum number of items to return.
|
|
1628
|
-
* @returns The created {@link
|
|
1676
|
+
* @returns The created {@link QueryLimitConstraint}.
|
|
1629
1677
|
*/
|
|
1630
|
-
export declare function limitToLast(limit: number):
|
|
1678
|
+
export declare function limitToLast(limit: number): QueryLimitConstraint;
|
|
1631
1679
|
|
|
1632
1680
|
declare const enum LimitType {
|
|
1633
1681
|
First = "F",
|
|
@@ -1652,6 +1700,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
1652
1700
|
private documentType;
|
|
1653
1701
|
version: SnapshotVersion;
|
|
1654
1702
|
readTime: SnapshotVersion;
|
|
1703
|
+
createTime: SnapshotVersion;
|
|
1655
1704
|
data: ObjectValue;
|
|
1656
1705
|
private documentState;
|
|
1657
1706
|
private constructor();
|
|
@@ -1664,7 +1713,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
1664
1713
|
* Creates a new document that is known to exist with the given data at the
|
|
1665
1714
|
* given version.
|
|
1666
1715
|
*/
|
|
1667
|
-
static newFoundDocument(documentKey: DocumentKey, version: SnapshotVersion, value: ObjectValue): MutableDocument;
|
|
1716
|
+
static newFoundDocument(documentKey: DocumentKey, version: SnapshotVersion, createTime: SnapshotVersion, value: ObjectValue): MutableDocument;
|
|
1668
1717
|
/** Creates a new document that is known to not exist at the given version. */
|
|
1669
1718
|
static newNoDocument(documentKey: DocumentKey, version: SnapshotVersion): MutableDocument;
|
|
1670
1719
|
/**
|
|
@@ -1830,6 +1879,21 @@ declare class ObjectValue {
|
|
|
1830
1879
|
clone(): ObjectValue;
|
|
1831
1880
|
}
|
|
1832
1881
|
|
|
1882
|
+
declare const enum Operator {
|
|
1883
|
+
LESS_THAN = "<",
|
|
1884
|
+
LESS_THAN_OR_EQUAL = "<=",
|
|
1885
|
+
EQUAL = "==",
|
|
1886
|
+
NOT_EQUAL = "!=",
|
|
1887
|
+
GREATER_THAN = ">",
|
|
1888
|
+
GREATER_THAN_OR_EQUAL = ">=",
|
|
1889
|
+
ARRAY_CONTAINS = "array-contains",
|
|
1890
|
+
IN = "in",
|
|
1891
|
+
NOT_IN = "not-in",
|
|
1892
|
+
ARRAY_CONTAINS_ANY = "array-contains-any"
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
/* Excluded from this release type: or */
|
|
1896
|
+
|
|
1833
1897
|
/**
|
|
1834
1898
|
* An ordering on a field, in some Direction. Direction defaults to ASCENDING.
|
|
1835
1899
|
*/
|
|
@@ -1840,15 +1904,18 @@ declare class OrderBy {
|
|
|
1840
1904
|
}
|
|
1841
1905
|
|
|
1842
1906
|
/**
|
|
1843
|
-
* Creates a {@link
|
|
1907
|
+
* Creates a {@link QueryOrderByConstraint} that sorts the query result by the
|
|
1844
1908
|
* specified field, optionally in descending order instead of ascending.
|
|
1845
1909
|
*
|
|
1910
|
+
* Note: Documents that do not contain the specified field will not be present
|
|
1911
|
+
* in the query result.
|
|
1912
|
+
*
|
|
1846
1913
|
* @param fieldPath - The field to sort by.
|
|
1847
1914
|
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
|
|
1848
1915
|
* not specified, order will be ascending.
|
|
1849
|
-
* @returns The created {@link
|
|
1916
|
+
* @returns The created {@link QueryOrderByConstraint}.
|
|
1850
1917
|
*/
|
|
1851
|
-
export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection):
|
|
1918
|
+
export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint;
|
|
1852
1919
|
|
|
1853
1920
|
/**
|
|
1854
1921
|
* The direction of a {@link orderBy} clause is specified as 'desc' or 'asc'
|
|
@@ -1973,11 +2040,14 @@ export declare class Query<T = DocumentData> {
|
|
|
1973
2040
|
withConverter<U>(converter: FirestoreDataConverter<U>): Query<U>;
|
|
1974
2041
|
}
|
|
1975
2042
|
|
|
2043
|
+
/* Excluded declaration from this release type: query */
|
|
2044
|
+
|
|
1976
2045
|
/**
|
|
1977
|
-
* Creates a new immutable instance of {@link Query} that is extended to also
|
|
1978
|
-
* additional query constraints.
|
|
2046
|
+
* Creates a new immutable instance of {@link Query} that is extended to also
|
|
2047
|
+
* include additional query constraints.
|
|
1979
2048
|
*
|
|
1980
|
-
* @param query - The {@link Query} instance to use as a base for the new
|
|
2049
|
+
* @param query - The {@link Query} instance to use as a base for the new
|
|
2050
|
+
* constraints.
|
|
1981
2051
|
* @param queryConstraints - The list of {@link QueryConstraint}s to apply.
|
|
1982
2052
|
* @throws if any of the provided query constraints cannot be combined with the
|
|
1983
2053
|
* existing or new constraints.
|
|
@@ -2001,20 +2071,22 @@ declare interface Query_2 {
|
|
|
2001
2071
|
readonly endAt: Bound | null;
|
|
2002
2072
|
}
|
|
2003
2073
|
|
|
2074
|
+
/* Excluded from this release type: QueryCompositeFilterConstraint */
|
|
2075
|
+
|
|
2004
2076
|
/**
|
|
2005
2077
|
* A `QueryConstraint` is used to narrow the set of documents returned by a
|
|
2006
2078
|
* Firestore query. `QueryConstraint`s are created by invoking {@link where},
|
|
2007
|
-
* {@link orderBy}, {@link
|
|
2008
|
-
* endBefore
|
|
2079
|
+
* {@link orderBy}, {@link startAt}, {@link startAfter}, {@link
|
|
2080
|
+
* endBefore}, {@link endAt}, {@link limit}, {@link limitToLast} and
|
|
2009
2081
|
* can then be passed to {@link query} to create a new query instance that
|
|
2010
2082
|
* also contains this `QueryConstraint`.
|
|
2011
2083
|
*/
|
|
2012
|
-
export declare abstract class QueryConstraint {
|
|
2013
|
-
/** The type of this query
|
|
2084
|
+
export declare abstract class QueryConstraint extends AppliableConstraint {
|
|
2085
|
+
/** The type of this query constraint */
|
|
2014
2086
|
abstract readonly type: QueryConstraintType;
|
|
2015
2087
|
/**
|
|
2016
2088
|
* Takes the provided {@link Query} and returns a copy of the {@link Query} with this
|
|
2017
|
-
* {@link
|
|
2089
|
+
* {@link AppliableConstraint} applied.
|
|
2018
2090
|
*/
|
|
2019
2091
|
abstract _apply<T>(query: Query<T>): Query<T>;
|
|
2020
2092
|
}
|
|
@@ -2043,6 +2115,23 @@ export declare class QueryDocumentSnapshot<T = DocumentData> extends DocumentSna
|
|
|
2043
2115
|
data(): T;
|
|
2044
2116
|
}
|
|
2045
2117
|
|
|
2118
|
+
/**
|
|
2119
|
+
* A `QueryEndAtConstraint` is used to exclude documents from the end of a
|
|
2120
|
+
* result set returned by a Firestore query.
|
|
2121
|
+
* `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
|
|
2122
|
+
* {@link (endBefore:1)} and can then be passed to {@link query} to create a new
|
|
2123
|
+
* query instance that also contains this `QueryEndAtConstraint`.
|
|
2124
|
+
*/
|
|
2125
|
+
export declare class QueryEndAtConstraint extends QueryConstraint {
|
|
2126
|
+
/** The type of this query constraint */
|
|
2127
|
+
readonly type: 'endBefore' | 'endAt';
|
|
2128
|
+
private readonly _docOrFields;
|
|
2129
|
+
private readonly _inclusive;
|
|
2130
|
+
/* Excluded from this release type: __constructor */
|
|
2131
|
+
static _create(type: 'endBefore' | 'endAt', _docOrFields: Array<unknown | DocumentSnapshot<unknown>>, _inclusive: boolean): QueryEndAtConstraint;
|
|
2132
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2046
2135
|
/**
|
|
2047
2136
|
* Returns true if the provided queries point to the same collection and apply
|
|
2048
2137
|
* the same constraints.
|
|
@@ -2054,6 +2143,74 @@ export declare class QueryDocumentSnapshot<T = DocumentData> extends DocumentSna
|
|
|
2054
2143
|
*/
|
|
2055
2144
|
export declare function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;
|
|
2056
2145
|
|
|
2146
|
+
/**
|
|
2147
|
+
* A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by
|
|
2148
|
+
* a Firestore query by filtering on one or more document fields.
|
|
2149
|
+
* `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then
|
|
2150
|
+
* be passed to {@link query} to create a new query instance that also contains
|
|
2151
|
+
* this `QueryFieldFilterConstraint`.
|
|
2152
|
+
*/
|
|
2153
|
+
export declare class QueryFieldFilterConstraint extends QueryConstraint {
|
|
2154
|
+
private readonly _field;
|
|
2155
|
+
private _op;
|
|
2156
|
+
private _value;
|
|
2157
|
+
/** The type of this query constraint */
|
|
2158
|
+
readonly type = "where";
|
|
2159
|
+
/* Excluded from this release type: __constructor */
|
|
2160
|
+
static _create(_field: FieldPath_2, _op: Operator, _value: unknown): QueryFieldFilterConstraint;
|
|
2161
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
2162
|
+
_parse<T>(query: Query<T>): FieldFilter;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
/* Excluded from this release type: QueryFilterConstraint */
|
|
2166
|
+
|
|
2167
|
+
/**
|
|
2168
|
+
* A `QueryLimitConstraint` is used to limit the number of documents returned by
|
|
2169
|
+
* a Firestore query.
|
|
2170
|
+
* `QueryLimitConstraint`s are created by invoking {@link limit} or
|
|
2171
|
+
* {@link limitToLast} and can then be passed to {@link query} to create a new
|
|
2172
|
+
* query instance that also contains this `QueryLimitConstraint`.
|
|
2173
|
+
*/
|
|
2174
|
+
export declare class QueryLimitConstraint extends QueryConstraint {
|
|
2175
|
+
/** The type of this query constraint */
|
|
2176
|
+
readonly type: 'limit' | 'limitToLast';
|
|
2177
|
+
private readonly _limit;
|
|
2178
|
+
private readonly _limitType;
|
|
2179
|
+
/* Excluded from this release type: __constructor */
|
|
2180
|
+
static _create(type: 'limit' | 'limitToLast', _limit: number, _limitType: LimitType): QueryLimitConstraint;
|
|
2181
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
/**
|
|
2185
|
+
* `QueryNonFilterConstraint` is a helper union type that represents
|
|
2186
|
+
* QueryConstraints which are used to narrow or order the set of documents,
|
|
2187
|
+
* but that do not explicitly filter on a document field.
|
|
2188
|
+
* `QueryNonFilterConstraint`s are created by invoking {@link orderBy},
|
|
2189
|
+
* {@link startAt}, {@link startAfter}, {@link endBefore}, {@link endAt},
|
|
2190
|
+
* {@link limit} or {@link limitToLast} and can then be passed to {@link query}
|
|
2191
|
+
* to create a new query instance that also contains the `QueryConstraint`.
|
|
2192
|
+
*/
|
|
2193
|
+
export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* A `QueryOrderByConstraint` is used to sort the set of documents returned by a
|
|
2197
|
+
* Firestore query. `QueryOrderByConstraint`s are created by invoking
|
|
2198
|
+
* {@link orderBy} and can then be passed to {@link query} to create a new query
|
|
2199
|
+
* instance that also contains this `QueryOrderByConstraint`.
|
|
2200
|
+
*
|
|
2201
|
+
* Note: Documents that do not contain the orderBy field will not be present in
|
|
2202
|
+
* the query result.
|
|
2203
|
+
*/
|
|
2204
|
+
export declare class QueryOrderByConstraint extends QueryConstraint {
|
|
2205
|
+
private readonly _field;
|
|
2206
|
+
private _direction;
|
|
2207
|
+
/** The type of this query constraint */
|
|
2208
|
+
readonly type = "orderBy";
|
|
2209
|
+
/* Excluded from this release type: __constructor */
|
|
2210
|
+
static _create(_field: FieldPath_2, _direction: Direction): QueryOrderByConstraint;
|
|
2211
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2057
2214
|
/**
|
|
2058
2215
|
* A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects
|
|
2059
2216
|
* representing the results of a query. The documents can be accessed as an
|
|
@@ -2086,6 +2243,23 @@ export declare class QuerySnapshot<T = DocumentData> {
|
|
|
2086
2243
|
forEach(callback: (result: QueryDocumentSnapshot<T>) => void, thisArg?: unknown): void;
|
|
2087
2244
|
}
|
|
2088
2245
|
|
|
2246
|
+
/**
|
|
2247
|
+
* A `QueryStartAtConstraint` is used to exclude documents from the start of a
|
|
2248
|
+
* result set returned by a Firestore query.
|
|
2249
|
+
* `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or
|
|
2250
|
+
* {@link (startAfter:1)} and can then be passed to {@link query} to create a
|
|
2251
|
+
* new query instance that also contains this `QueryStartAtConstraint`.
|
|
2252
|
+
*/
|
|
2253
|
+
export declare class QueryStartAtConstraint extends QueryConstraint {
|
|
2254
|
+
/** The type of this query constraint */
|
|
2255
|
+
readonly type: 'startAt' | 'startAfter';
|
|
2256
|
+
private readonly _docOrFields;
|
|
2257
|
+
private readonly _inclusive;
|
|
2258
|
+
/* Excluded from this release type: __constructor */
|
|
2259
|
+
static _create(type: 'startAt' | 'startAfter', _docOrFields: Array<unknown | DocumentSnapshot<unknown>>, _inclusive: boolean): QueryStartAtConstraint;
|
|
2260
|
+
_apply<T>(query: Query<T>): Query<T>;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2089
2263
|
/**
|
|
2090
2264
|
* Returns true if the provided references are equal.
|
|
2091
2265
|
*
|
|
@@ -2245,48 +2419,48 @@ declare class SnapshotVersion {
|
|
|
2245
2419
|
}
|
|
2246
2420
|
|
|
2247
2421
|
/**
|
|
2248
|
-
* Creates a {@link
|
|
2249
|
-
* provided document (exclusive). The starting position is
|
|
2250
|
-
* of the query. The document must contain all of the
|
|
2251
|
-
* orderBy of the query.
|
|
2422
|
+
* Creates a {@link QueryStartAtConstraint} that modifies the result set to
|
|
2423
|
+
* start after the provided document (exclusive). The starting position is
|
|
2424
|
+
* relative to the order of the query. The document must contain all of the
|
|
2425
|
+
* fields provided in the orderBy of the query.
|
|
2252
2426
|
*
|
|
2253
2427
|
* @param snapshot - The snapshot of the document to start after.
|
|
2254
|
-
* @returns A {@link
|
|
2428
|
+
* @returns A {@link QueryStartAtConstraint} to pass to `query()`
|
|
2255
2429
|
*/
|
|
2256
|
-
export declare function startAfter(snapshot: DocumentSnapshot<unknown>):
|
|
2430
|
+
export declare function startAfter(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
|
|
2257
2431
|
|
|
2258
2432
|
/**
|
|
2259
|
-
* Creates a {@link
|
|
2260
|
-
* provided fields relative to the order of the query. The order
|
|
2261
|
-
* values must match the order of the order by clauses of the query.
|
|
2433
|
+
* Creates a {@link QueryStartAtConstraint} that modifies the result set to
|
|
2434
|
+
* start after the provided fields relative to the order of the query. The order
|
|
2435
|
+
* of the field values must match the order of the order by clauses of the query.
|
|
2262
2436
|
*
|
|
2263
2437
|
* @param fieldValues - The field values to start this query after, in order
|
|
2264
2438
|
* of the query's order by.
|
|
2265
|
-
* @returns A {@link
|
|
2439
|
+
* @returns A {@link QueryStartAtConstraint} to pass to `query()`
|
|
2266
2440
|
*/
|
|
2267
|
-
export declare function startAfter(...fieldValues: unknown[]):
|
|
2441
|
+
export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;
|
|
2268
2442
|
|
|
2269
2443
|
/**
|
|
2270
|
-
* Creates a {@link
|
|
2271
|
-
* provided document (inclusive). The starting position is relative
|
|
2272
|
-
* of the query. The document must contain all of the fields
|
|
2273
|
-
* `orderBy` of this query.
|
|
2444
|
+
* Creates a {@link QueryStartAtConstraint} that modifies the result set to
|
|
2445
|
+
* start at the provided document (inclusive). The starting position is relative
|
|
2446
|
+
* to the order of the query. The document must contain all of the fields
|
|
2447
|
+
* provided in the `orderBy` of this query.
|
|
2274
2448
|
*
|
|
2275
2449
|
* @param snapshot - The snapshot of the document to start at.
|
|
2276
|
-
* @returns A {@link
|
|
2450
|
+
* @returns A {@link QueryStartAtConstraint} to pass to `query()`.
|
|
2277
2451
|
*/
|
|
2278
|
-
export declare function startAt(snapshot: DocumentSnapshot<unknown>):
|
|
2452
|
+
export declare function startAt(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
|
|
2279
2453
|
|
|
2280
2454
|
/**
|
|
2281
|
-
* Creates a {@link
|
|
2282
|
-
* provided fields relative to the order of the query. The order of
|
|
2283
|
-
* values must match the order of the order by clauses of the query.
|
|
2455
|
+
* Creates a {@link QueryStartAtConstraint} that modifies the result set to
|
|
2456
|
+
* start at the provided fields relative to the order of the query. The order of
|
|
2457
|
+
* the field values must match the order of the order by clauses of the query.
|
|
2284
2458
|
*
|
|
2285
2459
|
* @param fieldValues - The field values to start this query at, in order
|
|
2286
2460
|
* of the query's order by.
|
|
2287
|
-
* @returns A {@link
|
|
2461
|
+
* @returns A {@link QueryStartAtConstraint} to pass to `query()`.
|
|
2288
2462
|
*/
|
|
2289
|
-
export declare function startAt(...fieldValues: unknown[]):
|
|
2463
|
+
export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;
|
|
2290
2464
|
|
|
2291
2465
|
declare type TargetChangeTargetChangeType = 'NO_CHANGE' | 'ADD' | 'REMOVE' | 'CURRENT' | 'RESET';
|
|
2292
2466
|
|
|
@@ -2774,17 +2948,17 @@ declare type Value = firestoreV1ApiClientInterfaces.Value;
|
|
|
2774
2948
|
declare type ValueNullValue = 'NULL_VALUE';
|
|
2775
2949
|
|
|
2776
2950
|
/**
|
|
2777
|
-
* Creates a {@link
|
|
2778
|
-
* specified field and that the value should satisfy the
|
|
2779
|
-
* provided.
|
|
2951
|
+
* Creates a {@link QueryFieldFilterConstraint} that enforces that documents
|
|
2952
|
+
* must contain the specified field and that the value should satisfy the
|
|
2953
|
+
* relation constraint provided.
|
|
2780
2954
|
*
|
|
2781
2955
|
* @param fieldPath - The path to compare
|
|
2782
2956
|
* @param opStr - The operation string (e.g "<", "<=", "==", "<",
|
|
2783
2957
|
* "<=", "!=").
|
|
2784
2958
|
* @param value - The value for comparison
|
|
2785
|
-
* @returns The created {@link
|
|
2959
|
+
* @returns The created {@link QueryFieldFilterConstraint}.
|
|
2786
2960
|
*/
|
|
2787
|
-
export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown):
|
|
2961
|
+
export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint;
|
|
2788
2962
|
|
|
2789
2963
|
/**
|
|
2790
2964
|
* Filter conditions in a {@link where} clause are specified using the
|