@firebase/firestore 3.4.1-canary.31db4b706 → 3.4.1-canary.3d8109ca3
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/src/index/directional_index_byte_encoder.d.ts +24 -0
- package/dist/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
- package/dist/firestore/src/index/index_byte_encoder.d.ts +14 -0
- package/dist/firestore/src/index/ordered_code_writer.d.ts +14 -0
- package/dist/firestore/src/lite-api/reference.d.ts +4 -2
- package/dist/firestore/src/lite-api/reference_impl.d.ts +5 -0
- package/dist/firestore/src/lite-api/transaction.d.ts +4 -0
- package/dist/firestore/src/lite-api/write_batch.d.ts +3 -0
- package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +5 -0
- package/dist/firestore/src/model/collections.d.ts +0 -4
- package/dist/firestore/src/model/document.d.ts +3 -1
- package/dist/firestore/src/model/values.d.ts +3 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.esm2017.js +10 -8
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +10 -8
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +13 -7
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +13 -7
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +854 -852
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +15 -3
- package/dist/lite/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
- package/dist/lite/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
- package/dist/lite/firestore/src/index/index_byte_encoder.d.ts +14 -0
- package/dist/lite/firestore/src/index/ordered_code_writer.d.ts +14 -0
- package/dist/lite/firestore/src/lite-api/reference.d.ts +4 -2
- package/dist/lite/firestore/src/lite-api/reference_impl.d.ts +5 -0
- package/dist/lite/firestore/src/lite-api/transaction.d.ts +4 -0
- package/dist/lite/firestore/src/lite-api/write_batch.d.ts +3 -0
- package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +5 -0
- package/dist/lite/firestore/src/model/collections.d.ts +0 -4
- package/dist/lite/firestore/src/model/document.d.ts +3 -1
- package/dist/lite/firestore/src/model/values.d.ts +3 -0
- package/dist/lite/index.browser.esm2017.js +6 -3
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +6 -3
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +16 -2
- package/dist/lite/index.node.cjs.js +10 -3
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +10 -3
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +6 -3
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +83 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +1 -0
- package/dist/lite/packages/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
- package/dist/lite/packages/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
- package/dist/lite/packages/firestore/src/index/index_byte_encoder.d.ts +14 -0
- package/dist/lite/packages/firestore/src/index/ordered_code_writer.d.ts +14 -0
- package/dist/lite/packages/firestore/src/lite-api/reference.d.ts +4 -2
- package/dist/lite/packages/firestore/src/lite-api/reference_impl.d.ts +5 -0
- package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +4 -0
- package/dist/lite/packages/firestore/src/lite-api/write_batch.d.ts +3 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +5 -0
- package/dist/lite/packages/firestore/src/model/collections.d.ts +0 -4
- package/dist/lite/packages/firestore/src/model/document.d.ts +3 -1
- package/dist/lite/packages/firestore/src/model/values.d.ts +3 -0
- package/dist/lite/private.d.ts +83 -2
- package/dist/packages/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
- package/dist/packages/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
- package/dist/packages/firestore/src/index/index_byte_encoder.d.ts +14 -0
- package/dist/packages/firestore/src/index/ordered_code_writer.d.ts +14 -0
- package/dist/packages/firestore/src/lite-api/reference.d.ts +4 -2
- package/dist/packages/firestore/src/lite-api/reference_impl.d.ts +5 -0
- package/dist/packages/firestore/src/lite-api/transaction.d.ts +4 -0
- package/dist/packages/firestore/src/lite-api/write_batch.d.ts +3 -0
- package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +5 -0
- package/dist/packages/firestore/src/model/collections.d.ts +0 -4
- package/dist/packages/firestore/src/model/document.d.ts +3 -1
- package/dist/packages/firestore/src/model/values.d.ts +3 -0
- package/dist/private.d.ts +15 -3
- package/package.json +9 -9
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
import { ByteString } from '../util/byte_string';
|
|
18
|
+
/** An index value encoder. */
|
|
19
|
+
export interface DirectionalIndexByteEncoder {
|
|
20
|
+
writeBytes(value: ByteString): void;
|
|
21
|
+
writeString(value: string): void;
|
|
22
|
+
writeNumber(value: number): void;
|
|
23
|
+
writeInfinity(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
import { Value } from '../protos/firestore_proto_api';
|
|
18
|
+
import { DirectionalIndexByteEncoder } from './directional_index_byte_encoder';
|
|
19
|
+
/** Firestore index value writer. */
|
|
20
|
+
export declare class FirestoreIndexValueWriter {
|
|
21
|
+
static INSTANCE: FirestoreIndexValueWriter;
|
|
22
|
+
private constructor();
|
|
23
|
+
/** Writes an index value. */
|
|
24
|
+
writeIndexValue(value: Value, encoder: DirectionalIndexByteEncoder): void;
|
|
25
|
+
private writeIndexValueAux;
|
|
26
|
+
private writeIndexString;
|
|
27
|
+
private writeUnlabeledIndexString;
|
|
28
|
+
private writeIndexMap;
|
|
29
|
+
private writeIndexArray;
|
|
30
|
+
private writeIndexEntityRef;
|
|
31
|
+
private writeValueTypeLabel;
|
|
32
|
+
private writeTruncationMarker;
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DirectionalIndexByteEncoder } from './directional_index_byte_encoder';
|
|
2
|
+
/**
|
|
3
|
+
* Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the
|
|
4
|
+
* actual encoding.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IndexByteEncoder {
|
|
7
|
+
private orderedCode;
|
|
8
|
+
private ascending;
|
|
9
|
+
private descending;
|
|
10
|
+
seed(encodedBytes: Uint8Array): void;
|
|
11
|
+
forKind(kind: 'asc' | 'desc'): DirectionalIndexByteEncoder;
|
|
12
|
+
encodedBytes(): Uint8Array;
|
|
13
|
+
reset(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ByteString } from '../util/byte_string';
|
|
2
|
+
export declare class OrderedCodeWriter {
|
|
3
|
+
writeBytesAscending(value: ByteString): void;
|
|
4
|
+
writeBytesDescending(value: ByteString): void;
|
|
5
|
+
writeUtf8Ascending(sequence: string): void;
|
|
6
|
+
writeUtf8Descending(sequence: string): void;
|
|
7
|
+
writeNumberAscending(val: number): void;
|
|
8
|
+
writeNumberDescending(val: number): void;
|
|
9
|
+
writeInfinityAscending(): void;
|
|
10
|
+
writeInfinityDescending(): void;
|
|
11
|
+
reset(): void;
|
|
12
|
+
encodedBytes(): Uint8Array;
|
|
13
|
+
seed(encodedBytes: Uint8Array): void;
|
|
14
|
+
}
|
|
@@ -61,10 +61,12 @@ export declare type UpdateData<T> = T extends Primitive ? T : T extends {} ? {
|
|
|
61
61
|
*
|
|
62
62
|
* @param merge - Changes the behavior of a `setDoc()` call to only replace the
|
|
63
63
|
* values specified in its data argument. Fields omitted from the `setDoc()`
|
|
64
|
-
* call remain untouched.
|
|
64
|
+
* call remain untouched. If your input sets any field to an empty map, all
|
|
65
|
+
* nested fields are overwritten.
|
|
65
66
|
* @param mergeFields - Changes the behavior of `setDoc()` calls to only replace
|
|
66
67
|
* the specified field paths. Any field path that is not specified is ignored
|
|
67
|
-
* and remains untouched.
|
|
68
|
+
* and remains untouched. If your input sets any field to an empty map, all
|
|
69
|
+
* nested fields are overwritten.
|
|
68
70
|
*/
|
|
69
71
|
export declare type SetOptions = {
|
|
70
72
|
readonly merge?: boolean;
|
|
@@ -77,6 +77,7 @@ export declare function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
|
|
|
77
77
|
*
|
|
78
78
|
* @param reference - A reference to the document to write.
|
|
79
79
|
* @param data - A map of the fields and values for the document.
|
|
80
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
80
81
|
* @returns A `Promise` resolved once the data has been successfully written
|
|
81
82
|
* to the backend.
|
|
82
83
|
*/
|
|
@@ -94,6 +95,7 @@ export declare function setDoc<T>(reference: DocumentReference<T>, data: WithFie
|
|
|
94
95
|
* @param reference - A reference to the document to write.
|
|
95
96
|
* @param data - A map of the fields and values for the document.
|
|
96
97
|
* @param options - An object to configure the set behavior.
|
|
98
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
97
99
|
* @returns A `Promise` resolved once the data has been successfully written
|
|
98
100
|
* to the backend.
|
|
99
101
|
*/
|
|
@@ -112,6 +114,7 @@ export declare function setDoc<T>(reference: DocumentReference<T>, data: Partial
|
|
|
112
114
|
* @param data - An object containing the fields and values with which to
|
|
113
115
|
* update the document. Fields can contain dots to reference nested fields
|
|
114
116
|
* within the document.
|
|
117
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
115
118
|
* @returns A `Promise` resolved once the data has been successfully written
|
|
116
119
|
* to the backend.
|
|
117
120
|
*/
|
|
@@ -133,6 +136,7 @@ export declare function updateDoc<T>(reference: DocumentReference<T>, data: Upda
|
|
|
133
136
|
* @param field - The first field to update.
|
|
134
137
|
* @param value - The first value.
|
|
135
138
|
* @param moreFieldsAndValues - Additional key value pairs.
|
|
139
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
136
140
|
* @returns A `Promise` resolved once the data has been successfully written
|
|
137
141
|
* to the backend.
|
|
138
142
|
*/
|
|
@@ -161,6 +165,7 @@ export declare function deleteDoc(reference: DocumentReference<unknown>): Promis
|
|
|
161
165
|
*
|
|
162
166
|
* @param reference - A reference to the collection to add this document to.
|
|
163
167
|
* @param data - An Object containing the data for the new document.
|
|
168
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
164
169
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
165
170
|
* newly created document after it has been written to the backend.
|
|
166
171
|
*/
|
|
@@ -45,6 +45,7 @@ export declare class Transaction {
|
|
|
45
45
|
*
|
|
46
46
|
* @param documentRef - A reference to the document to be set.
|
|
47
47
|
* @param data - An object of the fields and values for the document.
|
|
48
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
48
49
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
49
50
|
*/
|
|
50
51
|
set<T>(documentRef: DocumentReference<T>, data: WithFieldValue<T>): this;
|
|
@@ -57,6 +58,7 @@ export declare class Transaction {
|
|
|
57
58
|
* @param documentRef - A reference to the document to be set.
|
|
58
59
|
* @param data - An object of the fields and values for the document.
|
|
59
60
|
* @param options - An object to configure the set behavior.
|
|
61
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
60
62
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
61
63
|
*/
|
|
62
64
|
set<T>(documentRef: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): this;
|
|
@@ -69,6 +71,7 @@ export declare class Transaction {
|
|
|
69
71
|
* @param data - An object containing the fields and values with which to
|
|
70
72
|
* update the document. Fields can contain dots to reference nested fields
|
|
71
73
|
* within the document.
|
|
74
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
72
75
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
73
76
|
*/
|
|
74
77
|
update<T>(documentRef: DocumentReference<T>, data: UpdateData<T>): this;
|
|
@@ -84,6 +87,7 @@ export declare class Transaction {
|
|
|
84
87
|
* @param field - The first field to update.
|
|
85
88
|
* @param value - The first value.
|
|
86
89
|
* @param moreFieldsAndValues - Additional key/value pairs.
|
|
90
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
87
91
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
88
92
|
*/
|
|
89
93
|
update(documentRef: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): this;
|
|
@@ -53,6 +53,7 @@ export declare class WriteBatch {
|
|
|
53
53
|
* @param documentRef - A reference to the document to be set.
|
|
54
54
|
* @param data - An object of the fields and values for the document.
|
|
55
55
|
* @param options - An object to configure the set behavior.
|
|
56
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
56
57
|
* @returns This `WriteBatch` instance. Used for chaining method calls.
|
|
57
58
|
*/
|
|
58
59
|
set<T>(documentRef: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): WriteBatch;
|
|
@@ -65,6 +66,7 @@ export declare class WriteBatch {
|
|
|
65
66
|
* @param data - An object containing the fields and values with which to
|
|
66
67
|
* update the document. Fields can contain dots to reference nested fields
|
|
67
68
|
* within the document.
|
|
69
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
68
70
|
* @returns This `WriteBatch` instance. Used for chaining method calls.
|
|
69
71
|
*/
|
|
70
72
|
update<T>(documentRef: DocumentReference<T>, data: UpdateData<T>): WriteBatch;
|
|
@@ -80,6 +82,7 @@ export declare class WriteBatch {
|
|
|
80
82
|
* @param field - The first field to update.
|
|
81
83
|
* @param value - The first value.
|
|
82
84
|
* @param moreFieldsAndValues - Additional key value pairs.
|
|
85
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
83
86
|
* @returns This `WriteBatch` instance. Used for chaining method calls.
|
|
84
87
|
*/
|
|
85
88
|
update(documentRef: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): WriteBatch;
|
|
@@ -16,11 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { SnapshotVersion } from '../core/snapshot_version';
|
|
18
18
|
import { MutableDocumentMap } from '../model/collections';
|
|
19
|
+
import { MutableDocument } from '../model/document';
|
|
19
20
|
import { IndexManager } from './index_manager';
|
|
20
21
|
import { LocalSerializer } from './local_serializer';
|
|
21
22
|
import { PersistencePromise } from './persistence_promise';
|
|
22
23
|
import { PersistenceTransaction } from './persistence_transaction';
|
|
23
24
|
import { RemoteDocumentCache } from './remote_document_cache';
|
|
25
|
+
export interface DocumentSizeEntry {
|
|
26
|
+
document: MutableDocument;
|
|
27
|
+
size: number;
|
|
28
|
+
}
|
|
24
29
|
export interface IndexedDbRemoteDocumentCache extends RemoteDocumentCache {
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
@@ -21,10 +21,6 @@ import { SortedSet } from '../util/sorted_set';
|
|
|
21
21
|
import { Document, MutableDocument } from './document';
|
|
22
22
|
import { DocumentKey } from './document_key';
|
|
23
23
|
/** Miscellaneous collection types / constants. */
|
|
24
|
-
export interface DocumentSizeEntry {
|
|
25
|
-
document: MutableDocument;
|
|
26
|
-
size: number;
|
|
27
|
-
}
|
|
28
24
|
export declare type MutableDocumentMap = SortedMap<DocumentKey, MutableDocument>;
|
|
29
25
|
export declare function mutableDocumentMap(): MutableDocumentMap;
|
|
30
26
|
export interface DocumentSizeEntries {
|
|
@@ -61,6 +61,8 @@ export interface Document {
|
|
|
61
61
|
*/
|
|
62
62
|
isUnknownDocument(): boolean;
|
|
63
63
|
isEqual(other: Document | null | undefined): boolean;
|
|
64
|
+
/** Creates a mutable copy of this document. */
|
|
65
|
+
mutableCopy(): MutableDocument;
|
|
64
66
|
toString(): string;
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
@@ -124,7 +126,7 @@ export declare class MutableDocument implements Document {
|
|
|
124
126
|
isNoDocument(): boolean;
|
|
125
127
|
isUnknownDocument(): boolean;
|
|
126
128
|
isEqual(other: Document | null | undefined): boolean;
|
|
127
|
-
|
|
129
|
+
mutableCopy(): MutableDocument;
|
|
128
130
|
toString(): string;
|
|
129
131
|
}
|
|
130
132
|
/**
|
|
@@ -18,6 +18,7 @@ import { DatabaseId } from '../core/database_info';
|
|
|
18
18
|
import { ArrayValue, MapValue, Value } from '../protos/firestore_proto_api';
|
|
19
19
|
import { DocumentKey } from './document_key';
|
|
20
20
|
import { TypeOrder } from './type_order';
|
|
21
|
+
export declare const MAX_VALUE: Value;
|
|
21
22
|
/** Extracts the backend's type order for the provided value. */
|
|
22
23
|
export declare function typeOrder(value: Value): TypeOrder;
|
|
23
24
|
/** Tests `left` and `right` for equality based on the backend semantics. */
|
|
@@ -73,3 +74,5 @@ export declare function isMapValue(value?: Value | null): value is {
|
|
|
73
74
|
};
|
|
74
75
|
/** Creates a deep copy of `source`. */
|
|
75
76
|
export declare function deepClone(source: Value): Value;
|
|
77
|
+
/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
|
|
78
|
+
export declare function isMaxValue(value: Value): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1504,10 +1504,12 @@ export declare function setLogLevel(logLevel: LogLevel): void;
|
|
|
1504
1504
|
*
|
|
1505
1505
|
* @param merge - Changes the behavior of a `setDoc()` call to only replace the
|
|
1506
1506
|
* values specified in its data argument. Fields omitted from the `setDoc()`
|
|
1507
|
-
* call remain untouched.
|
|
1507
|
+
* call remain untouched. If your input sets any field to an empty map, all
|
|
1508
|
+
* nested fields are overwritten.
|
|
1508
1509
|
* @param mergeFields - Changes the behavior of `setDoc()` calls to only replace
|
|
1509
1510
|
* the specified field paths. Any field path that is not specified is ignored
|
|
1510
|
-
* and remains untouched.
|
|
1511
|
+
* and remains untouched. If your input sets any field to an empty map, all
|
|
1512
|
+
* nested fields are overwritten.
|
|
1511
1513
|
*/
|
|
1512
1514
|
export declare type SetOptions = {
|
|
1513
1515
|
readonly merge?: boolean;
|
|
@@ -1797,6 +1799,7 @@ export declare class Transaction {
|
|
|
1797
1799
|
*
|
|
1798
1800
|
* @param documentRef - A reference to the document to be set.
|
|
1799
1801
|
* @param data - An object of the fields and values for the document.
|
|
1802
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
1800
1803
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
1801
1804
|
*/
|
|
1802
1805
|
set<T>(documentRef: DocumentReference<T>, data: WithFieldValue<T>): this;
|
|
@@ -1809,6 +1812,7 @@ export declare class Transaction {
|
|
|
1809
1812
|
* @param documentRef - A reference to the document to be set.
|
|
1810
1813
|
* @param data - An object of the fields and values for the document.
|
|
1811
1814
|
* @param options - An object to configure the set behavior.
|
|
1815
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
1812
1816
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
1813
1817
|
*/
|
|
1814
1818
|
set<T>(documentRef: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): this;
|
|
@@ -1821,6 +1825,7 @@ export declare class Transaction {
|
|
|
1821
1825
|
* @param data - An object containing the fields and values with which to
|
|
1822
1826
|
update the document. Fields can contain dots to reference nested fields
|
|
1823
1827
|
within the document.
|
|
1828
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
1824
1829
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
1825
1830
|
*/
|
|
1826
1831
|
update<T>(documentRef: DocumentReference<T>, data: UpdateData<T>): this;
|
|
@@ -1836,6 +1841,7 @@ within the document.
|
|
|
1836
1841
|
* @param field - The first field to update.
|
|
1837
1842
|
* @param value - The first value.
|
|
1838
1843
|
* @param moreFieldsAndValues - Additional key/value pairs.
|
|
1844
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
1839
1845
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
1840
1846
|
*/
|
|
1841
1847
|
update(documentRef: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): this;
|
|
@@ -1973,6 +1979,7 @@ export declare class WriteBatch {
|
|
|
1973
1979
|
* @param documentRef - A reference to the document to be set.
|
|
1974
1980
|
* @param data - An object of the fields and values for the document.
|
|
1975
1981
|
* @param options - An object to configure the set behavior.
|
|
1982
|
+
* @throws Error - If the provided input is not a valid Firestore document.
|
|
1976
1983
|
* @returns This `WriteBatch` instance. Used for chaining method calls.
|
|
1977
1984
|
*/
|
|
1978
1985
|
set<T>(documentRef: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): WriteBatch;
|
|
@@ -1985,6 +1992,7 @@ export declare class WriteBatch {
|
|
|
1985
1992
|
* @param data - An object containing the fields and values with which to
|
|
1986
1993
|
* update the document. Fields can contain dots to reference nested fields
|
|
1987
1994
|
* within the document.
|
|
1995
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
1988
1996
|
* @returns This `WriteBatch` instance. Used for chaining method calls.
|
|
1989
1997
|
*/
|
|
1990
1998
|
update<T>(documentRef: DocumentReference<T>, data: UpdateData<T>): WriteBatch;
|
|
@@ -2000,6 +2008,7 @@ export declare class WriteBatch {
|
|
|
2000
2008
|
* @param field - The first field to update.
|
|
2001
2009
|
* @param value - The first value.
|
|
2002
2010
|
* @param moreFieldsAndValues - Additional key value pairs.
|
|
2011
|
+
* @throws Error - If the provided input is not valid Firestore data.
|
|
2003
2012
|
* @returns This `WriteBatch` instance. Used for chaining method calls.
|
|
2004
2013
|
*/
|
|
2005
2014
|
update(documentRef: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): WriteBatch;
|
package/dist/index.esm2017.js
CHANGED
|
@@ -66,7 +66,7 @@ D.MOCK_USER = new D("mock-user");
|
|
|
66
66
|
* See the License for the specific language governing permissions and
|
|
67
67
|
* limitations under the License.
|
|
68
68
|
*/
|
|
69
|
-
let C = "9.6.1-canary.
|
|
69
|
+
let C = "9.6.1-canary.3d8109ca3";
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @license
|
|
@@ -1524,6 +1524,7 @@ function Pt(t) {
|
|
|
1524
1524
|
}
|
|
1525
1525
|
|
|
1526
1526
|
/** Tests `left` and `right` for equality based on the backend semantics. */ function Ct(t, e) {
|
|
1527
|
+
if (t === e) return !0;
|
|
1527
1528
|
const n = Dt(t);
|
|
1528
1529
|
if (n !== Dt(e)) return !1;
|
|
1529
1530
|
switch (n) {
|
|
@@ -1593,6 +1594,7 @@ function Nt(t, e) {
|
|
|
1593
1594
|
}
|
|
1594
1595
|
|
|
1595
1596
|
function kt(t, e) {
|
|
1597
|
+
if (t === e) return 0;
|
|
1596
1598
|
const n = Dt(t), s = Dt(e);
|
|
1597
1599
|
if (n !== s) return it(n, s);
|
|
1598
1600
|
switch (n) {
|
|
@@ -1997,7 +1999,7 @@ function Lt(t) {
|
|
|
1997
1999
|
isEqual(t) {
|
|
1998
2000
|
return t instanceof Wt && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
|
|
1999
2001
|
}
|
|
2000
|
-
|
|
2002
|
+
mutableCopy() {
|
|
2001
2003
|
return new Wt(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
|
|
2002
2004
|
}
|
|
2003
2005
|
toString() {
|
|
@@ -9669,7 +9671,7 @@ class Cr {
|
|
|
9669
9671
|
*/ addEntry(t, e, n) {
|
|
9670
9672
|
const s = e.key, i = this.docs.get(s), r = i ? i.size : 0, o = this.Ts(e);
|
|
9671
9673
|
return this.docs = this.docs.insert(s, {
|
|
9672
|
-
document: e.
|
|
9674
|
+
document: e.mutableCopy(),
|
|
9673
9675
|
size: o,
|
|
9674
9676
|
readTime: n
|
|
9675
9677
|
}), this.size += o - r, this.Jt.addToCollectionParentIndex(t, s.path.popLast());
|
|
@@ -9685,13 +9687,13 @@ class Cr {
|
|
|
9685
9687
|
}
|
|
9686
9688
|
getEntry(t, e) {
|
|
9687
9689
|
const n = this.docs.get(e);
|
|
9688
|
-
return Gs.resolve(n ? n.document.
|
|
9690
|
+
return Gs.resolve(n ? n.document.mutableCopy() : Wt.newInvalidDocument(e));
|
|
9689
9691
|
}
|
|
9690
9692
|
getEntries(t, e) {
|
|
9691
9693
|
let n = An();
|
|
9692
9694
|
return e.forEach((t => {
|
|
9693
9695
|
const e = this.docs.get(t);
|
|
9694
|
-
n = n.insert(t, e ? e.document.
|
|
9696
|
+
n = n.insert(t, e ? e.document.mutableCopy() : Wt.newInvalidDocument(t));
|
|
9695
9697
|
})), Gs.resolve(n);
|
|
9696
9698
|
}
|
|
9697
9699
|
getDocumentsMatchingQuery(t, e, n) {
|
|
@@ -9702,7 +9704,7 @@ class Cr {
|
|
|
9702
9704
|
for (;r.hasNext(); ) {
|
|
9703
9705
|
const {key: t, value: {document: i, readTime: o}} = r.getNext();
|
|
9704
9706
|
if (!e.path.isPrefixOf(t.path)) break;
|
|
9705
|
-
o.compareTo(n) <= 0 || Se(e, i) && (s = s.insert(i.key, i.
|
|
9707
|
+
o.compareTo(n) <= 0 || Se(e, i) && (s = s.insert(i.key, i.mutableCopy()));
|
|
9706
9708
|
}
|
|
9707
9709
|
return Gs.resolve(s);
|
|
9708
9710
|
}
|
|
@@ -17832,9 +17834,9 @@ function Ih(t, e) {
|
|
|
17832
17834
|
return n = Object.assign({
|
|
17833
17835
|
useFetchStreams: e
|
|
17834
17836
|
}, n), i._setSettings(n), i;
|
|
17835
|
-
}), "PUBLIC")), registerVersion(S, "3.4.1-canary.
|
|
17837
|
+
}), "PUBLIC")), registerVersion(S, "3.4.1-canary.3d8109ca3", t),
|
|
17836
17838
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
17837
|
-
registerVersion(S, "3.4.1-canary.
|
|
17839
|
+
registerVersion(S, "3.4.1-canary.3d8109ca3", "esm2017");
|
|
17838
17840
|
}();
|
|
17839
17841
|
|
|
17840
17842
|
export { rh as AbstractUserDataWriter, eu as Bytes, Fc as CACHE_SIZE_UNLIMITED, vc as CollectionReference, bc as DocumentReference, xu as DocumentSnapshot, Zc as FieldPath, nu as FieldValue, Oc as Firestore, j as FirestoreError, su as GeoPoint, $c as LoadBundleTask, Pc as Query, Bu as QueryConstraint, $u as QueryDocumentSnapshot, Fu as QuerySnapshot, ku as SnapshotMetadata, at as Timestamp, bh as Transaction, ch as WriteBatch, dc as _DatabaseId, St as _DocumentKey, tt as _EmptyAppCheckTokenProvider, G as _EmptyAuthCredentialsProvider, _t as _FieldPath, Tc as _cast, U as _debugAssert, gt as _isBase64Available, O as _logWarn, mc as _validateIsNotUsedTogether, Th as addDoc, Dh as arrayRemove, Sh as arrayUnion, Qc as clearIndexedDbPersistence, Vc as collection, Sc as collectionGroup, Rc as connectFirestoreEmulator, ph as deleteDoc, vh as deleteField, zc as disableNetwork, Dc as doc, tu as documentId, qc as enableIndexedDbPersistence, Kc as enableMultiTabIndexedDbPersistence, Gc as enableNetwork, th as endAt, Zu as endBefore, Bc as ensureFirestoreConfigured, Ah as executeWrite, hh as getDoc, fh as getDocFromCache, dh as getDocFromServer, wh as getDocs, _h as getDocsFromCache, mh as getDocsFromServer, Lc as getFirestore, Ch as increment, Mc as initializeFirestore, Gu as limit, zu as limitToLast, Jc as loadBundle, Yc as namedQuery, Eh as onSnapshot, Ih as onSnapshotsInSync, Qu as orderBy, Uu as query, Nc as queryEqual, Cc as refEqual, Ph as runTransaction, Vh as serverTimestamp, gh as setDoc, x as setLogLevel, Mu as snapshotEqual, Yu as startAfter, Ju as startAt, Hc as terminate, yh as updateDoc, Wc as waitForPendingWrites, Ku as where, Nh as writeBatch };
|