@firebase/firestore 3.4.3-202202014332 → 3.4.3-canary.2d04af91d

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 (44) hide show
  1. package/dist/firestore/src/api/database.d.ts +14 -9
  2. package/dist/firestore/src/api/index_configuration.d.ts +117 -0
  3. package/dist/firestore/src/api.d.ts +1 -0
  4. package/dist/firestore/src/model/field_index.d.ts +76 -0
  5. package/dist/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
  6. package/dist/index.d.ts +15 -9
  7. package/dist/index.esm2017.js +70 -13
  8. package/dist/index.esm2017.js.map +1 -1
  9. package/dist/index.esm5.js +85 -28
  10. package/dist/index.esm5.js.map +1 -1
  11. package/dist/index.node.cjs.js +91 -11
  12. package/dist/index.node.cjs.js.map +1 -1
  13. package/dist/index.node.mjs +91 -12
  14. package/dist/index.node.mjs.map +1 -1
  15. package/dist/index.rn.js +112 -13
  16. package/dist/index.rn.js.map +1 -1
  17. package/dist/internal.d.ts +118 -9
  18. package/dist/lite/firestore/src/api/database.d.ts +14 -9
  19. package/dist/lite/firestore/src/api/index_configuration.d.ts +117 -0
  20. package/dist/lite/firestore/src/api.d.ts +1 -0
  21. package/dist/lite/firestore/src/model/field_index.d.ts +76 -0
  22. package/dist/lite/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
  23. package/dist/lite/index.browser.esm2017.js +2 -2
  24. package/dist/lite/index.browser.esm2017.js.map +1 -1
  25. package/dist/lite/index.browser.esm5.js +42 -42
  26. package/dist/lite/index.browser.esm5.js.map +1 -1
  27. package/dist/lite/index.node.cjs.js +2 -2
  28. package/dist/lite/index.node.mjs +2 -2
  29. package/dist/lite/index.node.mjs.map +1 -1
  30. package/dist/lite/index.rn.esm2017.js +2 -2
  31. package/dist/lite/index.rn.esm2017.js.map +1 -1
  32. package/dist/lite/packages/firestore/src/api/database.d.ts +14 -9
  33. package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +117 -0
  34. package/dist/lite/packages/firestore/src/api.d.ts +1 -0
  35. package/dist/lite/packages/firestore/src/model/field_index.d.ts +76 -0
  36. package/dist/lite/packages/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
  37. package/dist/packages/firestore/dist/index.esm2017.d.ts +31 -10
  38. package/dist/packages/firestore/src/api/database.d.ts +14 -9
  39. package/dist/packages/firestore/src/api/index_configuration.d.ts +117 -0
  40. package/dist/packages/firestore/src/api.d.ts +1 -0
  41. package/dist/packages/firestore/src/model/field_index.d.ts +76 -0
  42. package/dist/packages/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
  43. package/dist/private.d.ts +22 -9
  44. package/package.json +9 -9
@@ -70,7 +70,7 @@ O.MOCK_USER = new O("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- var M = "9.6.4-202202014332", F = new h("@firebase/firestore");
73
+ var M = "9.6.4-canary.2d04af91d", F = new h("@firebase/firestore");
74
74
 
75
75
  /**
76
76
  * @license
@@ -16047,13 +16047,13 @@ function Pa(t) {
16047
16047
  /**
16048
16048
  * Loads a Firestore bundle into the local cache.
16049
16049
  *
16050
- * @param firestore - The {@link Firestore} instance to load bundles for for.
16051
- * @param bundleData - An object representing the bundle to be loaded. Valid objects are
16052
- * `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.
16050
+ * @param firestore - The {@link Firestore} instance to load bundles for.
16051
+ * @param bundleData - An object representing the bundle to be loaded. Valid
16052
+ * objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.
16053
16053
  *
16054
- * @returns
16055
- * A `LoadBundleTask` object, which notifies callers with progress updates, and completion
16056
- * or error events. It can be used as a `Promise<LoadBundleTaskProgress>`.
16054
+ * @returns A `LoadBundleTask` object, which notifies callers with progress
16055
+ * updates, and completion or error events. It can be used as a
16056
+ * `Promise<LoadBundleTaskProgress>`.
16057
16057
  */;
16058
16058
  }
16059
16059
 
@@ -16086,11 +16086,16 @@ function Va(t, e) {
16086
16086
  }));
16087
16087
  }(i, t._databaseId, e, o), o
16088
16088
  /**
16089
- * Reads a Firestore {@link Query} from local cache, identified by the given name.
16089
+ * Reads a Firestore {@link Query} from local cache, identified by the given
16090
+ * name.
16090
16091
  *
16091
16092
  * The named queries are packaged into bundles on the server side (along
16092
- * with resulting documents), and loaded to local cache using `loadBundle`. Once in local
16093
- * cache, use this method to extract a {@link Query} by name.
16093
+ * with resulting documents), and loaded to local cache using `loadBundle`. Once
16094
+ * in local cache, use this method to extract a {@link Query} by name.
16095
+ *
16096
+ * @param firestore - The {@link Firestore} instance to read the query from.
16097
+ * @param name - The name of the query.
16098
+ * @returns A `Promise` that is resolved with the Query or `null`.
16094
16099
  */;
16095
16100
  }
16096
16101
 
@@ -18207,7 +18212,7 @@ function hh(t, e) {
18207
18212
  * The `Transaction` object passed to a transaction's `updateFunction` provides
18208
18213
  * the methods to read and write data within the transaction context. See
18209
18214
  * {@link runTransaction}.
18210
- */ var dh, ph = /** @class */ function(e) {
18215
+ */ var dh = /** @class */ function(e) {
18211
18216
  // This class implements the same logic as the Transaction API in the Lite SDK
18212
18217
  // but is subclassed in order to return its own DocumentSnapshot types.
18213
18218
  /** @hideconstructor */
@@ -18287,7 +18292,7 @@ function hh(t, e) {
18287
18292
  * (the `updateFunction` returned a failed promise), the promise returned by the
18288
18293
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
18289
18294
  * rejected promise with the corresponding failure error is returned.
18290
- */ function yh(t, e) {
18295
+ */ function ph(t, e) {
18291
18296
  return function(t, e) {
18292
18297
  var i = this, o = new J;
18293
18298
  return t.asyncQueue.enqueueAndForget((function() {
@@ -18309,7 +18314,7 @@ function hh(t, e) {
18309
18314
  }));
18310
18315
  })), o.promise;
18311
18316
  }(Da(t = aa(t, _a)), (function(n) {
18312
- return e(new ph(t, n));
18317
+ return e(new dh(t, n));
18313
18318
  }));
18314
18319
  }
18315
18320
 
@@ -18332,14 +18337,14 @@ function hh(t, e) {
18332
18337
  /**
18333
18338
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
18334
18339
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
18335
- */ function vh() {
18340
+ */ function yh() {
18336
18341
  return new tc("deleteField");
18337
18342
  }
18338
18343
 
18339
18344
  /**
18340
18345
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
18341
18346
  * include a server-generated timestamp in the written data.
18342
- */ function mh() {
18347
+ */ function vh() {
18343
18348
  return new nc("serverTimestamp");
18344
18349
  }
18345
18350
 
@@ -18354,7 +18359,7 @@ function hh(t, e) {
18354
18359
  * @param elements - The elements to union into the array.
18355
18360
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
18356
18361
  * `updateDoc()`.
18357
- */ function gh() {
18362
+ */ function mh() {
18358
18363
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
18359
18364
  // NOTE: We don't actually parse the data until it's used in set() or
18360
18365
  // update() since we'd need the Firestore instance to do this.
@@ -18371,7 +18376,7 @@ function hh(t, e) {
18371
18376
  * @param elements - The elements to remove from the array.
18372
18377
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
18373
18378
  * `updateDoc()`
18374
- */ function wh() {
18379
+ */ function gh() {
18375
18380
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
18376
18381
  // NOTE: We don't actually parse the data until it's used in set() or
18377
18382
  // update() since we'd need the Firestore instance to do this.
@@ -18396,7 +18401,7 @@ function hh(t, e) {
18396
18401
  * @param n - The value to increment by.
18397
18402
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
18398
18403
  * `updateDoc()`
18399
- */ function bh(t) {
18404
+ */ function wh(t) {
18400
18405
  return new oc("increment", t);
18401
18406
  }
18402
18407
 
@@ -18426,25 +18431,77 @@ function hh(t, e) {
18426
18431
  *
18427
18432
  * @returns A {@link WriteBatch} that can be used to atomically execute multiple
18428
18433
  * writes.
18429
- */ function Ih(t) {
18434
+ */ function bh(t) {
18430
18435
  return Da(t = aa(t, _a)), new Jc(t, (function(e) {
18431
18436
  return fh(t, e);
18432
18437
  }))
18433
- /**
18434
- * Cloud Firestore
18438
+ /** An index component consisting of field path and index type. */;
18439
+ }
18440
+
18441
+ var Ih, Th = function(
18442
+ /** The field path of the component. */
18443
+ t,
18444
+ /** The fields sorting order. */
18445
+ e) {
18446
+ this.fieldPath = t, this.kind = e;
18447
+ };
18448
+
18449
+ /**
18450
+ * @license
18451
+ * Copyright 2021 Google LLC
18435
18452
  *
18436
- * @packageDocumentation
18437
- */;
18453
+ * Licensed under the Apache License, Version 2.0 (the "License");
18454
+ * you may not use this file except in compliance with the License.
18455
+ * You may obtain a copy of the License at
18456
+ *
18457
+ * http://www.apache.org/licenses/LICENSE-2.0
18458
+ *
18459
+ * Unless required by applicable law or agreed to in writing, software
18460
+ * distributed under the License is distributed on an "AS IS" BASIS,
18461
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18462
+ * See the License for the specific language governing permissions and
18463
+ * limitations under the License.
18464
+ */ function Eh(t, e) {
18465
+ Da(t = aa(t, _a));
18466
+ var n = "string" == typeof e ? function(t) {
18467
+ try {
18468
+ return JSON.parse(t);
18469
+ } catch (t) {
18470
+ throw new Y(H.INVALID_ARGUMENT, "Failed to parse JSON:" + t.message);
18471
+ }
18472
+ }(e) : e;
18473
+ // PORTING NOTE: We don't return an error if the user has not enabled
18474
+ // persistence since `enableIndexeddbPersistence()` can fail on the Web.
18475
+ if (Array.isArray(n.indexes)) for (var r = 0, i = n.indexes; r < i.length; r++) {
18476
+ var o = i[r];
18477
+ Sh(o, "collectionGroup");
18478
+ var s = [];
18479
+ if (Array.isArray(o.fields)) for (var u = 0, a = o.fields; u < a.length; u++) {
18480
+ var c = a[u], h = yc("setIndexConfiguration", Sh(c, "fieldPath"));
18481
+ "CONTAINS" === c.arrayConfig ? s.push(new Th(h, 2 /* CONTAINS */)) : "ASCENDING" === c.order ? s.push(new Th(h, 0 /* ASCENDING */)) : "DESCENDING" === c.order && s.push(new Th(h, 1 /* DESCENDING */));
18482
+ }
18483
+ }
18484
+ // TODO(indexing): Configure indexes
18485
+ return Promise.resolve();
18438
18486
  }
18439
18487
 
18440
- void 0 === dh && (dh = !0), M = i, o(new c("firestore", (function(t, e) {
18488
+ function Sh(t, e) {
18489
+ if ("string" != typeof t[e]) throw new Y(H.INVALID_ARGUMENT, "Missing string value for: " + e);
18490
+ return t[e];
18491
+ }
18492
+
18493
+ /**
18494
+ * Cloud Firestore
18495
+ *
18496
+ * @packageDocumentation
18497
+ */ void 0 === Ih && (Ih = !0), M = i, o(new c("firestore", (function(t, e) {
18441
18498
  var n = e.options, r = t.getProvider("app").getImmediate(), i = new _a(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
18442
18499
  return n = Object.assign({
18443
- useFetchStreams: dh
18500
+ useFetchStreams: Ih
18444
18501
  }, n), i._setSettings(n), i;
18445
- }), "PUBLIC")), s(P, "3.4.3-202202014332", void 0),
18502
+ }), "PUBLIC")), s(P, "3.4.3-canary.2d04af91d", void 0),
18446
18503
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
18447
- s(P, "3.4.3-202202014332", "esm5");
18504
+ s(P, "3.4.3-canary.2d04af91d", "esm5");
18448
18505
 
18449
- export { Wc as AbstractUserDataWriter, Ka as Bytes, Sa as CACHE_SIZE_UNLIMITED, ya as CollectionReference, da as DocumentReference, Tc as DocumentSnapshot, Ba as FieldPath, Ga as FieldValue, _a as Firestore, Y as FirestoreError, za as GeoPoint, Ea as LoadBundleTask, pa as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, ph as Transaction, Jc as WriteBatch, ea as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, aa as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, ia as _validateIsNotUsedTogether, ah as addDoc, wh as arrayRemove, gh as arrayUnion, La as clearIndexedDbPersistence, va as collection, ma as collectionGroup, la as connectFirestoreEmulator, uh as deleteDoc, vh as deleteField, Ma as disableNetwork, ga as doc, ja as documentId, Ca as enableIndexedDbPersistence, xa as enableMultiTabIndexedDbPersistence, Oa as enableNetwork, jc as endAt, Bc as endBefore, Da as ensureFirestoreConfigured, fh as executeWrite, $c as getDoc, th as getDocFromCache, eh as getDocFromServer, nh as getDocs, rh as getDocsFromCache, ih as getDocsFromServer, ka as getFirestore, bh as increment, Aa as initializeFirestore, Oc as limit, Mc as limitToLast, Va as loadBundle, qa as namedQuery, ch as onSnapshot, hh as onSnapshotsInSync, Lc as orderBy, Nc as query, ba as queryEqual, wa as refEqual, yh as runTransaction, mh as serverTimestamp, oh as setDoc, q as setLogLevel, Ac as snapshotEqual, qc as startAfter, Vc as startAt, Fa as terminate, sh as updateDoc, Pa as waitForPendingWrites, xc as where, Ih as writeBatch };
18506
+ export { Wc as AbstractUserDataWriter, Ka as Bytes, Sa as CACHE_SIZE_UNLIMITED, ya as CollectionReference, da as DocumentReference, Tc as DocumentSnapshot, Ba as FieldPath, Ga as FieldValue, _a as Firestore, Y as FirestoreError, za as GeoPoint, Ea as LoadBundleTask, pa as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, dh as Transaction, Jc as WriteBatch, ea as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, aa as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, Eh as _setIndexConfiguration, ia as _validateIsNotUsedTogether, ah as addDoc, gh as arrayRemove, mh as arrayUnion, La as clearIndexedDbPersistence, va as collection, ma as collectionGroup, la as connectFirestoreEmulator, uh as deleteDoc, yh as deleteField, Ma as disableNetwork, ga as doc, ja as documentId, Ca as enableIndexedDbPersistence, xa as enableMultiTabIndexedDbPersistence, Oa as enableNetwork, jc as endAt, Bc as endBefore, Da as ensureFirestoreConfigured, fh as executeWrite, $c as getDoc, th as getDocFromCache, eh as getDocFromServer, nh as getDocs, rh as getDocsFromCache, ih as getDocsFromServer, ka as getFirestore, wh as increment, Aa as initializeFirestore, Oc as limit, Mc as limitToLast, Va as loadBundle, qa as namedQuery, ch as onSnapshot, hh as onSnapshotsInSync, Lc as orderBy, Nc as query, ba as queryEqual, wa as refEqual, ph as runTransaction, vh as serverTimestamp, oh as setDoc, q as setLogLevel, Ac as snapshotEqual, qc as startAfter, Vc as startAt, Fa as terminate, sh as updateDoc, Pa as waitForPendingWrites, xc as where, bh as writeBatch };
18450
18507
  //# sourceMappingURL=index.esm5.js.map