@firebase/firestore 3.4.4-canary.aaeab08ac → 3.4.4-canary.b20cf306a

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.
Files changed (57) hide show
  1. package/dist/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  2. package/dist/firestore/src/api.d.ts +1 -1
  3. package/dist/firestore/src/core/database_info.d.ts +1 -0
  4. package/dist/firestore/src/core/target.d.ts +26 -1
  5. package/dist/firestore/src/model/field_index.d.ts +4 -0
  6. package/dist/firestore/src/model/values.d.ts +7 -0
  7. package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
  8. package/dist/firestore/test/util/helpers.d.ts +2 -2
  9. package/dist/index.esm2017.js +3253 -3249
  10. package/dist/index.esm2017.js.map +1 -1
  11. package/dist/index.esm5.js +3363 -3383
  12. package/dist/index.esm5.js.map +1 -1
  13. package/dist/index.node.cjs.js +196 -192
  14. package/dist/index.node.cjs.js.map +1 -1
  15. package/dist/index.node.mjs +196 -192
  16. package/dist/index.node.mjs.map +1 -1
  17. package/dist/index.rn.js +3253 -3249
  18. package/dist/index.rn.js.map +1 -1
  19. package/dist/internal.d.ts +1 -0
  20. package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  21. package/dist/lite/firestore/src/api.d.ts +1 -1
  22. package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
  23. package/dist/lite/firestore/src/core/target.d.ts +26 -1
  24. package/dist/lite/firestore/src/model/field_index.d.ts +4 -0
  25. package/dist/lite/firestore/src/model/values.d.ts +7 -0
  26. package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
  27. package/dist/lite/firestore/test/util/helpers.d.ts +2 -2
  28. package/dist/lite/index.browser.esm2017.js +6 -2
  29. package/dist/lite/index.browser.esm2017.js.map +1 -1
  30. package/dist/lite/index.browser.esm5.js +45 -43
  31. package/dist/lite/index.browser.esm5.js.map +1 -1
  32. package/dist/lite/index.node.cjs.js +6 -2
  33. package/dist/lite/index.node.cjs.js.map +1 -1
  34. package/dist/lite/index.node.mjs +6 -2
  35. package/dist/lite/index.node.mjs.map +1 -1
  36. package/dist/lite/index.rn.esm2017.js +6 -2
  37. package/dist/lite/index.rn.esm2017.js.map +1 -1
  38. package/dist/lite/internal.d.ts +1 -0
  39. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +1 -0
  40. package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  41. package/dist/lite/packages/firestore/src/api.d.ts +1 -1
  42. package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
  43. package/dist/lite/packages/firestore/src/core/target.d.ts +26 -1
  44. package/dist/lite/packages/firestore/src/model/field_index.d.ts +4 -0
  45. package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
  46. package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
  47. package/dist/lite/packages/firestore/test/util/helpers.d.ts +2 -2
  48. package/dist/packages/firestore/dist/index.esm2017.d.ts +182 -181
  49. package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  50. package/dist/packages/firestore/src/api.d.ts +1 -1
  51. package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
  52. package/dist/packages/firestore/src/core/target.d.ts +26 -1
  53. package/dist/packages/firestore/src/model/field_index.d.ts +4 -0
  54. package/dist/packages/firestore/src/model/values.d.ts +7 -0
  55. package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
  56. package/dist/packages/firestore/test/util/helpers.d.ts +2 -2
  57. package/package.json +9 -9
@@ -623,6 +623,7 @@ export declare class _DatabaseId {
623
623
  readonly projectId: string;
624
624
  readonly database: string;
625
625
  constructor(projectId: string, database?: string);
626
+ static empty(): _DatabaseId;
626
627
  get isDefaultDatabase(): boolean;
627
628
  isEqual(other: {}): boolean;
628
629
  }
@@ -20,7 +20,7 @@ export { LoadBundleTask, LoadBundleTaskProgress, TaskState } from './api/bundle'
20
20
  export { FirestoreSettings, PersistenceSettings } from './api/settings';
21
21
  export { DocumentChange, DocumentSnapshot, QueryDocumentSnapshot, QuerySnapshot, snapshotEqual, SnapshotOptions, FirestoreDataConverter, DocumentChangeType, SnapshotMetadata } from './api/snapshot';
22
22
  export { DocumentReference, CollectionReference, Query, doc, collection, collectionGroup, SetOptions, DocumentData, UpdateData, WithFieldValue, PartialWithFieldValue, refEqual, queryEqual } from './api/reference';
23
- export { endAt, endBefore, startAt, startAfter, limit, limitToLast, where, orderBy, query, QueryConstraint, QueryConstraintType, OrderByDirection, WhereFilterOp } from './api/query';
23
+ export { endAt, endBefore, startAt, startAfter, limit, limitToLast, where, orderBy, query, QueryConstraint, QueryConstraintType, OrderByDirection, WhereFilterOp } from './api/filter';
24
24
  export { Unsubscribe, SnapshotListenOptions } from './api/reference_impl';
25
25
  export { runTransaction, Transaction } from './api/transaction';
26
26
  export { getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, onSnapshot, onSnapshotsInSync, setDoc, updateDoc, deleteDoc, addDoc, executeWrite } from './api/reference_impl';
@@ -50,6 +50,7 @@ export declare class DatabaseId {
50
50
  readonly projectId: string;
51
51
  readonly database: string;
52
52
  constructor(projectId: string, database?: string);
53
+ static empty(): DatabaseId;
53
54
  get isDefaultDatabase(): boolean;
54
55
  isEqual(other: {}): boolean;
55
56
  }
@@ -15,6 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { Document } from '../model/document';
18
+ import { FieldIndex } from '../model/field_index';
18
19
  import { FieldPath, ResourcePath } from '../model/path';
19
20
  import { Value as ProtoValue } from '../protos/firestore_proto_api';
20
21
  /**
@@ -56,7 +57,31 @@ export declare function newTarget(path: ResourcePath, collectionGroup?: string |
56
57
  export declare function canonifyTarget(target: Target): string;
57
58
  export declare function stringifyTarget(target: Target): string;
58
59
  export declare function targetEquals(left: Target, right: Target): boolean;
59
- export declare function isDocumentTarget(target: Target): boolean;
60
+ export declare function targetIsDocumentTarget(target: Target): boolean;
61
+ /** Returns the field filters that target the given field path. */
62
+ export declare function targetGetFieldFiltersForPath(target: Target, path: FieldPath): FieldFilter[];
63
+ /**
64
+ * Returns the values that are used in ARRAY_CONTAINS or ARRAY_CONTAINS_ANY
65
+ * filters. Returns `null` if there are no such filters.
66
+ */
67
+ export declare function targetGetArrayValues(target: Target, fieldIndex: FieldIndex): ProtoValue[] | null;
68
+ /**
69
+ * Returns the list of values that are used in != or NOT_IN filters. Returns
70
+ * `null` if there are no such filters.
71
+ */
72
+ export declare function targetGetNotInValues(target: Target, fieldIndex: FieldIndex): ProtoValue[] | null;
73
+ /**
74
+ * Returns a lower bound of field values that can be used as a starting point to
75
+ * scan the index defined by `fieldIndex`. Returns `null` if no lower bound
76
+ * exists.
77
+ */
78
+ export declare function targetGetLowerBound(target: Target, fieldIndex: FieldIndex): Bound | null;
79
+ /**
80
+ * Returns an upper bound of field values that can be used as an ending point
81
+ * when scanning the index defined by `fieldIndex`. Returns `null` if no
82
+ * upper bound exists.
83
+ */
84
+ export declare function targetGetUpperBound(target: Target, fieldIndex: FieldIndex): Bound | null;
60
85
  export declare abstract class Filter {
61
86
  abstract matches(doc: Document): boolean;
62
87
  }
@@ -61,6 +61,10 @@ export declare class FieldIndex {
61
61
  /** Shows how up-to-date the index is for the current user. */
62
62
  indexState: IndexState);
63
63
  }
64
+ /** Returns the ArrayContains/ArrayContainsAny segment for this index. */
65
+ export declare function fieldIndexGetArraySegment(fieldIndex: FieldIndex): IndexSegment | undefined;
66
+ /** Returns all directional (ascending/descending) segments for this index. */
67
+ export declare function fieldIndexGetDirectionalSegments(fieldIndex: FieldIndex): IndexSegment[];
64
68
  /**
65
69
  * Compares indexes by collection group and segments. Ignores update time and
66
70
  * index ID.
@@ -19,6 +19,7 @@ import { ArrayValue, MapValue, Value } from '../protos/firestore_proto_api';
19
19
  import { DocumentKey } from './document_key';
20
20
  import { TypeOrder } from './type_order';
21
21
  export declare const MAX_VALUE: Value;
22
+ export declare const MIN_VALUE: Value;
22
23
  /** Extracts the backend's type order for the provided value. */
23
24
  export declare function typeOrder(value: Value): TypeOrder;
24
25
  /** Tests `left` and `right` for equality based on the backend semantics. */
@@ -76,3 +77,9 @@ export declare function isMapValue(value?: Value | null): value is {
76
77
  export declare function deepClone(source: Value): Value;
77
78
  /** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
78
79
  export declare function isMaxValue(value: Value): boolean;
80
+ /** Returns the lowest value for the given value type (inclusive). */
81
+ export declare function valuesGetLowerBound(value: Value): Value;
82
+ /** Returns the largest value for the given value type (exclusive). */
83
+ export declare function valuesGetUpperBound(value: Value): Value;
84
+ export declare function valuesMax(left: Value | undefined, right: Value | undefined): Value | undefined;
85
+ export declare function valuesMin(left: Value | undefined, right: Value | undefined): Value | undefined;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { Bytes, DocumentReference, OrderByDirection } from '../../src';
17
+ import { Bytes, DocumentReference } from '../../src';
18
18
  import { BundledDocuments } from '../../src/core/bundle';
19
19
  import { DatabaseId } from '../../src/core/database_info';
20
20
  import { Query } from '../../src/core/query';
@@ -71,7 +71,7 @@ export declare function setMutation(keyStr: string, json: JsonObject<unknown>):
71
71
  export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
72
72
  export declare function deleteMutation(keyStr: string): DeleteMutation;
73
73
  export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult;
74
- export declare function bound(values: Array<[string, {}, OrderByDirection]>, before: boolean): Bound;
74
+ export declare function bound(values: unknown[], before: boolean): Bound;
75
75
  export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
76
76
  export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
77
77
  export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
@@ -63,7 +63,7 @@ l.MOCK_USER = new l("mock-user");
63
63
  * See the License for the specific language governing permissions and
64
64
  * limitations under the License.
65
65
  */
66
- let f = "9.6.5-canary.aaeab08ac";
66
+ let f = "9.6.5-canary.b20cf306a";
67
67
 
68
68
  /**
69
69
  * @license
@@ -447,6 +447,9 @@ class K {
447
447
  constructor(t, n) {
448
448
  this.projectId = t, this.database = n || "(default)";
449
449
  }
450
+ static empty() {
451
+ return new K("", "");
452
+ }
450
453
  get isDefaultDatabase() {
451
454
  return "(default)" === this.database;
452
455
  }
@@ -2240,6 +2243,7 @@ function Jt(t, n) {
2240
2243
  }
2241
2244
  }
2242
2245
 
2246
+ // TODO(indexing): Change Bound.before to "inclusive"
2243
2247
  /**
2244
2248
  * Represents a bound of a query.
2245
2249
  *
@@ -5945,7 +5949,7 @@ class kr {
5945
5949
  return n && r._setSettings(n), r;
5946
5950
  }), "PUBLIC")),
5947
5951
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5948
- registerVersion("firestore-lite", "3.4.4-canary.aaeab08ac", ""), registerVersion("firestore-lite", "3.4.4-canary.aaeab08ac", "esm2017");
5952
+ registerVersion("firestore-lite", "3.4.4-canary.b20cf306a", ""), registerVersion("firestore-lite", "3.4.4-canary.b20cf306a", "esm2017");
5949
5953
 
5950
5954
  export { be as Bytes, fe as CollectionReference, he as DocumentReference, He as DocumentSnapshot, _e as FieldPath, ve as FieldValue, ie as Firestore, U as FirestoreError, Ee as GeoPoint, le as Query, tr as QueryConstraint, Ke as QueryDocumentSnapshot, Je as QuerySnapshot, gt as Timestamp, kr as Transaction, Sr as WriteBatch, Rr as addDoc, Nr as arrayRemove, Dr as arrayUnion, de as collection, we as collectionGroup, ce as connectFirestoreEmulator, Ar as deleteDoc, Pr as deleteField, me as doc, ge as documentId, wr as endAt, dr as endBefore, vr as getDoc, Er as getDocs, ue as getFirestore, $r as increment, oe as initializeFirestore, ur as limit, cr as limitToLast, ir as orderBy, nr as query, ye as queryEqual, pe as refEqual, jr as runTransaction, Vr as serverTimestamp, Tr as setDoc, w as setLogLevel, Xe as snapshotEqual, lr as startAfter, hr as startAt, ae as terminate, Ir as updateDoc, rr as where, xr as writeBatch };
5951
5955
  //# sourceMappingURL=index.browser.esm2017.js.map