@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.
- package/CHANGELOG.md +8 -0
- package/dist/firestore/compat/index.d.ts +1 -1
- package/dist/firestore/src/model/collections.d.ts +1 -1
- package/dist/firestore/src/model/document.d.ts +3 -1
- package/dist/index.esm2017.js +159 -159
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +68 -68
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +14 -21
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +14 -17
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +852 -852
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +3 -1
- package/dist/lite/firestore/compat/index.d.ts +1 -1
- package/dist/lite/firestore/src/model/collections.d.ts +1 -1
- package/dist/lite/firestore/src/model/document.d.ts +3 -1
- package/dist/lite/index.browser.esm2017.js +4 -4
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +4 -4
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +4 -4
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +4 -4
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +61 -61
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +67 -0
- package/dist/lite/packages/firestore/babel-register.d.ts +1 -0
- package/dist/lite/packages/firestore/compat/index.d.ts +1 -1
- package/dist/lite/packages/firestore/src/model/collections.d.ts +1 -1
- package/dist/lite/packages/firestore/src/model/document.d.ts +3 -1
- package/dist/lite/private.d.ts +67 -0
- package/dist/packages/firestore/babel-register.d.ts +1 -0
- package/dist/packages/firestore/compat/index.d.ts +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +21 -21
- package/dist/packages/firestore/src/model/collections.d.ts +1 -1
- package/dist/packages/firestore/src/model/document.d.ts +3 -1
- package/dist/private.d.ts +3 -1
- package/package.json +10 -10
package/dist/index.node.mjs
CHANGED
|
@@ -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.
|
|
13
|
+
const version$1 = "3.4.1-canary.0db840a09";
|
|
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.
|
|
66
|
+
const version = "9.6.1-canary.0db840a09";
|
|
68
67
|
|
|
69
68
|
/**
|
|
70
69
|
* @license
|
|
@@ -4183,7 +4182,7 @@ class MutableDocument {
|
|
|
4183
4182
|
this.documentState === other.documentState &&
|
|
4184
4183
|
this.data.isEqual(other.data));
|
|
4185
4184
|
}
|
|
4186
|
-
|
|
4185
|
+
mutableCopy() {
|
|
4187
4186
|
return new MutableDocument(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
|
|
4188
4187
|
}
|
|
4189
4188
|
toString() {
|
|
@@ -12868,7 +12867,7 @@ class MemoryRemoteDocumentCacheImpl {
|
|
|
12868
12867
|
const previousSize = entry ? entry.size : 0;
|
|
12869
12868
|
const currentSize = this.sizer(doc);
|
|
12870
12869
|
this.docs = this.docs.insert(key, {
|
|
12871
|
-
document: doc.
|
|
12870
|
+
document: doc.mutableCopy(),
|
|
12872
12871
|
size: currentSize,
|
|
12873
12872
|
readTime
|
|
12874
12873
|
});
|
|
@@ -12891,7 +12890,7 @@ class MemoryRemoteDocumentCacheImpl {
|
|
|
12891
12890
|
getEntry(transaction, documentKey) {
|
|
12892
12891
|
const entry = this.docs.get(documentKey);
|
|
12893
12892
|
return PersistencePromise.resolve(entry
|
|
12894
|
-
? entry.document.
|
|
12893
|
+
? entry.document.mutableCopy()
|
|
12895
12894
|
: MutableDocument.newInvalidDocument(documentKey));
|
|
12896
12895
|
}
|
|
12897
12896
|
getEntries(transaction, documentKeys) {
|
|
@@ -12899,7 +12898,7 @@ class MemoryRemoteDocumentCacheImpl {
|
|
|
12899
12898
|
documentKeys.forEach(documentKey => {
|
|
12900
12899
|
const entry = this.docs.get(documentKey);
|
|
12901
12900
|
results = results.insert(documentKey, entry
|
|
12902
|
-
? entry.document.
|
|
12901
|
+
? entry.document.mutableCopy()
|
|
12903
12902
|
: MutableDocument.newInvalidDocument(documentKey));
|
|
12904
12903
|
});
|
|
12905
12904
|
return PersistencePromise.resolve(results);
|
|
@@ -12921,7 +12920,7 @@ class MemoryRemoteDocumentCacheImpl {
|
|
|
12921
12920
|
if (!queryMatches(query, document)) {
|
|
12922
12921
|
continue;
|
|
12923
12922
|
}
|
|
12924
|
-
results = results.insert(document.key, document.
|
|
12923
|
+
results = results.insert(document.key, document.mutableCopy());
|
|
12925
12924
|
}
|
|
12926
12925
|
return PersistencePromise.resolve(results);
|
|
12927
12926
|
}
|
|
@@ -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
|
-
//
|
|
14316
|
-
//
|
|
14317
|
-
const
|
|
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
|
|
14487
|
-
const
|
|
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(
|
|
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
|
-
},
|
|
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');
|