@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
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.7f959622d";
|
|
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.7f959622d";
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* @license
|
|
@@ -3005,7 +3005,6 @@ class ArrayContainsAnyFilter extends FieldFilter {
|
|
|
3005
3005
|
return other.arrayValue.values.some(val => arrayValueContains(this.value.arrayValue, val));
|
|
3006
3006
|
}
|
|
3007
3007
|
}
|
|
3008
|
-
// TODO(indexing): Change Bound.before to "inclusive"
|
|
3009
3008
|
/**
|
|
3010
3009
|
* Represents a bound of a query.
|
|
3011
3010
|
*
|
|
@@ -3021,9 +3020,9 @@ class ArrayContainsAnyFilter extends FieldFilter {
|
|
|
3021
3020
|
* just after the provided values.
|
|
3022
3021
|
*/
|
|
3023
3022
|
class Bound {
|
|
3024
|
-
constructor(position,
|
|
3023
|
+
constructor(position, inclusive) {
|
|
3025
3024
|
this.position = position;
|
|
3026
|
-
this.
|
|
3025
|
+
this.inclusive = inclusive;
|
|
3027
3026
|
}
|
|
3028
3027
|
}
|
|
3029
3028
|
/**
|
|
@@ -3045,7 +3044,7 @@ function boundEquals(left, right) {
|
|
|
3045
3044
|
else if (right === null) {
|
|
3046
3045
|
return false;
|
|
3047
3046
|
}
|
|
3048
|
-
if (left.
|
|
3047
|
+
if (left.inclusive !== right.inclusive ||
|
|
3049
3048
|
left.position.length !== right.position.length) {
|
|
3050
3049
|
return false;
|
|
3051
3050
|
}
|
|
@@ -3210,10 +3209,10 @@ function queryToTarget(query) {
|
|
|
3210
3209
|
}
|
|
3211
3210
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
3212
3211
|
const startAt = queryImpl.endAt
|
|
3213
|
-
? new Bound(queryImpl.endAt.position, !queryImpl.endAt.
|
|
3212
|
+
? new Bound(queryImpl.endAt.position, !queryImpl.endAt.inclusive)
|
|
3214
3213
|
: null;
|
|
3215
3214
|
const endAt = queryImpl.startAt
|
|
3216
|
-
? new Bound(queryImpl.startAt.position, !queryImpl.startAt.
|
|
3215
|
+
? new Bound(queryImpl.startAt.position, !queryImpl.startAt.inclusive)
|
|
3217
3216
|
: null;
|
|
3218
3217
|
// Now return as a LimitType.First query.
|
|
3219
3218
|
queryImpl.memoizedTarget = newTarget(queryImpl.path, queryImpl.collectionGroup, orderBys, queryImpl.filters, queryImpl.limit, startAt, endAt);
|
|
@@ -3841,10 +3840,10 @@ function toQueryTarget(serializer, target) {
|
|
|
3841
3840
|
result.structuredQuery.limit = limit;
|
|
3842
3841
|
}
|
|
3843
3842
|
if (target.startAt) {
|
|
3844
|
-
result.structuredQuery.startAt =
|
|
3843
|
+
result.structuredQuery.startAt = toStartAtCursor(target.startAt);
|
|
3845
3844
|
}
|
|
3846
3845
|
if (target.endAt) {
|
|
3847
|
-
result.structuredQuery.endAt =
|
|
3846
|
+
result.structuredQuery.endAt = toEndAtCursor(target.endAt);
|
|
3848
3847
|
}
|
|
3849
3848
|
return result;
|
|
3850
3849
|
}
|
|
@@ -3866,9 +3865,15 @@ function toOrder(orderBys) {
|
|
|
3866
3865
|
}
|
|
3867
3866
|
return orderBys.map(order => toPropertyOrder(order));
|
|
3868
3867
|
}
|
|
3869
|
-
function
|
|
3868
|
+
function toStartAtCursor(cursor) {
|
|
3870
3869
|
return {
|
|
3871
|
-
before: cursor.
|
|
3870
|
+
before: cursor.inclusive,
|
|
3871
|
+
values: cursor.position
|
|
3872
|
+
};
|
|
3873
|
+
}
|
|
3874
|
+
function toEndAtCursor(cursor) {
|
|
3875
|
+
return {
|
|
3876
|
+
before: !cursor.inclusive,
|
|
3872
3877
|
values: cursor.position
|
|
3873
3878
|
};
|
|
3874
3879
|
}
|
|
@@ -6145,51 +6150,53 @@ function limitToLast(limit) {
|
|
|
6145
6150
|
return new QueryLimitConstraint('limitToLast', limit, "L" /* Last */);
|
|
6146
6151
|
}
|
|
6147
6152
|
class QueryStartAtConstraint extends QueryConstraint {
|
|
6148
|
-
constructor(type, _docOrFields,
|
|
6153
|
+
constructor(type, _docOrFields, _inclusive) {
|
|
6149
6154
|
super();
|
|
6150
6155
|
this.type = type;
|
|
6151
6156
|
this._docOrFields = _docOrFields;
|
|
6152
|
-
this.
|
|
6157
|
+
this._inclusive = _inclusive;
|
|
6153
6158
|
}
|
|
6154
6159
|
_apply(query) {
|
|
6155
|
-
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this.
|
|
6160
|
+
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._inclusive);
|
|
6156
6161
|
return new Query(query.firestore, query.converter, queryWithStartAt(query._query, bound));
|
|
6157
6162
|
}
|
|
6158
6163
|
}
|
|
6159
6164
|
function startAt(...docOrFields) {
|
|
6160
|
-
return new QueryStartAtConstraint('startAt', docOrFields,
|
|
6165
|
+
return new QueryStartAtConstraint('startAt', docOrFields,
|
|
6166
|
+
/*inclusive=*/ true);
|
|
6161
6167
|
}
|
|
6162
6168
|
function startAfter(...docOrFields) {
|
|
6163
6169
|
return new QueryStartAtConstraint('startAfter', docOrFields,
|
|
6164
|
-
/*
|
|
6170
|
+
/*inclusive=*/ false);
|
|
6165
6171
|
}
|
|
6166
6172
|
class QueryEndAtConstraint extends QueryConstraint {
|
|
6167
|
-
constructor(type, _docOrFields,
|
|
6173
|
+
constructor(type, _docOrFields, _inclusive) {
|
|
6168
6174
|
super();
|
|
6169
6175
|
this.type = type;
|
|
6170
6176
|
this._docOrFields = _docOrFields;
|
|
6171
|
-
this.
|
|
6177
|
+
this._inclusive = _inclusive;
|
|
6172
6178
|
}
|
|
6173
6179
|
_apply(query) {
|
|
6174
|
-
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this.
|
|
6180
|
+
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._inclusive);
|
|
6175
6181
|
return new Query(query.firestore, query.converter, queryWithEndAt(query._query, bound));
|
|
6176
6182
|
}
|
|
6177
6183
|
}
|
|
6178
6184
|
function endBefore(...docOrFields) {
|
|
6179
|
-
return new QueryEndAtConstraint('endBefore', docOrFields,
|
|
6185
|
+
return new QueryEndAtConstraint('endBefore', docOrFields,
|
|
6186
|
+
/*inclusive=*/ false);
|
|
6180
6187
|
}
|
|
6181
6188
|
function endAt(...docOrFields) {
|
|
6182
|
-
return new QueryEndAtConstraint('endAt', docOrFields, /*
|
|
6189
|
+
return new QueryEndAtConstraint('endAt', docOrFields, /*inclusive=*/ true);
|
|
6183
6190
|
}
|
|
6184
6191
|
/** Helper function to create a bound from a document or fields */
|
|
6185
|
-
function newQueryBoundFromDocOrFields(query, methodName, docOrFields,
|
|
6192
|
+
function newQueryBoundFromDocOrFields(query, methodName, docOrFields, inclusive) {
|
|
6186
6193
|
docOrFields[0] = getModularInstance(docOrFields[0]);
|
|
6187
6194
|
if (docOrFields[0] instanceof DocumentSnapshot) {
|
|
6188
|
-
return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document,
|
|
6195
|
+
return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document, inclusive);
|
|
6189
6196
|
}
|
|
6190
6197
|
else {
|
|
6191
6198
|
const reader = newUserDataReader(query.firestore);
|
|
6192
|
-
return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields,
|
|
6199
|
+
return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields, inclusive);
|
|
6193
6200
|
}
|
|
6194
6201
|
}
|
|
6195
6202
|
function newQueryFilter(query, methodName, dataReader, databaseId, fieldPath, op, value) {
|
|
@@ -6247,7 +6254,7 @@ function newQueryOrderBy(query, fieldPath, direction) {
|
|
|
6247
6254
|
* of the query or if any of the fields in the order by are an uncommitted
|
|
6248
6255
|
* server timestamp.
|
|
6249
6256
|
*/
|
|
6250
|
-
function newQueryBoundFromDocument(query, databaseId, methodName, doc,
|
|
6257
|
+
function newQueryBoundFromDocument(query, databaseId, methodName, doc, inclusive) {
|
|
6251
6258
|
if (!doc) {
|
|
6252
6259
|
throw new FirestoreError(Code.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ` +
|
|
6253
6260
|
`${methodName}().`);
|
|
@@ -6284,12 +6291,12 @@ function newQueryBoundFromDocument(query, databaseId, methodName, doc, before) {
|
|
|
6284
6291
|
}
|
|
6285
6292
|
}
|
|
6286
6293
|
}
|
|
6287
|
-
return new Bound(components,
|
|
6294
|
+
return new Bound(components, inclusive);
|
|
6288
6295
|
}
|
|
6289
6296
|
/**
|
|
6290
6297
|
* Converts a list of field values to a `Bound` for the given query.
|
|
6291
6298
|
*/
|
|
6292
|
-
function newQueryBoundFromFields(query, databaseId, dataReader, methodName, values,
|
|
6299
|
+
function newQueryBoundFromFields(query, databaseId, dataReader, methodName, values, inclusive) {
|
|
6293
6300
|
// Use explicit order by's because it has to match the query the user made
|
|
6294
6301
|
const orderBy = query.explicitOrderBy;
|
|
6295
6302
|
if (values.length > orderBy.length) {
|
|
@@ -6326,7 +6333,7 @@ function newQueryBoundFromFields(query, databaseId, dataReader, methodName, valu
|
|
|
6326
6333
|
components.push(wrapped);
|
|
6327
6334
|
}
|
|
6328
6335
|
}
|
|
6329
|
-
return new Bound(components,
|
|
6336
|
+
return new Bound(components, inclusive);
|
|
6330
6337
|
}
|
|
6331
6338
|
/**
|
|
6332
6339
|
* Parses the given `documentIdValue` into a `ReferenceValue`, throwing
|