@firebase/firestore 3.4.4-canary.2dd99ae2d → 3.4.4-canary.7f959622d
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/core/target.d.ts +8 -4
- package/dist/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/firestore/test/util/helpers.d.ts +1 -1
- package/dist/index.esm2017.js +2233 -2144
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +2964 -2912
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +199 -90
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +199 -90
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +2183 -2090
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/lite/firestore/src/core/target.d.ts +8 -4
- package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/firestore/test/util/helpers.d.ts +1 -1
- package/dist/lite/index.browser.esm2017.js +301 -298
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +327 -326
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +36 -29
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +36 -29
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +301 -298
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +90 -90
- package/dist/lite/packages/firestore/src/core/target.d.ts +8 -4
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +1 -1
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +61 -61
- package/dist/packages/firestore/src/core/target.d.ts +8 -4
- package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/packages/firestore/test/util/helpers.d.ts +1 -1
- package/dist/private.d.ts +2 -2
- package/package.json +9 -9
|
@@ -14,7 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
|
|
15
15
|
var nodeFetch__default = /*#__PURE__*/_interopDefaultLegacy(nodeFetch);
|
|
16
16
|
|
|
17
|
-
const version$1 = "3.4.4-canary.
|
|
17
|
+
const version$1 = "3.4.4-canary.7f959622d";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
@@ -67,7 +67,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
|
|
|
67
67
|
User.FIRST_PARTY = new User('first-party-uid');
|
|
68
68
|
User.MOCK_USER = new User('mock-user');
|
|
69
69
|
|
|
70
|
-
const version = "9.6.5-canary.
|
|
70
|
+
const version = "9.6.5-canary.7f959622d";
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -3013,7 +3013,6 @@ class ArrayContainsAnyFilter extends FieldFilter {
|
|
|
3013
3013
|
return other.arrayValue.values.some(val => arrayValueContains(this.value.arrayValue, val));
|
|
3014
3014
|
}
|
|
3015
3015
|
}
|
|
3016
|
-
// TODO(indexing): Change Bound.before to "inclusive"
|
|
3017
3016
|
/**
|
|
3018
3017
|
* Represents a bound of a query.
|
|
3019
3018
|
*
|
|
@@ -3029,9 +3028,9 @@ class ArrayContainsAnyFilter extends FieldFilter {
|
|
|
3029
3028
|
* just after the provided values.
|
|
3030
3029
|
*/
|
|
3031
3030
|
class Bound {
|
|
3032
|
-
constructor(position,
|
|
3031
|
+
constructor(position, inclusive) {
|
|
3033
3032
|
this.position = position;
|
|
3034
|
-
this.
|
|
3033
|
+
this.inclusive = inclusive;
|
|
3035
3034
|
}
|
|
3036
3035
|
}
|
|
3037
3036
|
/**
|
|
@@ -3053,7 +3052,7 @@ function boundEquals(left, right) {
|
|
|
3053
3052
|
else if (right === null) {
|
|
3054
3053
|
return false;
|
|
3055
3054
|
}
|
|
3056
|
-
if (left.
|
|
3055
|
+
if (left.inclusive !== right.inclusive ||
|
|
3057
3056
|
left.position.length !== right.position.length) {
|
|
3058
3057
|
return false;
|
|
3059
3058
|
}
|
|
@@ -3218,10 +3217,10 @@ function queryToTarget(query) {
|
|
|
3218
3217
|
}
|
|
3219
3218
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
3220
3219
|
const startAt = queryImpl.endAt
|
|
3221
|
-
? new Bound(queryImpl.endAt.position, !queryImpl.endAt.
|
|
3220
|
+
? new Bound(queryImpl.endAt.position, !queryImpl.endAt.inclusive)
|
|
3222
3221
|
: null;
|
|
3223
3222
|
const endAt = queryImpl.startAt
|
|
3224
|
-
? new Bound(queryImpl.startAt.position, !queryImpl.startAt.
|
|
3223
|
+
? new Bound(queryImpl.startAt.position, !queryImpl.startAt.inclusive)
|
|
3225
3224
|
: null;
|
|
3226
3225
|
// Now return as a LimitType.First query.
|
|
3227
3226
|
queryImpl.memoizedTarget = newTarget(queryImpl.path, queryImpl.collectionGroup, orderBys, queryImpl.filters, queryImpl.limit, startAt, endAt);
|
|
@@ -3849,10 +3848,10 @@ function toQueryTarget(serializer, target) {
|
|
|
3849
3848
|
result.structuredQuery.limit = limit;
|
|
3850
3849
|
}
|
|
3851
3850
|
if (target.startAt) {
|
|
3852
|
-
result.structuredQuery.startAt =
|
|
3851
|
+
result.structuredQuery.startAt = toStartAtCursor(target.startAt);
|
|
3853
3852
|
}
|
|
3854
3853
|
if (target.endAt) {
|
|
3855
|
-
result.structuredQuery.endAt =
|
|
3854
|
+
result.structuredQuery.endAt = toEndAtCursor(target.endAt);
|
|
3856
3855
|
}
|
|
3857
3856
|
return result;
|
|
3858
3857
|
}
|
|
@@ -3874,9 +3873,15 @@ function toOrder(orderBys) {
|
|
|
3874
3873
|
}
|
|
3875
3874
|
return orderBys.map(order => toPropertyOrder(order));
|
|
3876
3875
|
}
|
|
3877
|
-
function
|
|
3876
|
+
function toStartAtCursor(cursor) {
|
|
3878
3877
|
return {
|
|
3879
|
-
before: cursor.
|
|
3878
|
+
before: cursor.inclusive,
|
|
3879
|
+
values: cursor.position
|
|
3880
|
+
};
|
|
3881
|
+
}
|
|
3882
|
+
function toEndAtCursor(cursor) {
|
|
3883
|
+
return {
|
|
3884
|
+
before: !cursor.inclusive,
|
|
3880
3885
|
values: cursor.position
|
|
3881
3886
|
};
|
|
3882
3887
|
}
|
|
@@ -6153,51 +6158,53 @@ function limitToLast(limit) {
|
|
|
6153
6158
|
return new QueryLimitConstraint('limitToLast', limit, "L" /* Last */);
|
|
6154
6159
|
}
|
|
6155
6160
|
class QueryStartAtConstraint extends QueryConstraint {
|
|
6156
|
-
constructor(type, _docOrFields,
|
|
6161
|
+
constructor(type, _docOrFields, _inclusive) {
|
|
6157
6162
|
super();
|
|
6158
6163
|
this.type = type;
|
|
6159
6164
|
this._docOrFields = _docOrFields;
|
|
6160
|
-
this.
|
|
6165
|
+
this._inclusive = _inclusive;
|
|
6161
6166
|
}
|
|
6162
6167
|
_apply(query) {
|
|
6163
|
-
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this.
|
|
6168
|
+
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._inclusive);
|
|
6164
6169
|
return new Query(query.firestore, query.converter, queryWithStartAt(query._query, bound));
|
|
6165
6170
|
}
|
|
6166
6171
|
}
|
|
6167
6172
|
function startAt(...docOrFields) {
|
|
6168
|
-
return new QueryStartAtConstraint('startAt', docOrFields,
|
|
6173
|
+
return new QueryStartAtConstraint('startAt', docOrFields,
|
|
6174
|
+
/*inclusive=*/ true);
|
|
6169
6175
|
}
|
|
6170
6176
|
function startAfter(...docOrFields) {
|
|
6171
6177
|
return new QueryStartAtConstraint('startAfter', docOrFields,
|
|
6172
|
-
/*
|
|
6178
|
+
/*inclusive=*/ false);
|
|
6173
6179
|
}
|
|
6174
6180
|
class QueryEndAtConstraint extends QueryConstraint {
|
|
6175
|
-
constructor(type, _docOrFields,
|
|
6181
|
+
constructor(type, _docOrFields, _inclusive) {
|
|
6176
6182
|
super();
|
|
6177
6183
|
this.type = type;
|
|
6178
6184
|
this._docOrFields = _docOrFields;
|
|
6179
|
-
this.
|
|
6185
|
+
this._inclusive = _inclusive;
|
|
6180
6186
|
}
|
|
6181
6187
|
_apply(query) {
|
|
6182
|
-
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this.
|
|
6188
|
+
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._inclusive);
|
|
6183
6189
|
return new Query(query.firestore, query.converter, queryWithEndAt(query._query, bound));
|
|
6184
6190
|
}
|
|
6185
6191
|
}
|
|
6186
6192
|
function endBefore(...docOrFields) {
|
|
6187
|
-
return new QueryEndAtConstraint('endBefore', docOrFields,
|
|
6193
|
+
return new QueryEndAtConstraint('endBefore', docOrFields,
|
|
6194
|
+
/*inclusive=*/ false);
|
|
6188
6195
|
}
|
|
6189
6196
|
function endAt(...docOrFields) {
|
|
6190
|
-
return new QueryEndAtConstraint('endAt', docOrFields, /*
|
|
6197
|
+
return new QueryEndAtConstraint('endAt', docOrFields, /*inclusive=*/ true);
|
|
6191
6198
|
}
|
|
6192
6199
|
/** Helper function to create a bound from a document or fields */
|
|
6193
|
-
function newQueryBoundFromDocOrFields(query, methodName, docOrFields,
|
|
6200
|
+
function newQueryBoundFromDocOrFields(query, methodName, docOrFields, inclusive) {
|
|
6194
6201
|
docOrFields[0] = util.getModularInstance(docOrFields[0]);
|
|
6195
6202
|
if (docOrFields[0] instanceof DocumentSnapshot) {
|
|
6196
|
-
return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document,
|
|
6203
|
+
return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document, inclusive);
|
|
6197
6204
|
}
|
|
6198
6205
|
else {
|
|
6199
6206
|
const reader = newUserDataReader(query.firestore);
|
|
6200
|
-
return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields,
|
|
6207
|
+
return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields, inclusive);
|
|
6201
6208
|
}
|
|
6202
6209
|
}
|
|
6203
6210
|
function newQueryFilter(query, methodName, dataReader, databaseId, fieldPath, op, value) {
|
|
@@ -6255,7 +6262,7 @@ function newQueryOrderBy(query, fieldPath, direction) {
|
|
|
6255
6262
|
* of the query or if any of the fields in the order by are an uncommitted
|
|
6256
6263
|
* server timestamp.
|
|
6257
6264
|
*/
|
|
6258
|
-
function newQueryBoundFromDocument(query, databaseId, methodName, doc,
|
|
6265
|
+
function newQueryBoundFromDocument(query, databaseId, methodName, doc, inclusive) {
|
|
6259
6266
|
if (!doc) {
|
|
6260
6267
|
throw new FirestoreError(Code.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ` +
|
|
6261
6268
|
`${methodName}().`);
|
|
@@ -6292,12 +6299,12 @@ function newQueryBoundFromDocument(query, databaseId, methodName, doc, before) {
|
|
|
6292
6299
|
}
|
|
6293
6300
|
}
|
|
6294
6301
|
}
|
|
6295
|
-
return new Bound(components,
|
|
6302
|
+
return new Bound(components, inclusive);
|
|
6296
6303
|
}
|
|
6297
6304
|
/**
|
|
6298
6305
|
* Converts a list of field values to a `Bound` for the given query.
|
|
6299
6306
|
*/
|
|
6300
|
-
function newQueryBoundFromFields(query, databaseId, dataReader, methodName, values,
|
|
6307
|
+
function newQueryBoundFromFields(query, databaseId, dataReader, methodName, values, inclusive) {
|
|
6301
6308
|
// Use explicit order by's because it has to match the query the user made
|
|
6302
6309
|
const orderBy = query.explicitOrderBy;
|
|
6303
6310
|
if (values.length > orderBy.length) {
|
|
@@ -6334,7 +6341,7 @@ function newQueryBoundFromFields(query, databaseId, dataReader, methodName, valu
|
|
|
6334
6341
|
components.push(wrapped);
|
|
6335
6342
|
}
|
|
6336
6343
|
}
|
|
6337
|
-
return new Bound(components,
|
|
6344
|
+
return new Bound(components, inclusive);
|
|
6338
6345
|
}
|
|
6339
6346
|
/**
|
|
6340
6347
|
* Parses the given `documentIdValue` into a `ReferenceValue`, throwing
|