@firebase/firestore 3.4.0 → 3.4.1

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.
@@ -4,14 +4,13 @@ import { Logger, LogLevel } from '@firebase/logger';
4
4
  import { inspect, TextEncoder, TextDecoder } from 'util';
5
5
  import { createMockUserToken, getModularInstance, deepEqual, getUA, isIndexedDBAvailable, isSafari } from '@firebase/util';
6
6
  import { randomBytes as randomBytes$1 } from 'crypto';
7
- import module from 'module';
8
7
  import { credentials, loadPackageDefinition, Metadata } from '@grpc/grpc-js';
9
8
  import { dirname, resolve, join } from 'path';
10
9
  import { fileURLToPath } from 'url';
11
10
  import { loadSync } from '@grpc/proto-loader';
12
11
 
13
12
  const name = "@firebase/firestore";
14
- const version$1 = "3.4.0";
13
+ const version$1 = "3.4.1";
15
14
 
16
15
  /**
17
16
  * @license
@@ -64,7 +63,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
64
63
  User.FIRST_PARTY = new User('first-party-uid');
65
64
  User.MOCK_USER = new User('mock-user');
66
65
 
67
- const version = "9.6.0";
66
+ const version = "9.6.1";
68
67
 
69
68
  /**
70
69
  * @license
@@ -14312,11 +14311,9 @@ function nodePromise(action) {
14312
14311
  * See the License for the specific language governing permissions and
14313
14312
  * limitations under the License.
14314
14313
  */
14315
- // This is a hack fix for Node ES modules to use `require`.
14316
- // @ts-ignore To avoid using `--module es2020` flag.
14317
- const require = module.createRequire(import.meta.url);
14318
- // eslint-disable-next-line @typescript-eslint/no-require-imports
14319
- const { version: grpcVersion } = require('@grpc/grpc-js/package.json');
14314
+ // TODO: Fetch runtime version from grpc-js/package.json instead
14315
+ // when there's a cleaner way to dynamic require JSON in both Node ESM and CJS
14316
+ const grpcVersion = '1.3.7';
14320
14317
  const LOG_TAG$9 = 'Connection';
14321
14318
  const X_GOOG_API_CLIENT_VALUE = `gl-node/${process.versions.node} fire/${SDK_VERSION} grpc/${grpcVersion}`;
14322
14319
  function createMetadata(databasePath, authToken, appCheckToken, appId) {
@@ -14483,8 +14480,8 @@ class GrpcConnection {
14483
14480
  */
14484
14481
  // __filename and __dirname globals are unavailable in ES modules
14485
14482
  // @ts-ignore To avoid using `--module es2020` flag.
14486
- const __filename = fileURLToPath(import.meta.url);
14487
- const __dirname = dirname(__filename);
14483
+ const __filenameInESM = fileURLToPath(import.meta.url);
14484
+ const __dirnameInESM = dirname(__filenameInESM);
14488
14485
  /** Used by tests so we can match @grpc/proto-loader behavior. */
14489
14486
  const protoLoaderOptions = {
14490
14487
  longs: String,
@@ -14498,7 +14495,7 @@ const protoLoaderOptions = {
14498
14495
  * @returns The GrpcObject representing our protos.
14499
14496
  */
14500
14497
  function loadProtos() {
14501
- const root = resolve(__dirname, "src/protos" );
14498
+ const root = resolve(__dirnameInESM, "src/protos" );
14502
14499
  const firestoreProtoFile = join(root, 'google/firestore/v1/firestore.proto');
14503
14500
  const packageDefinition = loadSync(firestoreProtoFile, Object.assign(Object.assign({}, protoLoaderOptions), { includeDirs: [root] }));
14504
14501
  return loadPackageDefinition(packageDefinition);
@@ -20911,7 +20908,7 @@ function registerFirestore(variant, useFetchStreams = true) {
20911
20908
  settings = Object.assign({ useFetchStreams }, settings);
20912
20909
  firestoreInstance._setSettings(settings);
20913
20910
  return firestoreInstance;
20914
- }, "PUBLIC" /* PUBLIC */));
20911
+ }, 'PUBLIC'));
20915
20912
  registerVersion(name, version$1, variant);
20916
20913
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
20917
20914
  registerVersion(name, version$1, 'esm2017');