@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
|
@@ -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.e8972ef49";
|
|
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.e8972ef49";
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* @license
|
|
@@ -666,6 +666,9 @@ class DatabaseId {
|
|
|
666
666
|
this.projectId = projectId;
|
|
667
667
|
this.database = database ? database : DEFAULT_DATABASE_NAME;
|
|
668
668
|
}
|
|
669
|
+
static empty() {
|
|
670
|
+
return new DatabaseId('', '');
|
|
671
|
+
}
|
|
669
672
|
get isDefaultDatabase() {
|
|
670
673
|
return this.database === DEFAULT_DATABASE_NAME;
|
|
671
674
|
}
|
|
@@ -3025,9 +3028,9 @@ class ArrayContainsAnyFilter extends FieldFilter {
|
|
|
3025
3028
|
* just after the provided values.
|
|
3026
3029
|
*/
|
|
3027
3030
|
class Bound {
|
|
3028
|
-
constructor(position,
|
|
3031
|
+
constructor(position, inclusive) {
|
|
3029
3032
|
this.position = position;
|
|
3030
|
-
this.
|
|
3033
|
+
this.inclusive = inclusive;
|
|
3031
3034
|
}
|
|
3032
3035
|
}
|
|
3033
3036
|
/**
|
|
@@ -3049,7 +3052,7 @@ function boundEquals(left, right) {
|
|
|
3049
3052
|
else if (right === null) {
|
|
3050
3053
|
return false;
|
|
3051
3054
|
}
|
|
3052
|
-
if (left.
|
|
3055
|
+
if (left.inclusive !== right.inclusive ||
|
|
3053
3056
|
left.position.length !== right.position.length) {
|
|
3054
3057
|
return false;
|
|
3055
3058
|
}
|
|
@@ -3214,10 +3217,10 @@ function queryToTarget(query) {
|
|
|
3214
3217
|
}
|
|
3215
3218
|
// We need to swap the cursors to match the now-flipped query ordering.
|
|
3216
3219
|
const startAt = queryImpl.endAt
|
|
3217
|
-
? new Bound(queryImpl.endAt.position, !queryImpl.endAt.
|
|
3220
|
+
? new Bound(queryImpl.endAt.position, !queryImpl.endAt.inclusive)
|
|
3218
3221
|
: null;
|
|
3219
3222
|
const endAt = queryImpl.startAt
|
|
3220
|
-
? new Bound(queryImpl.startAt.position, !queryImpl.startAt.
|
|
3223
|
+
? new Bound(queryImpl.startAt.position, !queryImpl.startAt.inclusive)
|
|
3221
3224
|
: null;
|
|
3222
3225
|
// Now return as a LimitType.First query.
|
|
3223
3226
|
queryImpl.memoizedTarget = newTarget(queryImpl.path, queryImpl.collectionGroup, orderBys, queryImpl.filters, queryImpl.limit, startAt, endAt);
|
|
@@ -3845,10 +3848,10 @@ function toQueryTarget(serializer, target) {
|
|
|
3845
3848
|
result.structuredQuery.limit = limit;
|
|
3846
3849
|
}
|
|
3847
3850
|
if (target.startAt) {
|
|
3848
|
-
result.structuredQuery.startAt =
|
|
3851
|
+
result.structuredQuery.startAt = toStartAtCursor(target.startAt);
|
|
3849
3852
|
}
|
|
3850
3853
|
if (target.endAt) {
|
|
3851
|
-
result.structuredQuery.endAt =
|
|
3854
|
+
result.structuredQuery.endAt = toEndAtCursor(target.endAt);
|
|
3852
3855
|
}
|
|
3853
3856
|
return result;
|
|
3854
3857
|
}
|
|
@@ -3870,9 +3873,15 @@ function toOrder(orderBys) {
|
|
|
3870
3873
|
}
|
|
3871
3874
|
return orderBys.map(order => toPropertyOrder(order));
|
|
3872
3875
|
}
|
|
3873
|
-
function
|
|
3876
|
+
function toStartAtCursor(cursor) {
|
|
3877
|
+
return {
|
|
3878
|
+
before: cursor.inclusive,
|
|
3879
|
+
values: cursor.position
|
|
3880
|
+
};
|
|
3881
|
+
}
|
|
3882
|
+
function toEndAtCursor(cursor) {
|
|
3874
3883
|
return {
|
|
3875
|
-
before: cursor.
|
|
3884
|
+
before: !cursor.inclusive,
|
|
3876
3885
|
values: cursor.position
|
|
3877
3886
|
};
|
|
3878
3887
|
}
|
|
@@ -6149,51 +6158,53 @@ function limitToLast(limit) {
|
|
|
6149
6158
|
return new QueryLimitConstraint('limitToLast', limit, "L" /* Last */);
|
|
6150
6159
|
}
|
|
6151
6160
|
class QueryStartAtConstraint extends QueryConstraint {
|
|
6152
|
-
constructor(type, _docOrFields,
|
|
6161
|
+
constructor(type, _docOrFields, _inclusive) {
|
|
6153
6162
|
super();
|
|
6154
6163
|
this.type = type;
|
|
6155
6164
|
this._docOrFields = _docOrFields;
|
|
6156
|
-
this.
|
|
6165
|
+
this._inclusive = _inclusive;
|
|
6157
6166
|
}
|
|
6158
6167
|
_apply(query) {
|
|
6159
|
-
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this.
|
|
6168
|
+
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._inclusive);
|
|
6160
6169
|
return new Query(query.firestore, query.converter, queryWithStartAt(query._query, bound));
|
|
6161
6170
|
}
|
|
6162
6171
|
}
|
|
6163
6172
|
function startAt(...docOrFields) {
|
|
6164
|
-
return new QueryStartAtConstraint('startAt', docOrFields,
|
|
6173
|
+
return new QueryStartAtConstraint('startAt', docOrFields,
|
|
6174
|
+
/*inclusive=*/ true);
|
|
6165
6175
|
}
|
|
6166
6176
|
function startAfter(...docOrFields) {
|
|
6167
6177
|
return new QueryStartAtConstraint('startAfter', docOrFields,
|
|
6168
|
-
/*
|
|
6178
|
+
/*inclusive=*/ false);
|
|
6169
6179
|
}
|
|
6170
6180
|
class QueryEndAtConstraint extends QueryConstraint {
|
|
6171
|
-
constructor(type, _docOrFields,
|
|
6181
|
+
constructor(type, _docOrFields, _inclusive) {
|
|
6172
6182
|
super();
|
|
6173
6183
|
this.type = type;
|
|
6174
6184
|
this._docOrFields = _docOrFields;
|
|
6175
|
-
this.
|
|
6185
|
+
this._inclusive = _inclusive;
|
|
6176
6186
|
}
|
|
6177
6187
|
_apply(query) {
|
|
6178
|
-
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this.
|
|
6188
|
+
const bound = newQueryBoundFromDocOrFields(query, this.type, this._docOrFields, this._inclusive);
|
|
6179
6189
|
return new Query(query.firestore, query.converter, queryWithEndAt(query._query, bound));
|
|
6180
6190
|
}
|
|
6181
6191
|
}
|
|
6182
6192
|
function endBefore(...docOrFields) {
|
|
6183
|
-
return new QueryEndAtConstraint('endBefore', docOrFields,
|
|
6193
|
+
return new QueryEndAtConstraint('endBefore', docOrFields,
|
|
6194
|
+
/*inclusive=*/ false);
|
|
6184
6195
|
}
|
|
6185
6196
|
function endAt(...docOrFields) {
|
|
6186
|
-
return new QueryEndAtConstraint('endAt', docOrFields, /*
|
|
6197
|
+
return new QueryEndAtConstraint('endAt', docOrFields, /*inclusive=*/ true);
|
|
6187
6198
|
}
|
|
6188
6199
|
/** Helper function to create a bound from a document or fields */
|
|
6189
|
-
function newQueryBoundFromDocOrFields(query, methodName, docOrFields,
|
|
6200
|
+
function newQueryBoundFromDocOrFields(query, methodName, docOrFields, inclusive) {
|
|
6190
6201
|
docOrFields[0] = util.getModularInstance(docOrFields[0]);
|
|
6191
6202
|
if (docOrFields[0] instanceof DocumentSnapshot) {
|
|
6192
|
-
return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document,
|
|
6203
|
+
return newQueryBoundFromDocument(query._query, query.firestore._databaseId, methodName, docOrFields[0]._document, inclusive);
|
|
6193
6204
|
}
|
|
6194
6205
|
else {
|
|
6195
6206
|
const reader = newUserDataReader(query.firestore);
|
|
6196
|
-
return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields,
|
|
6207
|
+
return newQueryBoundFromFields(query._query, query.firestore._databaseId, reader, methodName, docOrFields, inclusive);
|
|
6197
6208
|
}
|
|
6198
6209
|
}
|
|
6199
6210
|
function newQueryFilter(query, methodName, dataReader, databaseId, fieldPath, op, value) {
|
|
@@ -6251,7 +6262,7 @@ function newQueryOrderBy(query, fieldPath, direction) {
|
|
|
6251
6262
|
* of the query or if any of the fields in the order by are an uncommitted
|
|
6252
6263
|
* server timestamp.
|
|
6253
6264
|
*/
|
|
6254
|
-
function newQueryBoundFromDocument(query, databaseId, methodName, doc,
|
|
6265
|
+
function newQueryBoundFromDocument(query, databaseId, methodName, doc, inclusive) {
|
|
6255
6266
|
if (!doc) {
|
|
6256
6267
|
throw new FirestoreError(Code.NOT_FOUND, `Can't use a DocumentSnapshot that doesn't exist for ` +
|
|
6257
6268
|
`${methodName}().`);
|
|
@@ -6288,12 +6299,12 @@ function newQueryBoundFromDocument(query, databaseId, methodName, doc, before) {
|
|
|
6288
6299
|
}
|
|
6289
6300
|
}
|
|
6290
6301
|
}
|
|
6291
|
-
return new Bound(components,
|
|
6302
|
+
return new Bound(components, inclusive);
|
|
6292
6303
|
}
|
|
6293
6304
|
/**
|
|
6294
6305
|
* Converts a list of field values to a `Bound` for the given query.
|
|
6295
6306
|
*/
|
|
6296
|
-
function newQueryBoundFromFields(query, databaseId, dataReader, methodName, values,
|
|
6307
|
+
function newQueryBoundFromFields(query, databaseId, dataReader, methodName, values, inclusive) {
|
|
6297
6308
|
// Use explicit order by's because it has to match the query the user made
|
|
6298
6309
|
const orderBy = query.explicitOrderBy;
|
|
6299
6310
|
if (values.length > orderBy.length) {
|
|
@@ -6330,7 +6341,7 @@ function newQueryBoundFromFields(query, databaseId, dataReader, methodName, valu
|
|
|
6330
6341
|
components.push(wrapped);
|
|
6331
6342
|
}
|
|
6332
6343
|
}
|
|
6333
|
-
return new Bound(components,
|
|
6344
|
+
return new Bound(components, inclusive);
|
|
6334
6345
|
}
|
|
6335
6346
|
/**
|
|
6336
6347
|
* Parses the given `documentIdValue` into a `ReferenceValue`, throwing
|