@firebase/firestore 3.4.9 → 3.4.10-canary.ebc17e27f
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 +14 -0
- package/dist/firestore/src/api/transaction.d.ts +2 -0
- package/dist/firestore/src/core/component_provider.d.ts +11 -6
- package/dist/firestore/src/lite-api/transaction.d.ts +2 -0
- package/dist/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/firestore/src/local/index_backfiller.d.ts +44 -0
- package/dist/firestore/src/local/index_manager.d.ts +2 -0
- package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
- package/dist/firestore/src/local/indexeddb_schema.d.ts +3 -2
- package/dist/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/firestore/src/local/local_documents_view.d.ts +64 -9
- package/dist/firestore/src/local/local_store.d.ts +9 -0
- package/dist/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
- package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/src/local/memory_index_manager.d.ts +1 -0
- package/dist/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/firestore/src/local/persistence.d.ts +3 -5
- package/dist/firestore/src/local/persistence_promise.d.ts +11 -0
- package/dist/firestore/src/local/query_engine.d.ts +1 -1
- package/dist/firestore/src/model/collections.d.ts +8 -2
- package/dist/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/firestore/src/model/mutation.d.ts +19 -1
- package/dist/firestore/src/model/mutation_batch.d.ts +8 -4
- package/dist/firestore/src/tsdoc-metadata.json +11 -11
- package/dist/firestore/src/util/async_queue.d.ts +5 -1
- package/dist/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
- package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
- package/dist/firestore/test/util/helpers.d.ts +13 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.esm2017.js +10689 -10296
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +9353 -8844
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +6738 -6123
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +6738 -6123
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +9818 -9424
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +6137 -5964
- package/dist/lite/firestore/src/api/transaction.d.ts +2 -0
- package/dist/lite/firestore/src/core/component_provider.d.ts +11 -6
- package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -0
- package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/lite/firestore/src/local/index_backfiller.d.ts +44 -0
- package/dist/lite/firestore/src/local/index_manager.d.ts +2 -0
- package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +3 -2
- package/dist/lite/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/lite/firestore/src/local/local_documents_view.d.ts +64 -9
- package/dist/lite/firestore/src/local/local_store.d.ts +9 -0
- package/dist/lite/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
- package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +1 -0
- package/dist/lite/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/lite/firestore/src/local/persistence.d.ts +3 -5
- package/dist/lite/firestore/src/local/persistence_promise.d.ts +11 -0
- package/dist/lite/firestore/src/local/query_engine.d.ts +1 -1
- package/dist/lite/firestore/src/model/collections.d.ts +8 -2
- package/dist/lite/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/lite/firestore/src/model/mutation.d.ts +19 -1
- package/dist/lite/firestore/src/model/mutation_batch.d.ts +8 -4
- package/dist/lite/firestore/src/util/async_queue.d.ts +5 -1
- package/dist/lite/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
- package/dist/lite/firestore/test/util/helpers.d.ts +13 -0
- package/dist/lite/index.browser.esm2017.js +1220 -738
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +1156 -764
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +2 -0
- package/dist/lite/index.node.cjs.js +655 -2
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +655 -2
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +1184 -702
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2916 -2898
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +106 -104
- package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -0
- package/dist/lite/packages/firestore/src/core/component_provider.d.ts +11 -6
- package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -0
- package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/lite/packages/firestore/src/local/index_backfiller.d.ts +44 -0
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +2 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +3 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +64 -9
- package/dist/lite/packages/firestore/src/local/local_store.d.ts +9 -0
- package/dist/lite/packages/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
- package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/lite/packages/firestore/src/local/persistence.d.ts +3 -5
- package/dist/lite/packages/firestore/src/local/persistence_promise.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/query_engine.d.ts +1 -1
- package/dist/lite/packages/firestore/src/model/collections.d.ts +8 -2
- package/dist/lite/packages/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/lite/packages/firestore/src/model/mutation.d.ts +19 -1
- package/dist/lite/packages/firestore/src/model/mutation_batch.d.ts +8 -4
- package/dist/lite/packages/firestore/src/util/async_queue.d.ts +5 -1
- package/dist/lite/packages/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +13 -0
- package/dist/lite/private.d.ts +2776 -2758
- package/dist/packages/firestore/dist/index.esm2017.d.ts +203 -201
- package/dist/packages/firestore/src/api/transaction.d.ts +2 -0
- package/dist/packages/firestore/src/core/component_provider.d.ts +11 -6
- package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -0
- package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/packages/firestore/src/local/index_backfiller.d.ts +44 -0
- package/dist/packages/firestore/src/local/index_manager.d.ts +2 -0
- package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +3 -2
- package/dist/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/packages/firestore/src/local/local_documents_view.d.ts +64 -9
- package/dist/packages/firestore/src/local/local_store.d.ts +9 -0
- package/dist/packages/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
- package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +1 -0
- package/dist/packages/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/packages/firestore/src/local/persistence.d.ts +3 -5
- package/dist/packages/firestore/src/local/persistence_promise.d.ts +11 -0
- package/dist/packages/firestore/src/local/query_engine.d.ts +1 -1
- package/dist/packages/firestore/src/model/collections.d.ts +8 -2
- package/dist/packages/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/packages/firestore/src/model/mutation.d.ts +19 -1
- package/dist/packages/firestore/src/model/mutation_batch.d.ts +8 -4
- package/dist/packages/firestore/src/util/async_queue.d.ts +5 -1
- package/dist/packages/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
- package/dist/packages/firestore/test/util/helpers.d.ts +13 -0
- package/dist/private.d.ts +5845 -5672
- package/package.json +19 -17
|
@@ -59,7 +59,11 @@ export declare const enum TimerId {
|
|
|
59
59
|
* A timer used to retry operations scheduled via retryable AsyncQueue
|
|
60
60
|
* operations.
|
|
61
61
|
*/
|
|
62
|
-
AsyncQueueRetry = "async_queue_retry"
|
|
62
|
+
AsyncQueueRetry = "async_queue_retry",
|
|
63
|
+
/**
|
|
64
|
+
* A timer used to periodically attempt index backfill.
|
|
65
|
+
*/
|
|
66
|
+
IndexBackfill = "index_backfill"
|
|
63
67
|
}
|
|
64
68
|
/**
|
|
65
69
|
* Represents an operation scheduled to be run in the future on an AsyncQueue.
|
|
@@ -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 {};
|
|
@@ -31,6 +31,7 @@ export declare class TestDocumentOverlayCache {
|
|
|
31
31
|
constructor(persistence: Persistence, cache: DocumentOverlayCache);
|
|
32
32
|
saveOverlays(largestBatch: number, data: MutationMap): Promise<void>;
|
|
33
33
|
getOverlay(key: DocumentKey): Promise<Overlay | null>;
|
|
34
|
+
getOverlays(keys: DocumentKey[]): Promise<OverlayMap>;
|
|
34
35
|
getOverlayMutation(docKey: string): Promise<Mutation | null>;
|
|
35
36
|
getOverlaysForCollection(path: ResourcePath, sinceBatchId: number): Promise<OverlayMap>;
|
|
36
37
|
getOverlaysForCollectionGroup(collectionGroup: string, sinceBatchId: number, count: number): Promise<OverlayMap>;
|
|
@@ -20,8 +20,9 @@ import { Observer } from '../../../src/core/event_manager';
|
|
|
20
20
|
import { Query } from '../../../src/core/query';
|
|
21
21
|
import { ViewSnapshot } from '../../../src/core/view_snapshot';
|
|
22
22
|
import { IndexedDbPersistence } from '../../../src/local/indexeddb_persistence';
|
|
23
|
+
import { LocalStore } from '../../../src/local/local_store';
|
|
23
24
|
import { MemoryPersistence } from '../../../src/local/memory_persistence';
|
|
24
|
-
import {
|
|
25
|
+
import { Scheduler, Persistence } from '../../../src/local/persistence';
|
|
25
26
|
import { PersistencePromise } from '../../../src/local/persistence_promise';
|
|
26
27
|
import { PersistenceTransaction, PersistenceTransactionMode } from '../../../src/local/persistence_transaction';
|
|
27
28
|
import { SharedClientState } from '../../../src/local/shared_client_state';
|
|
@@ -62,7 +63,8 @@ export declare class MockMultiTabOfflineComponentProvider extends MultiTabOfflin
|
|
|
62
63
|
private readonly document;
|
|
63
64
|
persistence: MockIndexedDbPersistence;
|
|
64
65
|
constructor(window: WindowLike, document: FakeDocument, onlineComponentProvider: OnlineComponentProvider);
|
|
65
|
-
createGarbageCollectionScheduler(cfg: ComponentConfiguration):
|
|
66
|
+
createGarbageCollectionScheduler(cfg: ComponentConfiguration, localStore: LocalStore): Scheduler | null;
|
|
67
|
+
createIndexBackfillerScheduler(cfg: ComponentConfiguration, localStore: LocalStore): Scheduler | null;
|
|
66
68
|
createSharedClientState(cfg: ComponentConfiguration): SharedClientState;
|
|
67
69
|
createPersistence(cfg: ComponentConfiguration): MockIndexedDbPersistence;
|
|
68
70
|
}
|
|
@@ -71,7 +73,7 @@ export declare class MockMemoryOfflineComponentProvider extends MemoryOfflineCom
|
|
|
71
73
|
persistence: MockMemoryPersistence;
|
|
72
74
|
connection: MockConnection;
|
|
73
75
|
constructor(gcEnabled: boolean);
|
|
74
|
-
createGarbageCollectionScheduler(cfg: ComponentConfiguration):
|
|
76
|
+
createGarbageCollectionScheduler(cfg: ComponentConfiguration): Scheduler | null;
|
|
75
77
|
createPersistence(cfg: ComponentConfiguration): Persistence;
|
|
76
78
|
}
|
|
77
79
|
export declare class MockConnection implements Connection {
|
|
@@ -63,12 +63,14 @@ export declare function fieldIndex(collectionGroup: string, options?: {
|
|
|
63
63
|
id?: number;
|
|
64
64
|
fields?: Array<[field: string, kind: IndexKind]>;
|
|
65
65
|
offset?: IndexOffset;
|
|
66
|
+
sequenceNumber?: number;
|
|
66
67
|
}): FieldIndex;
|
|
67
68
|
export declare function mask(...paths: string[]): FieldMask;
|
|
68
69
|
export declare function blob(...bytes: number[]): Bytes;
|
|
69
70
|
export declare function filter(path: string, op: string, value: unknown): FieldFilter;
|
|
70
71
|
export declare function setMutation(keyStr: string, json: JsonObject<unknown>): SetMutation;
|
|
71
72
|
export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
|
|
73
|
+
export declare function mergeMutation(keyStr: string, json: JsonObject<unknown>, updateMask: FieldPath[]): PatchMutation;
|
|
72
74
|
export declare function deleteMutation(keyStr: string): DeleteMutation;
|
|
73
75
|
export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult;
|
|
74
76
|
export declare function bound(values: unknown[], inclusive: boolean): Bound;
|
|
@@ -177,3 +179,14 @@ export declare function expectSetToEqual<T>(set: SortedSet<T>, arr: T[]): void;
|
|
|
177
179
|
export declare function expectEqualitySets<T>(elems: T[][], equalityFn: (v1: T, v2: T) => boolean, stringifyFn?: (v: T) => string): void;
|
|
178
180
|
export declare function validateFirestoreError(expectedCode: Code, actualError: Error): void;
|
|
179
181
|
export declare function forEachNumber<V>(obj: Dict<V>, fn: (key: number, val: V) => void): void;
|
|
182
|
+
/**
|
|
183
|
+
* Returns all possible permutations of the given array.
|
|
184
|
+
* For `[a, b]`, this method returns `[[a, b], [b, a]]`.
|
|
185
|
+
*/
|
|
186
|
+
export declare function computePermutations<T>(input: T[]): T[][];
|
|
187
|
+
/**
|
|
188
|
+
* Returns all possible combinations of the given array, including an empty
|
|
189
|
+
* array. For `[a, b, c]` this method returns
|
|
190
|
+
* `[[], [a], [a, b], [a, c], [b, c], [a, b, c]`.
|
|
191
|
+
*/
|
|
192
|
+
export declare function computeCombinations<T>(input: T[]): T[][];
|
package/dist/index.d.ts
CHANGED
|
@@ -1436,6 +1436,8 @@ export declare function refEqual<T>(left: DocumentReference<T> | CollectionRefer
|
|
|
1436
1436
|
* transaction against.
|
|
1437
1437
|
* @param updateFunction - The function to execute within the transaction
|
|
1438
1438
|
* context.
|
|
1439
|
+
* @param options - An options object to configure maximum number of attempts to
|
|
1440
|
+
* commit.
|
|
1439
1441
|
* @returns If the transaction completed successfully or was explicitly aborted
|
|
1440
1442
|
* (the `updateFunction` returned a failed promise), the promise returned by the
|
|
1441
1443
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
@@ -1810,8 +1812,8 @@ export declare class Transaction {
|
|
|
1810
1812
|
* not exist.
|
|
1811
1813
|
*
|
|
1812
1814
|
* @param documentRef - A reference to the document to be updated.
|
|
1813
|
-
* @param data - An object containing the fields and values with which to
|
|
1814
|
-
update the document. Fields can contain dots to reference nested fields
|
|
1815
|
+
* @param data - An object containing the fields and values with which to
|
|
1816
|
+
update the document. Fields can contain dots to reference nested fields
|
|
1815
1817
|
within the document.
|
|
1816
1818
|
* @throws Error - If the provided input is not valid Firestore data.
|
|
1817
1819
|
* @returns This `Transaction` instance. Used for chaining method calls.
|