@firebase/firestore 3.4.0 → 3.4.1-canary.0db840a09

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 (41) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/firestore/compat/index.d.ts +1 -1
  3. package/dist/firestore/src/model/collections.d.ts +1 -1
  4. package/dist/firestore/src/model/document.d.ts +3 -1
  5. package/dist/index.esm2017.js +159 -159
  6. package/dist/index.esm2017.js.map +1 -1
  7. package/dist/index.esm5.js +68 -68
  8. package/dist/index.esm5.js.map +1 -1
  9. package/dist/index.node.cjs.js +14 -21
  10. package/dist/index.node.cjs.js.map +1 -1
  11. package/dist/index.node.mjs +14 -17
  12. package/dist/index.node.mjs.map +1 -1
  13. package/dist/index.rn.js +852 -852
  14. package/dist/index.rn.js.map +1 -1
  15. package/dist/internal.d.ts +3 -1
  16. package/dist/lite/firestore/compat/index.d.ts +1 -1
  17. package/dist/lite/firestore/src/model/collections.d.ts +1 -1
  18. package/dist/lite/firestore/src/model/document.d.ts +3 -1
  19. package/dist/lite/index.browser.esm2017.js +4 -4
  20. package/dist/lite/index.browser.esm2017.js.map +1 -1
  21. package/dist/lite/index.browser.esm5.js +4 -4
  22. package/dist/lite/index.browser.esm5.js.map +1 -1
  23. package/dist/lite/index.node.cjs.js +4 -4
  24. package/dist/lite/index.node.cjs.js.map +1 -1
  25. package/dist/lite/index.node.mjs +4 -4
  26. package/dist/lite/index.node.mjs.map +1 -1
  27. package/dist/lite/index.rn.esm2017.js +61 -61
  28. package/dist/lite/index.rn.esm2017.js.map +1 -1
  29. package/dist/lite/internal.d.ts +67 -0
  30. package/dist/lite/packages/firestore/babel-register.d.ts +1 -0
  31. package/dist/lite/packages/firestore/compat/index.d.ts +1 -1
  32. package/dist/lite/packages/firestore/src/model/collections.d.ts +1 -1
  33. package/dist/lite/packages/firestore/src/model/document.d.ts +3 -1
  34. package/dist/lite/private.d.ts +67 -0
  35. package/dist/packages/firestore/babel-register.d.ts +1 -0
  36. package/dist/packages/firestore/compat/index.d.ts +1 -1
  37. package/dist/packages/firestore/dist/index.esm2017.d.ts +21 -21
  38. package/dist/packages/firestore/src/model/collections.d.ts +1 -1
  39. package/dist/packages/firestore/src/model/document.d.ts +3 -1
  40. package/dist/private.d.ts +3 -1
  41. package/package.json +10 -10
@@ -8,18 +8,13 @@ var logger = require('@firebase/logger');
8
8
  var util = require('util');
9
9
  var util$1 = require('@firebase/util');
10
10
  var crypto = require('crypto');
11
- var module$1 = require('module');
12
11
  var grpcJs = require('@grpc/grpc-js');
13
12
  var path = require('path');
14
13
  var url = require('url');
15
14
  var protoLoader = require('@grpc/proto-loader');
16
15
 
17
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
-
19
- var module__default = /*#__PURE__*/_interopDefaultLegacy(module$1);
20
-
21
16
  const name = "@firebase/firestore";
22
- const version$1 = "3.4.0";
17
+ const version$1 = "3.4.1-canary.0db840a09";
23
18
 
24
19
  /**
25
20
  * @license
@@ -72,7 +67,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
72
67
  User.FIRST_PARTY = new User('first-party-uid');
73
68
  User.MOCK_USER = new User('mock-user');
74
69
 
75
- const version = "9.6.0";
70
+ const version = "9.6.1-canary.0db840a09";
76
71
 
77
72
  /**
78
73
  * @license
@@ -4191,7 +4186,7 @@ class MutableDocument {
4191
4186
  this.documentState === other.documentState &&
4192
4187
  this.data.isEqual(other.data));
4193
4188
  }
4194
- clone() {
4189
+ mutableCopy() {
4195
4190
  return new MutableDocument(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
4196
4191
  }
4197
4192
  toString() {
@@ -12876,7 +12871,7 @@ class MemoryRemoteDocumentCacheImpl {
12876
12871
  const previousSize = entry ? entry.size : 0;
12877
12872
  const currentSize = this.sizer(doc);
12878
12873
  this.docs = this.docs.insert(key, {
12879
- document: doc.clone(),
12874
+ document: doc.mutableCopy(),
12880
12875
  size: currentSize,
12881
12876
  readTime
12882
12877
  });
@@ -12899,7 +12894,7 @@ class MemoryRemoteDocumentCacheImpl {
12899
12894
  getEntry(transaction, documentKey) {
12900
12895
  const entry = this.docs.get(documentKey);
12901
12896
  return PersistencePromise.resolve(entry
12902
- ? entry.document.clone()
12897
+ ? entry.document.mutableCopy()
12903
12898
  : MutableDocument.newInvalidDocument(documentKey));
12904
12899
  }
12905
12900
  getEntries(transaction, documentKeys) {
@@ -12907,7 +12902,7 @@ class MemoryRemoteDocumentCacheImpl {
12907
12902
  documentKeys.forEach(documentKey => {
12908
12903
  const entry = this.docs.get(documentKey);
12909
12904
  results = results.insert(documentKey, entry
12910
- ? entry.document.clone()
12905
+ ? entry.document.mutableCopy()
12911
12906
  : MutableDocument.newInvalidDocument(documentKey));
12912
12907
  });
12913
12908
  return PersistencePromise.resolve(results);
@@ -12929,7 +12924,7 @@ class MemoryRemoteDocumentCacheImpl {
12929
12924
  if (!queryMatches(query, document)) {
12930
12925
  continue;
12931
12926
  }
12932
- results = results.insert(document.key, document.clone());
12927
+ results = results.insert(document.key, document.mutableCopy());
12933
12928
  }
12934
12929
  return PersistencePromise.resolve(results);
12935
12930
  }
@@ -14320,11 +14315,9 @@ function nodePromise(action) {
14320
14315
  * See the License for the specific language governing permissions and
14321
14316
  * limitations under the License.
14322
14317
  */
14323
- // This is a hack fix for Node ES modules to use `require`.
14324
- // @ts-ignore To avoid using `--module es2020` flag.
14325
- const require$1 = module__default["default"].createRequire(new (require('url').URL)('file:' + __filename).href);
14326
- // eslint-disable-next-line @typescript-eslint/no-require-imports
14327
- const { version: grpcVersion } = require$1('@grpc/grpc-js/package.json');
14318
+ // TODO: Fetch runtime version from grpc-js/package.json instead
14319
+ // when there's a cleaner way to dynamic require JSON in both Node ESM and CJS
14320
+ const grpcVersion = '1.3.7';
14328
14321
  const LOG_TAG$9 = 'Connection';
14329
14322
  const X_GOOG_API_CLIENT_VALUE = `gl-node/${process.versions.node} fire/${SDK_VERSION} grpc/${grpcVersion}`;
14330
14323
  function createMetadata(databasePath, authToken, appCheckToken, appId) {
@@ -14491,8 +14484,8 @@ class GrpcConnection {
14491
14484
  */
14492
14485
  // __filename and __dirname globals are unavailable in ES modules
14493
14486
  // @ts-ignore To avoid using `--module es2020` flag.
14494
- const __filename$1 = url.fileURLToPath(new (require('url').URL)('file:' + __filename).href);
14495
- const __dirname$1 = path.dirname(__filename$1);
14487
+ const __filenameInESM = url.fileURLToPath(new (require('url').URL)('file:' + __filename).href);
14488
+ const __dirnameInESM = path.dirname(__filenameInESM);
14496
14489
  /** Used by tests so we can match @grpc/proto-loader behavior. */
14497
14490
  const protoLoaderOptions = {
14498
14491
  longs: String,
@@ -14506,7 +14499,7 @@ const protoLoaderOptions = {
14506
14499
  * @returns The GrpcObject representing our protos.
14507
14500
  */
14508
14501
  function loadProtos() {
14509
- const root = path.resolve(__dirname$1, "src/protos" );
14502
+ const root = path.resolve(__dirnameInESM, "src/protos" );
14510
14503
  const firestoreProtoFile = path.join(root, 'google/firestore/v1/firestore.proto');
14511
14504
  const packageDefinition = protoLoader.loadSync(firestoreProtoFile, Object.assign(Object.assign({}, protoLoaderOptions), { includeDirs: [root] }));
14512
14505
  return grpcJs.loadPackageDefinition(packageDefinition);
@@ -20919,7 +20912,7 @@ function registerFirestore(variant, useFetchStreams = true) {
20919
20912
  settings = Object.assign({ useFetchStreams }, settings);
20920
20913
  firestoreInstance._setSettings(settings);
20921
20914
  return firestoreInstance;
20922
- }, "PUBLIC" /* PUBLIC */));
20915
+ }, 'PUBLIC'));
20923
20916
  app.registerVersion(name, version$1, variant);
20924
20917
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
20925
20918
  app.registerVersion(name, version$1, 'cjs2017');