@firebase/firestore 3.11.0 → 3.12.0-20230511201449
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 +13 -0
- package/dist/firestore/src/api/long_polling_options.d.ts +55 -0
- package/dist/firestore/src/api/settings.d.ts +16 -2
- package/dist/firestore/src/api.d.ts +1 -0
- package/dist/firestore/src/core/database_info.d.ts +4 -1
- package/dist/firestore/src/lite-api/settings.d.ts +3 -0
- package/dist/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
- package/dist/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
- package/dist/index.cjs.js +1222 -1181
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +61 -2
- package/dist/index.esm2017.js +1137 -1096
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +1041 -1021
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +71 -6
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +71 -6
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +868 -827
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +67 -3
- package/dist/lite/firestore/src/api/long_polling_options.d.ts +55 -0
- package/dist/lite/firestore/src/api/settings.d.ts +16 -2
- package/dist/lite/firestore/src/api.d.ts +1 -0
- package/dist/lite/firestore/src/core/database_info.d.ts +4 -1
- package/dist/lite/firestore/src/lite-api/settings.d.ts +3 -0
- package/dist/lite/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
- package/dist/lite/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
- package/dist/lite/index.browser.esm2017.js +756 -716
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +764 -745
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.cjs.js +756 -716
- package/dist/lite/index.cjs.js.map +1 -1
- package/dist/lite/index.node.cjs.js +71 -6
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +71 -6
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +763 -723
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +52 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +127 -144
- package/dist/lite/packages/firestore/src/api/long_polling_options.d.ts +55 -0
- package/dist/lite/packages/firestore/src/api/settings.d.ts +16 -2
- package/dist/lite/packages/firestore/src/api.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/database_info.d.ts +4 -1
- package/dist/lite/packages/firestore/src/lite-api/settings.d.ts +3 -0
- package/dist/lite/packages/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
- package/dist/lite/private.d.ts +52 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +275 -292
- package/dist/packages/firestore/src/api/long_polling_options.d.ts +55 -0
- package/dist/packages/firestore/src/api/settings.d.ts +16 -2
- package/dist/packages/firestore/src/api.d.ts +1 -0
- package/dist/packages/firestore/src/core/database_info.d.ts +4 -1
- package/dist/packages/firestore/src/lite-api/settings.d.ts +3 -0
- package/dist/packages/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
- package/dist/packages/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
- package/dist/private.d.ts +67 -3
- package/package.json +5 -5
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 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
|
+
/**
|
|
18
|
+
* Options that configure the SDK’s underlying network transport (WebChannel)
|
|
19
|
+
* when long-polling is used.
|
|
20
|
+
*
|
|
21
|
+
* Note: This interface is "experimental" and is subject to change.
|
|
22
|
+
*
|
|
23
|
+
* See `FirestoreSettings.experimentalAutoDetectLongPolling`,
|
|
24
|
+
* `FirestoreSettings.experimentalForceLongPolling`, and
|
|
25
|
+
* `FirestoreSettings.experimentalLongPollingOptions`.
|
|
26
|
+
*/
|
|
27
|
+
export interface ExperimentalLongPollingOptions {
|
|
28
|
+
/**
|
|
29
|
+
* The desired maximum timeout interval, in seconds, to complete a
|
|
30
|
+
* long-polling GET response. Valid values are between 5 and 30, inclusive.
|
|
31
|
+
* Floating point values are allowed and will be rounded to the nearest
|
|
32
|
+
* millisecond.
|
|
33
|
+
*
|
|
34
|
+
* By default, when long-polling is used the "hanging GET" request sent by
|
|
35
|
+
* the client times out after 30 seconds. To request a different timeout
|
|
36
|
+
* from the server, set this setting with the desired timeout.
|
|
37
|
+
*
|
|
38
|
+
* Changing the default timeout may be useful, for example, if the buffering
|
|
39
|
+
* proxy that necessitated enabling long-polling in the first place has a
|
|
40
|
+
* shorter timeout for hanging GET requests, in which case setting the
|
|
41
|
+
* long-polling timeout to a shorter value, such as 25 seconds, may fix
|
|
42
|
+
* prematurely-closed hanging GET requests.
|
|
43
|
+
* For example, see https://github.com/firebase/firebase-js-sdk/issues/6987.
|
|
44
|
+
*/
|
|
45
|
+
timeoutSeconds?: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Compares two `ExperimentalLongPollingOptions` objects for equality.
|
|
49
|
+
*/
|
|
50
|
+
export declare function longPollingOptionsEqual(options1: ExperimentalLongPollingOptions, options2: ExperimentalLongPollingOptions): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Creates and returns a new `ExperimentalLongPollingOptions` with the same
|
|
53
|
+
* option values as the given instance.
|
|
54
|
+
*/
|
|
55
|
+
export declare function cloneLongPollingOptions(options: ExperimentalLongPollingOptions): ExperimentalLongPollingOptions;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { FirestoreSettings as LiteSettings } from '../lite-api/settings';
|
|
18
18
|
import { FirestoreLocalCache } from './cache_config';
|
|
19
|
+
import { ExperimentalLongPollingOptions } from './long_polling_options';
|
|
19
20
|
export { DEFAULT_HOST } from '../lite-api/settings';
|
|
20
21
|
/**
|
|
21
22
|
* Settings that can be passed to `enableIndexedDbPersistence()` to configure
|
|
@@ -80,8 +81,21 @@ export interface FirestoreSettings extends LiteSettings {
|
|
|
80
81
|
* detect if long-polling should be used. This is very similar to
|
|
81
82
|
* `experimentalForceLongPolling`, but only uses long-polling if required.
|
|
82
83
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
84
|
+
* After having had a default value of `false` since its inception in 2019,
|
|
85
|
+
* the default value of this setting was changed in mid-2023 to `true`. That
|
|
86
|
+
* is, auto-detection of long polling is now enabled by default. To disable
|
|
87
|
+
* it, set this setting to `false`, and please open a GitHub issue to share
|
|
88
|
+
* the problems that motivated you disabling long-polling auto-detection.
|
|
85
89
|
*/
|
|
86
90
|
experimentalAutoDetectLongPolling?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Options that configure the SDK’s underlying network transport (WebChannel)
|
|
93
|
+
* when long-polling is used.
|
|
94
|
+
*
|
|
95
|
+
* These options are only used if `experimentalForceLongPolling` is true or if
|
|
96
|
+
* `experimentalAutoDetectLongPolling` is true and the auto-detection
|
|
97
|
+
* determined that long-polling was needed. Otherwise, these options have no
|
|
98
|
+
* effect.
|
|
99
|
+
*/
|
|
100
|
+
experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
|
|
87
101
|
}
|
|
@@ -21,6 +21,7 @@ export { documentId, FieldPath } from './api/field_path';
|
|
|
21
21
|
export { clearIndexedDbPersistence, connectFirestoreEmulator, disableNetwork, EmulatorMockTokenOptions, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, ensureFirestoreConfigured, Firestore, getFirestore, initializeFirestore, loadBundle, namedQuery, terminate, waitForPendingWrites } from './api/database';
|
|
22
22
|
export { LoadBundleTask, LoadBundleTaskProgress, TaskState } from './api/bundle';
|
|
23
23
|
export { FirestoreSettings, PersistenceSettings } from './api/settings';
|
|
24
|
+
export { ExperimentalLongPollingOptions } from './api/long_polling_options';
|
|
24
25
|
export { DocumentChange, DocumentChangeType, DocumentSnapshot, FirestoreDataConverter, QueryDocumentSnapshot, QuerySnapshot, snapshotEqual, SnapshotMetadata, SnapshotOptions } from './api/snapshot';
|
|
25
26
|
export { collection, collectionGroup, CollectionReference, doc, DocumentData, DocumentReference, PartialWithFieldValue, Query, queryEqual, refEqual, SetOptions, UpdateData, WithFieldValue } from './api/reference';
|
|
26
27
|
export { and, endAt, endBefore, limit, limitToLast, or, orderBy, OrderByDirection, query, QueryCompositeFilterConstraint, QueryConstraint, QueryConstraintType, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryFilterConstraint, QueryLimitConstraint, QueryNonFilterConstraint, QueryOrderByConstraint, QueryStartAtConstraint, startAfter, startAt, where, WhereFilterOp } from './api/filter';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FirebaseApp } from '@firebase/app';
|
|
2
|
+
import { ExperimentalLongPollingOptions } from '../api/long_polling_options';
|
|
2
3
|
/**
|
|
3
4
|
* @license
|
|
4
5
|
* Copyright 2017 Google LLC
|
|
@@ -23,6 +24,7 @@ export declare class DatabaseInfo {
|
|
|
23
24
|
readonly ssl: boolean;
|
|
24
25
|
readonly forceLongPolling: boolean;
|
|
25
26
|
readonly autoDetectLongPolling: boolean;
|
|
27
|
+
readonly longPollingOptions: ExperimentalLongPollingOptions;
|
|
26
28
|
readonly useFetchStreams: boolean;
|
|
27
29
|
/**
|
|
28
30
|
* Constructs a DatabaseInfo using the provided host, databaseId and
|
|
@@ -38,10 +40,11 @@ export declare class DatabaseInfo {
|
|
|
38
40
|
* when using WebChannel as the network transport.
|
|
39
41
|
* @param autoDetectLongPolling - Whether to use the detectBufferingProxy
|
|
40
42
|
* option when using WebChannel as the network transport.
|
|
43
|
+
* @param longPollingOptions Options that configure long-polling.
|
|
41
44
|
* @param useFetchStreams Whether to use the Fetch API instead of
|
|
42
45
|
* XMLHTTPRequest
|
|
43
46
|
*/
|
|
44
|
-
constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, useFetchStreams: boolean);
|
|
47
|
+
constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, longPollingOptions: ExperimentalLongPollingOptions, useFetchStreams: boolean);
|
|
45
48
|
}
|
|
46
49
|
/** The default database name for a project. */
|
|
47
50
|
export declare const DEFAULT_DATABASE_NAME = "(default)";
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { FirestoreLocalCache } from '../api/cache_config';
|
|
18
18
|
import { CredentialsSettings } from '../api/credentials';
|
|
19
|
+
import { ExperimentalLongPollingOptions } from '../api/long_polling_options';
|
|
19
20
|
export declare const DEFAULT_HOST = "firestore.googleapis.com";
|
|
20
21
|
export declare const DEFAULT_SSL = true;
|
|
21
22
|
/**
|
|
@@ -41,6 +42,7 @@ export interface PrivateSettings extends FirestoreSettings {
|
|
|
41
42
|
cacheSizeBytes?: number;
|
|
42
43
|
experimentalForceLongPolling?: boolean;
|
|
43
44
|
experimentalAutoDetectLongPolling?: boolean;
|
|
45
|
+
experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
|
|
44
46
|
useFetchStreams?: boolean;
|
|
45
47
|
localCache?: FirestoreLocalCache;
|
|
46
48
|
}
|
|
@@ -57,6 +59,7 @@ export declare class FirestoreSettingsImpl {
|
|
|
57
59
|
readonly cacheSizeBytes: number;
|
|
58
60
|
readonly experimentalForceLongPolling: boolean;
|
|
59
61
|
readonly experimentalAutoDetectLongPolling: boolean;
|
|
62
|
+
readonly experimentalLongPollingOptions: ExperimentalLongPollingOptions;
|
|
60
63
|
readonly ignoreUndefinedProperties: boolean;
|
|
61
64
|
readonly useFetchStreams: boolean;
|
|
62
65
|
readonly cache?: FirestoreLocalCache;
|
|
@@ -23,6 +23,7 @@ export declare class WebChannelConnection extends RestConnection {
|
|
|
23
23
|
private readonly forceLongPolling;
|
|
24
24
|
private readonly autoDetectLongPolling;
|
|
25
25
|
private readonly useFetchStreams;
|
|
26
|
+
private readonly longPollingOptions;
|
|
26
27
|
constructor(info: DatabaseInfo);
|
|
27
28
|
protected performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req): Promise<Resp>;
|
|
28
29
|
openStream<Req, Resp>(rpcName: string, authToken: Token | null, appCheckToken: Token | null): Stream<Req, Resp>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 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 {};
|
package/dist/lite/private.d.ts
CHANGED
|
@@ -666,6 +666,7 @@ declare class DatabaseInfo {
|
|
|
666
666
|
readonly ssl: boolean;
|
|
667
667
|
readonly forceLongPolling: boolean;
|
|
668
668
|
readonly autoDetectLongPolling: boolean;
|
|
669
|
+
readonly longPollingOptions: ExperimentalLongPollingOptions;
|
|
669
670
|
readonly useFetchStreams: boolean;
|
|
670
671
|
/**
|
|
671
672
|
* Constructs a DatabaseInfo using the provided host, databaseId and
|
|
@@ -681,10 +682,11 @@ declare class DatabaseInfo {
|
|
|
681
682
|
* when using WebChannel as the network transport.
|
|
682
683
|
* @param autoDetectLongPolling - Whether to use the detectBufferingProxy
|
|
683
684
|
* option when using WebChannel as the network transport.
|
|
685
|
+
* @param longPollingOptions Options that configure long-polling.
|
|
684
686
|
* @param useFetchStreams Whether to use the Fetch API instead of
|
|
685
687
|
* XMLHTTPRequest
|
|
686
688
|
*/
|
|
687
|
-
constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, useFetchStreams: boolean);
|
|
689
|
+
constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, longPollingOptions: ExperimentalLongPollingOptions, useFetchStreams: boolean);
|
|
688
690
|
}
|
|
689
691
|
|
|
690
692
|
/**
|
|
@@ -1184,6 +1186,53 @@ declare interface EventManager {
|
|
|
1184
1186
|
onUnlisten?: (query: Query_2) => Promise<void>;
|
|
1185
1187
|
}
|
|
1186
1188
|
|
|
1189
|
+
/**
|
|
1190
|
+
* @license
|
|
1191
|
+
* Copyright 2023 Google LLC
|
|
1192
|
+
*
|
|
1193
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1194
|
+
* you may not use this file except in compliance with the License.
|
|
1195
|
+
* You may obtain a copy of the License at
|
|
1196
|
+
*
|
|
1197
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1198
|
+
*
|
|
1199
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1200
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1201
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1202
|
+
* See the License for the specific language governing permissions and
|
|
1203
|
+
* limitations under the License.
|
|
1204
|
+
*/
|
|
1205
|
+
/**
|
|
1206
|
+
* Options that configure the SDK’s underlying network transport (WebChannel)
|
|
1207
|
+
* when long-polling is used.
|
|
1208
|
+
*
|
|
1209
|
+
* Note: This interface is "experimental" and is subject to change.
|
|
1210
|
+
*
|
|
1211
|
+
* See `FirestoreSettings.experimentalAutoDetectLongPolling`,
|
|
1212
|
+
* `FirestoreSettings.experimentalForceLongPolling`, and
|
|
1213
|
+
* `FirestoreSettings.experimentalLongPollingOptions`.
|
|
1214
|
+
*/
|
|
1215
|
+
declare interface ExperimentalLongPollingOptions {
|
|
1216
|
+
/**
|
|
1217
|
+
* The desired maximum timeout interval, in seconds, to complete a
|
|
1218
|
+
* long-polling GET response. Valid values are between 5 and 30, inclusive.
|
|
1219
|
+
* Floating point values are allowed and will be rounded to the nearest
|
|
1220
|
+
* millisecond.
|
|
1221
|
+
*
|
|
1222
|
+
* By default, when long-polling is used the "hanging GET" request sent by
|
|
1223
|
+
* the client times out after 30 seconds. To request a different timeout
|
|
1224
|
+
* from the server, set this setting with the desired timeout.
|
|
1225
|
+
*
|
|
1226
|
+
* Changing the default timeout may be useful, for example, if the buffering
|
|
1227
|
+
* proxy that necessitated enabling long-polling in the first place has a
|
|
1228
|
+
* shorter timeout for hanging GET requests, in which case setting the
|
|
1229
|
+
* long-polling timeout to a shorter value, such as 25 seconds, may fix
|
|
1230
|
+
* prematurely-closed hanging GET requests.
|
|
1231
|
+
* For example, see https://github.com/firebase/firebase-js-sdk/issues/6987.
|
|
1232
|
+
*/
|
|
1233
|
+
timeoutSeconds?: number;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1187
1236
|
declare class FieldFilter extends Filter {
|
|
1188
1237
|
readonly field: FieldPath_2;
|
|
1189
1238
|
readonly op: Operator;
|
|
@@ -1548,6 +1597,7 @@ declare class FirestoreSettingsImpl {
|
|
|
1548
1597
|
readonly cacheSizeBytes: number;
|
|
1549
1598
|
readonly experimentalForceLongPolling: boolean;
|
|
1550
1599
|
readonly experimentalAutoDetectLongPolling: boolean;
|
|
1600
|
+
readonly experimentalLongPollingOptions: ExperimentalLongPollingOptions;
|
|
1551
1601
|
readonly ignoreUndefinedProperties: boolean;
|
|
1552
1602
|
readonly useFetchStreams: boolean;
|
|
1553
1603
|
readonly cache?: FirestoreLocalCache;
|
|
@@ -3488,6 +3538,7 @@ declare interface PrivateSettings extends Settings {
|
|
|
3488
3538
|
cacheSizeBytes?: number;
|
|
3489
3539
|
experimentalForceLongPolling?: boolean;
|
|
3490
3540
|
experimentalAutoDetectLongPolling?: boolean;
|
|
3541
|
+
experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
|
|
3491
3542
|
useFetchStreams?: boolean;
|
|
3492
3543
|
localCache?: FirestoreLocalCache;
|
|
3493
3544
|
}
|