@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.
Files changed (147) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/firestore/src/api/transaction.d.ts +2 -0
  3. package/dist/firestore/src/core/component_provider.d.ts +11 -6
  4. package/dist/firestore/src/lite-api/transaction.d.ts +2 -0
  5. package/dist/firestore/src/local/document_overlay_cache.d.ts +5 -0
  6. package/dist/firestore/src/local/index_backfiller.d.ts +44 -0
  7. package/dist/firestore/src/local/index_manager.d.ts +2 -0
  8. package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  9. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
  10. package/dist/firestore/src/local/indexeddb_schema.d.ts +3 -2
  11. package/dist/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  12. package/dist/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  13. package/dist/firestore/src/local/local_documents_view.d.ts +64 -9
  14. package/dist/firestore/src/local/local_store.d.ts +9 -0
  15. package/dist/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
  16. package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  17. package/dist/firestore/src/local/memory_index_manager.d.ts +1 -0
  18. package/dist/firestore/src/local/overlayed_document.d.ts +36 -0
  19. package/dist/firestore/src/local/persistence.d.ts +3 -5
  20. package/dist/firestore/src/local/persistence_promise.d.ts +11 -0
  21. package/dist/firestore/src/local/query_engine.d.ts +1 -1
  22. package/dist/firestore/src/model/collections.d.ts +8 -2
  23. package/dist/firestore/src/model/field_mask.d.ts +6 -0
  24. package/dist/firestore/src/model/mutation.d.ts +19 -1
  25. package/dist/firestore/src/model/mutation_batch.d.ts +8 -4
  26. package/dist/firestore/src/tsdoc-metadata.json +11 -11
  27. package/dist/firestore/src/util/async_queue.d.ts +5 -1
  28. package/dist/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
  29. package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  30. package/dist/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
  31. package/dist/firestore/test/util/helpers.d.ts +13 -0
  32. package/dist/index.d.ts +4 -2
  33. package/dist/index.esm2017.js +10689 -10296
  34. package/dist/index.esm2017.js.map +1 -1
  35. package/dist/index.esm5.js +9353 -8844
  36. package/dist/index.esm5.js.map +1 -1
  37. package/dist/index.node.cjs.js +6738 -6123
  38. package/dist/index.node.cjs.js.map +1 -1
  39. package/dist/index.node.mjs +6738 -6123
  40. package/dist/index.node.mjs.map +1 -1
  41. package/dist/index.rn.js +9818 -9424
  42. package/dist/index.rn.js.map +1 -1
  43. package/dist/internal.d.ts +6137 -5964
  44. package/dist/lite/firestore/src/api/transaction.d.ts +2 -0
  45. package/dist/lite/firestore/src/core/component_provider.d.ts +11 -6
  46. package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -0
  47. package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +5 -0
  48. package/dist/lite/firestore/src/local/index_backfiller.d.ts +44 -0
  49. package/dist/lite/firestore/src/local/index_manager.d.ts +2 -0
  50. package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  51. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
  52. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +3 -2
  53. package/dist/lite/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  54. package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  55. package/dist/lite/firestore/src/local/local_documents_view.d.ts +64 -9
  56. package/dist/lite/firestore/src/local/local_store.d.ts +9 -0
  57. package/dist/lite/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
  58. package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  59. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +1 -0
  60. package/dist/lite/firestore/src/local/overlayed_document.d.ts +36 -0
  61. package/dist/lite/firestore/src/local/persistence.d.ts +3 -5
  62. package/dist/lite/firestore/src/local/persistence_promise.d.ts +11 -0
  63. package/dist/lite/firestore/src/local/query_engine.d.ts +1 -1
  64. package/dist/lite/firestore/src/model/collections.d.ts +8 -2
  65. package/dist/lite/firestore/src/model/field_mask.d.ts +6 -0
  66. package/dist/lite/firestore/src/model/mutation.d.ts +19 -1
  67. package/dist/lite/firestore/src/model/mutation_batch.d.ts +8 -4
  68. package/dist/lite/firestore/src/util/async_queue.d.ts +5 -1
  69. package/dist/lite/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
  70. package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  71. package/dist/lite/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
  72. package/dist/lite/firestore/test/util/helpers.d.ts +13 -0
  73. package/dist/lite/index.browser.esm2017.js +1220 -738
  74. package/dist/lite/index.browser.esm2017.js.map +1 -1
  75. package/dist/lite/index.browser.esm5.js +1156 -764
  76. package/dist/lite/index.browser.esm5.js.map +1 -1
  77. package/dist/lite/index.d.ts +2 -0
  78. package/dist/lite/index.node.cjs.js +655 -2
  79. package/dist/lite/index.node.cjs.js.map +1 -1
  80. package/dist/lite/index.node.mjs +655 -2
  81. package/dist/lite/index.node.mjs.map +1 -1
  82. package/dist/lite/index.rn.esm2017.js +1184 -702
  83. package/dist/lite/index.rn.esm2017.js.map +1 -1
  84. package/dist/lite/internal.d.ts +2916 -2898
  85. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +106 -104
  86. package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -0
  87. package/dist/lite/packages/firestore/src/core/component_provider.d.ts +11 -6
  88. package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -0
  89. package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
  90. package/dist/lite/packages/firestore/src/local/index_backfiller.d.ts +44 -0
  91. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +2 -0
  92. package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  93. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
  94. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +3 -2
  95. package/dist/lite/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  96. package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  97. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +64 -9
  98. package/dist/lite/packages/firestore/src/local/local_store.d.ts +9 -0
  99. package/dist/lite/packages/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
  100. package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  101. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +1 -0
  102. package/dist/lite/packages/firestore/src/local/overlayed_document.d.ts +36 -0
  103. package/dist/lite/packages/firestore/src/local/persistence.d.ts +3 -5
  104. package/dist/lite/packages/firestore/src/local/persistence_promise.d.ts +11 -0
  105. package/dist/lite/packages/firestore/src/local/query_engine.d.ts +1 -1
  106. package/dist/lite/packages/firestore/src/model/collections.d.ts +8 -2
  107. package/dist/lite/packages/firestore/src/model/field_mask.d.ts +6 -0
  108. package/dist/lite/packages/firestore/src/model/mutation.d.ts +19 -1
  109. package/dist/lite/packages/firestore/src/model/mutation_batch.d.ts +8 -4
  110. package/dist/lite/packages/firestore/src/util/async_queue.d.ts +5 -1
  111. package/dist/lite/packages/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
  112. package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  113. package/dist/lite/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
  114. package/dist/lite/packages/firestore/test/util/helpers.d.ts +13 -0
  115. package/dist/lite/private.d.ts +2776 -2758
  116. package/dist/packages/firestore/dist/index.esm2017.d.ts +203 -201
  117. package/dist/packages/firestore/src/api/transaction.d.ts +2 -0
  118. package/dist/packages/firestore/src/core/component_provider.d.ts +11 -6
  119. package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -0
  120. package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
  121. package/dist/packages/firestore/src/local/index_backfiller.d.ts +44 -0
  122. package/dist/packages/firestore/src/local/index_manager.d.ts +2 -0
  123. package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  124. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
  125. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +3 -2
  126. package/dist/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  127. package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  128. package/dist/packages/firestore/src/local/local_documents_view.d.ts +64 -9
  129. package/dist/packages/firestore/src/local/local_store.d.ts +9 -0
  130. package/dist/packages/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
  131. package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  132. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +1 -0
  133. package/dist/packages/firestore/src/local/overlayed_document.d.ts +36 -0
  134. package/dist/packages/firestore/src/local/persistence.d.ts +3 -5
  135. package/dist/packages/firestore/src/local/persistence_promise.d.ts +11 -0
  136. package/dist/packages/firestore/src/local/query_engine.d.ts +1 -1
  137. package/dist/packages/firestore/src/model/collections.d.ts +8 -2
  138. package/dist/packages/firestore/src/model/field_mask.d.ts +6 -0
  139. package/dist/packages/firestore/src/model/mutation.d.ts +19 -1
  140. package/dist/packages/firestore/src/model/mutation_batch.d.ts +8 -4
  141. package/dist/packages/firestore/src/util/async_queue.d.ts +5 -1
  142. package/dist/packages/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
  143. package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  144. package/dist/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
  145. package/dist/packages/firestore/test/util/helpers.d.ts +13 -0
  146. package/dist/private.d.ts +5845 -5672
  147. 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 { GarbageCollectionScheduler, Persistence } from '../../../src/local/persistence';
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): GarbageCollectionScheduler | null;
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): GarbageCollectionScheduler | null;
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.