@firebase/firestore 3.4.8 → 3.4.9
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 +10 -0
- package/dist/firestore/lite/index.d.ts +1 -0
- package/dist/firestore/src/api/transaction.d.ts +2 -1
- package/dist/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/firestore/src/api.d.ts +1 -0
- package/dist/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/firestore/src/core/query.d.ts +2 -4
- package/dist/firestore/src/core/target.d.ts +6 -4
- package/dist/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/firestore/src/local/index_manager.d.ts +24 -3
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
- package/dist/firestore/src/local/indexeddb_schema.d.ts +1 -0
- package/dist/firestore/src/local/local_documents_view.d.ts +1 -1
- package/dist/firestore/src/local/memory_index_manager.d.ts +3 -2
- package/dist/firestore/src/local/query_engine.d.ts +44 -5
- package/dist/firestore/src/model/collections.d.ts +1 -1
- package/dist/firestore/src/model/values.d.ts +14 -2
- package/dist/firestore/src/util/misc.d.ts +3 -0
- package/dist/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
- package/dist/firestore/test/unit/local/test_index_manager.d.ts +2 -2
- package/dist/index.d.ts +24 -1
- package/dist/index.esm2017.js +4108 -3992
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +4198 -4087
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +1711 -1565
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +1711 -1565
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +4100 -3984
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +50 -4
- package/dist/lite/firestore/lite/index.d.ts +1 -0
- package/dist/lite/firestore/src/api/transaction.d.ts +2 -1
- package/dist/lite/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/firestore/src/api.d.ts +1 -0
- package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/firestore/src/core/query.d.ts +2 -4
- package/dist/lite/firestore/src/core/target.d.ts +6 -4
- package/dist/lite/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/lite/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/firestore/src/local/index_manager.d.ts +24 -3
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +1 -0
- package/dist/lite/firestore/src/local/local_documents_view.d.ts +1 -1
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +3 -2
- package/dist/lite/firestore/src/local/query_engine.d.ts +44 -5
- package/dist/lite/firestore/src/model/collections.d.ts +1 -1
- package/dist/lite/firestore/src/model/values.d.ts +14 -2
- package/dist/lite/firestore/src/util/misc.d.ts +3 -0
- package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
- package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +2 -2
- package/dist/lite/index.browser.esm2017.js +341 -312
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +299 -291
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +24 -1
- package/dist/lite/index.node.cjs.js +56 -15
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +56 -15
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +1227 -1198
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +25 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +28 -28
- package/dist/lite/packages/firestore/lite/index.d.ts +1 -0
- package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -1
- package/dist/lite/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/packages/firestore/src/api.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/packages/firestore/src/core/query.d.ts +2 -4
- package/dist/lite/packages/firestore/src/core/target.d.ts +6 -4
- package/dist/lite/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/lite/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +24 -3
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +3 -2
- package/dist/lite/packages/firestore/src/local/query_engine.d.ts +44 -5
- package/dist/lite/packages/firestore/src/model/collections.d.ts +1 -1
- package/dist/lite/packages/firestore/src/model/values.d.ts +14 -2
- package/dist/lite/packages/firestore/src/util/misc.d.ts +3 -0
- package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
- package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
- package/dist/lite/private.d.ts +25 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +155 -154
- package/dist/packages/firestore/lite/index.d.ts +1 -0
- package/dist/packages/firestore/src/api/transaction.d.ts +2 -1
- package/dist/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/packages/firestore/src/api.d.ts +1 -0
- package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/packages/firestore/src/core/query.d.ts +2 -4
- package/dist/packages/firestore/src/core/target.d.ts +6 -4
- package/dist/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/packages/firestore/src/local/index_manager.d.ts +24 -3
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +1 -0
- package/dist/packages/firestore/src/local/local_documents_view.d.ts +1 -1
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +3 -2
- package/dist/packages/firestore/src/local/query_engine.d.ts +44 -5
- package/dist/packages/firestore/src/model/collections.d.ts +1 -1
- package/dist/packages/firestore/src/model/values.d.ts +14 -2
- package/dist/packages/firestore/src/util/misc.d.ts +3 -0
- package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
- package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
- package/dist/private.d.ts +50 -4
- package/package.json +7 -7
|
@@ -31,7 +31,7 @@ export interface DocumentSizeEntries {
|
|
|
31
31
|
sizeMap: SortedMap<DocumentKey, number>;
|
|
32
32
|
}
|
|
33
33
|
export declare type DocumentMap = SortedMap<DocumentKey, Document>;
|
|
34
|
-
export declare function documentMap(): DocumentMap;
|
|
34
|
+
export declare function documentMap(...docs: Document[]): DocumentMap;
|
|
35
35
|
export declare type OverlayMap = ObjectMap<DocumentKey, Overlay>;
|
|
36
36
|
export declare function newOverlayMap(): OverlayMap;
|
|
37
37
|
export declare type MutationMap = ObjectMap<DocumentKey, Mutation>;
|
|
@@ -81,5 +81,17 @@ export declare function isMaxValue(value: Value): boolean;
|
|
|
81
81
|
export declare function valuesGetLowerBound(value: Value): Value;
|
|
82
82
|
/** Returns the largest value for the given value type (exclusive). */
|
|
83
83
|
export declare function valuesGetUpperBound(value: Value): Value;
|
|
84
|
-
export declare function
|
|
85
|
-
|
|
84
|
+
export declare function lowerBoundCompare(left: {
|
|
85
|
+
value: Value;
|
|
86
|
+
inclusive: boolean;
|
|
87
|
+
}, right: {
|
|
88
|
+
value: Value;
|
|
89
|
+
inclusive: boolean;
|
|
90
|
+
}): number;
|
|
91
|
+
export declare function upperBoundCompare(left: {
|
|
92
|
+
value: Value;
|
|
93
|
+
inclusive: boolean;
|
|
94
|
+
}, right: {
|
|
95
|
+
value: Value;
|
|
96
|
+
inclusive: boolean;
|
|
97
|
+
}): number;
|
|
@@ -25,6 +25,9 @@ export declare function primitiveComparator<T>(left: T, right: T): number;
|
|
|
25
25
|
export interface Equatable<T> {
|
|
26
26
|
isEqual(other: T): boolean;
|
|
27
27
|
}
|
|
28
|
+
export interface Iterable<V> {
|
|
29
|
+
forEach: (cb: (v: V) => void) => void;
|
|
30
|
+
}
|
|
28
31
|
/** Helper to compare arrays using isEqual(). */
|
|
29
32
|
export declare function arrayEquals<T>(left: T[], right: T[], comparator: (l: T, r: T) => boolean): boolean;
|
|
30
33
|
/**
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { Query } from '../../../src/core/query';
|
|
18
18
|
import { SnapshotVersion } from '../../../src/core/snapshot_version';
|
|
19
|
+
import { IndexManager } from '../../../src/local/index_manager';
|
|
19
20
|
import { LocalDocumentsView } from '../../../src/local/local_documents_view';
|
|
20
21
|
import { PersistencePromise } from '../../../src/local/persistence_promise';
|
|
21
22
|
import { PersistenceTransaction } from '../../../src/local/persistence_transaction';
|
|
@@ -51,7 +52,7 @@ export declare class CountingQueryEngine extends QueryEngine {
|
|
|
51
52
|
documentsReadByKey: number;
|
|
52
53
|
resetCounts(): void;
|
|
53
54
|
getDocumentsMatchingQuery(transaction: PersistenceTransaction, query: Query, lastLimboFreeSnapshotVersion: SnapshotVersion, remoteKeys: DocumentKeySet): PersistencePromise<DocumentMap>;
|
|
54
|
-
|
|
55
|
+
initialize(localDocuments: LocalDocumentsView, indexManager: IndexManager): void;
|
|
55
56
|
private wrapRemoteDocumentCache;
|
|
56
57
|
private wrapMutationQueue;
|
|
57
58
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { Target } from '../../../src/core/target';
|
|
18
|
-
import { IndexManager } from '../../../src/local/index_manager';
|
|
18
|
+
import { IndexManager, IndexType } from '../../../src/local/index_manager';
|
|
19
19
|
import { Persistence } from '../../../src/local/persistence';
|
|
20
20
|
import { DocumentMap } from '../../../src/model/collections';
|
|
21
21
|
import { DocumentKey } from '../../../src/model/document_key';
|
|
@@ -34,7 +34,7 @@ export declare class TestIndexManager {
|
|
|
34
34
|
addFieldIndex(index: FieldIndex): Promise<void>;
|
|
35
35
|
deleteFieldIndex(index: FieldIndex): Promise<void>;
|
|
36
36
|
getFieldIndexes(collectionGroup?: string): Promise<FieldIndex[]>;
|
|
37
|
-
|
|
37
|
+
getIndexType(target: Target): Promise<IndexType>;
|
|
38
38
|
getDocumentsMatchingTarget(target: Target): Promise<DocumentKey[] | null>;
|
|
39
39
|
getNextCollectionGroupToUpdate(): Promise<string | null>;
|
|
40
40
|
updateCollectionGroup(collectionGroup: string, offset: IndexOffset): Promise<void>;
|
package/dist/lite/private.d.ts
CHANGED
|
@@ -1970,7 +1970,7 @@ export declare function refEqual<T>(left: DocumentReference<T> | CollectionRefer
|
|
|
1970
1970
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
1971
1971
|
* rejected promise with the corresponding failure error is returned.
|
|
1972
1972
|
*/
|
|
1973
|
-
export declare function runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T
|
|
1973
|
+
export declare function runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T>, options?: TransactionOptions): Promise<T>;
|
|
1974
1974
|
|
|
1975
1975
|
/**
|
|
1976
1976
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
@@ -2475,6 +2475,30 @@ declare class Transaction_2 {
|
|
|
2475
2475
|
private ensureCommitNotCalled;
|
|
2476
2476
|
}
|
|
2477
2477
|
|
|
2478
|
+
/**
|
|
2479
|
+
* @license
|
|
2480
|
+
* Copyright 2022 Google LLC
|
|
2481
|
+
*
|
|
2482
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2483
|
+
* you may not use this file except in compliance with the License.
|
|
2484
|
+
* You may obtain a copy of the License at
|
|
2485
|
+
*
|
|
2486
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2487
|
+
*
|
|
2488
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2489
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2490
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2491
|
+
* See the License for the specific language governing permissions and
|
|
2492
|
+
* limitations under the License.
|
|
2493
|
+
*/
|
|
2494
|
+
/**
|
|
2495
|
+
* Options to customize transaction behavior.
|
|
2496
|
+
*/
|
|
2497
|
+
export declare interface TransactionOptions {
|
|
2498
|
+
/** Maximum number of attempts to commit, after which transaction fails. Default is 5. */
|
|
2499
|
+
readonly maxAttempts?: number;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2478
2502
|
/** Used to represent a field transform on a mutation. */
|
|
2479
2503
|
declare class TransformOperation {
|
|
2480
2504
|
private _;
|