@firebase/firestore 3.4.10-canary.8e952e2ee → 3.4.10-canary.bf4959b60
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.
- package/dist/firestore/src/platform/node/grpc_connection.d.ts +1 -1
- package/dist/firestore/src/remote/connection.d.ts +1 -1
- package/dist/firestore/src/remote/rest_connection.d.ts +1 -1
- package/dist/index.esm2017.js +7 -7
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +12 -12
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +16 -7
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +16 -7
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +7 -7
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/firestore/src/platform/node/grpc_connection.d.ts +1 -1
- package/dist/lite/firestore/src/remote/connection.d.ts +1 -1
- package/dist/lite/firestore/src/remote/rest_connection.d.ts +1 -1
- package/dist/lite/index.browser.esm2017.js +6 -6
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +11 -11
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +6 -6
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +6 -6
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +6 -6
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/packages/firestore/src/platform/node/grpc_connection.d.ts +1 -1
- package/dist/lite/packages/firestore/src/remote/connection.d.ts +1 -1
- package/dist/lite/packages/firestore/src/remote/rest_connection.d.ts +1 -1
- package/dist/packages/firestore/src/platform/node/grpc_connection.d.ts +1 -1
- package/dist/packages/firestore/src/remote/connection.d.ts +1 -1
- package/dist/packages/firestore/src/remote/rest_connection.d.ts +1 -1
- package/package.json +9 -9
package/dist/index.node.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import * as grpc from '@grpc/grpc-js';
|
|
|
8
8
|
import * as protoLoader from '@grpc/proto-loader';
|
|
9
9
|
|
|
10
10
|
const name = "@firebase/firestore";
|
|
11
|
-
const version$1 = "3.4.10-canary.
|
|
11
|
+
const version$1 = "3.4.10-canary.bf4959b60";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
@@ -61,7 +61,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
|
|
|
61
61
|
User.FIRST_PARTY = new User('first-party-uid');
|
|
62
62
|
User.MOCK_USER = new User('mock-user');
|
|
63
63
|
|
|
64
|
-
const version = "9.8.3-canary.
|
|
64
|
+
const version = "9.8.3-canary.bf4959b60";
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* @license
|
|
@@ -17237,7 +17237,7 @@ class GrpcConnection {
|
|
|
17237
17237
|
});
|
|
17238
17238
|
});
|
|
17239
17239
|
}
|
|
17240
|
-
invokeStreamingRPC(rpcName, path, request, authToken, appCheckToken) {
|
|
17240
|
+
invokeStreamingRPC(rpcName, path, request, authToken, appCheckToken, expectedResponseCount) {
|
|
17241
17241
|
const results = [];
|
|
17242
17242
|
const responseDeferred = new Deferred();
|
|
17243
17243
|
logDebug(LOG_TAG$9, `RPC '${rpcName}' invoked (streaming) with request:`, request);
|
|
@@ -17245,13 +17245,22 @@ class GrpcConnection {
|
|
|
17245
17245
|
const metadata = createMetadata(this.databasePath, authToken, appCheckToken, this.databaseInfo.appId);
|
|
17246
17246
|
const jsonRequest = Object.assign(Object.assign({}, request), { database: this.databasePath });
|
|
17247
17247
|
const stream = stub[rpcName](jsonRequest, metadata);
|
|
17248
|
+
let callbackFired = false;
|
|
17248
17249
|
stream.on('data', (response) => {
|
|
17249
17250
|
logDebug(LOG_TAG$9, `RPC ${rpcName} received result:`, response);
|
|
17250
17251
|
results.push(response);
|
|
17252
|
+
if (expectedResponseCount !== undefined &&
|
|
17253
|
+
results.length === expectedResponseCount) {
|
|
17254
|
+
callbackFired = true;
|
|
17255
|
+
responseDeferred.resolve(results);
|
|
17256
|
+
}
|
|
17251
17257
|
});
|
|
17252
17258
|
stream.on('end', () => {
|
|
17253
17259
|
logDebug(LOG_TAG$9, `RPC '${rpcName}' completed.`);
|
|
17254
|
-
|
|
17260
|
+
if (!callbackFired) {
|
|
17261
|
+
callbackFired = true;
|
|
17262
|
+
responseDeferred.resolve(results);
|
|
17263
|
+
}
|
|
17255
17264
|
});
|
|
17256
17265
|
stream.on('error', (grpcError) => {
|
|
17257
17266
|
logDebug(LOG_TAG$9, `RPC '${rpcName}' failed with error:`, grpcError);
|
|
@@ -20804,14 +20813,14 @@ class DatastoreImpl extends Datastore {
|
|
|
20804
20813
|
});
|
|
20805
20814
|
}
|
|
20806
20815
|
/** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */
|
|
20807
|
-
invokeStreamingRPC(rpcName, path, request) {
|
|
20816
|
+
invokeStreamingRPC(rpcName, path, request, expectedResponseCount) {
|
|
20808
20817
|
this.verifyInitialized();
|
|
20809
20818
|
return Promise.all([
|
|
20810
20819
|
this.authCredentials.getToken(),
|
|
20811
20820
|
this.appCheckCredentials.getToken()
|
|
20812
20821
|
])
|
|
20813
20822
|
.then(([authToken, appCheckToken]) => {
|
|
20814
|
-
return this.connection.invokeStreamingRPC(rpcName, path, request, authToken, appCheckToken);
|
|
20823
|
+
return this.connection.invokeStreamingRPC(rpcName, path, request, authToken, appCheckToken, expectedResponseCount);
|
|
20815
20824
|
})
|
|
20816
20825
|
.catch((error) => {
|
|
20817
20826
|
if (error.name === 'FirebaseError') {
|
|
@@ -20849,7 +20858,7 @@ async function invokeBatchGetDocumentsRpc(datastore, keys) {
|
|
|
20849
20858
|
const request = {
|
|
20850
20859
|
documents: keys.map(k => toName(datastoreImpl.serializer, k))
|
|
20851
20860
|
};
|
|
20852
|
-
const response = await datastoreImpl.invokeStreamingRPC('BatchGetDocuments', path, request);
|
|
20861
|
+
const response = await datastoreImpl.invokeStreamingRPC('BatchGetDocuments', path, request, keys.length);
|
|
20853
20862
|
const docs = new Map();
|
|
20854
20863
|
response.forEach(proto => {
|
|
20855
20864
|
const doc = fromBatchGetDocumentsResponse(datastoreImpl.serializer, proto);
|