@firebase/firestore 3.4.5-2022116201138 → 3.4.5-canary.091e8676f
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/CHANGELOG.md +1 -1
- package/dist/firestore/src/index/index_entry.d.ts +6 -0
- package/dist/firestore/src/local/index_manager.d.ts +2 -2
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
- package/dist/firestore/src/local/memory_index_manager.d.ts +1 -1
- package/dist/firestore/src/local/simple_db.d.ts +11 -0
- package/dist/firestore/src/model/field_index.d.ts +2 -0
- package/dist/firestore/src/model/type_order.d.ts +2 -1
- package/dist/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/firestore/test/unit/local/test_index_manager.d.ts +1 -1
- package/dist/index.esm2017.js +3825 -3356
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3816 -3345
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +828 -124
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +828 -124
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +3795 -3326
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/lite/firestore/src/index/index_entry.d.ts +6 -0
- package/dist/lite/firestore/src/local/index_manager.d.ts +2 -2
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +1 -1
- package/dist/lite/firestore/src/local/simple_db.d.ts +11 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +2 -0
- package/dist/lite/firestore/src/model/type_order.d.ts +2 -1
- package/dist/lite/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +1 -1
- package/dist/lite/index.browser.esm2017.js +34 -24
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +12 -23
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +21 -9
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +21 -9
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +34 -24
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/packages/firestore/src/index/index_entry.d.ts +6 -0
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/simple_db.d.ts +11 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +2 -0
- package/dist/lite/packages/firestore/src/model/type_order.d.ts +2 -1
- package/dist/lite/packages/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +1 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +183 -183
- package/dist/packages/firestore/src/index/index_entry.d.ts +6 -0
- package/dist/packages/firestore/src/local/index_manager.d.ts +2 -2
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +1 -1
- package/dist/packages/firestore/src/local/simple_db.d.ts +11 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +2 -0
- package/dist/packages/firestore/src/model/type_order.d.ts +2 -1
- package/dist/packages/firestore/src/platform/node/base64.d.ts +1 -0
- package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +1 -1
- package/dist/private.d.ts +2 -2
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -22,5 +22,11 @@ export declare class IndexEntry {
|
|
|
22
22
|
readonly arrayValue: Uint8Array;
|
|
23
23
|
readonly directionalValue: Uint8Array;
|
|
24
24
|
constructor(indexId: number, documentKey: DocumentKey, arrayValue: Uint8Array, directionalValue: Uint8Array);
|
|
25
|
+
/**
|
|
26
|
+
* Returns an IndexEntry entry that sorts immediately after the current
|
|
27
|
+
* directional value.
|
|
28
|
+
*/
|
|
29
|
+
successor(): IndexEntry;
|
|
25
30
|
}
|
|
26
31
|
export declare function indexEntryComparator(left: IndexEntry, right: IndexEntry): number;
|
|
32
|
+
export declare function compareByteArrays(left: Uint8Array, right: Uint8Array): number;
|
|
@@ -73,9 +73,9 @@ export interface IndexManager {
|
|
|
73
73
|
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
74
74
|
/**
|
|
75
75
|
* Returns the documents that match the given target based on the provided
|
|
76
|
-
* index.
|
|
76
|
+
* index or `null` if the target does not have a matching index.
|
|
77
77
|
*/
|
|
78
|
-
getDocumentsMatchingTarget(transaction: PersistenceTransaction,
|
|
78
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, target: Target): PersistencePromise<DocumentKeySet | null>;
|
|
79
79
|
/**
|
|
80
80
|
* Returns the next collection group to update. Returns `null` if no group
|
|
81
81
|
* exists.
|
|
@@ -39,6 +39,11 @@ export declare class IndexedDbIndexManager implements IndexManager {
|
|
|
39
39
|
*/
|
|
40
40
|
private collectionParentsCache;
|
|
41
41
|
private uid;
|
|
42
|
+
/**
|
|
43
|
+
* Maps from a target to its equivalent list of sub-targets. Each sub-target
|
|
44
|
+
* contains only one term from the target's disjunctive normal form (DNF).
|
|
45
|
+
*/
|
|
46
|
+
private targetToDnfSubTargets;
|
|
42
47
|
constructor(user: User);
|
|
43
48
|
/**
|
|
44
49
|
* Adds a new entry to the collection parent index.
|
|
@@ -51,7 +56,22 @@ export declare class IndexedDbIndexManager implements IndexManager {
|
|
|
51
56
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<ResourcePath[]>;
|
|
52
57
|
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
53
58
|
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
54
|
-
getDocumentsMatchingTarget(transaction: PersistenceTransaction,
|
|
59
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, target: Target): PersistencePromise<DocumentKeySet | null>;
|
|
60
|
+
private getSubTargets;
|
|
61
|
+
/**
|
|
62
|
+
* Constructs a key range query on `DbIndexEntry.store` that unions all
|
|
63
|
+
* bounds.
|
|
64
|
+
*/
|
|
65
|
+
private generateIndexRanges;
|
|
66
|
+
/** Generates the lower bound for `arrayValue` and `directionalValue`. */
|
|
67
|
+
private generateLowerBound;
|
|
68
|
+
/** Generates the upper bound for `arrayValue` and `directionalValue`. */
|
|
69
|
+
private generateUpperBound;
|
|
70
|
+
/**
|
|
71
|
+
* Generates an empty bound that scopes the index scan to the current index
|
|
72
|
+
* and user.
|
|
73
|
+
*/
|
|
74
|
+
private generateEmptyBound;
|
|
55
75
|
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
56
76
|
/**
|
|
57
77
|
* Returns the byte encoded form of the directional values in the field index.
|
|
@@ -61,6 +81,27 @@ export declare class IndexedDbIndexManager implements IndexManager {
|
|
|
61
81
|
private encodeDirectionalElements;
|
|
62
82
|
/** Encodes a single value to the ascending index format. */
|
|
63
83
|
private encodeSingleElement;
|
|
84
|
+
/**
|
|
85
|
+
* Encodes the given field values according to the specification in `target`.
|
|
86
|
+
* For IN queries, a list of possible values is returned.
|
|
87
|
+
*/
|
|
88
|
+
private encodeValues;
|
|
89
|
+
/**
|
|
90
|
+
* Encodes the given bounds according to the specification in `target`. For IN
|
|
91
|
+
* queries, a list of possible values is returned.
|
|
92
|
+
*/
|
|
93
|
+
private encodeBound;
|
|
94
|
+
/** Returns the byte representation for the provided encoders. */
|
|
95
|
+
private getEncodedBytes;
|
|
96
|
+
/**
|
|
97
|
+
* Creates a separate encoder for each element of an array.
|
|
98
|
+
*
|
|
99
|
+
* The method appends each value to all existing encoders (e.g. filter("a",
|
|
100
|
+
* "==", "a1").filter("b", "in", ["b1", "b2"]) becomes ["a1,b1", "a1,b2"]). A
|
|
101
|
+
* list of new encoders is returned.
|
|
102
|
+
*/
|
|
103
|
+
private expandIndexValues;
|
|
104
|
+
private isInFilter;
|
|
64
105
|
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup?: string): PersistencePromise<FieldIndex[]>;
|
|
65
106
|
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
66
107
|
updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
|
|
@@ -77,4 +118,10 @@ export declare class IndexedDbIndexManager implements IndexManager {
|
|
|
77
118
|
*/
|
|
78
119
|
private updateEntries;
|
|
79
120
|
private getNextSequenceNumber;
|
|
121
|
+
/**
|
|
122
|
+
* Returns a new set of IDB ranges that splits the existing range and excludes
|
|
123
|
+
* any values that match the `notInValue` from these ranges. As an example,
|
|
124
|
+
* '[foo > 2 && foo != 3]` becomes `[foo > 2 && < 3, foo > 3]`.
|
|
125
|
+
*/
|
|
126
|
+
private createRange;
|
|
80
127
|
}
|
|
@@ -30,7 +30,7 @@ export declare class MemoryIndexManager implements IndexManager {
|
|
|
30
30
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<ResourcePath[]>;
|
|
31
31
|
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
32
32
|
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
33
|
-
getDocumentsMatchingTarget(transaction: PersistenceTransaction,
|
|
33
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, target: Target): PersistencePromise<DocumentKeySet | null>;
|
|
34
34
|
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
35
35
|
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup?: string): PersistencePromise<FieldIndex[]>;
|
|
36
36
|
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
@@ -182,9 +182,20 @@ export declare class SimpleDbStore<KeyType extends IDBValidKey, ValueType extend
|
|
|
182
182
|
* Returns the number of rows in the store.
|
|
183
183
|
*/
|
|
184
184
|
count(): PersistencePromise<number>;
|
|
185
|
+
/** Loads all elements from the object store. */
|
|
185
186
|
loadAll(): PersistencePromise<ValueType[]>;
|
|
187
|
+
/** Loads all elements for the index range from the object store. */
|
|
186
188
|
loadAll(range: IDBKeyRange): PersistencePromise<ValueType[]>;
|
|
189
|
+
/**
|
|
190
|
+
* Loads all elements from the object store that fall into the provided in the
|
|
191
|
+
* index range for the given index.
|
|
192
|
+
*/
|
|
187
193
|
loadAll(index: string, range: IDBKeyRange): PersistencePromise<ValueType[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Loads the first `count` elements from the provided index range. Loads all
|
|
196
|
+
* elements if no limit is provided.
|
|
197
|
+
*/
|
|
198
|
+
loadFirst(range: IDBKeyRange, count: number | null): PersistencePromise<ValueType[]>;
|
|
188
199
|
deleteAll(): PersistencePromise<void>;
|
|
189
200
|
deleteAll(range: IDBKeyRange): PersistencePromise<void>;
|
|
190
201
|
deleteAll(index: string, range: IDBKeyRange): PersistencePromise<void>;
|
|
@@ -70,6 +70,8 @@ export declare function fieldIndexGetDirectionalSegments(fieldIndex: FieldIndex)
|
|
|
70
70
|
* index ID.
|
|
71
71
|
*/
|
|
72
72
|
export declare function fieldIndexSemanticComparator(left: FieldIndex, right: FieldIndex): number;
|
|
73
|
+
/** Returns a debug representation of the field index */
|
|
74
|
+
export declare function fieldIndexToString(fieldIndex: FieldIndex): string;
|
|
73
75
|
/** The type of the index, e.g. for which type of query it can be used. */
|
|
74
76
|
export declare const enum IndexKind {
|
|
75
77
|
/**
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
/** Converts a Base64 encoded string to a binary string. */
|
|
17
18
|
export declare function decodeBase64(encoded: string): string;
|
|
18
19
|
/** Converts a binary string to a Base64 encoded string. */
|
|
19
20
|
export declare function encodeBase64(raw: string): string;
|
|
@@ -34,7 +34,7 @@ export declare class TestIndexManager {
|
|
|
34
34
|
deleteFieldIndex(index: FieldIndex): Promise<void>;
|
|
35
35
|
getFieldIndexes(collectionGroup?: string): Promise<FieldIndex[]>;
|
|
36
36
|
getFieldIndex(target: Target): Promise<FieldIndex | null>;
|
|
37
|
-
getDocumentsMatchingTarget(
|
|
37
|
+
getDocumentsMatchingTarget(target: Target): Promise<DocumentKeySet | null>;
|
|
38
38
|
getNextCollectionGroupToUpdate(): Promise<string | null>;
|
|
39
39
|
updateCollectionGroup(collectionGroup: string, offset: IndexOffset): Promise<void>;
|
|
40
40
|
updateIndexEntries(documents: DocumentMap): Promise<void>;
|