@firebase/firestore 3.4.4-canary.dd86989b3 → 3.4.4-canary.e8972ef49
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/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/firestore/src/api.d.ts +1 -1
- package/dist/firestore/src/core/database_info.d.ts +1 -0
- package/dist/firestore/src/core/target.d.ts +34 -5
- package/dist/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/firestore/src/model/field_index.d.ts +4 -0
- package/dist/firestore/src/model/values.d.ts +7 -0
- package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +2 -2
- package/dist/index.esm2017.js +2626 -2469
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +2627 -2547
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +456 -279
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +456 -279
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +2652 -2491
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +171 -2
- package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/firestore/src/api.d.ts +1 -1
- package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +4 -0
- package/dist/lite/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +2 -2
- package/dist/lite/index.browser.esm2017.js +1159 -1152
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +311 -308
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +39 -28
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +39 -28
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +360 -353
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +3 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +125 -124
- package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/packages/firestore/src/api.d.ts +1 -1
- package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +4 -0
- package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +2 -2
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +148 -147
- package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/packages/firestore/src/api.d.ts +1 -1
- package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +4 -0
- package/dist/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +2 -2
- package/dist/private.d.ts +170 -2
- package/package.json +9 -9
package/dist/lite/index.node.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { FirebaseError, createMockUserToken, getModularInstance } from '@firebas
|
|
|
6
6
|
import nodeFetch from 'node-fetch';
|
|
7
7
|
import { randomBytes as randomBytes$1 } from 'crypto';
|
|
8
8
|
|
|
9
|
-
const version$1 = "3.4.4-canary.
|
|
9
|
+
const version$1 = "3.4.4-canary.e8972ef49";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
@@ -59,7 +59,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
|
|
|
59
59
|
User.FIRST_PARTY = new User('first-party-uid');
|
|
60
60
|
User.MOCK_USER = new User('mock-user');
|
|
61
61
|
|
|
62
|
-
const version = "9.6.5-canary.
|
|
62
|
+
const version = "9.6.5-canary.e8972ef49";
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* @license
|
|
@@ -658,6 +658,9 @@ class DatabaseId {
|
|
|
658
658
|
this.projectId = projectId;
|
|
659
659
|
this.database = database ? database : DEFAULT_DATABASE_NAME;
|
|
660
660
|
}
|
|
661
|
+
static empty() {
|
|
662
|
+
return new DatabaseId('', '');
|
|
663
|
+
}
|
|
661
664
|
get isDefaultDatabase() {
|
|
662
665
|
return this.database === DEFAULT_DATABASE_NAME;
|
|
663
666
|
}
|
|
@@ -3017,9 +3020,9 @@ class ArrayContainsAnyFilter extends FieldFilter {
|
|
|
3017
3020
|
* just after the provided values.
|
|
3018
3021
|
*/
|
|
3019
3022
|
class Bound {
|
|
3020
|
-
constructor(position,
|
|
3023
|
+
constructor(position, inclusive) {
|
|
3021
3024
|
this.position = position;
|
|
3022
|
-
this.
|
|
3025
|
+
this.inclusive = inclusive;
|
|
3023
3026
|
}
|
|
3024
3027
|
}
|
|
3025
3028
|
/**
|
|
@@ -3041,7 +3044,7 @@ function boundEquals(left, right) {
|
|
|
3041
3044
|
else if (right === null) {
|
|
3042
3045
|
return false;
|
|
3043
3046
|
}
|
|
3044
|
-
if (left.
|
|
3047
|
+
if (left.inclusive !== right.inclusive ||
|
|
3045
3048
|
left.position.length !== right.position.length) {
|
|
3046
3049
|
return false;
|
|
3047
3050
|
}
|
|
@@ -3206,10 +3209,10 @@ function queryToTarget(query) {
|
|
|
3206
3209
|
}
|
|
3207
3210
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
3208
3211
|
const startAt = queryImpl.endAt
|
|
3209
|
-
? new Bound(queryImpl.endAt.position, !queryImpl.endAt.
|
|
3212
|
+
? new Bound(queryImpl.endAt.position, !queryImpl.endAt.inclusive)
|
|
3210
3213
|
: null;
|
|
3211
3214
|
const endAt = queryImpl.startAt
|
|
3212
|
-
? new Bound(queryImpl.startAt.position, !queryImpl.startAt.
|
|
3215
|
+
? new Bound(queryImpl.startAt.position, !queryImpl.startAt.inclusive)
|
|
3213
3216
|
: null;
|
|
3214
3217
|
// Now return as a LimitType.First query.
|
|
3215
3218
|
queryImpl.memoizedTarget = newTarget(queryImpl.path, queryImpl.collectionGroup, orderBys, queryImpl.filters, queryImpl.limit, startAt, endAt);
|
|
@@ -3837,10 +3840,10 @@ function toQueryTarget(serializer, target) {
|
|
|
3837
3840
|
result.structuredQuery.limit = limit;
|
|
3838
3841
|
}
|
|
3839
3842
|
if (target.startAt) {
|
|
3840
|
-
result.structuredQuery.startAt =
|
|
3843
|
+
result.structuredQuery.startAt = toStartAtCursor(target.startAt);
|
|
3841
3844
|
}
|
|
3842
3845
|
if (target.endAt) {
|
|
3843
|
-
result.structuredQuery.endAt =
|
|
3846
|
+
result.structuredQuery.endAt = toEndAtCursor(target.endAt);
|
|
3844
3847
|
}
|
|
3845
3848
|
return result;
|
|
3846
3849
|
}
|
|
@@ -3862,9 +3865,15 @@ function toOrder(orderBys) {
|
|
|
3862
3865
|
}
|
|
3863
3866
|
return orderBys.map(order => toPropertyOrder(order));
|
|
3864
3867
|
}
|
|
3865
|
-
function
|
|
3868
|
+
function toStartAtCursor(cursor) {
|
|
3869
|
+
return {
|
|
3870
|
+
before: cursor.inclusive,
|
|
3871
|
+
values: cursor.position
|
|
3872
|
+
};
|
|
3873
|
+
}
|
|
3874
|
+
function toEndAtCursor(cursor) {
|
|
3866
3875
|
return {
|
|
3867
|
-
before: cursor.
|
|
3876
|
+
before: !cursor.inclusive,
|
|
3868
3877
|
values: cursor.position
|
|
3869
3878
|
};
|
|
3870
3879
|
}
|
|
@@ -6141,51 +6150,53 @@ function limitToLast(limit) {
|
|
|
6141
6150
|
return new QueryLimitConstraint('limitToLast', limit, "L" /* Last */);
|
|
6142
6151
|
}
|
|
6143
6152
|
class QueryStartAtConstraint extends QueryConstraint {
|
|
6144
|
-
constructor(type, _docOrFields,
|
|
6153
|
+
constructor(type, _docOrFields, _inclusive) {
|
|
6145
6154
|
super();
|
|
6146
6155
|
this.type = type;
|
|
6147
6156
|
this._docOrFields = _docOrFields;
|
|
6148
|
-
this.
|
|
6157
|
+
this._inclusive = _inclusive;
|
|
6149
6158
|
}
|
|
6150
6159
|
_apply(query) {
|
|
6151
|
-
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this.
|
|
6160
|
+
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._inclusive);
|
|
6152
6161
|
return new Query(query.firestore, query.converter, queryWithStartAt(query._query, bound));
|
|
6153
6162
|
}
|
|
6154
6163
|
}
|
|
6155
6164
|
function startAt(...docOrFields) {
|
|
6156
|
-
return new QueryStartAtConstraint('startAt', docOrFields,
|
|
6165
|
+
return new QueryStartAtConstraint('startAt', docOrFields,
|
|
6166
|
+
/*inclusive=*/ true);
|
|
6157
6167
|
}
|
|
6158
6168
|
function startAfter(...docOrFields) {
|
|
6159
6169
|
return new QueryStartAtConstraint('startAfter', docOrFields,
|
|
6160
|
-
/*
|
|
6170
|
+
/*inclusive=*/ false);
|
|
6161
6171
|
}
|
|
6162
6172
|
class QueryEndAtConstraint extends QueryConstraint {
|
|
6163
|
-
constructor(type, _docOrFields,
|
|
6173
|
+
constructor(type, _docOrFields, _inclusive) {
|
|
6164
6174
|
super();
|
|
6165
6175
|
this.type = type;
|
|
6166
6176
|
this._docOrFields = _docOrFields;
|
|
6167
|
-
this.
|
|
6177
|
+
this._inclusive = _inclusive;
|
|
6168
6178
|
}
|
|
6169
6179
|
_apply(query) {
|
|
6170
|
-
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this.
|
|
6180
|
+
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._inclusive);
|
|
6171
6181
|
return new Query(query.firestore, query.converter, queryWithEndAt(query._query, bound));
|
|
6172
6182
|
}
|
|
6173
6183
|
}
|
|
6174
6184
|
function endBefore(...docOrFields) {
|
|
6175
|
-
return new QueryEndAtConstraint('endBefore', docOrFields,
|
|
6185
|
+
return new QueryEndAtConstraint('endBefore', docOrFields,
|
|
6186
|
+
/*inclusive=*/ false);
|
|
6176
6187
|
}
|
|
6177
6188
|
function endAt(...docOrFields) {
|
|
6178
|
-
return new QueryEndAtConstraint('endAt', docOrFields, /*
|
|
6189
|
+
return new QueryEndAtConstraint('endAt', docOrFields, /*inclusive=*/ true);
|
|
6179
6190
|
}
|
|
6180
6191
|
/** Helper function to create a bound from a document or fields */
|
|
6181
|
-
function newQueryBoundFromDocOrFields(query, methodName, docOrFields,
|
|
6192
|
+
function newQueryBoundFromDocOrFields(query, methodName, docOrFields, inclusive) {
|
|
6182
6193
|
docOrFields[0] = getModularInstance(docOrFields[0]);
|
|
6183
6194
|
if (docOrFields[0] instanceof DocumentSnapshot) {
|
|
6184
|
-
return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document,
|
|
6195
|
+
return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document, inclusive);
|
|
6185
6196
|
}
|
|
6186
6197
|
else {
|
|
6187
6198
|
const reader = newUserDataReader(query.firestore);
|
|
6188
|
-
return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields,
|
|
6199
|
+
return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields, inclusive);
|
|
6189
6200
|
}
|
|
6190
6201
|
}
|
|
6191
6202
|
function newQueryFilter(query, methodName, dataReader, databaseId, fieldPath, op, value) {
|
|
@@ -6243,7 +6254,7 @@ function newQueryOrderBy(query, fieldPath, direction) {
|
|
|
6243
6254
|
* of the query or if any of the fields in the order by are an uncommitted
|
|
6244
6255
|
* server timestamp.
|
|
6245
6256
|
*/
|
|
6246
|
-
function newQueryBoundFromDocument(query, databaseId, methodName, doc,
|
|
6257
|
+
function newQueryBoundFromDocument(query, databaseId, methodName, doc, inclusive) {
|
|
6247
6258
|
if (!doc) {
|
|
6248
6259
|
throw new FirestoreError(Code.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ` +
|
|
6249
6260
|
`${methodName}().`);
|
|
@@ -6280,12 +6291,12 @@ function newQueryBoundFromDocument(query, databaseId, methodName, doc, before) {
|
|
|
6280
6291
|
}
|
|
6281
6292
|
}
|
|
6282
6293
|
}
|
|
6283
|
-
return new Bound(components,
|
|
6294
|
+
return new Bound(components, inclusive);
|
|
6284
6295
|
}
|
|
6285
6296
|
/**
|
|
6286
6297
|
* Converts a list of field values to a `Bound` for the given query.
|
|
6287
6298
|
*/
|
|
6288
|
-
function newQueryBoundFromFields(query, databaseId, dataReader, methodName, values,
|
|
6299
|
+
function newQueryBoundFromFields(query, databaseId, dataReader, methodName, values, inclusive) {
|
|
6289
6300
|
// Use explicit order by's because it has to match the query the user made
|
|
6290
6301
|
const orderBy = query.explicitOrderBy;
|
|
6291
6302
|
if (values.length > orderBy.length) {
|
|
@@ -6322,7 +6333,7 @@ function newQueryBoundFromFields(query, databaseId, dataReader, methodName, valu
|
|
|
6322
6333
|
components.push(wrapped);
|
|
6323
6334
|
}
|
|
6324
6335
|
}
|
|
6325
|
-
return new Bound(components,
|
|
6336
|
+
return new Bound(components, inclusive);
|
|
6326
6337
|
}
|
|
6327
6338
|
/**
|
|
6328
6339
|
* Parses the given `documentIdValue` into a `ReferenceValue`, throwing
|