@firebase/firestore 3.4.1-canary.4f3662b70 → 3.4.1-canary.7f05d22e8

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 (36) hide show
  1. package/dist/firestore/src/index/ordered_code_writer.d.ts +20 -9
  2. package/dist/firestore/src/util/byte_string.d.ts +1 -0
  3. package/dist/firestore/test/util/helpers.d.ts +1 -0
  4. package/dist/index.esm2017.js +43 -34
  5. package/dist/index.esm2017.js.map +1 -1
  6. package/dist/index.esm5.js +37 -27
  7. package/dist/index.esm5.js.map +1 -1
  8. package/dist/index.node.cjs.js +29 -15
  9. package/dist/index.node.cjs.js.map +1 -1
  10. package/dist/index.node.mjs +29 -15
  11. package/dist/index.node.mjs.map +1 -1
  12. package/dist/index.rn.js +43 -34
  13. package/dist/index.rn.js.map +1 -1
  14. package/dist/internal.d.ts +1 -0
  15. package/dist/lite/firestore/src/index/ordered_code_writer.d.ts +20 -9
  16. package/dist/lite/firestore/src/util/byte_string.d.ts +1 -0
  17. package/dist/lite/firestore/test/util/helpers.d.ts +1 -0
  18. package/dist/lite/index.browser.esm2017.js +1129 -1117
  19. package/dist/lite/index.browser.esm2017.js.map +1 -1
  20. package/dist/lite/index.browser.esm5.js +34 -21
  21. package/dist/lite/index.browser.esm5.js.map +1 -1
  22. package/dist/lite/index.node.cjs.js +15 -2
  23. package/dist/lite/index.node.cjs.js.map +1 -1
  24. package/dist/lite/index.node.mjs +15 -2
  25. package/dist/lite/index.node.mjs.map +1 -1
  26. package/dist/lite/index.rn.esm2017.js +138 -126
  27. package/dist/lite/index.rn.esm2017.js.map +1 -1
  28. package/dist/lite/internal.d.ts +1 -0
  29. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +108 -108
  30. package/dist/lite/packages/firestore/src/index/ordered_code_writer.d.ts +20 -9
  31. package/dist/lite/packages/firestore/src/util/byte_string.d.ts +1 -0
  32. package/dist/lite/packages/firestore/test/util/helpers.d.ts +1 -0
  33. package/dist/packages/firestore/src/index/ordered_code_writer.d.ts +20 -9
  34. package/dist/packages/firestore/src/util/byte_string.d.ts +1 -0
  35. package/dist/packages/firestore/test/util/helpers.d.ts +1 -0
  36. package/package.json +9 -9
@@ -14,12 +14,32 @@ export declare function numberOfLeadingZerosInByte(x: number): number;
14
14
  export declare class OrderedCodeWriter {
15
15
  buffer: Uint8Array;
16
16
  position: number;
17
+ writeBytesAscending(value: ByteString): void;
18
+ writeBytesDescending(value: ByteString): void;
17
19
  /** Writes utf8 bytes into this byte sequence, ascending. */
18
20
  writeUtf8Ascending(sequence: string): void;
19
21
  /** Writes utf8 bytes into this byte sequence, descending */
20
22
  writeUtf8Descending(sequence: string): void;
21
23
  writeNumberAscending(val: number): void;
22
24
  writeNumberDescending(val: number): void;
25
+ /**
26
+ * Writes the "infinity" byte sequence that sorts after all other byte
27
+ * sequences written in ascending order.
28
+ */
29
+ writeInfinityAscending(): void;
30
+ /**
31
+ * Writes the "infinity" byte sequence that sorts before all other byte
32
+ * sequences written in descending order.
33
+ */
34
+ writeInfinityDescending(): void;
35
+ /**
36
+ * Resets the buffer such that it is the same as when it was newly
37
+ * constructed.
38
+ */
39
+ reset(): void;
40
+ seed(encodedBytes: Uint8Array): void;
41
+ /** Makes a copy of the encoded bytes in this buffer. */
42
+ encodedBytes(): Uint8Array;
23
43
  /**
24
44
  * Encodes `val` into an encoding so that the order matches the IEEE 754
25
45
  * floating-point comparison results with the following exceptions:
@@ -28,10 +48,6 @@ export declare class OrderedCodeWriter {
28
48
  * NaN = NaN
29
49
  */
30
50
  private toOrderedBits;
31
- /** Resets the buffer such that it is the same as when it was newly constructed. */
32
- reset(): void;
33
- /** Makes a copy of the encoded bytes in this buffer. */
34
- encodedBytes(): Uint8Array;
35
51
  /** Writes a single byte ascending to the buffer. */
36
52
  private writeByteAscending;
37
53
  /** Writes a single byte descending to the buffer. */
@@ -40,10 +56,5 @@ export declare class OrderedCodeWriter {
40
56
  private writeSeparatorDescending;
41
57
  private writeEscapedByteAscending;
42
58
  private writeEscapedByteDescending;
43
- writeBytesAscending(value: ByteString): void;
44
- writeBytesDescending(value: ByteString): void;
45
- writeInfinityAscending(): void;
46
- writeInfinityDescending(): void;
47
- seed(encodedBytes: Uint8Array): void;
48
59
  private ensureAvailable;
49
60
  }
@@ -29,6 +29,7 @@ export declare class ByteString {
29
29
  private constructor();
30
30
  static fromBase64String(base64: string): ByteString;
31
31
  static fromUint8Array(array: Uint8Array): ByteString;
32
+ [Symbol.iterator](): Iterator<number>;
32
33
  toBase64(): string;
33
34
  toUint8Array(): Uint8Array;
34
35
  approximateByteSize(): number;
@@ -71,6 +71,7 @@ export declare function bound(values: Array<[string, {}, firestore.OrderByDirect
71
71
  export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
72
72
  export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
73
73
  export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
74
+ export declare function existenceFilterEvent(targetId: number, count: number, snapshotVersion: number): RemoteEvent;
74
75
  export declare function docAddedRemoteEvent(docOrDocs: MutableDocument | MutableDocument[], updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], activeTargets?: TargetId[]): RemoteEvent;
75
76
  export declare function docUpdateRemoteEvent(doc: MutableDocument, updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], limboTargets?: TargetId[]): RemoteEvent;
76
77
  export declare class TestBundledDocuments {
@@ -66,7 +66,7 @@ C.MOCK_USER = new C("mock-user");
66
66
  * See the License for the specific language governing permissions and
67
67
  * limitations under the License.
68
68
  */
69
- let N = "9.6.1-canary.4f3662b70";
69
+ let N = "9.6.1-canary.7f05d22e8";
70
70
 
71
71
  /**
72
72
  * @license
@@ -1264,6 +1264,18 @@ function yt() {
1264
1264
  */ (t);
1265
1265
  return new pt(e);
1266
1266
  }
1267
+ [Symbol.iterator]() {
1268
+ let t = 0;
1269
+ return {
1270
+ next: () => t < this.binaryString.length ? {
1271
+ value: this.binaryString.charCodeAt(t++),
1272
+ done: !1
1273
+ } : {
1274
+ value: void 0,
1275
+ done: !0
1276
+ }
1277
+ };
1278
+ }
1267
1279
  toBase64() {
1268
1280
  return t = this.binaryString, btoa(t);
1269
1281
  /** Converts a binary string to a Base64 encoded string. */
@@ -9004,21 +9016,19 @@ function mr(t) {
9004
9016
  // Reset newTargetDataByTargetMap in case this transaction gets re-run.
9005
9017
  i = n.qn;
9006
9018
  const o = [];
9007
- e.targetChanges.forEach(((e, r) => {
9008
- const a = i.get(r);
9009
- if (!a) return;
9019
+ e.targetChanges.forEach(((r, a) => {
9020
+ const c = i.get(a);
9021
+ if (!c) return;
9010
9022
  // Only update the remote keys if the target is still active. This
9011
9023
  // ensures that we can persist the updated target data along with
9012
9024
  // the updated assignment.
9013
- o.push(n.He.removeMatchingKeys(t, e.removedDocuments, r).next((() => n.He.addMatchingKeys(t, e.addedDocuments, r))));
9014
- const c = e.resumeToken;
9015
- // Update the resume token if the change includes one.
9016
- if (c.approximateByteSize() > 0) {
9017
- const u = a.withResumeToken(c, s).withSequenceNumber(t.currentSequenceNumber);
9018
- i = i.insert(r, u),
9019
- // Update the target data if there are target changes (or if
9020
- // sufficient time has passed since the last update).
9021
- /**
9025
+ o.push(n.He.removeMatchingKeys(t, r.removedDocuments, a).next((() => n.He.addMatchingKeys(t, r.addedDocuments, a))));
9026
+ let u = c.withSequenceNumber(t.currentSequenceNumber);
9027
+ e.targetMismatches.has(a) ? u = u.withResumeToken(pt.EMPTY_BYTE_STRING, ut.min()).withLastLimboFreeSnapshotVersion(ut.min()) : r.resumeToken.approximateByteSize() > 0 && (u = u.withResumeToken(r.resumeToken, s)),
9028
+ i = i.insert(a, u),
9029
+ // Update the target data if there are target changes (or if
9030
+ // sufficient time has passed since the last update).
9031
+ /**
9022
9032
  * Returns true if the newTargetData should be persisted during an update of
9023
9033
  * an active target. TargetData should always be persisted when a target is
9024
9034
  * being released and should not call this function.
@@ -9029,26 +9039,25 @@ function mr(t) {
9029
9039
  * values from getting too stale after a crash, but this doesn't have to be
9030
9040
  * too frequent.
9031
9041
  */
9032
- function(t, e, n) {
9033
- // Always persist target data if we don't already have a resume token.
9034
- if (U(e.resumeToken.approximateByteSize() > 0), 0 === t.resumeToken.approximateByteSize()) return !0;
9035
- // Don't allow resume token changes to be buffered indefinitely. This
9036
- // allows us to be reasonably up-to-date after a crash and avoids needing
9037
- // to loop over all active queries on shutdown. Especially in the browser
9038
- // we may not get time to do anything interesting while the current tab is
9039
- // closing.
9040
- if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;
9041
- // Otherwise if the only thing that has changed about a target is its resume
9042
- // token it's not worth persisting. Note that the RemoteStore keeps an
9043
- // in-memory view of the currently active targets which includes the current
9044
- // resume token, so stream failure or user changes will still use an
9045
- // up-to-date resume token regardless of what we do here.
9046
- return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;
9047
- }
9048
- /**
9049
- * Notifies local store of the changed views to locally pin documents.
9050
- */ (a, u, e) && o.push(n.He.updateTargetData(t, u));
9042
+ function(t, e, n) {
9043
+ // Always persist target data if we don't already have a resume token.
9044
+ if (0 === t.resumeToken.approximateByteSize()) return !0;
9045
+ // Don't allow resume token changes to be buffered indefinitely. This
9046
+ // allows us to be reasonably up-to-date after a crash and avoids needing
9047
+ // to loop over all active queries on shutdown. Especially in the browser
9048
+ // we may not get time to do anything interesting while the current tab is
9049
+ // closing.
9050
+ if (e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8) return !0;
9051
+ // Otherwise if the only thing that has changed about a target is its resume
9052
+ // token it's not worth persisting. Note that the RemoteStore keeps an
9053
+ // in-memory view of the currently active targets which includes the current
9054
+ // resume token, so stream failure or user changes will still use an
9055
+ // up-to-date resume token regardless of what we do here.
9056
+ return n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0;
9051
9057
  }
9058
+ /**
9059
+ * Notifies local store of the changed views to locally pin documents.
9060
+ */ (c, u, r) && o.push(n.He.updateTargetData(t, u));
9052
9061
  }));
9053
9062
  let a = Rn();
9054
9063
  // HACK: The only reason we allow a null snapshot version is so that we
@@ -17832,9 +17841,9 @@ function Ah(t, e) {
17832
17841
  return n = Object.assign({
17833
17842
  useFetchStreams: e
17834
17843
  }, n), i._setSettings(n), i;
17835
- }), "PUBLIC")), registerVersion(D, "3.4.1-canary.4f3662b70", t),
17844
+ }), "PUBLIC")), registerVersion(D, "3.4.1-canary.7f05d22e8", t),
17836
17845
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
17837
- registerVersion(D, "3.4.1-canary.4f3662b70", "esm2017");
17846
+ registerVersion(D, "3.4.1-canary.7f05d22e8", "esm2017");
17838
17847
  }();
17839
17848
 
17840
17849
  export { oh as AbstractUserDataWriter, nu as Bytes, Fc as CACHE_SIZE_UNLIMITED, Vc as CollectionReference, Pc as DocumentReference, $u as DocumentSnapshot, tu as FieldPath, su as FieldValue, Mc as Firestore, Q as FirestoreError, iu as GeoPoint, Oc as LoadBundleTask, vc as Query, Uu as QueryConstraint, Ou as QueryDocumentSnapshot, Fu as QuerySnapshot, xu as SnapshotMetadata, ct as Timestamp, Ph as Transaction, uh as WriteBatch, wc as _DatabaseId, Dt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, mt as _FieldPath, Ec as _cast, q as _debugAssert, yt as _isBase64Available, M as _logWarn, gc as _validateIsNotUsedTogether, Eh as addDoc, Ch as arrayRemove, Dh as arrayUnion, Wc as clearIndexedDbPersistence, Sc as collection, Dc as collectionGroup, bc as connectFirestoreEmulator, Th as deleteDoc, Vh as deleteField, Hc as disableNetwork, Cc as doc, eu as documentId, Kc as enableIndexedDbPersistence, jc as enableMultiTabIndexedDbPersistence, zc as enableNetwork, eh as endAt, th as endBefore, Uc as ensureFirestoreConfigured, Rh as executeWrite, lh as getDoc, dh as getDocFromCache, wh as getDocFromServer, _h as getDocs, mh as getDocsFromCache, gh as getDocsFromServer, Bc as getFirestore, Nh as increment, Lc as initializeFirestore, zu as limit, Hu as limitToLast, Yc as loadBundle, Xc as namedQuery, Ih as onSnapshot, Ah as onSnapshotsInSync, Wu as orderBy, qu as query, kc as queryEqual, Nc as refEqual, vh as runTransaction, Sh as serverTimestamp, yh as setDoc, $ as setLogLevel, Lu as snapshotEqual, Xu as startAfter, Yu as startAt, Jc as terminate, ph as updateDoc, Gc as waitForPendingWrites, ju as where, kh as writeBatch };