@firebase/firestore 4.7.12-canary.d5082f9f2 → 4.7.12-canary.d5428f3d2

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.
@@ -14,36 +14,19 @@
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';
19
17
  import { DocumentKey } from '../model/document_key';
20
18
  /** Represents an index entry saved by the SDK in persisted storage. */
21
19
  export declare class IndexEntry {
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);
20
+ readonly indexId: number;
21
+ readonly documentKey: DocumentKey;
22
+ readonly arrayValue: Uint8Array;
23
+ readonly directionalValue: Uint8Array;
24
+ constructor(indexId: number, documentKey: DocumentKey, arrayValue: Uint8Array, directionalValue: Uint8Array);
27
25
  /**
28
26
  * Returns an IndexEntry entry that sorts immediately after the current
29
27
  * directional value.
30
28
  */
31
29
  successor(): IndexEntry;
32
- dbIndexEntry(uid: string, orderedDocumentKey: Uint8Array, documentKey: DocumentKey): DbIndexEntry;
33
- dbIndexEntryKey(uid: string, orderedDocumentKey: Uint8Array, documentKey: DocumentKey): DbIndexEntryKey;
34
30
  }
35
31
  export declare function indexEntryComparator(left: IndexEntry, right: IndexEntry): number;
36
32
  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, KeySafeBytes } from './indexeddb_sentinels';
22
+ import { DbTimestampKey } 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,10 +44,8 @@ import { DbTimestampKey, KeySafeBytes } 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.
49
47
  */
50
- export declare const SCHEMA_VERSION = 18;
48
+ export declare const SCHEMA_VERSION = 17;
51
49
  /**
52
50
  * Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.
53
51
  */
@@ -470,14 +468,14 @@ export interface DbIndexEntry {
470
468
  /** The user id for this entry. */
471
469
  uid: string;
472
470
  /** The encoded array index value for this entry. */
473
- arrayValue: KeySafeBytes;
471
+ arrayValue: Uint8Array;
474
472
  /** The encoded directional value for equality and inequality filters. */
475
- directionalValue: KeySafeBytes;
473
+ directionalValue: Uint8Array;
476
474
  /**
477
475
  * The document key this entry points to. This entry is encoded by an ordered
478
476
  * encoder to match the key order of the index.
479
477
  */
480
- orderedDocumentKey: KeySafeBytes;
478
+ orderedDocumentKey: Uint8Array;
481
479
  /** The segments of the document key this entry points to. */
482
480
  documentKey: string[];
483
481
  }
@@ -201,14 +201,6 @@ 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;
212
204
  /**
213
205
  * The key for each index entry consists of the index id and its user id,
214
206
  * the encoded array and directional value for the indexed fields as well as
@@ -217,9 +209,9 @@ export type KeySafeBytes = Uint8Array | string;
217
209
  export type DbIndexEntryKey = [
218
210
  number,
219
211
  string,
220
- KeySafeBytes,
221
- KeySafeBytes,
222
- KeySafeBytes,
212
+ Uint8Array,
213
+ Uint8Array,
214
+ Uint8Array,
223
215
  string[]
224
216
  ];
225
217
  /** Name of the IndexedDb object store. */
@@ -256,7 +248,6 @@ export declare const V14_STORES: string[];
256
248
  export declare const V15_STORES: string[];
257
249
  export declare const V16_STORES: string[];
258
250
  export declare const V17_STORES: string[];
259
- export declare const V18_STORES: string[];
260
251
  /**
261
252
  * The list of all default IndexedDB stores used throughout the SDK. This is
262
253
  * used when creating transactions so that access across all stores is done