@firebase/firestore 4.7.14 → 4.7.15
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/index/index_entry.d.ts +22 -5
- package/dist/firestore/src/local/indexeddb_schema.d.ts +7 -5
- package/dist/firestore/src/local/indexeddb_sentinels.d.ts +12 -3
- package/dist/index.cjs.js +1888 -1837
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +1889 -1838
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +115 -52
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +116 -53
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +1932 -1881
- package/dist/index.rn.js.map +1 -1
- package/dist/lite/firestore/src/index/index_entry.d.ts +22 -5
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +7 -5
- package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +12 -3
- package/dist/lite/index.browser.esm2017.js +2 -2
- package/dist/lite/index.cjs.js +2 -2
- package/dist/lite/index.node.cjs.js +2 -2
- package/dist/lite/index.node.mjs +2 -2
- package/dist/lite/index.rn.esm2017.js +2 -2
- package/package.json +8 -6
|
@@ -14,19 +14,36 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { DbIndexEntry } from '../local/indexeddb_schema';
|
|
18
|
+
import { DbIndexEntryKey, KeySafeBytes } from '../local/indexeddb_sentinels';
|
|
17
19
|
import { DocumentKey } from '../model/document_key';
|
|
18
20
|
/** Represents an index entry saved by the SDK in persisted storage. */
|
|
19
21
|
export declare class IndexEntry {
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
constructor(
|
|
22
|
+
readonly _indexId: number;
|
|
23
|
+
readonly _documentKey: DocumentKey;
|
|
24
|
+
readonly _arrayValue: Uint8Array;
|
|
25
|
+
readonly _directionalValue: Uint8Array;
|
|
26
|
+
constructor(_indexId: number, _documentKey: DocumentKey, _arrayValue: Uint8Array, _directionalValue: Uint8Array);
|
|
25
27
|
/**
|
|
26
28
|
* Returns an IndexEntry entry that sorts immediately after the current
|
|
27
29
|
* directional value.
|
|
28
30
|
*/
|
|
29
31
|
successor(): IndexEntry;
|
|
32
|
+
dbIndexEntry(uid: string, orderedDocumentKey: Uint8Array, documentKey: DocumentKey): DbIndexEntry;
|
|
33
|
+
dbIndexEntryKey(uid: string, orderedDocumentKey: Uint8Array, documentKey: DocumentKey): DbIndexEntryKey;
|
|
30
34
|
}
|
|
31
35
|
export declare function indexEntryComparator(left: IndexEntry, right: IndexEntry): number;
|
|
32
36
|
export declare function compareByteArrays(left: Uint8Array, right: Uint8Array): number;
|
|
37
|
+
/**
|
|
38
|
+
* Workaround for WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=292721
|
|
39
|
+
* Create a key safe representation of Uint8Array values.
|
|
40
|
+
* If the browser is detected as Safari or WebKit, then
|
|
41
|
+
* the input array will be converted to "sortable byte string".
|
|
42
|
+
* Otherwise, the input array will be returned in its original type.
|
|
43
|
+
*/
|
|
44
|
+
export declare function encodeKeySafeBytes(array: Uint8Array): KeySafeBytes;
|
|
45
|
+
/**
|
|
46
|
+
* Reverts the key safe representation of Uint8Array (created by
|
|
47
|
+
* encodeKeySafeBytes) to a normal Uint8Array.
|
|
48
|
+
*/
|
|
49
|
+
export declare function decodeKeySafeBytes(input: KeySafeBytes): Uint8Array;
|
|
@@ -19,7 +19,7 @@ import { IndexKind } from '../model/field_index';
|
|
|
19
19
|
import { BundledQuery } from '../protos/firestore_bundle_proto';
|
|
20
20
|
import { Document as ProtoDocument, DocumentsTarget as ProtoDocumentsTarget, QueryTarget as ProtoQueryTarget, Write as ProtoWrite } from '../protos/firestore_proto_api';
|
|
21
21
|
import { EncodedResourcePath } from './encoded_resource_path';
|
|
22
|
-
import { DbTimestampKey } from './indexeddb_sentinels';
|
|
22
|
+
import { DbTimestampKey, KeySafeBytes } from './indexeddb_sentinels';
|
|
23
23
|
/**
|
|
24
24
|
* Schema Version for the Web client:
|
|
25
25
|
* 1. Initial version including Mutation Queue, Query Cache, and Remote
|
|
@@ -44,8 +44,10 @@ import { DbTimestampKey } from './indexeddb_sentinels';
|
|
|
44
44
|
* 14. Add overlays.
|
|
45
45
|
* 15. Add indexing support.
|
|
46
46
|
* 16. Parse timestamp strings before creating index entries.
|
|
47
|
+
* 17. TODO(tomandersen)
|
|
48
|
+
* 18. Encode key safe representations of IndexEntry in DbIndexEntryStore.
|
|
47
49
|
*/
|
|
48
|
-
export declare const SCHEMA_VERSION =
|
|
50
|
+
export declare const SCHEMA_VERSION = 18;
|
|
49
51
|
/**
|
|
50
52
|
* Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.
|
|
51
53
|
*/
|
|
@@ -468,14 +470,14 @@ export interface DbIndexEntry {
|
|
|
468
470
|
/** The user id for this entry. */
|
|
469
471
|
uid: string;
|
|
470
472
|
/** The encoded array index value for this entry. */
|
|
471
|
-
arrayValue:
|
|
473
|
+
arrayValue: KeySafeBytes;
|
|
472
474
|
/** The encoded directional value for equality and inequality filters. */
|
|
473
|
-
directionalValue:
|
|
475
|
+
directionalValue: KeySafeBytes;
|
|
474
476
|
/**
|
|
475
477
|
* The document key this entry points to. This entry is encoded by an ordered
|
|
476
478
|
* encoder to match the key order of the index.
|
|
477
479
|
*/
|
|
478
|
-
orderedDocumentKey:
|
|
480
|
+
orderedDocumentKey: KeySafeBytes;
|
|
479
481
|
/** The segments of the document key this entry points to. */
|
|
480
482
|
documentKey: string[];
|
|
481
483
|
}
|
|
@@ -201,6 +201,14 @@ export declare const DbIndexStateKeyPath: string[];
|
|
|
201
201
|
*/
|
|
202
202
|
export declare const DbIndexStateSequenceNumberIndex = "sequenceNumberIndex";
|
|
203
203
|
export declare const DbIndexStateSequenceNumberIndexPath: string[];
|
|
204
|
+
/**
|
|
205
|
+
* Representation of a byte array that is safe for
|
|
206
|
+
* use in an IndexedDb key. The value is either
|
|
207
|
+
* a "sortable byte string", which is key safe in
|
|
208
|
+
* Safari/WebKit, or the value is a Uint8Array,
|
|
209
|
+
* which is key safe in other browsers.
|
|
210
|
+
*/
|
|
211
|
+
export type KeySafeBytes = Uint8Array | string;
|
|
204
212
|
/**
|
|
205
213
|
* The key for each index entry consists of the index id and its user id,
|
|
206
214
|
* the encoded array and directional value for the indexed fields as well as
|
|
@@ -209,9 +217,9 @@ export declare const DbIndexStateSequenceNumberIndexPath: string[];
|
|
|
209
217
|
export type DbIndexEntryKey = [
|
|
210
218
|
number,
|
|
211
219
|
string,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
220
|
+
KeySafeBytes,
|
|
221
|
+
KeySafeBytes,
|
|
222
|
+
KeySafeBytes,
|
|
215
223
|
string[]
|
|
216
224
|
];
|
|
217
225
|
/** Name of the IndexedDb object store. */
|
|
@@ -248,6 +256,7 @@ export declare const V14_STORES: string[];
|
|
|
248
256
|
export declare const V15_STORES: string[];
|
|
249
257
|
export declare const V16_STORES: string[];
|
|
250
258
|
export declare const V17_STORES: string[];
|
|
259
|
+
export declare const V18_STORES: string[];
|
|
251
260
|
/**
|
|
252
261
|
* The list of all default IndexedDB stores used throughout the SDK. This is
|
|
253
262
|
* used when creating transactions so that access across all stores is done
|