@firebase/firestore 4.4.0-canary.537d39982 → 4.4.0-canary.6ea51fbfa

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 (35) hide show
  1. package/dist/firestore/src/core/firestore_client.d.ts +1 -1
  2. package/dist/firestore/src/global_index.d.ts +1 -1
  3. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +1 -2
  4. package/dist/firestore/src/local/local_serializer.d.ts +1 -2
  5. package/dist/index.cjs.js +20 -20
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.esm2017.js +20 -20
  8. package/dist/index.esm2017.js.map +1 -1
  9. package/dist/index.esm5.js +41 -52
  10. package/dist/index.esm5.js.map +1 -1
  11. package/dist/index.node.cjs.js +16 -19
  12. package/dist/index.node.cjs.js.map +1 -1
  13. package/dist/index.node.mjs +16 -19
  14. package/dist/index.node.mjs.map +1 -1
  15. package/dist/index.rn.js +20 -20
  16. package/dist/index.rn.js.map +1 -1
  17. package/dist/internal.d.ts +1 -1
  18. package/dist/lite/firestore/src/core/firestore_client.d.ts +1 -1
  19. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +1 -2
  20. package/dist/lite/firestore/src/local/local_serializer.d.ts +1 -2
  21. package/dist/lite/index.browser.esm2017.js +2 -2
  22. package/dist/lite/index.browser.esm5.js +2 -2
  23. package/dist/lite/index.cjs.js +2 -2
  24. package/dist/lite/index.node.cjs.js +2 -2
  25. package/dist/lite/index.node.mjs +2 -2
  26. package/dist/lite/index.rn.esm2017.js +2 -2
  27. package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +1 -1
  28. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -2
  29. package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +1 -2
  30. package/dist/packages/firestore/dist/index.esm2017.d.ts +0 -1
  31. package/dist/packages/firestore/src/core/firestore_client.d.ts +1 -1
  32. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -2
  33. package/dist/packages/firestore/src/local/local_serializer.d.ts +1 -2
  34. package/dist/private.d.ts +1 -1
  35. package/package.json +9 -9
@@ -76,7 +76,7 @@ export declare class FirestoreClient {
76
76
  * an async I/O to complete).
77
77
  */
78
78
  asyncQueue: AsyncQueue, databaseInfo: DatabaseInfo);
79
- getConfiguration(): Promise<ComponentConfiguration>;
79
+ get configuration(): ComponentConfiguration;
80
80
  setCredentialChangeListener(listener: (user: User) => Promise<void>): void;
81
81
  setAppCheckTokenChangeListener(listener: (appCheckToken: string, user: User) => Promise<void>): void;
82
82
  /**
@@ -6888,7 +6888,7 @@ declare class FirestoreClient {
6888
6888
  * an async I/O to complete).
6889
6889
  */
6890
6890
  asyncQueue: AsyncQueue, databaseInfo: DatabaseInfo);
6891
- getConfiguration(): Promise<ComponentConfiguration>;
6891
+ get configuration(): ComponentConfiguration;
6892
6892
  setCredentialChangeListener(listener: (user: User) => Promise<void>): void;
6893
6893
  setAppCheckTokenChangeListener(listener: (appCheckToken: string, user: User) => Promise<void>): void;
6894
6894
  /**
@@ -32,7 +32,6 @@ import { PersistenceTransaction } from './persistence_transaction';
32
32
  * data as it supports multi-tab access.
33
33
  */
34
34
  export declare class IndexedDbIndexManager implements IndexManager {
35
- private user;
36
35
  private readonly databaseId;
37
36
  /**
38
37
  * An in-memory copy of the index entries we've already written since the SDK
@@ -42,7 +41,7 @@ export declare class IndexedDbIndexManager implements IndexManager {
42
41
  * used to satisfy reads.
43
42
  */
44
43
  private collectionParentsCache;
45
- private uid;
44
+ private readonly uid;
46
45
  /**
47
46
  * Maps from a target to its equivalent list of sub-targets. Each sub-target
48
47
  * contains only one term from the target's disjunctive normal form (DNF).
@@ -14,7 +14,6 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { User } from '../auth/user';
18
17
  import { BundleMetadata, NamedQuery } from '../core/bundle';
19
18
  import { Query } from '../core/query';
20
19
  import { SnapshotVersion } from '../core/snapshot_version';
@@ -78,4 +77,4 @@ export declare function toDbDocumentOverlay(localSerializer: LocalSerializer, us
78
77
  export declare function toDbDocumentOverlayKey(userId: string, docKey: DocumentKey): DbDocumentOverlayKey;
79
78
  export declare function toDbIndexConfiguration(index: FieldIndex): DbIndexConfiguration;
80
79
  export declare function fromDbIndexConfiguration(index: DbIndexConfiguration, state: DbIndexState | null): FieldIndex;
81
- export declare function toDbIndexState(indexId: number, user: User, sequenceNumber: number, offset: IndexOffset): DbIndexState;
80
+ export declare function toDbIndexState(indexId: number, uid: string, sequenceNumber: number, offset: IndexOffset): DbIndexState;
package/dist/index.cjs.js CHANGED
@@ -70,7 +70,7 @@ User.MOCK_USER = new User("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- let S = "10.7.1-canary.537d39982";
73
+ let S = "10.7.1-canary.6ea51fbfa";
74
74
 
75
75
  /**
76
76
  * @license
@@ -2034,12 +2034,12 @@ class __PRIVATE_IndexBackfillerScheduler {
2034
2034
  return null !== this.task;
2035
2035
  }
2036
2036
  ee(e) {
2037
- __PRIVATE_logDebug("IndexBackiller", `Scheduled in ${e}ms`), this.task = this.asyncQueue.enqueueAfterDelay("index_backfill" /* TimerId.IndexBackfill */ , e, (async () => {
2037
+ __PRIVATE_logDebug("IndexBackfiller", `Scheduled in ${e}ms`), this.task = this.asyncQueue.enqueueAfterDelay("index_backfill" /* TimerId.IndexBackfill */ , e, (async () => {
2038
2038
  this.task = null;
2039
2039
  try {
2040
- __PRIVATE_logDebug("IndexBackiller", `Documents written: ${await this.X.te()}`);
2040
+ __PRIVATE_logDebug("IndexBackfiller", `Documents written: ${await this.X.te()}`);
2041
2041
  } catch (e) {
2042
- __PRIVATE_isIndexedDbTransactionError(e) ? __PRIVATE_logDebug("IndexBackiller", "Ignoring IndexedDB error during index backfill: ", e) : await __PRIVATE_ignoreIfPrimaryLeaseLoss(e);
2042
+ __PRIVATE_isIndexedDbTransactionError(e) ? __PRIVATE_logDebug("IndexBackfiller", "Ignoring IndexedDB error during index backfill: ", e) : await __PRIVATE_ignoreIfPrimaryLeaseLoss(e);
2043
2043
  }
2044
2044
  await this.ee(6e4);
2045
2045
  }));
@@ -2065,7 +2065,7 @@ class __PRIVATE_IndexBackfillerScheduler {
2065
2065
  const n = new Set;
2066
2066
  let r = t, i = !0;
2067
2067
  return PersistencePromise.doWhile((() => !0 === i && r > 0), (() => this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next((t => {
2068
- if (null !== t && !n.has(t)) return __PRIVATE_logDebug("IndexBackiller", `Processing collection: ${t}`),
2068
+ if (null !== t && !n.has(t)) return __PRIVATE_logDebug("IndexBackfiller", `Processing collection: ${t}`),
2069
2069
  this.re(e, t, r).next((e => {
2070
2070
  r -= e, n.add(t);
2071
2071
  }));
@@ -2078,7 +2078,7 @@ class __PRIVATE_IndexBackfillerScheduler {
2078
2078
  // Use the earliest offset of all field indexes to query the local cache.
2079
2079
  return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e, t).next((r => this.localStore.localDocuments.getNextDocuments(e, t, r, n).next((n => {
2080
2080
  const i = n.changes;
2081
- return this.localStore.indexManager.updateIndexEntries(e, i).next((() => this.ie(r, n))).next((n => (__PRIVATE_logDebug("IndexBackiller", `Updating offset: ${n}`),
2081
+ return this.localStore.indexManager.updateIndexEntries(e, i).next((() => this.ie(r, n))).next((n => (__PRIVATE_logDebug("IndexBackfiller", `Updating offset: ${n}`),
2082
2082
  this.localStore.indexManager.updateCollectionGroup(e, t, n)))).next((() => i.size));
2083
2083
  }))));
2084
2084
  }
@@ -7377,7 +7377,7 @@ function __PRIVATE_toDbDocumentOverlayKey(e, t) {
7377
7377
  function __PRIVATE_toDbIndexState(e, t, n, r) {
7378
7378
  return {
7379
7379
  indexId: e,
7380
- uid: t.uid || "",
7380
+ uid: t,
7381
7381
  sequenceNumber: n,
7382
7382
  readTime: __PRIVATE_toDbTimestamp(r.readTime),
7383
7383
  documentKey: __PRIVATE_encodeResourcePath(r.documentKey.path),
@@ -8382,7 +8382,7 @@ function __PRIVATE_applyDistributionFieldAndCompositeFilters(e, t) {
8382
8382
  */
8383
8383
  class __PRIVATE_IndexedDbIndexManager {
8384
8384
  constructor(e, t) {
8385
- this.user = e, this.databaseId = t,
8385
+ this.databaseId = t,
8386
8386
  /**
8387
8387
  * An in-memory copy of the index entries we've already written since the SDK
8388
8388
  * launched. Used to avoid re-writing the same entry repeatedly.
@@ -8452,7 +8452,7 @@ class __PRIVATE_IndexedDbIndexManager {
8452
8452
  if (t.indexState) {
8453
8453
  const n = __PRIVATE_indexStateStore(e);
8454
8454
  return i.next((e => {
8455
- n.put(__PRIVATE_toDbIndexState(e, this.user, t.indexState.sequenceNumber, t.indexState.offset));
8455
+ n.put(__PRIVATE_toDbIndexState(e, this.uid, t.indexState.sequenceNumber, t.indexState.offset));
8456
8456
  }));
8457
8457
  }
8458
8458
  return i.next();
@@ -8734,7 +8734,7 @@ class __PRIVATE_IndexedDbIndexManager {
8734
8734
  }
8735
8735
  updateCollectionGroup(e, t, n) {
8736
8736
  const r = __PRIVATE_indexConfigurationStore(e), i = __PRIVATE_indexStateStore(e);
8737
- return this.gn(e).next((e => r.W("collectionGroupIndex", IDBKeyRange.bound(t, t)).next((t => PersistencePromise.forEach(t, (t => i.put(__PRIVATE_toDbIndexState(t.indexId, this.user, e, n))))))));
8737
+ return this.gn(e).next((e => r.W("collectionGroupIndex", IDBKeyRange.bound(t, t)).next((t => PersistencePromise.forEach(t, (t => i.put(__PRIVATE_toDbIndexState(t.indexId, this.uid, e, n))))))));
8738
8738
  }
8739
8739
  updateIndexEntries(e, t) {
8740
8740
  // Porting Note: `getFieldIndexes()` on Web does not cache index lookups as
@@ -16748,8 +16748,9 @@ class MemoryOfflineComponentProvider {
16748
16748
  return new __PRIVATE_MemorySharedClientState;
16749
16749
  }
16750
16750
  async terminate() {
16751
- this.gcScheduler && this.gcScheduler.stop(), await this.sharedClientState.shutdown(),
16752
- await this.persistence.shutdown();
16751
+ var e, t;
16752
+ null === (e = this.gcScheduler) || void 0 === e || e.stop(), null === (t = this.indexBackfillerScheduler) || void 0 === t || t.stop(),
16753
+ this.sharedClientState.shutdown(), await this.persistence.shutdown();
16753
16754
  }
16754
16755
  }
16755
16756
 
@@ -16883,6 +16884,7 @@ class __PRIVATE_LruGcMemoryOfflineComponentProvider extends MemoryOfflineCompone
16883
16884
  }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, e.initialUser, e.maxConcurrentLimboResolutions, t);
16884
16885
  }
16885
16886
  async terminate() {
16887
+ var e;
16886
16888
  await async function __PRIVATE_remoteStoreShutdown(e) {
16887
16889
  const t = __PRIVATE_debugCast(e);
16888
16890
  __PRIVATE_logDebug("RemoteStore", "RemoteStore shutting down."), t.v_.add(5 /* OfflineCause.Shutdown */),
@@ -16890,7 +16892,7 @@ class __PRIVATE_LruGcMemoryOfflineComponentProvider extends MemoryOfflineCompone
16890
16892
  // Set the OnlineState to Unknown (rather than Offline) to avoid potentially
16891
16893
  // triggering spurious listener events with cached data, etc.
16892
16894
  t.x_.set("Unknown" /* OnlineState.Unknown */);
16893
- }(this.remoteStore), this.datastore && await this.datastore.terminate();
16895
+ }(this.remoteStore), null === (e = this.datastore) || void 0 === e || e.terminate();
16894
16896
  }
16895
16897
  }
16896
16898
 
@@ -17380,7 +17382,7 @@ class FirestoreClient {
17380
17382
  })), this.appCheckCredentials.start(n, (e => (__PRIVATE_logDebug("FirestoreClient", "Received new app check token=", e),
17381
17383
  this.appCheckCredentialListener(e, this.user))));
17382
17384
  }
17383
- async getConfiguration() {
17385
+ get configuration() {
17384
17386
  return {
17385
17387
  asyncQueue: this.asyncQueue,
17386
17388
  databaseInfo: this.databaseInfo,
@@ -17423,7 +17425,7 @@ class FirestoreClient {
17423
17425
 
17424
17426
  async function __PRIVATE_setOfflineComponentProvider(e, t) {
17425
17427
  e.asyncQueue.verifyOperationInProgress(), __PRIVATE_logDebug("FirestoreClient", "Initializing OfflineComponentProvider");
17426
- const n = await e.getConfiguration();
17428
+ const n = e.configuration;
17427
17429
  await t.initialize(n);
17428
17430
  let r = n.initialUser;
17429
17431
  e.setCredentialChangeListener((async e => {
@@ -17437,9 +17439,7 @@ async function __PRIVATE_setOfflineComponentProvider(e, t) {
17437
17439
  async function __PRIVATE_setOnlineComponentProvider(e, t) {
17438
17440
  e.asyncQueue.verifyOperationInProgress();
17439
17441
  const n = await __PRIVATE_ensureOfflineComponents(e);
17440
- __PRIVATE_logDebug("FirestoreClient", "Initializing OnlineComponentProvider");
17441
- const r = await e.getConfiguration();
17442
- await t.initialize(n, r),
17442
+ __PRIVATE_logDebug("FirestoreClient", "Initializing OnlineComponentProvider"), await t.initialize(n, e.configuration),
17443
17443
  // The CredentialChangeListener of the online component provider takes
17444
17444
  // precedence over the offline component provider.
17445
17445
  e.setCredentialChangeListener((e => __PRIVATE_remoteStoreHandleCredentialChange(t.remoteStore, e))),
@@ -21819,9 +21819,9 @@ let Se = null;
21819
21819
  return r = Object.assign({
21820
21820
  useFetchStreams: t
21821
21821
  }, r), s._setSettings(r), s;
21822
- }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.4.0-canary.537d39982", e),
21822
+ }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(w, "4.4.0-canary.6ea51fbfa", e),
21823
21823
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
21824
- app.registerVersion(w, "4.4.0-canary.537d39982", "cjs2017");
21824
+ app.registerVersion(w, "4.4.0-canary.6ea51fbfa", "cjs2017");
21825
21825
  }();
21826
21826
 
21827
21827
  exports.AbstractUserDataWriter = AbstractUserDataWriter;