@firebase/firestore 3.4.1-canary.c2fff0c6a → 3.4.2-canary.044a8d7f9
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 +12 -0
- package/dist/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
- package/dist/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
- package/dist/firestore/src/index/index_byte_encoder.d.ts +14 -0
- package/dist/firestore/src/index/ordered_code_writer.d.ts +60 -0
- package/dist/firestore/src/lite-api/reference.d.ts +4 -2
- package/dist/firestore/src/model/values.d.ts +3 -0
- package/dist/firestore/src/util/byte_string.d.ts +1 -0
- package/dist/firestore/src/util/error.d.ts +2 -3
- package/dist/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -0
- package/dist/firestore/test/util/helpers.d.ts +1 -0
- package/dist/index.d.ts +6 -21
- package/dist/index.esm2017.js +2639 -2630
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +2601 -2591
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +38 -20
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +38 -20
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +2837 -2828
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +7 -21
- package/dist/lite/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
- package/dist/lite/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
- package/dist/lite/firestore/src/index/index_byte_encoder.d.ts +14 -0
- package/dist/lite/firestore/src/index/ordered_code_writer.d.ts +60 -0
- package/dist/lite/firestore/src/lite-api/reference.d.ts +4 -2
- package/dist/lite/firestore/src/model/values.d.ts +3 -0
- package/dist/lite/firestore/src/util/byte_string.d.ts +1 -0
- package/dist/lite/firestore/src/util/error.d.ts +2 -3
- package/dist/lite/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +1 -0
- package/dist/lite/index.browser.esm2017.js +834 -822
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +835 -822
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +6 -21
- package/dist/lite/index.node.cjs.js +23 -6
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +24 -7
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +833 -821
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +7 -21
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +109 -109
- package/dist/lite/packages/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
- package/dist/lite/packages/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
- package/dist/lite/packages/firestore/src/index/index_byte_encoder.d.ts +14 -0
- package/dist/lite/packages/firestore/src/index/ordered_code_writer.d.ts +60 -0
- package/dist/lite/packages/firestore/src/lite-api/reference.d.ts +4 -2
- package/dist/lite/packages/firestore/src/model/values.d.ts +3 -0
- package/dist/lite/packages/firestore/src/util/byte_string.d.ts +1 -0
- package/dist/lite/packages/firestore/src/util/error.d.ts +2 -3
- package/dist/lite/packages/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +1 -0
- package/dist/lite/private.d.ts +6 -21
- package/dist/packages/firestore/dist/index.esm2017.d.ts +156 -156
- package/dist/packages/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
- package/dist/packages/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
- package/dist/packages/firestore/src/index/index_byte_encoder.d.ts +14 -0
- package/dist/packages/firestore/src/index/ordered_code_writer.d.ts +60 -0
- package/dist/packages/firestore/src/lite-api/reference.d.ts +4 -2
- package/dist/packages/firestore/src/model/values.d.ts +3 -0
- package/dist/packages/firestore/src/util/byte_string.d.ts +1 -0
- package/dist/packages/firestore/src/util/error.d.ts +2 -3
- package/dist/packages/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +1 -0
- package/dist/private.d.ts +6 -21
- package/package.json +9 -9
package/dist/internal.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { DocumentData as DocumentData_2 } from '@firebase/firestore-types';
|
|
8
8
|
import { EmulatorMockTokenOptions } from '@firebase/util';
|
|
9
9
|
import { FirebaseApp } from '@firebase/app';
|
|
10
|
+
import { FirebaseError } from '@firebase/util';
|
|
10
11
|
import { _FirebaseService } from '@firebase/app';
|
|
11
12
|
import { LogLevelString as LogLevel } from '@firebase/logger';
|
|
12
13
|
import { SetOptions as SetOptions_2 } from '@firebase/firestore-types';
|
|
@@ -362,6 +363,7 @@ export declare class _ByteString {
|
|
|
362
363
|
private constructor();
|
|
363
364
|
static fromBase64String(base64: string): _ByteString;
|
|
364
365
|
static fromUint8Array(array: Uint8Array): _ByteString;
|
|
366
|
+
[Symbol.iterator](): Iterator<number>;
|
|
365
367
|
toBase64(): string;
|
|
366
368
|
toUint8Array(): Uint8Array;
|
|
367
369
|
approximateByteSize(): number;
|
|
@@ -1681,7 +1683,7 @@ declare interface FirestoreDataConverter_2<T> {
|
|
|
1681
1683
|
}
|
|
1682
1684
|
|
|
1683
1685
|
/** An error returned by a Firestore operation. */
|
|
1684
|
-
export declare class FirestoreError extends
|
|
1686
|
+
export declare class FirestoreError extends FirebaseError {
|
|
1685
1687
|
/**
|
|
1686
1688
|
* The backend error code associated with this error.
|
|
1687
1689
|
*/
|
|
@@ -1690,8 +1692,6 @@ export declare class FirestoreError extends Error {
|
|
|
1690
1692
|
* A custom error description.
|
|
1691
1693
|
*/
|
|
1692
1694
|
readonly message: string;
|
|
1693
|
-
/** The custom name for all FirestoreErrors. */
|
|
1694
|
-
readonly name: string;
|
|
1695
1695
|
/** The stack of the error. */
|
|
1696
1696
|
readonly stack?: string;
|
|
1697
1697
|
/** @hideconstructor */
|
|
@@ -1706,22 +1706,6 @@ export declare class FirestoreError extends Error {
|
|
|
1706
1706
|
message: string);
|
|
1707
1707
|
}
|
|
1708
1708
|
|
|
1709
|
-
/**
|
|
1710
|
-
* @license
|
|
1711
|
-
* Copyright 2017 Google LLC
|
|
1712
|
-
*
|
|
1713
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1714
|
-
* you may not use this file except in compliance with the License.
|
|
1715
|
-
* You may obtain a copy of the License at
|
|
1716
|
-
*
|
|
1717
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1718
|
-
*
|
|
1719
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1720
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1721
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1722
|
-
* See the License for the specific language governing permissions and
|
|
1723
|
-
* limitations under the License.
|
|
1724
|
-
*/
|
|
1725
1709
|
/**
|
|
1726
1710
|
* The set of Firestore status codes. The codes are the same at the ones
|
|
1727
1711
|
* exposed by gRPC here:
|
|
@@ -4255,10 +4239,12 @@ export declare function setLogLevel(logLevel: LogLevel): void;
|
|
|
4255
4239
|
*
|
|
4256
4240
|
* @param merge - Changes the behavior of a `setDoc()` call to only replace the
|
|
4257
4241
|
* values specified in its data argument. Fields omitted from the `setDoc()`
|
|
4258
|
-
* call remain untouched.
|
|
4242
|
+
* call remain untouched. If your input sets any field to an empty map, all
|
|
4243
|
+
* nested fields are overwritten.
|
|
4259
4244
|
* @param mergeFields - Changes the behavior of `setDoc()` calls to only replace
|
|
4260
4245
|
* the specified field paths. Any field path that is not specified is ignored
|
|
4261
|
-
* and remains untouched.
|
|
4246
|
+
* and remains untouched. If your input sets any field to an empty map, all
|
|
4247
|
+
* nested fields are overwritten.
|
|
4262
4248
|
*/
|
|
4263
4249
|
export declare type SetOptions = {
|
|
4264
4250
|
readonly merge?: boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
import { ByteString } from '../util/byte_string';
|
|
18
|
+
/** An index value encoder. */
|
|
19
|
+
export interface DirectionalIndexByteEncoder {
|
|
20
|
+
writeBytes(value: ByteString): void;
|
|
21
|
+
writeString(value: string): void;
|
|
22
|
+
writeNumber(value: number): void;
|
|
23
|
+
writeInfinity(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
import { Value } from '../protos/firestore_proto_api';
|
|
18
|
+
import { DirectionalIndexByteEncoder } from './directional_index_byte_encoder';
|
|
19
|
+
/** Firestore index value writer. */
|
|
20
|
+
export declare class FirestoreIndexValueWriter {
|
|
21
|
+
static INSTANCE: FirestoreIndexValueWriter;
|
|
22
|
+
private constructor();
|
|
23
|
+
/** Writes an index value. */
|
|
24
|
+
writeIndexValue(value: Value, encoder: DirectionalIndexByteEncoder): void;
|
|
25
|
+
private writeIndexValueAux;
|
|
26
|
+
private writeIndexString;
|
|
27
|
+
private writeUnlabeledIndexString;
|
|
28
|
+
private writeIndexMap;
|
|
29
|
+
private writeIndexArray;
|
|
30
|
+
private writeIndexEntityRef;
|
|
31
|
+
private writeValueTypeLabel;
|
|
32
|
+
private writeTruncationMarker;
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DirectionalIndexByteEncoder } from './directional_index_byte_encoder';
|
|
2
|
+
/**
|
|
3
|
+
* Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the
|
|
4
|
+
* actual encoding.
|
|
5
|
+
*/
|
|
6
|
+
export declare class IndexByteEncoder {
|
|
7
|
+
private orderedCode;
|
|
8
|
+
private ascending;
|
|
9
|
+
private descending;
|
|
10
|
+
seed(encodedBytes: Uint8Array): void;
|
|
11
|
+
forKind(kind: 'asc' | 'desc'): DirectionalIndexByteEncoder;
|
|
12
|
+
encodedBytes(): Uint8Array;
|
|
13
|
+
reset(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ByteString } from '../util/byte_string';
|
|
2
|
+
/**
|
|
3
|
+
* Counts the number of zeros in a byte.
|
|
4
|
+
*
|
|
5
|
+
* Visible for testing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function numberOfLeadingZerosInByte(x: number): number;
|
|
8
|
+
/**
|
|
9
|
+
* OrderedCodeWriter is a minimal-allocation implementation of the writing
|
|
10
|
+
* behavior defined by the backend.
|
|
11
|
+
*
|
|
12
|
+
* The code is ported from its Java counterpart.
|
|
13
|
+
*/
|
|
14
|
+
export declare class OrderedCodeWriter {
|
|
15
|
+
buffer: Uint8Array;
|
|
16
|
+
position: number;
|
|
17
|
+
writeBytesAscending(value: ByteString): void;
|
|
18
|
+
writeBytesDescending(value: ByteString): void;
|
|
19
|
+
/** Writes utf8 bytes into this byte sequence, ascending. */
|
|
20
|
+
writeUtf8Ascending(sequence: string): void;
|
|
21
|
+
/** Writes utf8 bytes into this byte sequence, descending */
|
|
22
|
+
writeUtf8Descending(sequence: string): void;
|
|
23
|
+
writeNumberAscending(val: number): void;
|
|
24
|
+
writeNumberDescending(val: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Writes the "infinity" byte sequence that sorts after all other byte
|
|
27
|
+
* sequences written in ascending order.
|
|
28
|
+
*/
|
|
29
|
+
writeInfinityAscending(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Writes the "infinity" byte sequence that sorts before all other byte
|
|
32
|
+
* sequences written in descending order.
|
|
33
|
+
*/
|
|
34
|
+
writeInfinityDescending(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Resets the buffer such that it is the same as when it was newly
|
|
37
|
+
* constructed.
|
|
38
|
+
*/
|
|
39
|
+
reset(): void;
|
|
40
|
+
seed(encodedBytes: Uint8Array): void;
|
|
41
|
+
/** Makes a copy of the encoded bytes in this buffer. */
|
|
42
|
+
encodedBytes(): Uint8Array;
|
|
43
|
+
/**
|
|
44
|
+
* Encodes `val` into an encoding so that the order matches the IEEE 754
|
|
45
|
+
* floating-point comparison results with the following exceptions:
|
|
46
|
+
* -0.0 < 0.0
|
|
47
|
+
* all non-NaN < NaN
|
|
48
|
+
* NaN = NaN
|
|
49
|
+
*/
|
|
50
|
+
private toOrderedBits;
|
|
51
|
+
/** Writes a single byte ascending to the buffer. */
|
|
52
|
+
private writeByteAscending;
|
|
53
|
+
/** Writes a single byte descending to the buffer. */
|
|
54
|
+
private writeByteDescending;
|
|
55
|
+
private writeSeparatorAscending;
|
|
56
|
+
private writeSeparatorDescending;
|
|
57
|
+
private writeEscapedByteAscending;
|
|
58
|
+
private writeEscapedByteDescending;
|
|
59
|
+
private ensureAvailable;
|
|
60
|
+
}
|
|
@@ -61,10 +61,12 @@ export declare type UpdateData<T> = T extends Primitive ? T : T extends {} ? {
|
|
|
61
61
|
*
|
|
62
62
|
* @param merge - Changes the behavior of a `setDoc()` call to only replace the
|
|
63
63
|
* values specified in its data argument. Fields omitted from the `setDoc()`
|
|
64
|
-
* call remain untouched.
|
|
64
|
+
* call remain untouched. If your input sets any field to an empty map, all
|
|
65
|
+
* nested fields are overwritten.
|
|
65
66
|
* @param mergeFields - Changes the behavior of `setDoc()` calls to only replace
|
|
66
67
|
* the specified field paths. Any field path that is not specified is ignored
|
|
67
|
-
* and remains untouched.
|
|
68
|
+
* and remains untouched. If your input sets any field to an empty map, all
|
|
69
|
+
* nested fields are overwritten.
|
|
68
70
|
*/
|
|
69
71
|
export declare type SetOptions = {
|
|
70
72
|
readonly merge?: boolean;
|
|
@@ -18,6 +18,7 @@ import { DatabaseId } from '../core/database_info';
|
|
|
18
18
|
import { ArrayValue, MapValue, Value } from '../protos/firestore_proto_api';
|
|
19
19
|
import { DocumentKey } from './document_key';
|
|
20
20
|
import { TypeOrder } from './type_order';
|
|
21
|
+
export declare const MAX_VALUE: Value;
|
|
21
22
|
/** Extracts the backend's type order for the provided value. */
|
|
22
23
|
export declare function typeOrder(value: Value): TypeOrder;
|
|
23
24
|
/** Tests `left` and `right` for equality based on the backend semantics. */
|
|
@@ -73,3 +74,5 @@ export declare function isMapValue(value?: Value | null): value is {
|
|
|
73
74
|
};
|
|
74
75
|
/** Creates a deep copy of `source`. */
|
|
75
76
|
export declare function deepClone(source: Value): Value;
|
|
77
|
+
/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
|
|
78
|
+
export declare function isMaxValue(value: Value): boolean;
|
|
@@ -29,6 +29,7 @@ export declare class ByteString {
|
|
|
29
29
|
private constructor();
|
|
30
30
|
static fromBase64String(base64: string): ByteString;
|
|
31
31
|
static fromUint8Array(array: Uint8Array): ByteString;
|
|
32
|
+
[Symbol.iterator](): Iterator<number>;
|
|
32
33
|
toBase64(): string;
|
|
33
34
|
toUint8Array(): Uint8Array;
|
|
34
35
|
approximateByteSize(): number;
|
|
@@ -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
|
+
import { FirebaseError } from '@firebase/util';
|
|
17
18
|
/**
|
|
18
19
|
* The set of Firestore status codes. The codes are the same at the ones
|
|
19
20
|
* exposed by gRPC here:
|
|
@@ -170,7 +171,7 @@ export declare const Code: {
|
|
|
170
171
|
DATA_LOSS: FirestoreErrorCode;
|
|
171
172
|
};
|
|
172
173
|
/** An error returned by a Firestore operation. */
|
|
173
|
-
export declare class FirestoreError extends
|
|
174
|
+
export declare class FirestoreError extends FirebaseError {
|
|
174
175
|
/**
|
|
175
176
|
* The backend error code associated with this error.
|
|
176
177
|
*/
|
|
@@ -179,8 +180,6 @@ export declare class FirestoreError extends Error {
|
|
|
179
180
|
* A custom error description.
|
|
180
181
|
*/
|
|
181
182
|
readonly message: string;
|
|
182
|
-
/** The custom name for all FirestoreErrors. */
|
|
183
|
-
readonly name: string;
|
|
184
183
|
/** The stack of the error. */
|
|
185
184
|
readonly stack?: string;
|
|
186
185
|
/** @hideconstructor */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -71,6 +71,7 @@ export declare function bound(values: Array<[string, {}, firestore.OrderByDirect
|
|
|
71
71
|
export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
|
|
72
72
|
export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
|
|
73
73
|
export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
|
|
74
|
+
export declare function existenceFilterEvent(targetId: number, count: number, snapshotVersion: number): RemoteEvent;
|
|
74
75
|
export declare function docAddedRemoteEvent(docOrDocs: MutableDocument | MutableDocument[], updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], activeTargets?: TargetId[]): RemoteEvent;
|
|
75
76
|
export declare function docUpdateRemoteEvent(doc: MutableDocument, updatedInTargets?: TargetId[], removedFromTargets?: TargetId[], limboTargets?: TargetId[]): RemoteEvent;
|
|
76
77
|
export declare class TestBundledDocuments {
|